Communication method and device and computer readable storage medium

By implementing a communication method in the first network element, the terminal device can select a terminal device with a good service quality based on the list of adjacent service users screened out by quality data, solving the problem that the terminal device is difficult to effectively discover and select a terminal device with a high service quality.

CN120166487APending Publication Date: 2025-06-17HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311728690.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

In adjacent business scenarios, it is difficult for terminal devices to effectively discover and select terminal devices with better service quality for ProSe communication.

Method used

By implementing a communication method in the first network element, the method includes receiving a discovery request from the second network element, acquiring the target neighbor service user identification and quality data, and sending a neighbor service user list included in the discovery response, the list is filtered based on quality data.

Benefits of technology

Ensure that the terminal equipment can select terminal equipment with better service quality from other terminal equipment found, so as to obtain better service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120166487A_ABST
    Figure CN120166487A_ABST
Patent Text Reader

Abstract

The invention provides a communication method and device and a computer readable storage medium, and the method comprises the steps: receiving a first discovery request from a second network element, the first discovery request comprising a first application identifier; obtaining a target proximity service user identifier corresponding to the first application identifier and the first network element, and quality data corresponding to the target proximity service user identifier, wherein the quality data is used for indicating the historical service quality of the terminal; a first discovery response is sent to the second network element, the first discovery response comprises a first discovery parameter, and the first discovery parameter comprises a first neighbor service user list; wherein the first adjacent service user list is obtained based on the target adjacent service user identifier and the quality data corresponding to the target adjacent service user identifier, and the first adjacent service user list is used for selecting the terminal equipment. According to the embodiment of the invention, the terminal equipment can be helped to obtain better service quality in an adjacent service scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and in particular, to a communication method, apparatus, and computer-readable storage medium. Background Art

[0002] In a proximity based service (ProSe) scenario, direct communication can be performed between terminal devices, and one terminal device can provide proximity services / proximity service to another terminal device. Generally, before performing proximity service communication, one terminal device needs to first discover nearby terminal devices, and then this terminal device can establish a ProSe communication connection with a discovered terminal device to transmit information on the data plane and signaling plane through the PC5 interface.

[0003] Meanwhile, how to enable a terminal device to discover / select a terminal device with better service quality to establish a ProSe communication connection is an issue that technical personnel are concerned about. Summary of the Invention

[0004] Embodiments of the present application disclose a communication method, apparatus, and computer-readable storage medium, which can enable a terminal device to select a terminal device with better service quality from other discovered terminal devices, or can enable a terminal device to directly discover a terminal device with better service quality, so as to ensure that the terminal device can obtain better service quality.

[0005] In a first aspect, a communication method is disclosed. This method can be applied to a first network element, or to a module (such as a processor) in the first network element, or to a logical module or software that can implement all or part of the functions of the first network element. Hereinafter, an example of being applied to the first network element will be described. The communication method may include: the first network element receives a first discovery request from a second network element, the first discovery request includes a first application identifier, and the first discovery request is used to request discovery parameters corresponding to the first application identifier; obtain the first application identifier, a target proximity service user identifier corresponding to the first network element, and quality data corresponding to the target proximity service user identifier, where the quality data is used to indicate the historical service quality of the terminal; send a first discovery response to the second network element, the first discovery response includes first discovery parameters, and the first discovery parameters include a first proximity service user list; wherein, the first proximity service user list is obtained based on the target proximity service user identifier and the quality data corresponding to the target proximity service user identifier, and the first proximity service user list is used to select a terminal device.

[0006] In the embodiments of the present application, the first network element may obtain a first list of neighboring service users based on the quality data of the terminal device corresponding to the first network element and the first application identifier. Subsequently, the first list of neighboring service users may be provided to the corresponding second terminal device, and the second terminal device may use the first list of neighboring service users to select a terminal device with better historical service quality for ProSe communication, thereby ensuring that it can obtain better service quality. Among them, there are various implementation methods for the first list of neighboring service users, such as a blacklist and a whitelist.

[0007] In combination with the first aspect, in a possible implementation manner, obtaining the target neighboring service user identifier corresponding to the first application identifier and the first network element, and the quality data corresponding to the target neighboring service user identifier includes: obtaining the target neighboring service user identifier corresponding to the first application identifier and the first network element, and the quality data corresponding to the target neighboring service user identifier from the first ledger, where the first ledger is a shared ledger of the first consensus group, and the first consensus group includes the second network element and the first network element.

[0008] In combination with the first aspect, in a possible implementation manner, the first ledger is a distributed ledger or a blockchain.

[0009] In the embodiments of the present application, the quality data of the terminal device may be stored through a decentralized storage technology, such as storing the quality data of the terminal device through a distributed ledger or a blockchain. In this way, multi-party trusted data storage and data sharing can be achieved, so that each network element in the consensus group can obtain a first list of neighboring service users based on the quality data of the terminal device.

[0010] In combination with the first aspect, in a possible implementation manner, the first list of neighboring service users includes a white list and / or a black list. The white list is used to indicate terminal devices whose historical service quality meets the first condition, and the black list is used to indicate terminal devices whose historical service quality meets the second condition.

[0011] In the embodiments of the present application, the first list of neighboring service users includes a white list and / or a black list. The white list may indicate terminal devices with better historical service quality, and the black list may indicate terminal devices with poorer historical service quality. In this way, after the second terminal device obtains the white list and / or the black list, it can preferentially select the terminal devices in the white list for communication connection, and can choose not to connect to the terminal devices in the black list or reduce the connection priority of the terminal devices in the black list, thereby ensuring that the second terminal device can obtain better service quality.

[0012] With reference to the first aspect, in a possible implementation manner, the first proximity service user list includes multiple proximity service user identifiers and a quality indicator corresponding to each proximity service user identifier in the multiple proximity service user identifiers.

[0013] In an embodiment of the present application, the first neighboring service user list may include neighboring service user identifiers corresponding to multiple terminal devices, and a quality indicator corresponding to each neighboring service user identifier, and the quality indicator may be used to indicate the historical service quality of the terminal device. In this way, after the second terminal device obtains the first neighboring service user list, when multiple terminal devices are found, the historical service quality of the multiple terminal devices may be determined based on the first neighboring service user list, and then the terminal device with the best historical service quality may be selected for ProSe communication, thereby ensuring that the second terminal device can obtain a better service quality.

[0014] In combination with the first aspect, in a possible implementation, the method also includes: receiving a second discovery request from a first terminal device, the second discovery request including a second application identifier, the second discovery request being used to request discovery parameters corresponding to the second application identifier; obtaining first quality data corresponding to the second application identifier and a proximity service user identifier of the first terminal device, the first quality data being used to indicate a historical service quality of the first terminal device; determining a second discovery parameter based on the first quality data; and sending a second discovery response to the first terminal device, the second discovery response including the second discovery parameter.

[0015] In an embodiment of the present application, a discovery parameter can be specifically assigned to the first terminal device based on the historical service quality of the first terminal device. Exemplarily, the historical service quality can be divided into multiple levels, such as (0, 60), (60, 80), (80, 90), (90, 100), and different levels of historical service quality can correspond to different discovery parameters. In this way, terminal devices with different historical service qualities can use different discovery parameters, so that terminal devices with different historical service qualities can be distinguished, and the second terminal device can be facilitated to discover / select the first terminal device with better historical service quality.

[0016] In combination with the first aspect, in a possible implementation, obtaining the first quality data corresponding to the second application identifier and the proximity service user identifier of the first terminal device includes: obtaining the first quality data corresponding to the second application identifier and the proximity service user identifier of the first terminal device from a first ledger, the first ledger being a shared ledger of a first consensus group, and the first consensus group including the second network element and the first network element.

[0017] In an embodiment of the present application, the quality data of the terminal device can be stored through decentralized storage technology, such as storing the quality data of the terminal device through a distributed ledger or blockchain, so that multi-party trusted data storage and data sharing can be achieved, thereby facilitating each network element in the consensus group to obtain a first neighboring service user list based on the quality data of the terminal device.

[0018] In combination with the first aspect, in a possible implementation, determining the second discovery parameter based on the first quality data includes: when the first quality data satisfies a third condition, determining the second discovery parameter based on the first quality data.

[0019] In the embodiment of the present application, when the first quality data does not meet the third condition, it indicates that the historical service quality of the first terminal device is poor, and the discovery request from the first terminal device can be rejected, that is, the allocation of discovery parameters to the first terminal device is rejected. When the first quality data meets the third condition, it indicates that the historical service quality of the first terminal device is good, and the discovery parameters can be allocated to the first terminal device. In this way, the first terminal device with poor historical service quality can be prevented from being discovered by the second terminal device, thereby preventing the first terminal device from obtaining poor service quality.

[0020] In combination with the first aspect, in a possible implementation, determining the second discovery parameter based on the first quality data includes: determining a second discovery parameter of a first type when the first quality data satisfies a fourth condition; determining a second discovery parameter of a second type when the first quality data satisfies a fifth condition, and the terminal historical service qualities corresponding to the first type and the second type of discovery parameters are different.

[0021] In the embodiment of the present application, the discovery parameter can be specifically assigned to the first terminal device based on the historical service quality of the first terminal device. For example, when the first quality data meets the fourth condition, the second discovery parameter of the first type can be assigned to the first terminal device. When the first quality data meets the fifth condition, the second discovery parameter of the second type can be assigned to the first terminal device. The discovery parameter of the first type is different from the discovery parameter of the second type. In this way, terminal devices with different historical service qualities can be distinguished, which can facilitate the second terminal device to discover / select the first terminal device with better historical service quality.

[0022] In combination with the first aspect, in a possible implementation, the method also includes: when it is determined that the service quality of the first terminal device does not match the proximity service application code currently used by the first terminal device, sending a first control request to the first terminal device, wherein the first control request is used to adjust the discovery parameters of the first terminal device.

[0023] In an embodiment of the present application, the quality of service of the first terminal device may change, which may cause the quality of service of the first terminal device not to match the neighboring service application code currently used by the first terminal device. At this time, the first network element may send a control request to the first terminal device to adjust the neighboring service application code of the first terminal device, so that the quality of service of the first terminal device matches the neighboring service application code currently used by the first terminal device. For example, the neighboring service application code currently used by the first terminal device represents a better historical quality of service, but the quality of service reports feedback by other terminal devices currently indicate that the quality of service of the first terminal device is poor. Therefore, in order to prevent other terminal devices from misidentifying the first terminal device as a terminal device with a better quality of service later, the discovery parameters of the first terminal device can be adjusted so that the first terminal device uses a neighboring service application code representing a poor historical quality of service.

[0024] In combination with the first aspect, in a possible implementation manner, the first control request includes the neighboring service application code to be revoked and the neighboring service user identifier of the first terminal device.

[0025] In combination with the first aspect, in a possible implementation manner, the first control request further includes the neighboring service application code to be added.

[0026] In combination with the first aspect, in a possible implementation manner, the first control request further includes the corresponding application identifier.

[0027] In combination with the first aspect, in a possible implementation manner, the neighboring service user identifier is an open neighboring service application user identifier or a restricted neighboring service application user identifier.

[0028] A second aspect discloses a communication method. This method can be applied to the first network element, or to a module (such as a processor) in the first network element, or to a logical module or software that can implement all or part of the functions of the first network element. The following describes it by taking the application to the first network element as an example. The communication method may include: The first network element receives a second discovery request from the first terminal device. The second discovery request includes a second application identifier, and the second discovery request is used to request the discovery parameters corresponding to the second application identifier; obtain the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device. The first quality data is used to indicate the historical quality of service of the first terminal device; determine the second discovery parameters based on the first quality data; and send a second discovery response to the first terminal device. The second discovery response includes the second discovery parameters.

[0029] In combination with the second aspect, in a possible implementation manner, obtaining the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device includes: obtaining the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device from a first ledger, where the first ledger is a shared ledger of a first consensus group, and the first consensus group includes a second network element and the first network element.

[0030] In combination with the second aspect, in a possible implementation manner, the first ledger is a distributed ledger or a blockchain.

[0031] In combination with the second aspect, in a possible implementation manner, determining the second discovery parameter based on the first quality data includes: when the first quality data meets a third condition, determining the second discovery parameter based on the first quality data.

[0032] In combination with the second aspect, in a possible implementation manner, determining the second discovery parameter based on the first quality data includes: when the first quality data meets a fourth condition, determining a second discovery parameter of a first type; when the first quality data meets a fifth condition, determining a second discovery parameter of a second type, where the terminal historical service qualities corresponding to the first type and the second type are different.

[0033] In combination with the second aspect, in a possible implementation manner, the method further includes: when it is determined that the service quality of the first terminal device does not match the discovery parameter currently used by the first terminal device, sending a first control request to the first terminal device, where the first control request is used to adjust the discovery parameter of the first terminal device.

[0034] In combination with the second aspect, in a possible implementation manner, the first control request includes a neighboring service application code to be revoked and the neighboring service user identifier of the first terminal device.

[0035] In combination with the second aspect, in a possible implementation manner, the first control request further includes a neighboring service application code to be added.

[0036] In combination with the second aspect, in a possible implementation manner, the first control request further includes a corresponding application identifier.

[0037] It should be noted that the technical solution of the second aspect of this application may correspond to the solution of the first aspect, and the relevant beneficial effects can refer to the beneficial effects of the first aspect.

[0038] A third aspect discloses a communication method. This method can be applied to a second terminal device, or to a module (such as a processor) in the second terminal device, or to a logic module or software that can implement all or part of the functions of the second terminal device. Hereinafter, taking the application to the second terminal device as an example for description, the communication method may include: The second terminal device sends a third discovery request to a second network element. The third discovery request includes the first application identifier, and the third discovery request is used to request discovery parameters corresponding to the first application identifier; receiving a third discovery response from the second network element. The third discovery response includes third discovery parameters. The third discovery parameters include a first proximity service user list. The first proximity service user list is used to select a terminal device, and the first proximity service user list is obtained based on historical quality of service; selecting a terminal device based on the first proximity service user list.

[0039] In combination with the third aspect, in a possible implementation manner, the first proximity service user list includes a whitelist and / or a blacklist. The whitelist is used to indicate terminal devices whose historical quality of service meets a first condition, and the blacklist is used to indicate terminal devices whose historical quality of service meets a second condition.

[0040] In combination with the third aspect, in a possible implementation manner, the first proximity service user list includes a plurality of proximity service user identifiers, and a quality indication corresponding to each proximity service user identifier in the plurality of proximity service user identifiers.

[0041] In combination with the third aspect, in a possible implementation manner, the method further includes: The second terminal device performs proximity service communication with a first terminal device. The second terminal device is a remote terminal device, and the first terminal device is a relay terminal device;

[0042] The second terminal device sends a quality of service report of the first terminal device to the second network element.

[0043] In combination with the third aspect, in a possible implementation manner, the quality of service report includes a proximity service user identifier of the first terminal device, a first application identifier, and second quality data. The second quality data is used to indicate the historical quality of service of the first terminal device.

[0044] In combination with the third aspect, in a possible implementation manner, the second quality data is a quality score, and the quality score is determined based on one or more of signal quality, response time, throughput, retransmission time, and the number of supported security algorithms.

[0045] In combination with the third aspect, in a possible implementation manner, the third discovery parameters further include a discovery filter.

[0046] In combination with the third aspect, in a possible implementation manner, the proximity service user identifier is an open proximity service application user identifier or a restricted proximity service application user identifier.

[0047] It should be noted that the technical solution of the third aspect of this application may correspond to the solution of the first aspect, and the relevant beneficial effects can refer to the beneficial effects of the first aspect.

[0048] A fourth aspect discloses a communication method. This method can be applied to the second network element, or to a module (such as a processor) in the second network element, or to a logical module or software that can implement all or part of the functions of the second network element. Hereinafter, taking the application to the second network element as an example for description, the communication method may include: the second network element receives a quality of service report of a first terminal device; based on the quality of service report of the first terminal device, obtains quality of service feedback information of the first terminal device, and the quality of service feedback information includes a proximity service user identifier of the first terminal device, a first application identifier, and third quality data, and the third quality data is used to indicate the historical quality of service of the first terminal device; uploads the quality of service feedback information of the first terminal device to a first ledger, and the first ledger is a shared ledger of a first consensus group, and the first consensus group includes the first network element and the second network element.

[0049] In combination with the fourth aspect, in a possible implementation manner, the quality of service report includes a proximity service user identifier of the first terminal device, the first application identifier, and second quality data, and the second quality data is used to indicate the historical quality of service of the first terminal device.

[0050] In combination with the fourth aspect, in a possible implementation manner, the method further includes: receiving a third discovery request from a second terminal device, where the third discovery request includes the first application identifier, and the third discovery request is used to request discovery parameters corresponding to the first application identifier; based on the third discovery request, sending a first discovery request to the first network element, where the first discovery request includes the first application identifier, and the first discovery request is used to request discovery parameters corresponding to the first application identifier; receiving a first discovery response from the first network element in response to the first discovery request, where the first discovery response includes first discovery parameters, and the first discovery parameters include a first proximity service user list; based on the first discovery response, sending a third discovery response to the second terminal device, where the third discovery response includes third discovery parameters, and the third discovery parameters include the first proximity service user list, and the first proximity service user list is used to select a terminal device, and the first proximity service user list is obtained based on historical quality of service.

[0051] In combination with the fourth aspect, in a possible implementation manner, the third discovery parameters further include a discovery filter.

[0052] In combination with the fourth aspect, in a possible implementation, the neighboring service user identifier is an open neighboring service application user identifier or a restricted neighboring service application user identifier.

[0053] In combination with the fourth aspect, in a possible implementation, the first ledger is a distributed ledger or a blockchain.

[0054] It should be noted that the technical solution of the fourth aspect of this application may correspond to the solution of the first aspect, and the related beneficial effects can refer to the beneficial effects of the first aspect.

[0055] The fifth aspect discloses a communication device, which may be a first network element or a module (for example, a processor) in the first network element. The communication device may include: a receiving unit, configured to receive a first discovery request from a second network element, where the first discovery request includes a first application identifier, and the first discovery request is used to request discovery parameters corresponding to the first application identifier; a processing unit, configured to obtain a target neighboring service user identifier corresponding to the first application identifier and the first network element, and quality data corresponding to the target neighboring service user identifier, where the quality data is used to indicate the historical service quality of the terminal; a sending unit, configured to send a first discovery response to the second network element, where the first discovery response includes first discovery parameters, and the first discovery parameters include a first neighboring service user list; where the first neighboring service user list is obtained based on the target neighboring service user identifier and the quality data corresponding to the target neighboring service user identifier, and the first neighboring service user list is used to select a terminal device.

[0056] In combination with the fifth aspect, in a possible implementation, the processing unit is specifically configured to: obtain the target neighboring service user identifier corresponding to the first application identifier and the first network element, and the quality data corresponding to the target neighboring service user identifier from a first ledger, where the first ledger is a shared ledger of a first consensus group, and the first consensus group includes the second network element and the first network element.

[0057] In combination with the fifth aspect, in a possible implementation, the first ledger is a distributed ledger or a blockchain.

[0058] In combination with the fifth aspect, in a possible implementation, the first neighboring service user list includes a whitelist and / or a blacklist, where the whitelist is used to indicate terminal devices whose historical service quality meets a first condition, and the blacklist is used to indicate terminal devices whose historical service quality meets a second condition.

[0059] In combination with the fifth aspect, in a possible implementation, the first neighboring service user list includes multiple neighboring service user identifiers, and a quality indication corresponding to each neighboring service user identifier in the multiple neighboring service user identifiers.

[0060] In combination with the fifth aspect, in a possible implementation, the receiving unit is further configured to receive a second discovery request from a first terminal device, where the second discovery request includes a second application identifier, and the second discovery request is used to request discovery parameters corresponding to the second application identifier; the processing unit is further configured to obtain first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device, where the first quality data is used to indicate the historical service quality of the first terminal device; the processing unit is further configured to determine second discovery parameters based on the first quality data; and the sending unit is further configured to send a second discovery response to the first terminal device, where the second discovery response includes the second discovery parameters.

[0061] In combination with the fifth aspect, in a possible implementation, the processing unit obtains the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device, including: obtaining the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device from a first ledger, where the first ledger is a shared ledger of a first consensus group, and the first consensus group includes the second network element and the first network element.

