A network slice selection method, performed by a network slice selection function network element, wherein the method comprises: receiving, by the network slice selection function network element, a first message from a mobility management network element, wherein the first message comprises network slice selection assistance information NSSAI subscribed to by a terminal and slice subscription information of n third-party service providers SPs corresponding to the NSSAI subscribed to by the terminal, slice subscription information of each third-party SP in the slice subscription information of the n third-party SPs comprises a first identifier, the first identifier is set up to be used to search for mapping information that is managed by each third-party SP and that is of NSSAI allocated by different operators to the third-party SP, and n is a positive integer; obtaining, by the network slice selection function network element based on the first identifier, first mapping information corresponding to each third-party SP, wherein the first mapping information comprises mapping information between NSSAI of a home network of the terminal and NSSAI of a visited network of the terminal, wherein the obtaining, by the network slice selection function network element based on the first identifier, first mapping information corresponding to each third-party SP comprises: sending, by the network slice selection function network element, a second message to a unified data repository network element of the visited network of the terminal, wherein the second message comprises the first identifier and the network identifier of the home network of the terminal; receiving, by the network slice selection function network element, the first mapping information from the unified data repository network element of the visited network of the terminal; and determining, by the network slice selection function network element, allowed NSSAI for the terminal based on the NSSAI subscribed to by the terminal and the first mapping information, wherein the allowed NSSAI is used to indicate one or more network slices that the terminal is allowed to access in the visited network of the terminal. receiving, by the network slice selection function network element, a first message from a mobility management network element, wherein the first message comprises network slice selection assistance information NSSAI subscribed to by a terminal and slice subscription information of n third-party service providers SPs corresponding to the NSSAI subscribed to by the terminal, slice subscription information of each third-party SP in the slice subscription information of the n third-party SPs comprises a first identifier, the first identifier is set up to be used to search for mapping information that is managed by each third-party SP and that is of NSSAI allocated by different operators to the third-party SP, and n is a positive integer; obtaining, by the network slice selection function network element based on the first identifier, first mapping information corresponding to each third-party SP, wherein the first mapping information comprises mapping information between NSSAI of a home network of the terminal and NSSAI of a visited network of the terminal, wherein the obtaining, by the network slice selection function network element based on the first identifier, first mapping information corresponding to each third-party SP comprises: sending, by the network slice selection function network element, a second message to a unified data repository network element of the visited network of the terminal, wherein the second message comprises the first identifier and the network identifier of the home network of the terminal; receiving, by the network slice selection function network element, the first mapping information from the unified data repository network element of the visited network of the terminal; and sending, by the network slice selection function network element, a second message to a unified data repository network element of the visited network of the terminal, wherein the second message comprises the first identifier and the network identifier of the home network of the terminal; receiving, by the network slice selection function network element, the first mapping information from the unified data repository network element of the visited network of the terminal; and determining, by the network slice selection function network element, allowed NSSAI for the terminal based on the NSSAI subscribed to by the terminal and the first mapping information, wherein the allowed NSSAI is used to indicate one or more network slices that the terminal is allowed to access in the visited network of the terminal.