[0062] In combination with the fifth aspect, in a possible implementation, the processing unit determines the second discovery parameters based on the first quality data, including: when the first quality data meets a third condition, determining the second discovery parameters based on the first quality data.

[0063] In combination with the fifth aspect, in a possible implementation, the processing unit determines the second discovery parameters based on the first quality data, including: when the first quality data meets a fourth condition, determining second discovery parameters of a first type; and when the first quality data meets a fifth condition, determining second discovery parameters of a second type, where the terminal historical service qualities corresponding to the discovery parameters of the first type and the second type are different.

[0064] In combination with the fifth aspect, in a possible implementation, the sending unit is further configured to, when determining that the service quality of the first terminal device does not match the neighboring service application code currently used by the first terminal device, send a first control request to the first terminal device, where the first control request is used to adjust the discovery parameters of the first terminal device.

[0065] In combination with the fifth aspect, in a possible implementation, the first control request includes a neighboring service application code to be revoked and the neighboring service user identifier of the first terminal device.

[0066] In combination with the fifth aspect, in a possible implementation, the first control request further includes a neighboring service application code to be added.

[0067] In combination with the fifth aspect, in a possible implementation manner, the first control request further includes a corresponding application identifier.

[0068] In combination with the fifth aspect, in a possible implementation manner, the proximity service user identifier is an open proximity service application user identifier or a restricted proximity service application user identifier.

[0069] A sixth aspect discloses a communication device, which may be a first network element or a module (for example, a processor) in the first network element. The communication device may include: a receiving unit, configured to receive a second discovery request from a first terminal device, where the second discovery request includes a second application identifier, and the second discovery request is used to request discovery parameters corresponding to the second application identifier; a processing unit, configured to obtain first quality data corresponding to the second application identifier and the proximity service user identifier of the first terminal device, where the first quality data is used to indicate the historical service quality of the first terminal device; the processing unit is further configured to determine second discovery parameters based on the first quality data; and a sending unit, configured to send a second discovery response to the first terminal device, where the second discovery response includes the second discovery parameters.

[0070] In combination with the sixth aspect, in a possible implementation manner, the processing unit is specifically configured to: obtain, from a first ledger, first quality data corresponding to the second application identifier and the proximity service user identifier of the first terminal device, where the first ledger is a shared ledger of a first consensus group, and the first consensus group includes a second network element and the first network element.

[0071] In combination with the sixth aspect, in a possible implementation manner, the first ledger is a distributed ledger or a blockchain.

[0072] In combination with the sixth aspect, in a possible implementation manner, the processing unit determines the second discovery parameters based on the first quality data, including: when the first quality data meets a third condition, determining the second discovery parameters based on the first quality data.

[0073] In combination with the sixth aspect, in a possible implementation manner, the processing unit determines the second discovery parameters based on the first quality data, including: when the first quality data meets a fourth condition, determining a first type of second discovery parameters; when the first quality data meets a fifth condition, determining a second type of second discovery parameters, where the terminal historical service qualities corresponding to the first type and the second type are different.

[0074] In combination with the sixth aspect, in a possible implementation manner, the sending unit is further configured to, when it is determined that the service quality of the first terminal device does not match the discovery parameters currently used by the first terminal device, send a first control request to the first terminal device, where the first control request is used to adjust the discovery parameters of the first terminal device.

[0075] In combination with the sixth aspect, in a possible implementation manner, the first control request includes the adjacent service application code to be revoked and the adjacent service user identifier of the first terminal device.

[0076] In combination with the sixth aspect, in a possible implementation manner, the first control request further includes the adjacent service application code to be added.

[0077] In combination with the sixth aspect, in a possible implementation manner, the first control request further includes the corresponding application identifier.

[0078] The seventh aspect discloses a communication device, which may be a second terminal device or a module (for example, a processor) in the second terminal device. The communication device may include: a sending unit, configured to send a third discovery request to a second network element, where the third discovery request includes the first application identifier, and the third discovery request is used to request discovery parameters corresponding to the first application identifier; a receiving unit, configured to receive a third discovery response from the second network element, where the third discovery response includes third discovery parameters, the third discovery parameters include a first adjacent service user list, the first adjacent service user list is used to select a terminal device, and the first adjacent service user list is obtained based on historical service quality; and a processing unit, configured to select a terminal device based on the first adjacent service user list.

[0079] In combination with the seventh aspect, in a possible implementation manner, the first adjacent service user list includes a whitelist and / or a blacklist, the whitelist is used to indicate terminal devices whose historical service quality meets a first condition, and the blacklist is used to indicate terminal devices whose historical service quality meets a second condition.

[0080] In combination with the seventh aspect, in a possible implementation manner, the first adjacent service user list includes a plurality of adjacent service user identifiers and a quality indication corresponding to each adjacent service user identifier in the plurality of adjacent service user identifiers.

[0081] In combination with the seventh aspect, in a possible implementation manner, the communication device performs adjacent service communication with a first terminal device through the sending unit and the receiving unit, the communication device is a remote terminal device, and the first terminal device is a relay terminal device; the sending unit is further configured to send a service quality report of the first terminal device to the second network element.

[0082] In combination with the seventh aspect, in a possible implementation manner, the service quality report includes the adjacent service user identifier of the first terminal device, the first application identifier, and second quality data, and the second quality data is used to indicate the historical service quality of the first terminal device.

[0083] In combination with the seventh aspect, in a possible implementation manner, the second quality data is a mass fraction, and the mass fraction is determined based on one or more of signal quality, response time, throughput, retransmission time, and the number of supported security algorithms.

[0084] In combination with the seventh aspect, in a possible implementation manner, the third discovery parameter further includes a discovery filter.

[0085] In combination with the seventh aspect, in a possible implementation manner, the neighboring service user identifier is an open neighboring service application user identifier or a restricted neighboring service application user identifier.

[0086] The eighth aspect discloses a communication device, which may be a second network element or a module (e.g., a processor) in the second network element. The communication device may include: a receiving unit, configured to receive a service quality report of a first terminal device; a processing unit, configured to obtain service quality feedback information of the first terminal device based on the service quality report of the first terminal device, where the service quality feedback information includes a neighboring service user identifier, a first application identifier, and third quality data of the first terminal device, and the third quality data is used to indicate the historical service quality of the first terminal device; and a sending unit, configured to upload the service quality feedback information of the first terminal device to a first ledger, where the first ledger is a shared ledger of a first consensus group, and the first consensus group includes the first network element and the second network element.

[0087] In combination with the eighth aspect, in a possible implementation manner, the service quality report includes a neighboring service user identifier, a first application identifier, and second quality data of the first terminal device, and the second quality data is used to indicate the historical service quality of the first terminal device.

[0088] In combination with the eighth aspect, in a possible implementation manner, the receiving unit is further configured to receive a third discovery request from a second terminal device, where the third discovery request includes the first application identifier, and the third discovery request is used to request discovery parameters corresponding to the first application identifier; the sending unit is further configured to send a first discovery request to the first network element based on the third discovery request, where the first discovery request includes the first application identifier, and the first discovery request is used to request discovery parameters corresponding to the first application identifier; the receiving unit is further configured to receive a first discovery response from the first network element in response to the first discovery request, where the first discovery response includes first discovery parameters, and the first discovery parameters include a first neighboring service user list; and the sending unit is further configured to send a third discovery response to the second terminal device based on the first discovery response, where the third discovery response includes third discovery parameters, and the third discovery parameters include the first neighboring service user list, and the first neighboring service user list is used to select a terminal device, and the first neighboring service user list is obtained based on historical service quality.

[0089] In combination with the eighth aspect, in a possible implementation, the third discovery parameter further includes a discovery filter.

[0090] In combination with the eighth aspect, in a possible implementation, the neighboring service user identifier is an open neighboring service application user identifier or a restricted neighboring service application user identifier.

[0091] In combination with the eighth aspect, in a possible implementation, the first ledger is a distributed ledger or a blockchain.

[0092] The ninth aspect discloses a communication system, which includes a first network element and a second network element. The first network element is used to implement the methods provided in the first aspect and any possible implementation manner in the first aspect; the second network element is used to implement the methods provided in the fourth aspect and any possible implementation manner in the second aspect.

[0093] The tenth aspect discloses a communication system, which includes a first network element and a second terminal device. The first network element is used to implement the methods provided in the first aspect and any possible implementation manner in the first aspect; the second terminal device is used to implement the methods provided in the third aspect and any possible implementation manner in the third aspect.

[0094] The eleventh aspect discloses a communication device, including a processor and a communication interface; the communication interface is used to receive and / or send data; the processor calls a computer program or computer instructions stored in a memory to implement the methods provided in the first aspect and any possible implementation manner in the first aspect.

[0095] The twelfth aspect discloses a communication device, including a processor and a communication interface; the communication interface is used to receive and / or send data; the processor calls a computer program or computer instructions stored in a memory to implement the methods provided in the second aspect and any possible implementation manner in the second aspect.

[0096] The thirteenth aspect discloses a communication device, including a processor and a communication interface; the communication interface is used to receive and / or send data; the processor calls a computer program or computer instructions stored in a memory to implement the methods provided in the third aspect and any possible implementation manner in the third aspect.

[0097] The fourteenth aspect discloses a communication device, including a processor and a communication interface; the communication interface is used to receive and / or send data; the processor calls a computer program or computer instructions stored in a memory to implement the methods provided in the fourth aspect and any possible implementation manner in the fourth aspect.

[0098] As a possible implementation manner, the processors included in the communication device disclosed in the eleventh aspect, the communication device disclosed in the twelfth aspect, the communication device disclosed in the thirteenth aspect, and the communication device disclosed in the fourteenth aspect above may be one or more.

[0099] Optionally, the communication device disclosed in the eleventh aspect, the communication device disclosed in the twelfth aspect, the communication device disclosed in the thirteenth aspect, and the communication device disclosed in the fourteenth aspect above further include one or more memories.

[0100] The fifteenth aspect discloses a computer-readable storage medium, on which a computer program or computer instructions are stored. When the computer program or computer instructions run, the methods provided in the first aspect above and any possible implementation manner of the first aspect are implemented, or the methods provided in the second aspect above and any possible implementation manner of the second aspect are implemented, or the methods provided in the third aspect above and any possible implementation manner of the third aspect are implemented, or the methods provided in the fourth aspect above and any possible implementation manner of the fourth aspect are implemented.

[0101] The sixteenth aspect discloses a chip, including a processor for executing a program stored in a memory. When the program is executed, the chip executes the methods provided in the first aspect above and any possible implementation manner of the first aspect, or executes the methods provided in the second aspect above and any possible implementation manner of the second aspect, or executes the methods provided in the third aspect above and any possible implementation manner of the third aspect, or executes the methods provided in the fourth aspect above and any possible implementation manner of the fourth aspect.

[0102] As a possible implementation manner, the memory is located outside the chip.

[0103] The seventeenth aspect discloses a computer program product, which includes computer program code. When the computer program code runs, the methods provided in the first aspect above and any possible implementation manner of the first aspect are executed, or the methods provided in the second aspect above and any possible implementation manner of the second aspect are executed, or the methods provided in the third aspect above and any possible implementation manner of the third aspect are executed, or the methods provided in the fourth aspect above and any possible implementation manner of the fourth aspect are executed.

[0104] It should be understood that the implementation and beneficial effects of the above multiple aspects or any possible implementation manner of the present application can be referred to each other. Description of the Drawings

[0105] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0106] Figure 1 It is a schematic diagram of a network architecture provided by an embodiment of the present application;

[0107] Figure 2 It is a schematic diagram of a ProSe discovery scenario provided by an embodiment of the present application;

[0108] Figure 3 It is a schematic flowchart of a communication method disclosed by an embodiment of the present application;

[0109] Figure 4 It is a schematic diagram of the sharing of service quality feedback information disclosed by an embodiment of the present application;

[0110] Figure 5 It is a schematic flowchart of another communication method disclosed by an embodiment of the present application;

[0111] Figure 6 It is a schematic flowchart of yet another communication method disclosed by an embodiment of the present application;

[0112] Figure 7 It is a schematic flowchart of yet another communication method disclosed by an embodiment of the present application;

[0113] Figure 8 It is a schematic diagram of the structure of a communication device disclosed by an embodiment of the present application;

[0114] Figure 9 It is a schematic diagram of the structure of another communication device disclosed by an embodiment of the present application;

[0115] Figure 10 It is a schematic diagram of the structure of yet another communication device disclosed by an embodiment of the present application;

[0116] Figure 11 It is a schematic diagram of the structure of yet another communication device disclosed by an embodiment of the present application. Detailed implementation manners

[0117] Embodiments of the present application disclose a communication method, apparatus, and computer-readable storage medium, which enable a terminal device to select a terminal device with better quality of service from other discovered terminal devices, or enable the terminal device to directly discover a terminal device with better quality of service, thereby ensuring that the terminal device can obtain better quality of service. The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.

[0118] To better understand the embodiments of the present application, the system architecture of the embodiments of the present application will be described first.

[0119] In some scenarios of the embodiments of the present application, the scenario of the fifth-generation (5G) communication network is taken as an example for illustration. However, it should be understood that the solutions in the embodiments of the present application can also be applied to other communication networks, such as the sixth-generation (6G) communication network, and the corresponding names can also be replaced by the names of corresponding functions / devices in other communication networks.

[0120] Please refer to Figure 1 , Figure 1 which is a schematic diagram of a network architecture provided by the embodiments of the present application. As Figure 1 shown, the architecture may include terminal devices and various network entities, which will be introduced separately below.

[0121] A terminal device, also known as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), customer premise equipment (CPE), etc., is a device with wireless communication capabilities that can provide voice and / or data connectivity services to users. The terminal device can be a handheld terminal, laptop computer, RSU (road side unit), subscriber unit, cellular phone, smart phone, wireless data card, personal digital assistant (PDA) computer, tablet computer, tag, wireless modem, other processing devices connected to the wireless modem, handheld device, laptop computer, cordless phone, or wireless local loop (WLL) station, machine type communication (MTC) terminal, wearable device (such as smart watch, smart bracelet, pedometer, etc.), vehicle-mounted device (such as car, bicycle, electric vehicle, airplane, ship, train, high-speed rail, etc.), virtual reality (VR) device, augmented reality (AR) device, wireless terminal in industrial control, smart home device (such as refrigerator, TV, air conditioner, electricity meter, etc.), smart robot, workshop device, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, or wireless terminal in smart home, flight device (such as smart robot, hot air balloon, drone, airplane, etc.) or other devices that can access the network. The terminal device can be fixed or mobile and can be deployed on land, including indoor or outdoor, handheld, wearable or vehicle-mounted; it can also be deployed on the water (such as a ship, etc.); it can also be deployed in the air (such as an airplane, balloon, satellite, etc.).

[0122] The next-generation radio access network (NG-RAN) is a network composed of multiple 5G-RAN nodes, which is used to implement wireless physical layer functions, resource scheduling, radio resource management, radio access control, etc. The 5G-RAN node is also an access network device, which mainly provides access for terminal devices. The access network device may include a radio access network (RAN) device and an access node (AN) device. The RAN device is mainly a wireless network device in the 3GPP network, and the AN device may be an access network device defined by non-3GPP. The RAN device may include various forms of base stations, such as macro base stations, micro base stations (also called small stations), relay stations, access points, balloon stations, drones, etc. The specific technologies and specific device forms adopted by the wireless access network device in the embodiments of the present application are not limited.

[0123] Among them, the UE can be connected to the NG-RAN through the Uu interface. For example, Figure 1 the UEA and UED shown can be connected to the NG-RAN through the Uu interface. Two UEs with proximity-based services application functions can be connected through the PC5 interface. For example, Figure 1 the UEA and UEB shown can be connected through the PC5 interface, the UEB and UEC can be connected through the PC5 interface, and the UEA and UED can be connected through the PC5 interface. Through the PC5 interface, two UEs can communicate directly, that is, device-to-device (D2D) communication can be performed. In the 5G network, D2D communication can be collectively referred to as proximity based service (ProSe). It should be noted that in some cases, ProSe can also be understood as proximity service. It should be noted that although the PC5 interface is mainly used as an example in the embodiments of the present application, the embodiments of the present application do not limit the adopted proximity communication technology. For example, two UEs can communicate through other proximity communication technology interfaces such as Bluetooth and WIFI.

[0124] The access and mobility management function (AMF) network element is mainly used for mobility management and access management, and is responsible for transmitting user policies between the user equipment and the policy control function (PCF) network element. Exemplarily, the AMF can be used to establish a non-access stratum (NAS) connection with the UE and can have the same 5G NAS security context as the UE. Among them, the 5G NAS security context can include KAMF, NAS layer keys and their identical key identification information, UE security capabilities, and uplink and downlink NAS COUNT values. Further, the NAS layer keys can include a NAS encryption key and a NAS integrity protection key, which are respectively used for the confidentiality protection and integrity protection of NAS messages.

[0125] The session management function (SMF) network element is mainly responsible for UE session management, including the selection of the user plane function (UPF), the allocation of Internet protocol (IP) addresses, the quality of service (QoS) management of the session, and obtaining policy and charging control (PCC) policies (from the PCF), etc.

[0126] The PCF network element mainly supports providing a unified policy framework to control network behavior, such as providing configuration policy information for the UE and providing policy information for controlling the UE to network control plane network elements (for example, AMF, SMF).

[0127] The unified data management (UDM) network element is mainly used to manage user data. For example, the management of subscription information, including storing the subscription information of the UE or obtaining the subscription information from the unified data repository (UDR) and providing it to other network elements (such as AMF); generating authentication credentials for the UE of the third generation partnership project (3GPP); registering and maintaining the network elements currently serving the UE. For example, the AMF currently serving the UE, that is, the serving AMF.

[0128] The UDR is also one of the network elements in the 5G core network, mainly used for storing user data, including the subscribed data called by the UDM, the policy information called by the PCF, the structured data for capability open, the application data called by the NEF, etc.

[0129] The UPF network element mainly serves as the anchor point for the protocol data unit (PDU) session connection, responsible for filtering user equipment data packets, data transmission / forwarding, rate control, generating charging information, etc.

[0130] The data network (data network) network element is used to provide a network for transmitting data.

[0131] The network exposure function (NEF) network element can be used to securely expose the services and capabilities provided by the 3GPP network functions to the outside, and can realize the interaction between other internal network elements of the core network and the external application servers of the core network, so as to provide network capability information to the external application servers, or provide the information of the external application servers to the core network network elements.

[0132] The ProSe application server (application server) can be an application function (AF), that is, an AF with ProSe application server functions. Exemplarily, the ProSe application server can be the AF of the DN. Among them, the AF with ProSe application server functions can include all the functions of the AF defined in Release 15 of 23.501R, and also include the relevant functions for ProSe services. In the user plane architecture, the ProSe application server and the UE can perform user plane communication through the path of UE-RAN-UPF-AF. The ProSe application server can also communicate with other network functions (NF) in the 5G core network (5G core network, 5GC) through the NEF, for example, communicate with the PCF through the NEF. Exemplarily, the ProSe application server can be used to provide the authorization information of the UE, and can store the correspondence between the UE identifier (such as RPAUID) at the APP layer and the PDUID at the network side.

[0133] The main functions of the 5G direct discovery name management function (5G DDNMF) include: allocating ProSe application IDs and ProSe application codes for open ProSe discovery, and handling the mapping relationship between ProSe application IDs and ProSe application codes; allocating restricted ProSe application user IDs (RPAUIDs) and ProSe restricted codes for restricted ProSe discovery, and handling the mapping relationship between restricted ProSe application user IDs and ProSe restricted codes, etc.

[0134] The 5G core network may also include a ProSe key management function (PKMF). The PKMF can be used to generate keys for the PC5 connection between the remote UE and the relay UE during the relay communication between the UE and the network. The UE can interact with the PKMF through the user plane channel to obtain the PC5 key.

[0135] It should be noted that the 5G DDNMF can be at the public land mobile network (PLMN) granularity, that is, one PLMN corresponds to one 5G DDNMF.

[0136] It should be understood that Figure 1 is only a schematic diagram, Figure 1 The shown architecture may also include other devices / network elements, such as a location management function (LMF), etc. For specific details, reference can be made to the relevant content in the 5G standard.

[0137] It should also be understood that the above network elements or functions can be implemented in the form of hardware, computer software, or a combination of hardware and computer software. Exemplarily, the above network elements or functions can be implemented by one device, can also be jointly implemented by multiple devices, or can be implemented by a functional module within one device. The embodiments of the present application do not make specific limitations in this regard.

[0138] In addition, the above-mentioned "network element" can also be referred to as an entity, device, module, etc., and the present application does not limit this. Moreover, for the convenience of description, the description of "network element" is omitted in some parts of the following description. For example, the NEF network element is abbreviated as NEF. In this case, "NEF" should be understood as the NEF network element or the NEF entity, and the same understanding should apply to other network elements or functions. That is to say, functions, functional network elements, and functional entities can be equivalent. For example, UDM, UDM network element, and UDM entity can be equivalent.

[0139] It should be understood that the technical solutions provided in the embodiments of the present application can be applied to various communication systems. For example: the fifth-generation (5G) communication system, the transitional system between the 5G communication system and the 6G communication system (this transitional system can also be called the 5.5G communication system), the network with the integration of multiple systems, etc.; of course, it can also be a future communication system, such as the sixth-generation (6G) or even the seventh-generation (7G) communication system, etc.

[0140] It should be noted that the system architecture, network architecture, and service scenarios (or application scenarios) described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those of ordinary skill in the art know that with the evolution of the communication network architecture and the emergence of new service scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.

[0141] To better understand the embodiments of the present application, the relevant content, terms, or nouns involved in the present application are briefly introduced below.

[0142] I. Proximity Service Communication

[0143] Proximity service communication allows direct communication between UEs without passing through access network devices, thus improving network transmission efficiency and reducing UE power consumption. Generally, before proximity service communication, one UE needs to first discover another UE, and then a communication connection can be established between the two UEs to transmit information on the data plane and signaling plane through the PC5 interface.

[0144] Among them, the 5G standard includes ProSe Direct Discovery, which is defined as the process of using NR (new radio) wireless signals to detect and identify another nearby UE.

[0145] Exemplarily, an application scenario of proximity service communication is introduced. When a UE is outside the network coverage or has poor communication signals with the access network device / RAN, the UE (remote UE) can perform auxiliary communication through another UE (relay UE), that is, communicate between the remote UE and the relay UE, and the relay UE communicates with the mobile network / access network device, so as to enable the remote UE to obtain services. It can be understood that by establishing a communication mode from the remote UE to the relay UE to the network, the communication from the UE outside the network coverage to the network can be extended and supported.

[0146] II. Discovery type and discovery model

[0147] In the embodiments of the present application, there are two discovery types: open type and restricted type. Among them, the open type does not require explicit permission from the discovered UE, while the restricted type occurs only with explicit permission from the discovered UE.

[0148] For more content about open discovery or restricted discovery, reference can be made to the relevant descriptions in the 5G standard, which will not be elaborated here.

[0149] In the embodiments of the present application, there are also two discovery models: model A and model B. Model A uses a single discovery protocol message, that is, the Announcement message. Model B uses two discovery protocol messages, that is, the Solicitation message and the Response message.

[0150] Specifically, two roles are defined in model A ("I am here"), namely the announcing UE (A-UE) and the monitoring UE (M-UE). Among them, the A-UE can broadcast discovery messages, and the M-UE interested in the discovery messages can read and process the discovery messages. Exemplarily, the A-UE can request discovery parameters from the corresponding DDNMF and can receive the discovery parameters sent by the corresponding DDNMF. The discovery parameters can include adjacent service application codes. After that, the A-UE can broadcast the adjacent service application codes or discovery messages (adjacent service application codes) at a predefined discovery period. The M-UE can also request discovery parameters from the corresponding DDNMF and can receive the discovery parameters sent by the corresponding DDNMF. The discovery parameters can include discovery filters. After that, the M-UE can monitor the adjacent service application codes or discovery messages that match the discovery filters on the PC5 interface. After detecting the adjacent service application codes or discovery messages that match the discovery filters, the M-UE can establish ProSe communication with the corresponding UE for data interaction. Exemplarily, when the service provided by the A-UE is a relay service, the A-UE can be called a relay UE, and the M-UE can be called a remote UE.

[0151] Two roles are also defined in model B ("Who is there?" / "Where are you?"), namely the discoverer UE and the discoveree UE. Among them, in the discovery process of model B, the discoverer UE can send ProSe query codes or discovery messages (ProSe query codes) and can monitor the ProSe response codes or response messages (ProSe response codes) that match the discovery response filter. The discoveree UE can monitor the ProSe query codes or discovery messages that match the discovery query filter on the PC5 interface and can send the ProSe response codes or response messages corresponding to the ProSe query codes when detecting the ProSe query codes or discovery messages that match the discovery query filter. After the discoverer UE detects the ProSe response codes or response messages that match the discovery response filter, it can establish ProSe communication with the corresponding UE for data interaction. Exemplarily, when the service provided by the discoveree UE is a relay service, the discoveree UE can be called a relay UE, and the discoverer UE can be called a remote UE.

[0152] In some possible implementations, model A can be applicable to both open discovery type and restricted discovery type, while model B can only be applicable to the restricted discovery type.

[0153] For more detailed information about open discovery type and restricted discovery type, as well as model A and model B (such as the discovery process in various scenarios), reference can be made to the relevant descriptions in the 5G standard.

[0154] III. Distributed Ledger Technology and Blockchain

[0155] Both distributed ledger technology (DLT) and blockchain are decentralized technologies. Among them, a distributed ledger can be a database distributed across multiple nodes or computing devices, and each node can replicate and save a ledger. One of the characteristics of distributed ledger technology is that the ledger is not maintained by a single node, and the updates of the ledger are independently constructed and recorded by each node. Moreover, each node can vote on these updates to ensure that they conform to the opinions of the majority of nodes. This voting is also called consensus, and the consensus is automatically achieved through the adopted consensus algorithm. After the consensus is reached, the distributed ledger can be updated by itself, and the latest version of the ledger will be saved on each node respectively.

[0156] Blockchain can be understood as a chain composed of one block after another. Each block stores certain information, and they can be connected into a chain in the order of their generation time. This chain is saved in all nodes, and these nodes jointly participate in the data verification, storage, and maintenance of the blockchain system. On the other hand, blockchain is essentially a continuously growing chain, and its structure only allows new blocks to be added to the blockchain, and does not allow changes or deletions. Moreover, if a new block is to be added to the blockchain, it must be confirmed by consensus and broadcast to each node to achieve full network synchronization, and then it cannot be changed or deleted.

[0157] Decentralized technologies such as distributed ledger technology and blockchain can achieve multi-party trust and can be used for shared storage of data. In the embodiments of this application, decentralized technologies such as distributed ledger technology and blockchain can be introduced into the communication network to achieve multi-party trusted data storage and data sharing. For example, for multiple PLMNs corresponding to DDNMF, they can build a consensus group to jointly maintain a distributed ledger or blockchain to achieve multi-party trusted data storage and data sharing.

[0158] In the related art, during the discovery process of a terminal device, a terminal device may discover multiple terminal devices. Exemplarily, such as Figure 2As shown, it is schematically illustrated in model A mode, where UE1 is the M-UE, and UE2, UE3, and UE4 are A-UEs. UE2, UE3, and UE4 can respectively broadcast their corresponding proximity service application codes or discovery messages. UE1 can receive the proximity service application codes or discovery messages broadcast by UE2, UE3, and UE4 respectively, and can determine that the proximity service application codes or discovery messages broadcast by UE2, UE3, and UE4 respectively match the discovery filter. That is to say, UE1 can discover UE2, UE3, and UE4. When a terminal device discovers multiple nearby terminal devices, the terminal device may randomly select a terminal device for ProSe communication, or select a terminal device for ProSe communication based on a pre-configured policy (such as selecting the one with the maximum signal reception power). However, it is possible that the selected terminal device has poor quality of service and cannot provide good service. To solve the above problems, in the embodiments of the present application, after ProSe communication, a service quality report of the corresponding terminal device can be uploaded, so that later the DDNMF can generate a corresponding proximity service user list based on the historical service quality of the terminal device. The proximity service user list can help select a terminal device with good service quality. Alternatively, the DDNMF can allocate discovery parameters (such as proximity service application codes) based on the historical service quality of the terminal device or specifically, and in this way, it can also help discover / select a terminal device with good service quality.

[0159] To facilitate the understanding of the embodiments of the present application, the relevant content of the embodiments of the present application will be briefly introduced below. In the embodiments of the present application, there are multiple ways to help a terminal device obtain better ProSe service quality, and two examples are given below. The first way is to generate a proximity service user list based on the historical service quality of the terminal device. The proximity service user list can include a blacklist and / or a whitelist, or include other user lists that can indicate the historical service quality of the terminal device. A terminal device with good historical service quality can be selected through the proximity service user list. The second way is to specifically allocate discovery parameters for the terminal device based on the historical service quality of the terminal device. For example, for a terminal device with good historical service quality, discovery parameters representing good historical service quality (such as proximity service application codes) can be allocated to it, and for a terminal device with poor historical service quality, discovery parameters representing poor historical service quality can be allocated to it. Of course, the above two ways can also be combined, and the embodiments of the present application do not limit this.

[0160] The communication method in the embodiments of this application mainly involves network elements such as a first terminal device, a second terminal device, a first network element, and a second network element. For ease of understanding, the functions of each network element in the embodiments of this application will be briefly described below. Among them, the second terminal device can be a terminal device that requires ProSe (service), and the first terminal device can be a device that can provide ProSe (service). Exemplarily, the first terminal device can establish ProSe communication with the second terminal device, and the first terminal device can provide ProSe service for the second terminal device. Further, the first terminal device can be an A-UE, and the second terminal device can be an M-UE. Alternatively, the first terminal device can be a discovered UE, and the second terminal device can be a discoverer UE. The first network element and the second network element can provide a discovery function. Exemplarily, the first network element can be the DDNMF corresponding to the first terminal device, and the second network element can be the DDNMF corresponding to the second terminal device. Further, the first network element can be the DDNMF corresponding to the HPLMN (home PLMN) of the first terminal device, and the second network element can be the DDNMF corresponding to the HPLMN of the second terminal device. Of course, the functions of the above-mentioned network elements are not limited to this, and in addition to the above-mentioned network elements, it can also involve UDM, ProSe application server, the DDNMF corresponding to the VPLMN / Local PLMN (visited PLMN / local PLMN) of the first terminal device (in a roaming scenario), the DDNMF corresponding to the VPLMN / Local PLMN of the second terminal device, etc. (in a roaming scenario). The technical solution provided in the embodiments of this application will be described in detail below.

[0161] Based on the above system architecture, please refer to Figure 3 , Figure 3 which is a schematic flowchart of a communication method disclosed in the embodiments of this application. As Figure 3 shown, the method may include but is not limited to the following steps:

[0162] 301. The second network element receives the quality of service report of the terminal device.

[0163] In the embodiments of this application, after a terminal device obtains the ProSe service of another terminal device, it can send the quality of service report of this terminal device to the corresponding DDNMF. Exemplarily, when the second terminal device conducts proximity service communication with the first terminal device, after the second terminal device obtains the ProSe service of the first terminal device, the second terminal device can send the quality of service report of the first terminal device to the second network element. Correspondingly, the second network element can receive the quality of service report of the first terminal device sent by the second terminal device. Optionally, the second terminal device can be a remote terminal device, and the first terminal device can be a relay terminal device.

[0164] Among them, the quality of service report may include the identification information and quality data of the corresponding terminal device. Optionally, the quality of service report may further include the corresponding application identifier (APP ID). Exemplarily, the quality of service report of the first terminal device may include the identification information of the first terminal device and the second quality data. The identification information of the first terminal device may be information capable of identifying the first terminal device, such as the proximity service user identifier of the first terminal device. Further, the proximity service user identifier of the first terminal device may be a ProSe application ID, a restricted ProSe application user ID, a ProSe discovery UE ID, or other information capable of identifying the first terminal device, such as a generic public subscription identifier, a subscription concealed identifier (SUCI), a subscription permanent identifier (SUPI), a globally unique temporary identifier (GUTI), an international mobile subscriber identity (IMSI), etc., and the embodiments of the present application are not limited thereto. The second quality data is used to indicate the (historical) quality of service of the first terminal device. The second quality data may be a quality score (such as 1, 2, 3, 4, 5, etc.), may also be a quality level (such as excellent, good, medium, poor, etc.), or may also be other data capable of indicating the quality of service, such as (average) signal reception power, (average) signal-to-noise ratio, (average) response time, (average) throughput, (average) retransmission time, etc., and the embodiments of the present application are not limited thereto. In addition, the second quality data may be obtained based on one ProSe communication with the second terminal device, or may be obtained based on multiple ProSe communications with the second terminal device. Exemplarily, one ProSe communication may be all the information and data transmitted after establishing a ProSe connection with the second terminal device once, and multiple ProSe communications may be all the information and data transmitted after establishing a ProSe connection with the second terminal device multiple times.Alternatively, a single ProSe communication can be understood as the communication process after a ProSe connection is established once between a first terminal device and a second terminal device. Multiple ProSe communications can be understood as the communication processes after ProSe connections are established separately multiple times between the first terminal device and the second terminal device, which is not limited herein.

[0165] Optionally, the quality of service report of the first terminal device may further include a corresponding application identifier, such as a first application identifier. Generally speaking, when the second terminal device communicates with the first terminal device based on the PC5 interface, it corresponds to a certain application, or in other words, the proximity service communication is based on a certain application. The second terminal device may include the application identifier of this application in the quality of service report. Specifically, the application here may be a certain application program (such as a chat application program), or a certain specific service (such as a voice communication service, a video communication service). Correspondingly, the application identifier may be the application identifier of a certain application program (APP), or the application identifier of a certain specific service. Moreover, the application identifier may be a digital identifier corresponding to the application (such as 02, 11, etc.), may also be the application name, or may be other information that can identify the corresponding application, which is not limited herein. Exemplarily, currently the second terminal device and the first terminal device perform a network relay service, and the application identifier of this service is 2, then the application identifier included in the quality of service report may be 2.

[0166] It should be noted that the quality data in the quality of service report is associated with the identification information of the terminal device, that is to say, the quality data in the quality of service report is the quality data corresponding to the terminal device indicated by the identification information of the terminal device. Further, in the case where the application identifier is included in the quality of service report, the quality data in the quality of service report is associated with the application identifier and the identification information of the terminal device (such as RPAUID), that is to say, the quality data in the quality of service report is the quality data corresponding to the application indicated by the application identifier and the terminal device indicated by the identification information of the terminal device. Exemplarily, for the quality of service report (identification information of the first terminal device, first application identifier, second quality data), the second quality data in this quality of service report is the quality data associated with the first terminal device and the first application identifier.

[0167] For example, in order to obtain the quality of service report of the first terminal device, when the second terminal device conducts proximity service communication with the first terminal device and obtains the ProSe service corresponding to the first application, the second terminal device may measure one or more of the (average) signal quality (such as received power or received signal-to-noise ratio), (average) response time, (average) throughput, (average) retransmission time, etc. of the first terminal device, and may also obtain other information related to the quality of service from the first terminal device, such as the number of supported security algorithms. After that, the second terminal device may obtain a quality score based on the measured relevant data of the first terminal device and / or other information obtained related to the quality of service. For example, the quality score may be determined based on one or more of the signal quality, response time, throughput, retransmission time, number of supported security algorithms, etc. Exemplarily, in a possible implementation manner, the second terminal device may include a pre-configured quality of service algorithm, and based on this quality of service algorithm and the signal quality, response time, throughput, retransmission time, number of supported security algorithms, etc. of the first terminal device, the quality score of the first terminal device may be calculated. After obtaining the quality score of the first terminal device, the second terminal device may send a corresponding quality of service report to the second network element, which may include the identification information of the first terminal device, the identification of the first application (i.e., the first application identification), and the quality score of the first terminal device. In some possible implementation manners, if the overall quality of service of the first terminal device is better, the quality score may be higher. For example, when the second terminal device and the first terminal device communicate based on the PC5 interface, if the second terminal device determines that the communication signal quality of the first terminal device is relatively poor and the retransmission rate is relatively high according to the measurement results, then the finally obtained quality score of the first terminal device will be lower. Another example is for the relay scenario. If the first terminal device has a low throughput and low transmission efficiency when transmitting the data of the second terminal device to the network side, then the finally obtained quality of service score of the first terminal device will also be lower.

[0168] It should be understood that the above signal quality, response time, throughput, retransmission time, number of supported security algorithms, etc. may be related to the PC5 interface or ProSe.

[0169] It should be noted that in some possible implementation manners, the ProSe APP ID and the RPAUID may be IDs belonging to an application assigned by the ProSe APP function or the ProSe application server to the terminal device. For the same terminal device, the ProSe APP ID and the RPAUID may be the same in different application programs and services (for example, the RPAUIDs corresponding to the first terminal device in Application 1, Application 2, and Application 3 are the same), or may be different (for example, the RPAUIDs corresponding to the first terminal device in Application 1, Application 2, and Application 3 are different), which is specifically related to the configuration of the operator or the application provider.

[0170] 302. The second network element obtains the service quality feedback information of the terminal device based on the service quality report of the terminal device.

[0171] After receiving the service quality report of the terminal device, the second network element may obtain the service quality feedback information of the terminal device based on the service quality report of the terminal device. Exemplarily, after receiving the service quality report of the first terminal device from the second terminal device, the second network element may obtain the service quality feedback information of the first terminal device based on the service quality report of the first terminal device.

[0172] Among them, the service quality feedback information of the first terminal device may include the neighboring service user identifier and the third quality data of the first terminal device. The neighboring service user identifier of the first terminal device may be the ProSe APP ID, the RPAUID, or the PDUID. Specifically, the neighboring service user identifier in the service quality feedback information of the first terminal device may be the same as the neighboring service user identifier in the service quality report of the first terminal device, such as both being the RPAUID. The neighboring service user identifier in the service quality feedback information of the first terminal device may also be different from the neighboring service user identifier in the service quality report of the first terminal device. For example, the neighboring service user identifier in the service quality report of the first terminal device is the RPAUID, while the neighboring service user identifier in the service quality feedback information of the first terminal device may be the PDUID obtained by converting the RPAUID in the service quality report. Another example is that the neighboring service user identifier in the service quality report of the first terminal device is the PDUID, while the neighboring service user identifier in the service quality feedback information of the first terminal device may be the RPAUID obtained by converting the PDUID in the service quality report.

[0173] The third quality data is used to indicate the (historical) quality of service of the first terminal device. The third quality data may be a quality score, a quality level, or other data that can indicate the quality of service. The embodiments of the present application do not limit this. Specifically, the third quality data may be the same as the second quality data or different from the second quality data. For example, the second network element may collect multiple quality of service reports for the neighboring service user identifier (such as RPAUID) of the first terminal device. These multiple quality of service reports may be from different terminal devices or all from the second terminal device. After that, the second network element may obtain a comprehensive quality data through an algorithm based on the quality data in these multiple quality of service reports, and this comprehensive quality data may be the third quality data. For example, the average value, maximum value, or minimum value of the quality data in these multiple quality of service reports may be taken, which can be set according to the actual situation.

[0174] Optionally, the quality of service feedback information of the first terminal device may further include a corresponding application identifier, such as the first application identifier. Specifically, the application identifier in the quality of service feedback information of the first terminal device may be the same as the application identifier in the quality of service report of the first terminal device.

[0175] It should be noted that in some possible implementation manners, the second network element may not need to process based on the quality of service report, and the quality of service feedback information may be the quality of service report.

[0176] 303. The second network element shares the quality of service feedback information of the terminal device with the first network element.

[0177] After obtaining the quality of service feedback information of the terminal device, the second network element may share the quality of service feedback information with other network elements (such as the first network element) so that other network elements can use it.

[0178] It can be understood that there are multiple ways for the second network element to share service quality feedback information with the first network element, and the embodiments of this application do not limit this. For example, the second network element can upload the service quality feedback information to a shared database of the second network element and the first network element. Exemplarily, the shared database can be a network element that can be accessed by both the first network element and the second network element, such as a network repository function (NRF), etc. The embodiments of this application do not limit the specific implementation of the shared database. For another example, the second network element can directly send the service quality feedback information to the first network element. For another example, the second network element can upload the service quality feedback information to a distributed ledger or blockchain, and the first network element can access the distributed ledger or blockchain. For example, the first network element is a certain node in the distributed ledger or blockchain. For another example, intelligent network elements such as network data analytics function (NWDAF) can be included in the network / core network. The intelligent network elements such as NWDAF can collect the service quality feedback information from the second network element and can inform the first network element of the service quality of the corresponding terminal device inferred / calculated based on the service quality feedback information.

[0179] Exemplarily, after the second network element obtains the service quality feedback information of the first terminal device, it can upload the service quality feedback information of the first terminal device to the first ledger. The first ledger is a shared ledger of the first consensus group, and the first consensus group can include the first network element and the second network element. Optionally, the first ledger can be a distributed ledger or blockchain.

[0180] The following takes blockchain as an example for a simple illustration. After the second network element obtains the service quality feedback information of the first terminal device, it can chain the service quality feedback information of the first terminal device (the RPAUID of the first terminal device, the first application identifier, the third quality data). Specifically, the second network element can send the service quality feedback information of the first terminal device (the RPAUID of the first terminal device, the first application identifier, the third quality data) to other nodes in the blockchain (such as the first network element) as data to be chained. After that, when the data to be chained accumulates to a certain time or size, a head node election process can be initiated. By voting, a node can be selected as the current leader. After that, the leader can package the data to be chained into a new block and then broadcast it to other nodes in the blockchain. After that, other nodes synchronize the new block, and the data to be chained is successfully chained.

[0181] Please refer to Figure 4 , Figure 4 which is a schematic diagram of sharing service quality feedback information disclosed in the embodiments of this application. As Figure 4As shown, each DDNMF (such as A-UE1 DDNMF, A-UE2 DDNMF, A-UE3 DDNMF, M-UE1 DDNMF, etc.) can be a node of the same blockchain or distributed ledger, and data can be shared among the nodes through consensus. For example, the quality of service feedback information can be shared among the nodes.

[0182] It should be noted that the above is only described by taking the second network element as an example, but it should be understood that other network elements (such as the first network element) in the first consensus group can also upload service feedback information to the first ledger. For example, the first network element can receive the service quality report of the second terminal device from the first terminal device, and then can obtain the service quality feedback information of the second terminal device based on the service quality report of the second terminal device. After that, the service quality feedback information of the second terminal device can be uploaded to the first ledger.

[0183] It can be understood that the above is only described by taking the first ledger as an example, but in some possible implementation manners, multiple ledgers can be configured. For example, there can also be a second ledger, a third ledger, etc. Each ledger can be used to store data of different classifications. For example, for each application identifier, there is a corresponding ledger.

[0184] It should be noted that the above steps 301-303 are optional.

[0185] 304. The second terminal device sends a third discovery request to the second network element. The third discovery request includes a first application identifier, and the third discovery request is used to request the discovery parameters corresponding to the first application identifier.

[0186] In order to obtain the discovery parameters corresponding to the first application identifier, the second terminal device can send a third discovery request (discovery request) to the second network element. Correspondingly, the second network element can receive the third discovery request from the second terminal device. Exemplarily, the discovery parameters corresponding to the first application identifier that the second terminal device wants to obtain here can help the second terminal device discover the terminal devices that can provide the ProSe service corresponding to the first application identifier.

[0187] The third discovery request may also include one or more of ProSe App ID(s) / RPAUID, the terminal device identity of the second terminal device, a discovery command, a discovery type, a discovery model, etc. The terminal device identity is used to indicate the corresponding terminal device and may be an international mobile subscriber identity (IMSI), a generic public subscription identifier (GPSI), a subscription permanent identifier (SUPI), etc. The discovery command can be used to identify the type of the first terminal device and may be "monitor", "ProSe Query". The network side can determine the identity of the terminal device, whether it is an M-UE or a discoverer UE, through the discovery command. Specifically, if "command = monitor", it indicates that the corresponding terminal device is an M-UE, and if "command = ProSe Query", it indicates that the corresponding terminal device is a discoverer UE. The discovery type is used to indicate the discovery type corresponding to the first terminal device, such as indicating open ProSe discovery or restricted ProSe discovery. The discovery model is used to indicate the discovery model corresponding to the first terminal device, such as indicating model A or model B. In addition to the above information, other information may also be included in the third discovery request, which is not limited herein.

[0188] 305. The second network element sends a first discovery request to the first network element. The first discovery request includes a first application identifier, and the first discovery request is used to request discovery parameters corresponding to the first application identifier.

[0189] After receiving the third discovery request from the second terminal device, the second network element may send a first discovery request to the first network element based on the third discovery request. Correspondingly, the first network element may receive the first discovery request from the second network element. Exemplarily, for the model A scenario, the first discovery request may be a monitor request, and for the model B scenario, the first discovery request may be a discovery request.

[0190] In some possible implementation manners, before the second network element sends a first discovery request to the first network element, it may first perform an authorization check on the second terminal device. After the authorization check passes, the second network element may then send the first discovery request to the first network element. Exemplarily, the second network element may request the UDM or the ProSe application server to perform an authorization check on the second terminal device. The UDM or the ProSe application server may store the authorization information or subscription information of the terminal device. The following exemplarily describes the process of the second network element requesting the UDM or the ProSe application server to perform an authorization check on the second terminal device. First, the second network element may send an authorization request to the UDM or the ProSe application server. The authorization request may include the user identifier of the second terminal device (such as ProSe AppID / RPAUID) and / or other relevant information. After receiving the authorization request, the UDM or the ProSe application server may obtain the corresponding authorization information or subscription information based on the information in the authorization request, such as the authorization information or subscription information corresponding to the ProSe App ID / RPAUID, and then may perform an authorization check on the second terminal device based on the corresponding authorization information or subscription information, and return an authorization response to the second network element. The authorization response may indicate that the authorization passes or fails. For example, the authorization response may include an indication message that indicates that the authorization passes or fails. Optionally, the authorization response may further include other relevant information. For example, for a restricted discovery scenario, the authorization response may include N pairs (target PDUID, target RPAUID), and these N pairs (target PDUID, target RPAUID) are associated with the terminal devices that the second terminal device can discover, where N is a positive integer. It should be noted that the above content related to the authorization check is only an exemplification and does not constitute a limitation thereto. For specific details, reference may also be made to the relevant content in the 5G standard.

[0191] In a possible implementation manner, the second network element may send a first discovery request to the corresponding first network element based on the authorization response returned by the UDM or the ProSe application server. Exemplarily, the second network element may send a first discovery request to the corresponding first network element based on the N pairs (target PDUID, target RPAUID) in the authorization response. It should be understood that different (target PDUID, target RPAUID) may correspond to different first network elements, that is, different 5G DDNMFs.

[0192] Optionally, the first discovery request may further include one or more of a proximity service user identifier (such as ProSe App ID, RPAUID, etc.), a terminal device identifier of the second terminal device, a target PDUID, a target RPAUID, etc.

[0193]

[0193] The first network element obtains a first application identifier, a target neighboring service user identifier corresponding to the first network element, and quality data corresponding to the target neighboring service user identifier.

[0194]

[0194] After the first network element receives a first discovery request from the second network element, it may obtain first discovery parameters based on the first discovery request. To obtain the first discovery parameters, the first network element may obtain a first application identifier, a target neighboring service user identifier corresponding to the first network element, and quality data corresponding to the target neighboring service user identifier.

[0195]

[0195] For ease of understanding, the first application identifier and the target neighboring service user identifier corresponding to the first network element are briefly described below. From the literal meaning, the first application identifier and the target neighboring service user identifier corresponding to the first network element are the neighboring service user identifiers that correspond to both the first application identifier and the first network element. Among them, corresponding to the first network element means that the terminal device indicated by the corresponding neighboring service user identifier belongs to the management of the first network element or belongs to the first network element, or belongs to the PLMN corresponding to the first network element. That is to say, the HPLMN of the terminal device indicated by the target neighboring service user identifier is the same as the PLMN corresponding to the first network element.

[0196]

[0196] It should be understood that the method of obtaining data here may correspond to the method of sharing data in step 303 above. For example, if the service feedback information is uploaded to the first ledger in step 303 above, then the first network element may obtain the quality data corresponding to the target neighboring service user identifier from the first ledger.

[0197] Exemplarily, a set of data in the first ledger may be (proximity service user identifier, application identifier, quality data). The first network element may first obtain the corresponding data in the first ledger through the first application identifier. For example, the first network element may compare the application identifier in each set of data in the first ledger with the first application identifier. If they are the same, it indicates a match, and the set of data can be obtained. If they are different, it indicates a mismatch, and the set of data can be ignored. After obtaining one or more sets of data in the first ledger that match the first application identifier, the first network element may determine whether the proximity service user identifier in each set of data corresponds to the first network element. If it corresponds to the first network element, it can be determined that the set of data matches and the set of data can be retained. Otherwise, if it does not correspond to the first network element, the set of data can be ignored. Finally, after screening, the first network element may obtain one or more sets of target data. The proximity service user identifier in this one or more sets of target data is the target proximity service user identifier corresponding to the first application identifier and the first network element. The quality data in this one or more sets of target data is the quality data corresponding to the target proximity service user identifier. It should be understood that the target proximity service user identifier may be one or more, and one target proximity service user identifier may correspond to one or more quality data. One target proximity service user identifier corresponds to multiple quality data because there may be multiple sets of data in multiple sets of target data for the same proximity service user identifier and application identifier. Of course, in some possible implementation manners, when the first network element obtains data, for the same proximity service user identifier and application identifier, only the latest set of data, that is, the set of data that is uploaded to the first ledger most recently, may be obtained.

[0198] It should be noted that in some cases, the first network element may not be able to identify whether the neighboring service user identifier in a set of data in the first ledger corresponds to the first network element. For example, the first network element may only be able to identify based on the PDUID, but the RPAUID, etc. is stored in the first ledger. In this case, the first network element can first convert the RPAUID in a set of data into the corresponding PDUID, and then determine whether the PDUID corresponds to the first network element. Further, the conversion between the RPAUID and the PDUID can be performed by the first network element or by other network elements (such as the ProSe application server). Exemplarily, the ProSe application server may store the correspondence between the RPAUID and the PDUID. The first network element can send an identifier query request to the corresponding ProSe application server. The identifier query request may include one or more RPAUIDs to be converted. Correspondingly, the ProSe application server can receive the identifier query request from the first network element, and based on the correspondence between the RPAUID and the PDUID, convert the one or more RPAUIDs carried in the identifier query request into the corresponding one or more PDUIDs, and can return an identifier query response to the first network element. The identifier query response may include the PDUIDs corresponding to the one or more RPAUIDs to be converted. In a possible implementation manner, the first network element can determine the corresponding ProSe application server based on the first application identifier, and then can send the RPAUID to be converted to the corresponding ProSe application server.

[0199] It should also be noted that in some possible implementation manners, each set of data stored in the first ledger may not have a corresponding application identifier. In this case, one or more sets of data corresponding to the first network element can be obtained from the first ledger. The neighboring service user identifier and the quality data in this one or more sets of data can be used as the target neighboring service user identifier and the quality data corresponding to the target neighboring service user identifier respectively. That is to say, in this case, the first application identifier and the target neighboring service user identifier corresponding to the first network element are equivalent to the target neighboring service user identifier corresponding to the first network element.

[0200] It can be understood that for a restricted discovery scenario, the second terminal device may only be able to discover the corresponding terminal device(s) of one or more target PDUIDs / target RPAUIDs. Therefore, when the first discovery request includes a target PDUID and / or a target RPAUID, the first network element may obtain one or more sets of data corresponding to the first application identifier and the target PDUID, or one or more sets of data corresponding to the first application identifier and the target RPAUID, only from the first ledger. The neighboring service user identifier(s) in this one or more sets of data is / are the target neighboring service user identifier(s) corresponding to the first application identifier and the first network element. The neighboring service user identifier(s) and the quality data in this one or more sets of data may be used as the target neighboring service user identifier(s) and the quality data corresponding to the target neighboring service user identifier(s), respectively.

[0201] After the first network element obtains the target neighboring service user identifier corresponding to the first application identifier and the first network element, and the quality data corresponding to the target neighboring service user identifier, the first network element may obtain a first neighboring service user list based on the target neighboring service user identifier and the quality data corresponding to the target neighboring service user identifier. The first neighboring service user list may be used to select a terminal device.

[0202] Specifically, in one implementation, the first neighboring service user list may include a whitelist and / or a blacklist. The whitelist is used to indicate terminal devices whose historical service quality meets the first condition, and the blacklist is used to indicate terminal devices whose historical service quality meets the second condition. In another implementation, the first neighboring service user list may include multiple neighboring service user identifiers, and a quality indication corresponding to each neighboring service user identifier among the multiple neighboring service user identifiers. The following will be introduced separately.

[0203] For the whitelist, if the quality data corresponding to a target adjacent service user identifier meets the first condition, that is, the historical service quality meets the first condition, the first network element can add the target adjacent service user identifier to the whitelist. Among them, for different situations, the quality data meeting the first condition can be different. Exemplarily, if the quality data is a quality score, meeting the first condition can be that the quality score is greater than or equal to the first threshold (such as 60). Another example, if the quality data is a quality level, meeting the first condition can be that the quality level is higher than medium (such as good, excellent, etc.). In addition to the above two situations, the quality data meeting the first condition can also be other situations that can indicate that the service quality of the corresponding terminal device is better, which is not limited here. In addition, when a target adjacent service user identifier includes multiple corresponding quality data, the average value of these multiple quality data can be taken, or the latest quality data (that is, the quality data latest uploaded to the first ledger) can be taken, or the minimum value can be taken, and then it is determined whether the average value or the latest value or the minimum value meets the first condition. For example, assuming there are 5 groups of data, and the corresponding target adjacent service user identifiers and quality scores are (RPAUID1, 55), (RPAUID 2, 70), (RPAUID 3, 90), (RPAUID 4, 30), (RPAUID 5, 36) respectively, the first network element can determine that the quality scores corresponding to RPAUID 2 and RPAUID 3 meet the first condition, and can add RPAUID 2 and RPAUID 3 to the whitelist.

[0204] For the blacklist, if the quality data corresponding to a target adjacent service user identifier meets the second condition, that is, the historical service quality meets the second condition, the first network element can add the target adjacent service user identifier to the blacklist. Among them, for different situations, the quality data meeting the second condition can be different. Exemplarily, if the quality data is a quality score, meeting the second condition can be that the quality score is less than the second threshold (such as 60). Another example, if the quality data is a quality level, meeting the second condition can be that the quality level is lower than or equal to medium (such as medium, poor, etc.). In addition to the above two situations, the quality data meeting the second condition can also be other situations that can indicate that the service quality of the corresponding terminal device is worse, which is not limited here. In addition, since a target adjacent service user identifier may include multiple corresponding quality data, at this time, the average value of these multiple quality data can be taken, or the latest quality data can be taken, or the minimum value can be taken, and then it is determined whether the average value or the latest value or the minimum value meets the second condition.

[0205] It can be understood that the neighboring service user identifiers in the above-mentioned whitelist and blacklist are not distinguished. However, in some possible implementation manners, the first network element may sort the neighboring service user identifiers in the whitelist and the blacklist based on the corresponding quality data, and may obtain a sorted whitelist (hereinafter referred to as the first recommended order list) and a sorted blacklist (hereinafter referred to as the second recommended order list). Specifically, for the sorting of the whitelist, for a neighboring service user identifier in the whitelist, if the service quality represented by the quality data corresponding to the neighboring service user identifier is better, the sorting of the neighboring service user identifier can be more forward. For example, the whitelist includes RPAUID 2, RPAUID 3, and RPAUID6, where the quality data corresponding to RPAUID 2 is 70, the quality data corresponding to RPAUID 3 is 90, and the quality data corresponding to RPAUID 6 is 80. Then, RPAUID 3 can be ranked in front of RPAUID6, and RPAUID6 can be ranked in front of RPAUID2. The corresponding first recommended order list can be {RPAUID 3, RPAUID 6, RPAUID2}. Similarly, for the sorting of the blacklist, for a neighboring service user identifier in the blacklist, if the service quality represented by the quality data corresponding to the neighboring service user identifier is worse, the sorting of the neighboring service user identifier can be more forward. For example, the blacklist includes RPAUID1, RPAUID4, and RPAUID5, where the quality data corresponding to RPAUID1 is 55, the quality data corresponding to RPAUID4 is 30, and the quality data corresponding to RPAUID5 is 36. Then, RPAUID4 can be ranked in front of RPAUID5, and RPAUID5 can be ranked in front of RPAUID1. The corresponding first recommended order list can be {RPAUID 4, RPAUID 5, RPAUID1}. It should be understood that for the first recommended order list, the more forward the sorting of a neighboring service user identifier, the higher the priority corresponding to the neighboring service user identifier. Correspondingly, the terminal device corresponding to the neighboring service user identifier can be preferentially selected. For the second recommended order list, the more forward the sorting of a neighboring service user identifier, the lower the priority corresponding to the neighboring service user identifier. Correspondingly, the terminal device corresponding to the neighboring service user identifier can be preferentially not selected.

[0206] The following describes the case where the first neighboring service user list includes multiple neighboring service user identifiers and the quality indication corresponding to each neighboring service user identifier in the multiple neighboring service user identifiers. After the first network element obtains the target neighboring service user identifier corresponding to the first application identifier and the first network element, and the quality data corresponding to the target neighboring service user identifier, the first network element may add the target neighboring service user identifier and the quality data corresponding to the target neighboring service user identifier to the first neighboring service user list. That is to say, the neighboring service user identifier in the first neighboring service user list may be the target neighboring service user identifier corresponding to the first application identifier and the first network element. Correspondingly, the quality indication in the first neighboring service user list may be the quality data corresponding to the target neighboring service user identifier. In some possible implementation manners, the first network element may only add some of the target neighboring service user identifiers corresponding to the first application identifier and the first network element, and the quality data corresponding to the part of the target neighboring service user identifiers to the first neighboring service user list, such as only adding the target neighboring service user identifiers whose quality data meets the first condition and the corresponding quality data. In addition, since one target neighboring service user identifier may include multiple corresponding quality data, at this time, the average value of the multiple quality data may be taken, or the latest quality data among them may be taken, or the minimum value may be taken, and then the target neighboring service user identifier and the average value or the latest value or the minimum value may be added to the first neighboring service user list.

[0207] It should be noted that the above description of the first neighboring service user list is only an exemplary description and does not constitute a limitation thereto. In some other possible implementation manners, the first neighboring service user list may be other types of neighboring service user lists that can be used to select terminal devices.

[0208] 307. The first network element sends a first discovery response to the second network element, and the first discovery response includes a first discovery parameter, and the first discovery parameter includes a first neighboring service user list.

[0209] After the first network element obtains the first neighboring service user list based on the historical service quality of the terminal device, the first network element may send a first discovery response to the second network element. Correspondingly, the second network element may receive the first discovery response from the first network element. Exemplarily, for the modelA scenario, the first discovery response may be monitorresponse, and for the modelB scenario, the first discovery response may be discoveryresponse.

[0210] The first discovery parameter may further include one or more of a ProSe application code (ProSeAPPcode), a ProSe application mask (ProSeAPPmask), a ProSe restricted code, a ProSe query code, and a ProSe response code. Exemplarily, for the open discovery + model A scenario, the first discovery parameter may further include ProSeAPPCode(s) / ProSeAPPmask(s); for the restricted discovery + model A scenario, the first discovery parameter may further include the ProSe restricted code; and for the restricted discovery + model B scenario, the first discovery parameter may further include the ProSe query code and the ProSe response code.

[0211] The first discovery parameter may further include the time to live (TTL) of the corresponding code, that is, the valid time. Exemplarily, the first discovery parameter may include a validity timer, which is associated with the corresponding code in the first discovery parameter. For example, the first discovery parameter includes the ProSe restricted code and the validity timer, and the validity timer may be used to indicate the validity period of the ProSe restricted code.

[0212] In some possible embodiments, before the first network element sends a first discovery response to the second network element, it may first determine whether the historical quality of service of the second terminal device meets the sixth condition. If the sixth condition is met, it indicates that the second terminal device is a non-malicious terminal device / non-abnormal terminal device / has good quality of service, and the first network element may send a first discovery response to the second network element. If the sixth condition is not met, it indicates that the second terminal device is a malicious terminal device / abnormal terminal device / has poor quality of service, and the first network element may reject or ignore the first discovery request. Exemplarily, the first network element may obtain a set (such as the latest uploaded set) or multiple sets of data that match the first application identifier and the adjacent service user identifier of the second terminal device from the first ledger, and then may determine whether the quality data in this set or these multiple sets of data meets the sixth condition, that is, determine whether the historical quality of service of the second terminal device meets the sixth condition. Among them, for different situations, the quality data meeting the sixth condition may be different. Taking the quality data as the quality score as an example, meeting the sixth condition may be that the quality score in this set of data or the average value of the quality data in these multiple sets of data is greater than or equal to a certain threshold (such as 60). It should be noted that the above description of the historical quality of service meeting the sixth condition is only an exemplary illustration and does not limit it. In some other possible embodiments of the present application, it may also be determined whether to return a first discovery response to the second network element based on the historical quality of service in the first ledger through other means.

[0213] In one possible implementation manner, when the first network element determines that the historical quality of service of the second terminal device does not meet the sixth condition, the first network element may send a trigger failure response to the second network element, and the trigger failure response may include the first application identifier, the adjacent service user identifier of the second terminal device, and a failure reason indication. After receiving the trigger failure response from the first network element, the second network element may send the trigger failure response to the second terminal device. Among them, the failure reason indication may indicate the specific reason for the trigger failure (such as the reason for not allowing the second terminal device to perform a monitor operation), which may be a specific reason or a reason value (such as a number), and the reason value may correspond to a specific failure reason.

[0214] 308. The second network element sends a third discovery response to the second terminal device, and the third discovery response includes third discovery parameters, and the third discovery parameters include a first adjacent service user list.

[0215] After receiving the first discovery response from the first network element, the second network element may send a third discovery response to the second terminal device based on the first discovery response. Correspondingly, the second terminal device may receive the third discovery response from the second network element.

[0216] Optionally, the third discovery parameter further includes a discovery filter. The discovery filter may include one or more of a neighboring service application code, a neighboring service application mask, a restricted neighboring service application code, a ProSe query code, and a ProSe response code. Exemplarily, for the open discovery + modelA scenario, the discovery filter may include a neighboring service application code and a neighboring service application mask; for the restricted discovery + modelA scenario, the discovery filter may include a restricted neighboring service application code and a neighboring service application mask; for the restricted discovery + modelB scenario, the discovery filter may include a ProSe query code, a ProSe response code, and a neighboring service application mask.

[0217] The discovery filter may further include the time to live (TTL) of the corresponding code, such as a validity timer. The above description of the discovery filter is only exemplary, and more detailed content can be referred to in the relevant description of the 5G standard.

[0218] It can be understood that, for the modelA scenario, the discovery filter is mainly provided to the M-UE so that the M-UE can use the discovery filter to match the neighboring service application code or the restricted neighboring service application code received on the PC5 interface. For the modelB scenario, the discovery filter in the third discovery parameter may be a discovery response filter, and the discovery response filter is mainly provided to the discoverer UE so that the discoverer UE can use the discovery response filter to match the ProSe response code received on the PC5 interface.

[0219] Exemplarily, in the scenario where the second terminal device is roaming, before the second network element sends a third discovery response to the second terminal device, the second network element may send an announce authorization message to the third network element. After receiving the announce authorization message from the second network element, the third network element may perform corresponding processing. In the case of authorizing the second terminal device to perform ProSe direct discovery announcing, the third network element may send an announce authorization ack to the second network element. After receiving the announce authorization ack from the third network element, the second network element may send a third discovery response to the second terminal device. The third network element may be the DDNMF in the VPLMN / Local PLMN corresponding to the second terminal device. The announce authorization message may include one or more of the neighboring service user identifier (such as RPAUID) corresponding to the second terminal device, the ProSe query code, the terminal device identifier of the second terminal device, the validity timer, etc.

[0220] 309. The second terminal device selects a terminal device based on the first proximity service user list.

[0221] After the second terminal device receives a third discovery response from the second network element, it can select a terminal device based on the first proximity service user list in the third discovery response to select a terminal device with better historical quality of service. Exemplarily, when the second terminal device executes the ProSe discovery process and discovers multiple terminal devices, the second terminal device can select one terminal device from the discovered multiple terminal devices based on the first proximity service user list for ProSe communication to provide ProSe services for the second terminal device.

[0222] Specifically, the second terminal device can first use a discovery filter to match the ProSe code received on the PC5 interface to discover nearby terminal devices. When discovering multiple nearby terminal devices, the second terminal device can make a selection based on the first proximity service user list. When the first proximity service user list includes a whitelist, the second terminal device can select a terminal device in the whitelist for ProSe communication, or preferentially select a terminal device in the whitelist for ProSe communication. For example, the second terminal device can obtain the proximity service user identifier of the discovered terminal device. If the proximity service user identifier exists in the whitelist, the second terminal device can perform ProSe communication with the discovered terminal device.

[0223] When the first proximity service user list includes a blacklist, the second terminal device can avoid performing ProSe communication with the terminal devices in the blacklist, or reduce the priority of performing ProSe communication with the terminal devices in the blacklist. For example, the second terminal device can obtain the proximity service user identifier of the discovered terminal device. If the proximity service user identifier exists in the blacklist, the second terminal device can ignore the discovered terminal device and not perform ProSe communication with the discovered terminal device.

[0224] When the first neighboring service user list includes multiple neighboring service user identifiers and a quality indication corresponding to each neighboring service user identifier in the multiple neighboring service user identifiers, the second terminal device may select a terminal device with better service quality as much as possible based on the quality indication. For example, the second terminal device may obtain the neighboring service user identifiers of the multiple discovered terminal devices, and then may find the corresponding quality indication in the first neighboring service user list based on the neighboring service user identifiers of the multiple terminal devices. After that, the second terminal device may select the terminal device with the best historical service quality represented by the corresponding quality indication among the multiple discovered terminal devices. For example, assume that the second terminal device discovers 4 terminal devices, namely A-UE 1, A-UE 2, A-UE 3, and A-UE 4. The quality indication in the first neighboring service user list is a quality score. The data corresponding to these 4 A-UEs in the first neighboring service user list are (neighboring service user identifier of A-UE 1, 60), (neighboring service user identifier of A-UE 2, 95), (neighboring service user identifier of A-UE 3, 55), and (neighboring service user identifier of A-UE 4, 75). In this case, the second terminal device may determine that the historical service quality corresponding to A-UE 2 is the best, may select A-UE 2, and may perform ProSe communication with A-UE 2.

[0225] It should be noted that the embodiments of the present application do not limit the manner in which the second terminal device obtains the neighboring service user identifiers of the discovered terminal devices. For example, the second terminal device may send an acquisition request to other terminal devices, and the acquisition request is used to request to obtain the neighboring service user identifiers. For another example, the second terminal device may obtain the neighboring service user identifiers of other terminal devices during the process of establishing ProSe communication / ProSe service with other terminal devices.

[0226] It can be understood that the above acquisition of the first neighboring service user list and the acquisition of the discovery filter may be implemented through the same discovery request (such as the discovery request for obtaining the discovery filter in the related art), but the embodiments of the present application do not limit this. For example, the second terminal device may obtain the first neighboring service user list through a new request, while the discovery filter may be obtained in the manner of the related art.

[0227] It can be understood that for different scenarios, the specific processes for the above-mentioned second terminal device to discover other terminal devices may be different, and a brief description is given below. For the model A scenario, the second terminal device can be an M-UE. The second terminal device can use a discovery filter to match the proximity service application code / restricted proximity service application code sent by other A-UEs on the PC5 interface. If the proximity service application code / restricted proximity service application code sent by a certain A-UE matches the discovery filter, the second terminal device can discover that A-UE. For the model B scenario, the second terminal device can be a discoverer UE. The second terminal device can send a ProSe query code and can use a discovery response filter to match the ProSe response code corresponding to the ProSe query code sent by other discovered UEs on the PC5 interface. If the ProSe response code sent by a certain discovered UE matches the discovery response filter, the second terminal device can discover that discovered UE. The discovered UE can use a discovery query filter to match the ProSe query code sent by the discoverer UE on the PC5 interface. If a ProSe query code that matches the discovery response filter is detected, the discovered UE can send the ProSe response code corresponding to the ProSe query code. The processes for an A-UE to obtain discovery parameters (such as the broadcast proximity service application code / restricted proximity service application code, etc.) and for a discovered UE to obtain discovery parameters (such as the ProSe response code, discovery query filter, etc.) are not specifically limited and can refer to the relevant descriptions in the 5G standard.

[0228] The above Figure 3 In the corresponding technical solution, mainly based on the historical quality of service of the terminal device, a first proximity service user list is obtained, and then the first proximity service user list is provided to the second terminal device (M-UE / discoverer UE). The second terminal device can select a terminal device based on the first proximity service user list to obtain the ProSe service for the corresponding application to ensure that the selected terminal device can provide a better quality of service. The following introduces another technical solution. This solution mainly controls the discovery parameters (such as proximity service application code, restricted proximity service application code, ProSe response code, etc.) sent by the A-UE / discovered UE based on the historical quality of service of the A-UE / discovered UE, so that the M-UE / discoverer UE can select an A-UE / discovered UE with better quality of service based on the discovery parameters sent by the A-UE / discovered UE for ProSe communication. The following is combined with Figure 5 for a detailed introduction.

[0229] Based on the above system architecture, please refer to Figure 5 , Figure 5It is a schematic flowchart of another communication method disclosed in an embodiment of the present application. As Figure 5 shown, the method may include but is not limited to the following steps:

[0230] 501. The second network element receives a quality of service report of the terminal device.

[0231] 502. The second network element obtains quality of service feedback information of the terminal device based on the quality of service report of the terminal device.

[0232] 503. The second network element shares the quality of service feedback information of the terminal device with the first network element.

[0233] After the second network element obtains the quality of service feedback information of the terminal device, it can share the quality of service feedback information with other network elements (such as the first network element) so that other network elements can use it.

[0234] It can be understood that the above steps 501-503 are optional.

[0235] Steps 501-503 are similar to the above steps 301-303, and the relevant descriptions in the above steps 301-303 can be referred to.

[0236] 504. The first terminal device sends a second discovery request to the first network element. The second discovery request includes a second application identifier, and the second discovery request is used to request discovery parameters corresponding to the second application identifier.

[0237] In order to obtain discovery parameters corresponding to the second application identifier, the first terminal device may send a second discovery request (discovery request) to the first network element. Correspondingly, the first network element may receive the second discovery request from the first terminal device. Exemplarily, the discovery parameters corresponding to the second application identifier that the first terminal device wants to obtain here can help the first terminal device be discovered by other terminal devices that need to obtain the ProSe service corresponding to the second application identifier.

[0238] The second discovery request may also include one or more of ProSe App ID / RPAUID, the terminal device identity of the first terminal device, discovery command, discovery type, discovery model, etc. The terminal device identity is used to indicate the corresponding terminal device, and may be IMSI, GPSI, SUPI, etc. The discovery command may be "announce", "ProSe Response". The network side can determine the identity of the terminal device through the discovery command, whether it is an A-UE or a discovered UE. Specifically, if "command = announce", it indicates that the corresponding terminal device is an A-UE, and if "command = ProSe Response", it indicates that the corresponding terminal device is a discovered UE. The discovery type is used to indicate the discovery type corresponding to the first terminal device, such as indicating open discovery or restricted discovery. The discovery model is used to indicate the discovery model corresponding to the first terminal device, such as indicating model A or model B. In addition to the above information, the second discovery request may also include other information, which is not limited herein.

[0239] 505. The first network element obtains first quality data corresponding to the second application identifier and the proximity service user identifier of the first terminal device.

[0240] After receiving the second discovery request from the first terminal device, the first network element may obtain first quality data corresponding to the second application identifier and the proximity service user identifier of the first terminal device based on the second discovery request. Among them, the first quality data can be used to indicate the historical service quality of the first terminal device. It can be understood that the second application identifier and the above-mentioned first application identifier may be the same.

[0241] It should be understood that the manner in which the first network element obtains the first quality data may correspond to the manner of sharing data in step 503 above. For example, if in step 503 above, the service feedback information is uploaded to the first ledger, then the first network element may obtain the first quality data corresponding to the second application identifier and the proximity service user identifier of the first terminal device from the first ledger. The first ledger is a shared ledger of the first consensus group, and the first consensus group includes the second network element and the first network element. Optionally, the first ledger is a distributed ledger or a blockchain.

[0242] Exemplarily, a set of data in the first ledger may be (proximity service user identifier, application identifier, quality data). The first network element may obtain corresponding data in the first ledger through the second application identifier and the proximity service user identifier of the first terminal device. For example, the first network element may compare the application identifier and the proximity service user identifier in each set of data in the first ledger with the second application identifier and the proximity service user identifier of the first terminal device respectively. If they are all the same, it indicates a match, and the set of data can be obtained. If one of the pairs is different (the application identifier in the set of data is different from the second application identifier, or the proximity service user identifier in the set of data is different from the proximity service user identifier of the first terminal device), it indicates a mismatch, and the set of data can be ignored. Finally, after screening, the first network element may obtain one or more sets of target data, and the proximity service user identifiers in this one or more sets of target data are all the same as the proximity service user identifier of the first terminal device. The quality data in this one or more sets of target data may be the first quality data, that is to say, the first quality data may be multiple quality data. Of course, in some possible implementation manners, when the first network element obtains data, for the same proximity service user identifier (such as the proximity service user identifier of the first terminal device) and application identifier (such as the second application identifier), it may only obtain the latest set of data, that is, the set of data that was uploaded to the first ledger most recently, and may use the quality data in this set of data as the first quality data.

[0243] It should be noted that, in some cases, the proximity service user identifier stored in the first ledger may be PDUID, while the proximity service user identifier of the first terminal device received by the first network element is RPAUID. In this case, the first network element may first convert the RPAUID into the corresponding PDUID, and then match the data in the first ledger based on the PDUID. Of course, in other cases, the proximity service user identifier stored in the first ledger may be RPAUID, while the proximity service user identifier of the first terminal device received by the first network element is PDUID. In this case, the first network element may first convert the PDUID into the corresponding RPAUID, and then match the data in the first ledger based on the RPAUID. Further, the conversion between RPAUID and PDUID may be performed by the first network element or by other network elements (such as the ProSe application server), and the embodiments of the present application do not limit this here.

[0244] It should also be noted that in some possible implementation manners, each group of data stored in the first ledger may not have a corresponding application identifier. In this case, one or more groups of data corresponding to the neighboring service user identifier of the first terminal device can be obtained from the first ledger, and the quality data in this one or more groups of data can be used as the first quality data. That is to say, in this case, the second application identifier and the first quality data corresponding to the neighboring service user identifier of the first terminal device are equivalent to the first quality data corresponding to the neighboring service user identifier of the first terminal device.

[0245] In some possible implementation manners, before the first network element obtains the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device, the first network element may first perform an authorization check on the second terminal device. After the authorization check passes, the first network element may then obtain the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device. Exemplarily, the first network element may request the UDM or the ProSe application server to perform an authorization check on the first terminal device. The UDM or the ProSe application server may store the authorization information or subscription information of the terminal device. The following exemplarily describes the process of the first network element requesting the UDM or the ProSe application server to perform an authorization check on the first terminal device. First, the first network element may send an authorization request to the UDM or the ProSe application server. The authorization request may include the user identifier of the first terminal device (such as ProSe AppID / RPAUID) and / or other relevant information. After receiving the authorization request, the UDM or the ProSe application server may obtain the corresponding authorization information or subscription information based on the information in the authorization request, such as the authorization information or subscription information corresponding to the ProSe App ID / RPAUID, and then may perform an authorization check on the first terminal device based on the corresponding authorization information or subscription information, and return an authorization response to the first network element. The authorization response may indicate that the authorization is passed or the authorization is not passed. For example, the authorization response may include an indication message, and the indication message indicates that the authorization is passed or the authorization is not passed. Optionally, the authorization response may further include other relevant information, which is not limited herein. It should be noted that the above content related to the authorization check is only an exemplification and does not constitute a limitation thereto. For the specific content, reference may also be made to the relevant content in the 5G standard.

[0246] It can be understood that the operation of the first network element performing an authorization check on the second terminal device may also be performed before step 506 or step 507, and this is not limited in the embodiments of the present application.

[0247] 506. The first network element determines the second discovery parameter based on the first quality data.

[0248] After the first network element obtains the first quality data, it may determine a second discovery parameter based on the first quality data.

[0249] In some possible implementation manners, before the first network element determines the second discovery parameter based on the first quality data, it may first determine whether the historical service quality of the first terminal device meets a third condition, that is, determine whether the first quality data meets the third condition. When the third condition is met, it indicates that the first terminal device is a non-malicious terminal device / non-abnormal terminal device / has good service quality, and the first network element may determine the second discovery parameter. When the third condition is not met, it indicates that the first terminal device is a malicious terminal device / abnormal terminal device / has poor service quality, and the first network element may reject or ignore the second discovery request. Among them, for different situations, the first quality data meeting the third condition may be different. Taking the quality data as a quality score as an example, meeting the third condition may be that the first quality data is greater than or equal to a certain threshold (such as 60). Taking the quality data as a quality level as an example, meeting the third condition may be that the first quality data is higher than or equal to a certain quality level (such as good).

[0250] In a possible implementation manner, when the first network element determines that the historical service quality of the first terminal device does not meet the third condition, the first network element may send a discovery fail response to the first terminal device. The discovery fail response may include a second application identifier, a neighboring service user identifier of the first terminal device, and a failure reason indication. The failure reason indication may indicate the specific reason for the trigger failure (such as the reason for not allowing the first terminal device to perform an announce operation), and may be a specific reason or a reason value (such as a number). The reason value may correspond to a specific failure reason.

[0251] In the embodiments of the present application, the first network element may determine different types of discovery parameters based on the first quality data. Exemplarily, when the first quality data meets a fourth condition, the first network element may determine a second discovery parameter of a first type. When the first quality data meets a fifth condition, the first network element may determine a second discovery parameter of a second type. The terminal historical service qualities corresponding to the first type and the second type are different. That is to say, for different historical service qualities of the first terminal device, discovery parameters may be allocated to the first terminal device specifically. It should be noted that the discovery parameters allocated to the first terminal device specifically here mainly refer to neighboring service application codes, restricted neighboring service application codes, or ProSe response codes.

[0252] Specifically, in the embodiments of the present application, discovery parameters can be divided into multiple types, and different types of discovery parameters can correspond to different service qualities. For example, for the case where the quality data is a quality score, multiple levels can be divided based on the quality score. For example, it can be divided into 4 levels, namely (0, 60), (60, 80), (80, 90), and (90, 100). These 4 different levels can correspond to different types of discovery parameters. Exemplarily, (0, 60) can correspond to discovery parameters of type 1, (60, 80) can correspond to discovery parameters of type 2, (80, 90) can correspond to discovery parameters of type 3, and (90, 100) can correspond to discovery parameters of type 4. The discovery parameters of type 1 can be the 1234X series, that is, the prefix can be 1234. For example, 12341, 12342, 12343, 12344, 12345, etc. are all discovery parameters of the 1234X series. Or, the discovery parameters of type 1 can be one or more specific discovery parameters, such as 12341, 12342, etc. The discovery parameters of type 2 can be the 1235X series or one or more specific discovery parameters, the discovery parameters of type 3 can be the 1236X series or one or more specific discovery parameters, and the discovery parameters of type 4 can be the 1237X series or one or more specific discovery parameters. The above-mentioned first quality data satisfying the fourth condition can be that the first quality data is in the interval (0, 60). Correspondingly, the second discovery parameter of the first type can be the discovery parameter of type 1. The above-mentioned first quality data satisfying the fifth condition can be that the first quality data is in the interval (90, 100). Correspondingly, the second discovery parameter of the second type can be the discovery parameter of type 4. Optionally, in some possible implementation manners, for the case of poor service quality, corresponding discovery parameters may not be allocated. For example, the discovery parameters corresponding to the quality score interval (0, 50) are empty, which means there is no available code.

[0253] For another example, in the case where the quality data is a quality level, each quality level may correspond to different types of discovery parameters. Exemplarily, the level "poor" may correspond to discovery parameters of type 1, the level "medium" may correspond to discovery parameters of type 2, the level "good" may correspond to discovery parameters of type 3, and the level "excellent" may correspond to discovery parameters of type 4. The discovery parameters of type 1 may be the 1234X series, the discovery parameters of type 2 may be the 1235X series, the discovery parameters of type 3 may be the 1236X series, and the discovery parameters of type 4 may be the 1237 series. The first quality data satisfying the fourth condition may be that the first quality data is at the level of "poor", and correspondingly, the second discovery parameter of the first type may be the discovery parameter of type 1. The first quality data satisfying the fifth condition may be that the first quality data is at the level of "excellent", and correspondingly, the second discovery parameter of the second type may be the discovery parameter of type 4. It should be noted that the different types of discovery parameters corresponding to the above different quality score levels / quality levels may be specified by the network side, may be specified in the protocol, or may be specified through negotiation with other network elements, which is not limited herein. Optionally, in some possible implementation manners, for the case of poor service quality, corresponding discovery parameters may not be allocated. For example, the discovery parameters corresponding to the quality level of "poor" are empty, which means there is no available code.

[0254] It can be seen that based on the first quality data corresponding to the first terminal device, that is, the historical service quality of the first terminal device, the first network element can allocate discovery parameters matching its historical service quality for it. For example, if the historical service quality of the first terminal device is level 1 (such as the first quality data is at the level of poor or the first quality data is in the range of 0 to 60), one or more codes corresponding to level 1 can be allocated to the first terminal device, such as allocating multiple codes {12341, 12342, 12343, 12344, 12345} to the first terminal device, or directly allocating a code prefix to the first terminal device, such as 1234X. If the historical service quality of the first terminal device is level 2 (such as the first quality data is at the level of excellent or the first quality data is in the range of 90 to 100), one or more codes corresponding to level 2 can be allocated to the first terminal device, such as allocating multiple codes {12371, 12372, 12373, 12374, 12375} to the first terminal device, or directly allocating a code prefix to the first terminal device, such as 1237X.

[0255] 507. The first network element sends a second discovery response to the first terminal device, and the second discovery response includes the second discovery parameter.

[0256] After the first network element obtains the second discovery parameter based on the first quality data, the first network element may send a second discovery response to the first terminal device. Correspondingly, the first terminal device may receive the second discovery response from the first network element. Exemplarily, the second discovery response may be discoveryresponse.

[0257] In addition to including the code (such as the proximity service application code, restricted proximity service application code, or ProSe response code) determined in step 506 above, the second discovery parameter may further include the time to live (TTL) corresponding to the code. Exemplarily, the first discovery parameter may include a validity timer, which is associated with the corresponding code in the second discovery parameter. For example, the second discovery parameter includes a restricted proximity service application code and a validity timer, and the validity timer may be used to indicate the validity period of the restricted proximity service application code. It should be noted that the second discovery parameter may further include other relevant information, such as one or more of the application identifier, discovery mode, proximity service application identifier, discovery query filter, etc. The embodiments of the present application do not limit this, and the specific content may refer to the relevant descriptions in the 5G standard.

[0258] Exemplarily, in the roaming scenario of the first terminal device, before the first network element sends the second discovery response to the first terminal device, the first network element may send an announce authorization message to the fourth network element. After receiving the announce authorization message from the first network element, the fourth network element may perform corresponding processing. In the case of authorizing the first terminal device to perform ProSe direct discovery announcing, the fourth network element may send an announce authorization ack to the first network element. After receiving the announce authorization ack from the fourth network element, the first network element may send the second discovery response to the first terminal device. Among them, the fourth network element may be the DDNMF in the VPLMN / LocalPLMN corresponding to the first terminal device. The announce authorization message may include one or more of the proximity service user identifier (such as RPAUID) corresponding to the first terminal device, the second application identifier, ProSe codes (such as restricted proximity service application code, ProSe response code, etc.), the terminal device identifier of the first terminal device, the validity timer, etc.

[0259] 508. The first terminal device sends the second discovery parameter.

[0260] After the first terminal device receives the second discovery response from the first network element, it may send the second discovery parameter in the second discovery response so that other terminal devices with corresponding neighboring service requirements can discover the first terminal device.

[0261] Exemplarily, for the modelA scenario, the second discovery parameter may be a neighboring service application code or a restricted neighboring service application code. After the first terminal device receives the second discovery parameter, it may broadcast the neighboring service application code or the restricted neighboring service application code. For the modelB scenario, the second discovery parameter may be a ProSe response code. When the first terminal device monitors a ProSe query code matching the discovery query filter on the PC5 interface, it may send the ProSe response code corresponding to the ProSe query code.

[0262] It can be understood that the M-UE or the discoverer UE can match the ProSe code (neighboring service application code or restricted neighboring service application code or ProSe response code) received on the PC5 interface through a discovery filter to discover nearby terminal devices. In the embodiments of the present application, since the ProSe code sent by the first terminal device corresponds to the historical quality of service of the first terminal device, there are various ways to enable the M-UE or the discoverer UE to obtain better quality of service, which are exemplified below. One way is to specifically allocate a discovery filter for the M-UE or the discoverer UE so that only terminal devices with good quality of service can be discovered through the discovery filter, such as the first quality data being excellent or the first quality data being greater than 90. Another way is to inform the M-UE or the discoverer UE of the correspondence between the historical quality of service and the code. In this way, the M-UE or the discoverer UE can determine which codes correspond to better historical quality of service and which codes correspond to worse historical quality of service, so as to make a targeted selection.

[0263] Exemplarily, assume that the M-UE discovers 4 terminal devices, namely A-UE 1, A-UE 2, A-UE 3, and A-UE 4. Among them, the code broadcast by A-UE 1 is 12341, the code broadcast by A-UE 2 is 12342, the code broadcast by A-UE 3 is 12371, and the code broadcast by A-UE 4 is 12372. The M-UE can determine that the historical quality of service corresponding to 12341 and 12342 is worse, while the historical quality of service corresponding to 12371 and 12372 is better based on the correspondence between the historical quality of service and the code. Therefore, the M-UE can select one of A-UE 3 and A-UE 4 for ProSe communication to provide ProSe service for the M-UE.

[0264] Exemplarily, assume that the ProSe codes allocated to the M-UE are {12371, 12372, 12373, 12374, 12375}. Through these ProSe codes, the M-UE can only discover the A-UE with better historical service quality and cannot discover the A-UE with poor historical service quality (such as the A-UE only allocated with the 1234X series of codes), thereby ensuring that the M-UE obtains better service quality.

[0265] 509. When the first network element determines that the service quality of the first terminal device does not match the discovery parameters currently used by the first terminal device, the first network element sends a first control request to the first terminal device, and the first control request is used to adjust the discovery parameters of the first terminal device.

[0266] It can be understood that the service quality of the first terminal device may change. For example, within the first time period, the service quality of the first terminal device may be better, while within a certain time period after the first time period, the service quality of the first terminal device may become worse. Therefore, the discovery parameters previously allocated to the first terminal device may not match the current service quality of the first terminal device. At this time, the first network element can send a first control request to the first terminal device. Correspondingly, the first terminal device can receive the first control request from the first network element.

[0267] Exemplarily, after the first network element allocates second discovery parameters to the first terminal device, it can check (such as periodically checking) whether the first ledger includes newly uploaded quality data corresponding to the first terminal device and the second application identifier (hereinafter simply referred to as the fourth quality data). If it includes, the first network element can determine whether the service quality of the first terminal device matches the currently used discovery parameters (second discovery parameters) based on the fourth quality data. In a possible implementation manner, the first network element can compare the fourth quality data with the first quality data. If the fourth quality data and the first quality data are both in the same quality score interval or are of the same quality level (such as excellent level), it indicates that the service quality of the first terminal device matches the currently used discovery parameters. Otherwise, it indicates that the service quality of the first terminal device does not match the currently used discovery parameters.

[0268] In the case where the quality of service of the first terminal device does not match the discovery parameters currently used by the first terminal device, the first network element may send a first control request to the first terminal device to adjust the discovery parameters of the first terminal device. Exemplarily, the first control request may include the proximity service application code to be revoked, the proximity service user identifier of the first terminal device, etc. For example, the second discovery parameters previously assigned to the first terminal device are 1237X and 1234X, and according to the fourth quality data, it can be determined that the first terminal device should use 1234X. At this time, a first control request may be sent to the first terminal device, and the first control request may include the proximity service application code 1237X to be revoked and the proximity service user identifier of the first terminal device.

[0269] Optionally, the first control request may further include the proximity service application code to be newly added. For example, the second discovery parameters previously assigned to the first terminal device are 1237X, and according to the fourth quality data, it can be determined that the first terminal device should use 1234X. At this time, a first control request may be sent to the first terminal device, and the first control request may include the proximity service application code 1237X to be revoked, the proximity service application code 1234X to be newly added, and the proximity service user identifier of the first terminal device.

[0270] Optionally, the first control request may further include the corresponding application identifier. For example, the second discovery parameters previously assigned to the first terminal device are 1237X and are based on the second application identifier. When it is determined according to the fourth quality data that the first terminal device should use 1234X, the first network element may send a first control request to the first terminal device, and the first control request may include the proximity service application code 1237X to be revoked, the proximity service application code 1234X to be newly added, the second application identifier, and the proximity service user identifier of the first terminal device.

[0271] Optionally, the first control request may further include the time to live (TTL) of the proximity service application code to be newly added.

[0272] 510. The first terminal device sends the adjusted discovery parameters.

[0273] After receiving the first control request from the first network element, the first terminal device may adjust the currently used discovery parameters based on the first control request. For example, the second discovery parameters currently broadcast by the first terminal device are 1237X, and the first control request received by the first terminal device includes the proximity service application code 1237X to be revoked, the proximity service application code 1234X to be newly added, the second application identifier, and the proximity service user identifier of the first terminal device. After that, the first terminal device may stop using the second discovery parameter 1237X and may use the discovery parameter 1234X.

[0274] Optionally, after receiving the first control request from the first network element, the first terminal device may stop broadcasting the discovery parameters currently in use.

[0275] Optionally, after the first terminal device successfully adjusts the discovery parameters based on the first control request, it may send a first control response to the first network element, where the first control response is used to indicate that the discovery parameter adjustment is successful. In a possible implementation, the first control response may include the neighboring service application codes that have been successfully revoked, the neighboring service user identifier of the first terminal device, and the like. Optionally, the first control response may further include the newly added neighboring service application codes and / or the corresponding application identifiers.

[0276] It can be understood that steps 509 and 510 are optional.

[0277] It can be seen that in the above process, the discovery parameters of the A-UE / discovered UE can be controlled based on the historical quality of service of the A-UE / discovered UE, so that the M-UE / discovering UE can discover or select the A-UE / discovered UE with better historical quality of service, thereby ensuring that the M-UE / discovering UE can obtain better quality of service.

[0278] It can be understood that the above Figure 3 corresponding solution is mainly to provide the first neighboring service user list for the second terminal device (M-UE / discovering UE), so that the second terminal device can select the A-UE / discovered UE with better quality of service based on the neighboring service user list, while Figure 5 the corresponding solution is mainly to allocate discovery parameters for the first terminal device (A-UE / discovered UE) based on the historical quality of service of the first terminal device, so as to distinguish the first terminal devices with different historical qualities of service through the discovery parameters, and thus the M-UE / discovering UE can discover or select the first terminal device with better historical quality of service in other ways (such as allocating discovery filters for the M-UE / discovering UE specifically). It can be seen that Figure 3 and Figure 5 the corresponding solutions are two different methods, but these two methods can be combined to achieve better effects, and the embodiments of this application do not make specific limitations on this.

[0279] Exemplarily, it is assumed that M-UE discovers 4 terminal devices, namely A-UE 1, A-UE 2, A-UE 3, and A-UE 4, wherein the code broadcast by A-UE 1 is 12341, the code broadcast by A-UE 2 is 12342, the code broadcast by A-UE 3 is 12371, and the code broadcast by A-UE 4 is 12372. M-UE can determine based on the correspondence between the historical service quality and the code that the historical service quality corresponding to 12341 and 12342 is poor, while the historical service quality corresponding to 12371 and 12372 is good. Therefore, M-UE can select one from A-UE 3 and A-UE 4 for ProSe communication to provide ProSe service for M-UE. Further, the first neighboring service user list received by M-UE may include a whitelist list, and the whitelist list may include the neighboring service user identifier of A-UE 3. Therefore, M-UE can give priority to A-UE 3 and can perform ProSe communication with A-UE 3.

[0280] It should be noted that, although some embodiments of the present application are described with two sending modes, modelA and modelB, and two discovery types, restricted discovery and open discovery, the embodiments of the present application do not limit the discovery modes and discovery types. For example, for future networks, other discovery modes or discovery types may also be included, and the embodiments of the present application are also applicable. The concept of the embodiments of the present application is mainly to control / adjust the subsequent service discovery based on the historical service quality of the terminal device, such as generating a corresponding first neighboring service user list for selecting the terminal device based on the historical service quality, and allocating discovery parameters targeted at the historical service quality.

[0281] The following example uses the scenario of modelA+restricted discovery as an example. Figure 3 For details, see Figure 6 , Figure 6 for Figure 3 An example of the communication method shown. Figure 6 M-UE 1 and M-UE 2 can correspond Figure 3 The second terminal device in Figure 6 M-UEDDNMF can be Figure 3 The second network element in Figure 6 A-UE DDNMF can be Figure 3 The first network element in the Figure 6 As shown, the processing flow may include but is not limited to the following steps:

[0282] 601.M-UE DDNMF and A-UE DDNMF establish a consensus group to maintain the first ledger.

[0283] In the embodiments of the present application, data and information across various DDNMFs can be shared through technologies such as blockchain technology and distributed ledger technology to construct a trust chain across PLMNs.

[0284] It should be noted that the consensus group may include multiple members or nodes, not limited to M-UE DDNMF and A-UE DDNMF, and may also include DDNMFs in other PLMNs. It should be understood that M-UE DDNMF may be the DDNMF corresponding to M-UE 1, such as the DDNMF in the HPLMN of M-UE 1, and the HPLMNs of M-UE 1 and M-UE 2 are the same.

[0285] It can be understood that each DDNMF in the consensus group can reach / communicate through IP (Internet Protocol) routing, and the address information (such as IP address) of other DDNMFs in the consensus group can be stored in each DDNMF.

[0286] It should be noted that M-UE DDNMF and A-UE DDNMF can also achieve data sharing through a shared database or intelligent network elements such as NWDAF. For specific details, reference can be made to the relevant description in step 303 above.

[0287] 602. M-UE 1 sends a discovery request to M-UE DDNMF.

[0288] In order to discover terminal devices that can provide corresponding ProSe services, M-UE 1 can send a discovery request to M-UE DDNMF. Correspondingly, M-UE DDNMF can receive the discovery request from M-UE 1. Among them, the discovery request can be used to request a corresponding discovery filter, and the discovery filter can be used to match the restricted proximity service application code sent by terminal devices that can provide corresponding ProSe services at the PC5 interface. Exemplarily, the discovery request may include the RPAUID of M-UE 1, application identifier, discovery command = monitor, and the terminal device identifier of M-UE 1.

[0289] Step 602 is related to step 304 above, and reference can also be made to the relevant description in step 304 above.

[0290] It should be noted that there is no inevitable connection between step 602 and 601, that is, there is no restriction on the execution order between step 602 and 601. In one possible implementation, step 602 can be executed first, and then step 601. Or rather, as long as M-UE DDNMF joins the consensus group corresponding to A-UE DDNMF before M-UE DDNMF obtains service feedback information.

[0291] 603. The M-UE DDNMF sends a discovery response to M-UE 1.

[0292] After the M-UE DDNMF receives a discovery request from M-UE 1, it can perform corresponding processing based on the discovery request to obtain a discovery filter. Exemplarily, the M-UE DDNMF can authorize M-UE 1 and can send a monitor request to the corresponding A-UE DDNMF, requesting the corresponding restricted proximity service application code, etc.

[0293] After the M-UE DDNMF obtains the discovery filter corresponding to M-UE 1, it can send a discovery response to M-UE 1, and the discovery response includes the discovery filter. Correspondingly, M-UE 1 can receive the discovery response from the M-UE DDNMF.

[0294] It should be noted that the discovery response may also include the target RPAUID(s), or the discovery filter may also include the target RPAUID(s). The target RPAUID(s) is the RPAUID of one or more A-UEs corresponding to M-UE 1. The target RPAUID(s) is the application layer identifier of the corresponding A-UE and can be used to indicate the A-UEs that can be discovered by M-UE 1.

[0295] It should be noted that the target RPAUID(s) can be one or more RPAUID identifiers or an identifier prefix. For example, assume that the RPAUID(s) is 100001 abcde, then it means that all A-UEs with RPAUID starting with 100001 can be discovered. That is to say, if it is in hexadecimal, 100001 abcde can be equivalent to 10000100000 to 100001FFFFF. If the target RPAUID(s) parameter is not sent or the target RPAUID(s) parameter is empty, it can be considered unrestricted.

[0296] Step 603 is related to the above steps 307, 308, etc., and the relevant descriptions in the above steps 307, 308, etc. can also be referred to.

[0297] 604. The A-UE broadcasts the restricted proximity service application code.

[0298] Exemplarily, the A-UE can send a discovery request to the A-UE DDNMF, requesting the restricted proximity service application code, etc. After the A-UE obtains the restricted proximity service application code, it can broadcast the restricted proximity service application code.

[0299] 605. The M-UE 1 obtains the service of the A-UE and records the RPAUID of the A-UE.

[0300] Exemplarily, the M-UE 1 can match the restricted proximity service application code received on the PC5 interface through a discovery filter. If the M-UE 1 monitors a restricted proximity service application code that matches the discovery filter, it can discover the A-UE that broadcasts the restricted proximity service application code and can establish ProSe communication / service with the corresponding A-UE. When establishing ProSe communication / service, the A-UE can send its own RPAUID, and the M-UE 1 can record the RPAUID of the A-UE.

[0301] During the process of the M-UE 1 obtaining the service of the A-UE, the M-UE 1 can obtain data related to the quality of service of the A-UE (such as measuring the PC5 signal quality / average response time / throughput / retransmission time / types of supported security algorithms, etc.). For the content of obtaining data related to the quality of service, reference can also be made to the relevant description in step 301 above.

[0302] 606. The M-UE 1 sends a quality of service report to the M-UE DDNMF.

[0303] The M-UE 1 can generate a quality of service report for the A-UE and then send the quality of service report for the A-UE to the M-UE DDNMF. Correspondingly, the M-UE DDNMF can receive the quality of service report for the A-UE.

[0304] The quality of service report may include an application identifier, the RPAUID of the A-UE, a quality of service score, etc. For the content of the quality of service report, reference can also be made to the relevant description in step 301 above.

[0305] 607. The M-UE DDNMF obtains quality of service feedback information based on the quality of service report.

[0306] Step 607 is similar to step 302 above, and reference can be made to the relevant description in step 302 above.

[0307] 608. The M-UE DDNMF shares the quality of service feedback information of the terminal device with the A-UE DDNMF.

[0308] The M-UE DDNMF can submit the quality of service feedback information to the first ledger to save the quality of service feedback information in the first ledger after consensus. Exemplarily, for a blockchain, the quality of service feedback information can be synchronized to all nodes in the consensus group through a consensus algorithm.

[0309] Step 608 is similar to step 303 above, and the relevant description in step 303 can be referred to.

[0310] 609. M-UE 2 sends a discovery request to M-UE DDNMF.

[0311] Correspondingly, M-UE DDNMF can receive the discovery request from M-UE 2. Exemplarily, the discovery request may include the RPAUID of M-UE 1, the application identifier, the discovery command = monitor, and the terminal device identifier of M-UE 1.

[0312] It should be noted that M-UE 1 and M-UE 2 may be the same UE or different UEs, and the embodiments of the present application do not limit this.

[0313] Step 609 is similar to step 602, and the relevant description in step 602 can be referred to.

[0314] 610. M-UE DDNMF sends an authentication request to the UDM.

[0315] After receiving the discovery request from M-UE 2, M-UE DDNMF can send an authentication request to the UDM based on the discovery request. The authentication request can be used to check whether M-UE DDNMF has the permission to provide the monitoring service. Exemplarily, the authentication request may be a discovery authorization request, and the UDM may be the UDM associated with the HPLMN of M-UE 2.

[0316] 611. The UDM sends an authentication response to M-UE DDNMF.

[0317] After receiving the authentication request from M-UE DDNMF, the UDM can perform authentication based on the authentication request and return an authentication response to M-UE DDNMF.

[0318] It can be understood that steps 610 and 611 are optional.

[0319] 612. M-UE DDNMF sends an authorization request to the ProSe application server.

[0320] After receiving the discovery request from M-UE 2, M-UE DDNMF can send an authorization request to the ProSe application server based on the discovery request. The authorization request may include the RPAUID of M-UE 2. Exemplarily, M-UE DDNMF can determine the corresponding ProSe application server based on the application identifier in the discovery request.

[0321] Optionally, the authorization request may further include a request type (requesttype), which may be "restricted discovery / monitor".

[0322] 613. The ProSe application server sends an authorization response to the M-UE DDNMF.

[0323] After receiving the authorization request from the M-UE DDNMF, the ProSe application server may perform authorization based on the authorization request. Exemplarily, the ProSe application server may determine the corresponding target RPAUID(s) based on the RPAUID of M-UE2. In the case where the authorization request further includes a request type, the ProSe application server may check whether M-UE 2 can request the APP service corresponding to "restricted discovery / monitor".

[0324] The authorization response may include the target RPAUID(s). Optionally, the authorization response may further include a response type (responsetype), which may be "restricted discovery / monitorack".

[0325] 614. The M-UE DDNMF sends a monitoring request to the A-UE DDNMF.

[0326] Exemplarily, the monitoring request may include the RPAUID of M-UE2, the target RPAUID(s), and the application identifier.

[0327] It can be understood that different target RPAUIDs may be associated with different A-UE DDNMFs. That is to say, the M-UE DDNMF may send monitoring requests to different A-UE DDNMFs based on different RPAUIDs in the target RPAUID(s).

[0328] Step 614 is similar to the above step 305, and the relevant description in the above step 305 may also be referred to.

[0329] 615. The A-UE DDNMF obtains a first neighboring service user list based on the monitoring request.

[0330] After receiving the monitoring request from the M-UE DDNMF, the A-UE DDNMF may obtain a first neighboring service user list based on the monitoring request and the first ledger. The first neighboring service user list may include a whitelist and / or a blacklist.

[0331] Exemplarily, in the process of the A-UE DDNMF obtaining the first list of neighboring service users, service feedback information obtained based on the quality of service report of the A-UE uploaded by the M-UE 1 in step 605 above can be used. For example, assuming that the quality score in the quality of service report of the A-UE uploaded by the M-UE 1 in step 605 is 90, then the A-UE (such as the RPAUID of the A-UE) can be added to the whitelist.

[0332] Step 615 is related to step 306 above, and the relevant description in step 306 above can also be referred to.

[0333] 616. The A-UE DDNMF sends a monitoring response to the M-UE DDNMF.

[0334] Exemplarily, after the A-UE DDNMF obtains the first list of neighboring service users, it can send a monitoring response (monitorresponse) to the M-UE DDNMF. The monitoring response can include a ProSe code (such as a restricted neighboring service application code) and the first list of neighboring service users. This monitoring response is related to the first discovery response in step 307 above, and the relevant description in step 307 above can also be referred to.

[0335] 617. The M-UE DDNMF sends a discovery response to the M-UE 2.

[0336] Exemplarily, after the M-UE DDNMF receives the monitoring response from the A-UE DDNMF, it can send a discovery response (discoveryresponse) to the M-UE 2. The discovery response can include a discovery filter and the first list of neighboring service users. This discovery response is similar to the third discovery response in step 308 above, and the relevant description in step 308 above can also be referred to.

[0337] After the M-UE 2 receives the discovery response from the M-UE DDNMF, it can match the restricted neighboring service application codes sent by other A-UEs through the discovery filter in the discovery response to discover other A-UEs. In the case of discovering multiple other A-UEs, the M-UE 2 can select one based on the first list of neighboring service users, such as selecting the A-UE with the last historical quality of service, to ensure that a better quality of service can be obtained. It should be understood that after the M-UE 2 obtains the service of a certain A-UE, the M-UE 2 can also send the quality of service report of the A-UE to the M-UE DDNMF. For a more detailed description of the M-UE 2 selecting a terminal device based on the first list of neighboring service users, reference can be made to the relevant description in step 309 above.

[0338] It is understandable that the embodiments of the present application do not specifically limit the execution order of each step between steps 601-617. For example, the relevant steps 602-608 triggered by the M-UE1 initiating a discovery request and the relevant steps 609-617 triggered by the M-UE2 initiating a discovery request may be completely independent, and there are multiple situations for the execution order between the two. Among them, when step 615 is executed after step 608, the A-UE DDNMF can obtain the first neighboring service user list by using the quality of service report of the A-UE uploaded by the M-UE2. That is to say, the quality of service report of the A-UE fed back by one M-UE may affect the service discovery of other M-UEs.

[0339] It should be noted that although some embodiments of the present application are described in terms of two sending modes, namely modelA and modelB, and two discovery types, namely restricted discovery and open discovery, the embodiments of the present application do not limit the discovery mode and discovery type. For example, for future networks, there may also be other discovery modes or discovery types, and the embodiments of the present application are equally applicable. The main idea of the embodiments of the present application is to control / adjust subsequent service discovery based on the historical quality of service of the terminal device, such as generating a corresponding first neighboring service user list for selecting terminal devices according to the historical quality of service, and allocating discovery parameters specifically for the historical quality of service.

[0340] Next, take the scenario of modelA + restricted discovery as an example to Figure 5 illustrate the communication method shown in Figure 7 , Figure 7 For Figure 5 an example of the communication method shown in Figure 7 The A-UE in Figure 5 can correspond to Figure 7 the first terminal device in Figure 5 the second network element in Figure 7 The A-UE DDNMF in Figure 5 can be Figure 7 the first network element in

[0341] 701. The M-UE DDNMF and the A-UE DDNMF establish a consensus group and maintain the first ledger.

[0342] 702. The M-UE1 sends a discovery request to the M-UE DDNMF.

[0343] 703. The M-UE DDNMF sends a discovery response to the M-UE1.

[0344] 704.A - UE Broadcast - Restricted Proximity Service Application Code.

[0345] 705.M - UE 1 obtains the service of A - UE and records the RPAUID of A - UE.

[0346] 706.M - UE 1 sends a quality - of - service report to M - UE DDNMF.

[0347] 707.M - UE DDNMF obtains quality - of - service feedback information based on the quality - of - service report.

[0348] 708.M - UE DDNMF shares the quality - of - service feedback information of the terminal device with A - UE DDNMF.

[0349] Steps 701 - 708 are similar to the above - mentioned steps 601 - 608, and the relevant descriptions in the above - mentioned steps 601 - 608 can be referred to.

[0350] 709.A - UE sends a discovery request to A - UE DDNMF.

[0351] Correspondingly, A - UE DDNMF can receive the discovery request from A - UE. Exemplarily, the discovery request can include the RPAUID of A - UE, the application identifier, the discovery command = announce, and the terminal device identifier of A - UE.

[0352] Step 709 is similar to step 504, and the relevant description in step 504 can be referred to.

[0353] 710.A - UE DDNMF sends an authentication request to UDM.

[0354] After receiving the discovery request from A - UE, A - UE DDNMF can send an authentication request to UDM based on the discovery request. The authentication request can be used to check whether A - UE DDNMF has the permission to provide the announce service. Exemplarily, the authentication request can be a discovery authorization request, and the UDM can be the UDM associated with the HPLMN of A - UE.

[0355] 711.UDM sends an authentication response to A - UE DDNMF.

[0356] After receiving the authentication request from A - UE DDNMF, UDM can perform authentication based on the authentication request and return an authentication response to A - UE DDNMF.

[0357] It can be understood that steps 710 and 711 are optional.

[0358] 712. The A-UE DDNMF sends an authorization request to the ProSe application server.

[0359] After the A-UE DDNMF receives a discovery request from the A-UE, it may send an authorization request to the ProSe application server based on the discovery request. The authorization request may include the RPAUID of the A-UE. Exemplarily, the A-UE DDNMF may determine the corresponding ProSe application server based on the application identifier in the discovery request.

[0360] Optionally, the authorization request may further include a request type, and the request type may be "restricted discovery / announce".

[0361] 713. The ProSe application server sends an authorization response to the A-UE DDNMF.

[0362] After the ProSe application server receives the authorization request from the A-UE DDNMF, it may perform authorization based on the authorization request. When the authorization request further includes a request type, the ProSe application server may check whether the A-UE can request the APP service corresponding to "restricted discovery / announce".

[0363] The authorization response may include PDUID(s). Optionally, the authorization response may further include a response type, and the response type may be "restricted discovery / announce ack".

[0364] 714. The A-UE DDNMF obtains the historical quality of service of the A-UE from the first ledger.

[0365] The first ledger stores the quality of service feedback information corresponding to the A-UE. The A-UE DDNMF may obtain the quality of service feedback information of the A-UE from the first ledger based on the identifier corresponding to the A-UE (such as the RPAUID), which may include the quality data of the A-UE, and the quality data may be used to indicate the historical quality of service of the A-UE.

[0366] Step 714 is similar to the above step 505, and the relevant description in the above step 505 may also be referred to.

[0367] 715. In the case where the historical quality of service of the A-UE is poor, the A-UE DDNMF sends a failure response to the A-UE.

[0368] Exemplarily, when the A-UE DDNMF determines that the historical service quality of the A-UE is poor based on the quality data of the A-UE, or determines that the A-UE is a malicious terminal device, the A-UE DDNMF may send a failure response to the A-UE. Optionally, the failure response may include an application identifier, the RPAUID of the A-UE, and a failure reason indication. For a more detailed description of step 715, reference may be made to the relevant description in step 506 above, which will not be elaborated here.

[0369] It can be understood that step 715 is optional. In the case where the historical service quality of the A-UE is poor, the A-UE DDNMF may also not send a failure response to the A-UE, and may allocate a restricted proximity service application code for the A-UE specifically.

[0370] 716. The A-UE DDNMF allocates a ProSe code for the A-UE based on the historical service quality of the A-UE.

[0371] In the embodiments of the present application, different ProSe codes may be allocated for the A-UE according to different historical service qualities.

[0372] Specifically, in the embodiments of the present application, multiple service quality levels may be divided based on the quality data, and different service quality levels may correspond to different ProSe codes. For example, for the case where the quality data is a quality score, multiple service quality levels / hierarchies may be divided based on the quality score. For example, it may be divided into 4 service quality levels, namely level a to level d. Level a corresponds to (0, 60), level b corresponds to (60, 80), level c corresponds to (80, 90), and level d corresponds to (90, 100). These 4 different service quality levels may correspond to different ProSe codes. Exemplarily, level a may correspond to discovery parameters of type 1, level b may correspond to discovery parameters of type 2, level c may correspond to discovery parameters of type 3, and level d may correspond to discovery parameters of type 4. Another example is that for the case where the quality data is a quality level, multiple service quality levels / hierarchies may be divided based on the quality level. For example, each quality level corresponds to a service quality level, and different service quality levels may correspond to different ProSe codes.

[0373] It can be understood that in the embodiments of the present application, there is a corresponding relationship between the ProSe code and the historical service quality. That is to say, a ProSe code actually implicitly identifies the corresponding historical service quality. Therefore, if the historical service quality of A-UE is poor (such as the quality data corresponding to A-UE is of poor grade or is in the range of 0 to 60), then a ProSe code representing poor historical service quality can be assigned to A-UE. If the historical service quality of A-UE is good (such as the quality data corresponding to A-UE is of excellent grade or is in the range of 90 to 100), then a ProSe code representing good historical service quality can be assigned to A-UE. In this way, A-UEs with different service qualities can be distinguished by the ProSe code.

[0374] Step 716 is similar to the above-mentioned step 506, and the relevant description in the above-mentioned step 506 can also be referred to.

[0375] 717. The A-UE DDNMF sends a discovery response to the A-UE.

[0376] After the A-UE DDNMF assigns a ProSe code to the A-UE, it can send a discovery response to the A-UE. The discovery response may include the ProSe code (restricted proximity service application code) assigned to the A-UE. Correspondingly, the A-UE can receive the discovery response from the A-UE DDNMF, and the A-UE can broadcast the received restricted proximity service application code.

[0377] 718. When it is determined based on the first ledger that the service quality of the A-UE does not match the ProSe code currently used by the A-UE, the A-UE DDNMF sends a revocation control signaling to the A-UE.

[0378] It can be understood that the quality of service of the A-UE may not match the ProSe code currently used by the A-UE. For example, when the ProSe code is first allocated to the A-UE, there may be no quality of service feedback information corresponding to the A-UE in the first ledger. The A-UE DDNMF allocates the ProSe code corresponding to level 1 (such as the quality data corresponding to the A-UE is poor or in the range of 0-60) and the ProSe code corresponding to level 2 (such as the quality data corresponding to the A-UE is excellent or in the range of 90-100) for the A-UE. Subsequently, the M-UE served by the A-UE can upload the quality of service report of the A-UE, and the corresponding quality of service feedback information can be stored in the first ledger. Based on the quality data included in the quality of service feedback information, it can be determined that the quality of service of the A-UE is level 2. Therefore, the quality of service of the A-UE does not match the ProSe code corresponding to level 1 currently used by the A-UE. Another example is that when the ProSe code is previously allocated to the A-UE, based on the quality of service feedback information in the first ledger, it can be determined that the quality of service of the A-UE is level 2, so the ProSe code corresponding to level 2 is allocated to the A-UE. However, subsequently, new quality of service feedback information of the A-UE is added to the first ledger. Based on the newly added quality of service feedback information of the A-UE, it can be determined that the quality of service of the A-UE is level 1. Therefore, the quality of service of the A-UE does not match the ProSe code corresponding to level 2 currently used by the A-UE.

[0379] Exemplarily, the revocation control signaling may include the RPAUID of the A-UE, the terminal device identifier of the A-UE, and the ProSe code to be revoked, etc.

[0380] Step 718 is similar to the above step 509, and the relevant description in the above step 509 can also be referred to. Exemplarily, the revocation control signaling corresponds to the first control request.

[0381] 719. The A-UE stops broadcasting the restricted proximity service application code and adjusts the currently used restricted proximity service application code based on the revocation control signaling.

[0382] After the A-UE receives the revocation control signaling from the A-UE DDNMF, the A-UE can stop broadcasting the currently used restricted proximity service application code and can also adjust the currently used restricted proximity service application code based on the revocation control signaling.

[0383] Step 719 is related to the above step 510, and the relevant description in the above step 510 can also be referred to.

[0384] 720. The A-UE sends a revocation success response to the A-UE DDNMF.

[0385] Exemplarily, the revocation success response may include a ProSe code that was successfully revoked.

[0386] The revocation success response is similar to the first control response in the above step 509 , and reference may be made to the relevant description in the above step 509 .

[0387] 721. A-UE rebroadcasts the adjusted restricted proximity service application code.

[0388] After the A-UE adjusts the currently used restricted proximity service application code based on the cancellation control signaling, the adjusted restricted proximity service application code may be rebroadcasted.

[0389] Step 721 is related to step 510 , and reference may be made to the related description in the above step 510 .

[0390] It will be appreciated that steps 718-721 are optional.

[0391] In the above process, the ProSe code can be allocated specifically based on the historical service quality of the A-UE, so that the network side can accurately control the service discovery process of the A-UE based on the historical service quality of the A-UE.

[0392] It should be noted that the relevant information (ie, the same information or similar information) and the relevant descriptions in the above different embodiments may refer to each other.

[0393] The above mainly introduces the communication method provided by the embodiment of the present application. It can be understood that in order to realize the corresponding functions mentioned above, the first terminal device, the first network element and the second network element may include hardware structures and / or software modules corresponding to the execution of each function. In combination with the units and steps of each example described in the embodiments disclosed in this document, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. 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 embodiments of the present application.

[0394] The embodiment of the present application can divide the functional modules of the first terminal device, the first network element, the second network element, etc. according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one 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 functional division. There may be other division methods in actual implementation.

[0395] In the case where each functional module is divided according to each function, Figure 8 FIG. 800 shows a possible structural diagram of a communication device 800. The communication device 800 includes a receiving unit 801, a processing unit 802, and a transmitting unit 803.

[0396] In a possible design, the communication device 800 may be the above-mentioned first network element, or may be a chip in the first network element, or may be a processing system in the first network element, etc. Among them:

[0397] The receiving unit 801 is configured to receive a first discovery request from a second network element. The first discovery request includes a first application identifier, and the first discovery request is used to request discovery parameters corresponding to the first application identifier;

[0398] The processing unit 802 is configured to obtain the target neighboring service user identifier corresponding to the first application identifier and the first network element, and quality data corresponding to the target neighboring service user identifier. The quality data is used to indicate the historical service quality of the terminal;

[0399] The transmitting unit 803 is configured to send a first discovery response to the second network element. The first discovery response includes first discovery parameters. The first discovery parameters include a first neighboring service user list; wherein, the first neighboring service user list is obtained based on the target neighboring service user identifier and the quality data corresponding to the target neighboring service user identifier, and the first neighboring service user list is used to select a terminal device.

[0400] In a possible implementation, the processing unit 802 is specifically configured to: obtain the target neighboring service user identifier corresponding to the first application identifier and the first network element, and quality data corresponding to the target neighboring service user identifier from a first ledger. The first ledger is a shared ledger of a first consensus group, and the first consensus group includes the second network element and the first network element.

[0401] In a possible implementation, the first ledger is a distributed ledger or a blockchain.

[0402] In a possible implementation, the first neighboring service user list includes a whitelist and / or a blacklist. The whitelist is used to indicate terminal devices whose historical service quality meets a first condition, and the blacklist is used to indicate terminal devices whose historical service quality meets a second condition.

[0403] In a possible implementation, the first neighboring service user list includes a plurality of neighboring service user identifiers, and a quality indication corresponding to each neighboring service user identifier in the plurality of neighboring service user identifiers.

[0404] In a possible implementation, the receiving unit 801 is further configured to receive a second discovery request from a first terminal device, where the second discovery request includes a second application identifier, and the second discovery request is used to request discovery parameters corresponding to the second application identifier; the processing unit 802 is further configured to obtain first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device, where the first quality data is used to indicate the historical service quality of the first terminal device; the processing unit 802 is further configured to determine second discovery parameters based on the first quality data; and the sending unit 803 is further configured to send a second discovery response to the first terminal device, where the second discovery response includes the second discovery parameters.

[0405] In a possible implementation, the processing unit 802 obtaining the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device includes: obtaining the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device from a first ledger, where the first ledger is a shared ledger of a first consensus group, and the first consensus group includes the second network element and the first network element.

[0406] In a possible implementation, the processing unit 802 determining the second discovery parameters based on the first quality data includes: when the first quality data meets a third condition, determining the second discovery parameters based on the first quality data.

[0407] In a possible implementation, the processing unit 802 determining the second discovery parameters based on the first quality data includes: when the first quality data meets a fourth condition, determining first-type second discovery parameters; and when the first quality data meets a fifth condition, determining second-type second discovery parameters, where the terminal historical service qualities corresponding to the first-type and second-type discovery parameters are different.

[0408] In a possible implementation, the sending unit 803 is further configured to, when determining that the service quality of the first terminal device does not match the neighboring service application code currently used by the first terminal device, send a first control request to the first terminal device, where the first control request is used to adjust the discovery parameters of the first terminal device.

[0409] In a possible implementation, the first control request includes a neighboring service application code to be revoked and the neighboring service user identifier of the first terminal device.

[0410] In a possible implementation, the first control request further includes a neighboring service application code to be added.

[0411] In a possible implementation, the first control request further includes a corresponding application identifier.

[0412] In a possible implementation, the proximity service user identifier is an open proximity service application user identifier or a restricted proximity service application user identifier.

[0413] For the specific operations of each unit in the communication device 800 above, reference may be made to the description corresponding to the first network element in the foregoing method embodiments, which will not be elaborated here.

[0414] In another possible design, the communication device 800 may be the foregoing first network element, or may be a chip in the first network element, or may be a processing system in the first network element, etc. Among them:

[0415] A receiving unit 801, configured to receive a second discovery request from a first terminal device, where the second discovery request includes a second application identifier, and the second discovery request is used to request discovery parameters corresponding to the second application identifier;

[0416] A processing unit 802, configured to obtain first quality data corresponding to the second application identifier and the proximity service user identifier of the first terminal device, where the first quality data is used to indicate the historical service quality of the first terminal device;

[0417] The processing unit 802 is further configured to determine second discovery parameters based on the first quality data;

[0418] A sending unit 803, configured to send a second discovery response to the first terminal device, where the second discovery response includes the second discovery parameters.

[0419] In a possible implementation, the processing unit 802 is specifically configured to: obtain first quality data corresponding to the second application identifier and the proximity service user identifier of the first terminal device from a first ledger, where the first ledger is a shared ledger of a first consensus group, and the first consensus group includes a second network element and the first network element.

[0420] In a possible implementation, the first ledger is a distributed ledger or a blockchain.

[0421] In a possible implementation, the processing unit 802 determining second discovery parameters based on the first quality data includes: determining second discovery parameters based on the first quality data when the first quality data meets a third condition.

[0422] In a possible implementation, the processing unit 802 determining second discovery parameters based on the first quality data includes: determining second discovery parameters of a first type when the first quality data meets a fourth condition; and determining second discovery parameters of a second type when the first quality data meets a fifth condition, where the historical service qualities of the terminals corresponding to the first type and the second type are different.

[0423] In a possible implementation, the sending unit 803 is further configured to send a first control request to the first terminal device when it is determined that the quality of service of the first terminal device does not match the discovery parameters currently used by the first terminal device, where the first control request is used to adjust the discovery parameters of the first terminal device.

[0424] In a possible implementation, the first control request includes the proximity service application code to be revoked and the proximity service user identifier of the first terminal device.

[0425] In a possible implementation, the first control request further includes the proximity service application code to be added.

[0426] In a possible implementation, the first control request further includes the corresponding application identifier.

[0427] For the specific operations of each unit in the communication device 800 above, reference may be made to the description corresponding to the first network element in the foregoing method embodiments, which will not be elaborated herein.

[0428] Figure 9 FIG. shows a possible structural schematic diagram of a communication device 900. The communication device 900 includes a sending unit 901, a receiving unit 902, and a processing unit 903.

[0429] In a possible design, the communication device 900 may be the foregoing second terminal device, or may be a chip in the second terminal device, or may be a processing system in the second terminal device, etc. Among them:

[0430] The sending unit 901 is configured to send a third discovery request to a second network element, where the third discovery request includes the first application identifier, and the third discovery request is used to request the discovery parameters corresponding to the first application identifier;

[0431] The receiving unit 902 is configured to receive a third discovery response from the second network element, where the third discovery response includes third discovery parameters, the third discovery parameters include a first proximity service user list, the first proximity service user list is used to select a terminal device, and the first proximity service user list is obtained based on historical quality of service;

[0432] The processing unit 903 is configured to select a terminal device based on the first proximity service user list.

[0433] In a possible implementation, the first proximity service user list includes a whitelist and / or a blacklist. The whitelist is used to indicate terminal devices whose historical quality of service meets a first condition, and the blacklist is used to indicate terminal devices whose historical quality of service meets a second condition.

[0434] In a possible implementation, the first neighboring service user list includes multiple neighboring service user identifiers, and a quality indication corresponding to each neighboring service user identifier in the multiple neighboring service user identifiers.

[0435] In a possible implementation, the communication device performs neighboring service communication with a first terminal device through the sending unit 901 and the receiving unit 902. The communication device is a remote terminal device, and the first terminal device is a relay terminal device; the sending unit 901 is further configured to send a service quality report of the first terminal device to a second network element.

[0436] In a possible implementation, the service quality report includes a neighboring service user identifier of the first terminal device, a first application identifier, and second quality data, where the second quality data is used to indicate the historical service quality of the first terminal device.

[0437] In a possible implementation, the second quality data is a quality score, and the quality score is determined based on one or more of signal quality, response time, throughput, retransmission time, and the number of supported security algorithms.

[0438] In a possible implementation, the third discovery parameter further includes a discovery filter.

[0439] In a possible implementation, the neighboring service user identifier is an open neighboring service application user identifier or a restricted neighboring service application user identifier.

[0440] For the specific operations of each unit in the communication device 900 above, reference may be made to the description corresponding to the second terminal device in the foregoing method embodiments, which will not be elaborated here.

[0441] Figure 10 FIG. shows a possible structural schematic diagram of a communication device 1000. The communication device 1000 includes a receiving unit 1001, a processing unit 1002, and a sending unit 1003.

[0442] In a possible design, the communication device 1000 may be the above-mentioned second network element, or may be a chip in the second network element, or may be a processing system in the second network element, etc. Among them:

[0443] The receiving unit 1001 is configured to receive a service quality report of a first terminal device;

[0444] The processing unit 1002 is configured to obtain service quality feedback information of the first terminal device based on the service quality report of the first terminal device. The service quality feedback information includes a neighboring service user identifier of the first terminal device, a first application identifier, and third quality data, where the third quality data is used to indicate the historical service quality of the first terminal device;

[0445] A sending unit 1003, configured to upload the quality of service feedback information of the first terminal device to a first ledger, where the first ledger is a shared ledger of a first consensus group, and the first consensus group includes a first network element and the second network element.

[0446] In a possible implementation, the quality of service report includes a neighboring service user identifier of the first terminal device, the first application identifier, and second quality data, where the second quality data is used to indicate the historical quality of service of the first terminal device.

[0447] In a possible implementation, the receiving unit 1001 is further configured to receive a third discovery request from a second terminal device, where the third discovery request includes the first application identifier, and the third discovery request is used to request discovery parameters corresponding to the first application identifier; the sending unit 1003 is further configured to send a first discovery request to the first network element based on the third discovery request, where the first discovery request includes the first application identifier, and the first discovery request is used to request discovery parameters corresponding to the first application identifier; the receiving unit 1001 is further configured to receive a first discovery response from the first network element in response to the first discovery request, where the first discovery response includes first discovery parameters, and the first discovery parameters include a first neighboring service user list; the sending unit 1003 is further configured to send a third discovery response to the second terminal device based on the first discovery response, where the third discovery response includes third discovery parameters, and the third discovery parameters include the first neighboring service user list, and the first neighboring service user list is used to select a terminal device, and the first neighboring service user list is obtained based on the historical quality of service.

[0448] In a possible implementation, the third discovery parameters further include a discovery filter.

[0449] In a possible implementation, the neighboring service user identifier is an open neighboring service application user identifier or a restricted neighboring service application user identifier.

[0450] In a possible implementation, the first ledger is a distributed ledger or a blockchain.

[0451] For the specific operations of the various units in the foregoing communication device 1000, reference may be made to the description corresponding to the second network element in the foregoing method embodiment, which will not be elaborated herein.

[0452] Figure 11 The figure shows a possible schematic hardware structure diagram of a communication device 1100 provided in an embodiment of the present application. The communication device 1100 may include a communication interface 1104 and at least one processor 1102. Optionally, a bus 1103 may further be included. Further optionally, at least one memory 1101 may further be included, where the memory 1101, the processor 1102, and the communication interface 1104 may be connected through the bus 1103.

[0453] Among them, the memory 1101 is used to provide storage space, and data such as an operating system and computer programs can be stored in the storage space. The memory 1101 can be one or a combination of multiple types such as random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or compact disc read-only memory (CD-ROM), etc.

[0454] The processor 1102 is a module for performing arithmetic operations and / or logical operations. Specifically, it can be a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor unit (MPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a complex programmable logic device (CPLD), or a combination of one or more of such processing modules.

[0455] The communication interface 1104 is used to receive data sent from the outside and / or send data to the outside. It can be a wired link interface including, for example, an Ethernet cable, or a wireless link (Wi-Fi, Bluetooth, general wireless transmission, etc.) interface. Optionally, the communication interface 1104 can also include a transmitter (such as a radio frequency transmitter, antenna, etc.) coupled to the interface, or a receiver, etc.

[0456] In one design, the communication device 1100 can be used to perform the functions of the first network element in the foregoing embodiments. Specifically, reference can be made to the description corresponding to the first network element in the foregoing method embodiments, and details are not described herein again.

[0457] In another design, the communication device 1100 can be used to perform the functions of the second terminal device in the foregoing embodiments. Specifically, reference can be made to the description corresponding to the second terminal device in the foregoing method embodiments, and details are not described herein again.

[0458] In another design, the communication device 1100 can be used to perform the functions of the second network element in the foregoing embodiments. Specifically, reference can be made to the description corresponding to the second network element in the foregoing method embodiments, and details are not described herein again.

[0459] In another design, the communication device 1100 can be used to perform the functions of the first terminal device in the foregoing embodiments. Specifically, reference can be made to the description corresponding to the first terminal device in the foregoing method embodiments, and details are not described herein again.

[0460] In a possible design, the processor 1102 in the device 1100 is used to read the computer program stored in the memory 1101 and perform the operations performed by the first network element, the second network element, the second terminal device, or the first terminal device in the foregoing communication method. For example Figure 3 , Figure 5 , Figure 6 or Figure 7 the communication method described in any one of the embodiments.

[0461] It should be noted that Figure 11 the shown communication device 1100 is only one implementation manner of the embodiments of the present application. In actual applications, the communication device 1100 may further include more or fewer components, which are not limited herein.

[0462] The embodiments of the present application also disclose a communication system, which includes a first network element and a second network element. The first network element is used to perform the operations performed by the first network element in any one of the foregoing method embodiments, and the second network element is used to perform the operations performed by the second network element in any one of the foregoing method embodiments.

[0463] The embodiments of the present application also disclose a communication system, which includes a first network element, a second network element, and a second terminal device. The first network element is used to perform the operations performed by the first network element in any one of the foregoing method embodiments, the second network element is used to perform the operations performed by the second network element in any one of the foregoing method embodiments, and the second terminal device is used to perform the operations performed by the second terminal device in any one of the foregoing method embodiments.

[0464] The embodiments of the present application also disclose a communication system, which includes a first network element and a second terminal device. The first network element is used to perform the operations performed by the first network element in any one of the foregoing method embodiments, and the second terminal device is used to perform the operations performed by the second terminal device in any one of the foregoing method embodiments.

[0465] An embodiment of the present application also discloses a chip, which includes a processor. The processor is configured to execute a computer program or computer instructions stored in a memory, so that the chip performs the operations performed by the first network element in the above method embodiment, or the operations performed by the second network element in the above method embodiment, or the operations performed by the second terminal device in the above method embodiment.

[0466] As a possible implementation, the memory is located outside the chip.

[0467] An embodiment of the present application also discloses a computer-readable storage medium, on which instructions are stored. When the instructions are executed, the operations performed by the first network element in the above method embodiment, or the operations performed by the second network element in the above method embodiment, or the operations performed by the second terminal device in the above method embodiment are executed.

[0468] An embodiment of the present application also discloses a computer program product including instructions. When the instructions are executed, the operations performed by the first network element in the above method embodiment, or the operations performed by the second network element in the above method embodiment, or the operations performed by the second terminal device in the above method embodiment are executed.

[0469] It should be understood that the transmission in the embodiments of the present application can be direct transmission or indirect transmission. Direct transmission means that a device or module directly sends information / data to the corresponding device or module, and indirect transmission means that a device or module sends information / data to the corresponding device or module through other devices or modules.

[0470] Obviously, the embodiments described above are only a part of the embodiments of this application, rather than all embodiments. The mention of "embodiment" in this document means that the specific features, structures or characteristics described in connection with the embodiment can be included in at least one embodiment of this application. The appearance of this phrase in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. Those skilled in the art can explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope protected by this application. The terms "first", "second", "third", etc. in the specification and claims of this application and the accompanying drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a series of steps or units are included, or optionally, steps or units not listed are also included, or optionally, other steps or units inherent in these processes, methods, products or devices are also included. It can be understood that in some embodiments, the equal sign in the above conditional judgment can take a value greater than or less than one end. For example, the above conditional judgment on a threshold greater than, less than or equal to can also be changed to a conditional judgment on the threshold greater than or equal to, less than. This is not limited here. It can also be understood that for an architecture with multiple devices or modules, if one device or module generates an information and another device or module utilizes this information, then there can be multiple ways for the other device to obtain this information. For example, the device or module that generates the information can directly send the information to the device or module that utilizes the information (equivalent to direct sending), or the device or module that generates the information can send the information to the device or module that utilizes the information through other devices or modules (equivalent to indirect sending).

[0471] It can be understood that only parts related to this application rather than all content are shown in the drawings. It should be understood that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged as long as it is logical. When its operations are completed, the process can be terminated, but there can also be additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0472] As used in this specification, the terms "component", "module", "system", "unit", etc. are used to denote computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable, an execution thread, a program, and / or one distributed between two or more computers. In addition, these units can execute from various computer-readable media storing various data structures. For example, a unit can communicate through local and / or remote processes according to a signal having one or more data packets (e.g., data from a second unit interacting with another unit among a local system, a distributed system, and / or a network. For example, the Internet interacting with other systems through a signal).

[0473] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present application. It should be understood that the above description is only the specific embodiments of the present application and is not used to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the present application shall be included in the protection scope of the present application.

Claims

1. A communication method, characterized in that, Including: A first network element receives a first discovery request from a second network element. The first discovery request includes a first application identifier and is used to request discovery parameters corresponding to the first application identifier. Obtain the first application identifier, a target neighboring service user identifier corresponding to the first network element, and quality data corresponding to the target neighboring service user identifier. The quality data is used to indicate the historical service quality of the terminal. Send a first discovery response to the second network element. The first discovery response includes first discovery parameters, and the first discovery parameters include a first neighboring service user list. Among them, the first neighboring service user list is obtained based on the target neighboring service user identifier and the quality data corresponding to the target neighboring service user identifier, and the first neighboring service user list is used to select terminal devices.

2. The method according to claim 1, characterized in that, The obtaining the first application identifier, the target neighboring service user identifier corresponding to the first network element, and the quality data corresponding to the target neighboring service user identifier includes: Obtain the first application identifier, the target neighboring service user identifier corresponding to the first network element, and the quality data corresponding to the target neighboring service user identifier from a first ledger. The first ledger is a shared ledger of a first consensus group, and the first consensus group includes the second network element and the first network element.

3. The method according to claim 2, characterized in that, The first ledger is a distributed ledger or a blockchain.

4. The method according to any one of claims 1-3, characterized in that, The first neighboring service user list includes a whitelist and / or a blacklist. The whitelist is used to indicate terminal devices whose historical service quality meets a first condition, and the blacklist is used to indicate terminal devices whose historical service quality meets a second condition.

5. The method according to any one of claims 1-3, characterized in that, The first neighboring service user list includes multiple neighboring service user identifiers and a quality indication corresponding to each neighboring service user identifier among the multiple neighboring service user identifiers.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: Receive a second discovery request from a first terminal device. The second discovery request includes a second application identifier and is used to request discovery parameters corresponding to the second application identifier. Obtain the second application identifier and first quality data corresponding to the neighboring service user identifier of the first terminal device. The first quality data is used to indicate the historical service quality of the first terminal device. Determine second discovery parameters based on the first quality data. Send a second discovery response to the first terminal device. The second discovery response includes the second discovery parameters.

7. The method according to claim 6, characterized in that, The obtaining the second application identifier and the first quality data corresponding to the neighboring service user identifier of the first terminal device includes: Obtain the second application identifier and the first quality data corresponding to the neighboring service user identifier of the first terminal device from a first ledger. The first ledger is a shared ledger of a first consensus group, and the first consensus group includes the second network element and the first network element.

8. The method according to claim 6 or 7, characterized in that, The determining the second discovery parameters based on the first quality data includes: When the first quality data meets a third condition, determine the second discovery parameters based on the first quality data.

9. The method according to any one of claims 6-8, characterized in that, The determining the second discovery parameters based on the first quality data includes: When the first quality data meets the fourth condition, determine a second discovery parameter of the first type; When the first quality data meets the fifth condition, determine a second discovery parameter of the second type, where the discovery parameters of the first type and the second type correspond to different historical service qualities of the terminal.

10. The method according to any one of claims 6-9, characterized in that, The method further includes: When it is determined that the service quality of the first terminal device does not match the neighboring service application code currently used by the first terminal device, send a first control request to the first terminal device, where the first control request is used to adjust the discovery parameter of the first terminal device.

11. The method according to claim 10, characterized in that, The first control request includes the neighboring service application code to be revoked and the neighboring service user identifier of the first terminal device.

12. The method according to any one of claims 1-11, characterized in that, The neighboring service user identifier is an open neighboring service application user identifier or a restricted neighboring service application user identifier.

13. A communication method, characterized in that, It includes: A first network element receives a second discovery request from a first terminal device, where the second discovery request includes a second application identifier, and the second discovery request is used to request the discovery parameter corresponding to the second application identifier; Obtain first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device, where the first quality data is used to indicate the historical service quality of the first terminal device; Determine a second discovery parameter based on the first quality data; Send a second discovery response to the first terminal device, where the second discovery response includes the second discovery parameter.

14. The method according to claim 13, wherein, The obtaining of the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device includes: Obtain the first quality data corresponding to the second application identifier and the neighboring service user identifier of the first terminal device from a first ledger, where the first ledger is a shared ledger of a first consensus group, and the first consensus group includes a second network element and the first network element.

15. The method according to claim 14, wherein, The first ledger is a distributed ledger or a blockchain.

16. The method according to any one of claims 1-3, wherein, The determining of the second discovery parameter based on the first quality data includes: When the first quality data meets the third condition, determine a second discovery parameter based on the first quality data.

17. The method according to any one of claims 13-16, wherein, The determining of the second discovery parameter based on the first quality data includes: When the first quality data meets the fourth condition, determine a second discovery parameter of the first type; When the first quality data meets the fifth condition, determine a second discovery parameter of the second type, where the first type and the second type correspond to different terminal historical service qualities.

18. The method according to any one of claims 13-17, wherein, The method further includes: When it is determined that the service quality of the first terminal device does not match the discovery parameter currently used by the first terminal device, send a first control request to the first terminal device, where the first control request is used to adjust the discovery parameter of the first terminal device.

19. The method according to claim 18, wherein, The first control request includes the neighboring service application code to be revoked and the neighboring service user identifier of the first terminal device.

20. A communication method, wherein, It includes: A second terminal device sends a third discovery request to a second network element, where the third discovery request includes the first application identifier, and the third discovery request is used to request the discovery parameter corresponding to the first application identifier; Receive a third discovery response from the second network element, where the third discovery response includes third discovery parameters, and the third discovery parameters include a first list of neighboring service users, and the first list of neighboring service users is used to select a terminal device and is obtained based on historical quality of service; Select a terminal device based on the first list of neighboring service users.

21. The method according to claim 20, wherein, The first list of neighboring service users includes a whitelist and / or a blacklist. The whitelist is used to indicate terminal devices whose historical quality of service meets a first condition, and the blacklist is used to indicate terminal devices whose historical quality of service meets a second condition.

22. The method according to claim 20, wherein, The first list of neighboring service users includes a plurality of neighboring service user identifiers, and a quality indication corresponding to each neighboring service user identifier in the plurality of neighboring service user identifiers.

23. The method according to any one of claims 20-22, wherein, The method further includes: the second terminal device performs neighboring service communication with the first terminal device, where the second terminal device is a remote terminal device and the first terminal device is a relay terminal device; The second terminal device sends a quality of service report of the first terminal device to the second network element.

24. The method according to claim 23, wherein, The quality of service report includes a neighboring service user identifier, a first application identifier, and second quality data of the first terminal device, and the second quality data is used to indicate the historical quality of service of the first terminal device.

25. The method according to claim 24, wherein, The second quality data is a quality score, and the quality score is determined based on one or more of signal quality, response time, throughput, retransmission time, and the number of supported security algorithms.

26. The method according to any one of claims 20-25, wherein, The neighboring service user identifier is an open neighboring service application user identifier or a restricted neighboring service application user identifier.

27. A communication device, characterized in that, It includes a processor and a communication interface; the communication interface is used to receive and / or send data; the processor invokes a computer program or computer instructions stored in a memory to implement the method according to any one of claims 1-12, or implement the method according to any one of claims 13-19, or implement the method according to any one of claims 20-26.

28. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or computer instructions, and the computer program or computer instructions are executed by a processor to implement the method according to any one of claims 1-12, or implement the method according to any one of claims 13-19, or implement the method according to any one of claims 20-26.