WO2023016255A1 - Network function service authorization method and apparatus - Google Patents

Network function service authorization method and apparatus Download PDF

Info

Publication number
WO2023016255A1
WO2023016255A1 PCT/CN2022/108155 CN2022108155W WO2023016255A1 WO 2023016255 A1 WO2023016255 A1 WO 2023016255A1 CN 2022108155 W CN2022108155 W CN 2022108155W WO 2023016255 A1 WO2023016255 A1 WO 2023016255A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
network function
service provider
provider network
function
Prior art date
Application number
PCT/CN2022/108155
Other languages
French (fr)
Chinese (zh)
Inventor
邓娟
张博
宗在峰
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023016255A1 publication Critical patent/WO2023016255A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • H04W12/084Access security using delegated authorisation, e.g. open authorisation [OAuth] protocol

Definitions

  • the present application relates to the field of communication technologies, and in particular to a method and device for network function service authorization.
  • the fifth generation communication system provides a service architecture.
  • the service provider network function provides services, and the service consumer network function accesses the services provided by the service provider network function.
  • the standard protocol defines the authorization mechanism when the service consumer network function accesses the service provided by the service provider network function, so as to ensure that only the authorized service consumer network function can access the service provided by the service provider network function.
  • the service provider network function can perform Hypertext Transfer Protocol (Hypertext Transfer Protocol, HTTP) redirection, that is, other available service provider network functions or other available service provider network function instances (that is, target service provider network function or target service provider network function instance) to notify the service consumer network function, so that the service consumer network function can access the target service provider The network function or service of this target service provider network function instance.
  • HTTP Hypertext Transfer Protocol
  • the service consumer web function may not have been authorized to access the services of the target service provider web function or the services of the target service provider web function instance, the service consumer web function cannot be provided from the target service The provider web function or the target service provider web function instance obtains the service.
  • Embodiments of the present application provide a network function service authorization method and device for authorizing a service consumer's network function to access a first service (that is, a service requested by the consumer's network function).
  • a network function service authorization method including: the service consumer network function sends a first request message to the network warehouse function according to the first information, and the first request message includes the second information and the first service The service name of the service, the first request message is used to request to obtain an access token, and the access token is used for the authorization check when the service consumer network function accesses the first service; the service consumer network function A first response message is received from the web repository function.
  • the first information may be used to indicate that the service consumer network function satisfies the condition of sending the first request message including the second information to request to acquire the access token.
  • the second information may include service provider network function information, for example, the second information is the network function type or network function set identifier of the service provider network function that provides the first service, or the second service provider network function (i.e. Instance ID of the second service provider network function).
  • the first service is the service requested by the service consumer network function.
  • the service consumer network function can obtain an access token,
  • the access token includes second information for an authorization check when the service consumer web function accesses the first service (i.e. the requested service) provided by the service provider web function of the web function type , or provided by the service provider network function of the network function set, or provided by the target service provider network function.
  • the target service provider network function is also referred to as the second service provider network function
  • the target service provider web function can check the The first access command is successful, and then services are provided for the service consumer network function, so that when redirection occurs, it can be ensured that the service consumer network function can obtain the service provided by the target service provider network function.
  • the first information is used to indicate that the service consumer network function supports the Hypertext Transfer Protocol HTTP redirection feature, and/or the first service supports the HTTP redirection feature, and/or Or the service provider network function that provides the first service supports the HTTP redirection feature; or, the first information includes the first indication and/or the instance identifier of the second service provider network function, and the first indication uses Indicates service access authorization failure or HTTP redirection or obtaining an access token or other service provider network functions available; or, the first information includes instance identifiers of multiple service provider network functions; the service provider The network function may provide the first service; or, the first information is used to instruct the service consumer network function to use a service communication agent to communicate with the service provider network function.
  • the method further includes: the service consumer network function receives the first information.
  • the service consumer network function receiving the first information includes: the service consumer network function receiving the first message sent by the network warehouse function or the service communication agent or the first service provider network function. information.
  • the first information from the first service provider network function may include the first indication (for indicating HTTP redirection, or there are other available service provider network functions, such as HTTP redirection status code) and the second service provider Information about the provider network function (i.e. the target service provider function).
  • the first information from the service communication agent may include: the first indication, and may further include information of the second service provider network function (that is, the target service provider network function).
  • the first indication may include: information used to indicate HTTP redirection or other available service provider network functions, such as HTTP redirection status code; or, used to indicate service access authorization failure or HTTP redirection or acquisition An access token or other information about the available service provider network function (ie, the indication generated by the service communication agent based on the HTTP redirection indication from the first service provider network function).
  • the second information includes: the network function type of the service provider network function requested by the service consumer network function; or, the service provider network requested by the service consumer network function
  • the network function set identifier of the function; or, the instance identifier of the second service provider network function; or, the instance identifiers of multiple service provider network functions, and the service provider network function can provide the first service.
  • the response message includes any of the following: a first access token, where the first access token includes the network function type of the service provider network function, and/or the service provider A network function set identifier of a network function; or a second access token, the second access token including instance identifiers of a plurality of service provider network functions; or a plurality of third access tokens, each of the first The three access tokens respectively include an instance identifier of a service provider network function; or, the fourth access token includes the instance identifier of the second service provider network function.
  • the service consumer network function further includes: the service consumer network function sending the first service provider network function or the second service provider network
  • the function or service communication agent sends a second request message, the second request message is used to request a service, and the second request message includes the first access token or the second access token or the third access token or the fourth access token.
  • the service consumer network function before the service consumer network function sends the first request message to the network warehouse function according to the first information, the service consumer network function further includes: the service consumer network function sending the first service provider network function Or the service communication agent sends a third request message, where the third service request message is used to request the first service.
  • the service consumer network function before the service consumer network function sends the first request message to the network warehouse function according to the first information, the service consumer network function further includes: the service consumer network function sends the first request message to the network warehouse function Four request messages, the fourth request message includes the service name of the first service, and the fourth request message is used to request to discover the first service or to discover an instance of a network function that can provide the first service .
  • a network function service authorization method including: a service communication agent receives a first request message of a network function of a service consumer, and the first request message includes a first access token; the service communication agent sends a request to the second a service provider network function sending a second request message, the second request message including the first access token; the service communication agent receiving a second response message from the first service provider network function, The second response message includes information on the network function of the second service provider and a redirection status code, and the redirection status code is used to indicate that the service access authorization fails or the hypertext transfer protocol HTTP redirects or acquires an access token or has Other available service provider network functions; the service communication agent sends a first response message to the service consumer network function, and the first response message is used for the consumer network function to request to obtain a second access token.
  • the service communication agent can receive the request from After the second response message of the first service provider network function (which includes the information of the second service provider network function and the redirection status code), send the first response message to the service consumer network function, so that the service consumer
  • the consumer web function requests a second access token, which can be used for authorization checks when the service consumer web function accesses the requested service, so that the service consumer web function can use the second access token
  • the token requests services from the second service provider network function (ie, the target service provider network function to which it is redirected).
  • the first response message includes first information, and the first information includes a first indication and/or an instance identifier of a network function of the second service provider; wherein the first indication is used to indicate the occurrence of An HTTP redirection, or used to instruct the access consumer web function to obtain an access token, or the service access authorization failed, or there are other service provider web functions available.
  • the service communication agent before the service communication agent sends the first response message to the service consumer network function, it further includes:
  • the service communication agent determines that a first condition is satisfied; wherein the first condition includes at least one of the following conditions:
  • the first access token does not include the instance identifier of the second service provider network function
  • said first access token cannot be used to authorize services accessing said second service provider network functionality
  • the first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, and the specific service provider network function includes the first Service Provider Network Functions;
  • the first access token does not include the network function type or network function set identifier of the service provider network function
  • the first access token includes the instance identifier of the first service provider network function.
  • the service communication agent sends a third request message to the second service provider network function, and the third request message includes the first access token.
  • the service communication agent after the service communication agent sends the first response message to the service consumer network function, it further includes: the service communication agent receives a fourth request sent by the service consumer network function message, the fourth request message includes the second access token; the service communication agent sends a fifth request message to the second service provider network function, and the fifth request message includes the second access token.
  • the second access token includes the instance identifier of the second service provider network function, or the network function type of the service provider network function, or the network Feature set ID.
  • a network function service authorization method including: a network warehouse function receives a first request message from a service consumer network function, and the first request message is used to request an access token; the first request The message includes the service name of the first service requested by the service consumer network function, and the network function type or instance identifier of the requested service provider network function; the network warehouse function determines that the first condition is satisfied, and then generates the first an access token, or a second access token, or a plurality of third access tokens; the web repository function sends a first response message to the service consumer web function, the first response message including the first an access token, or the second access token, or the plurality of third access tokens.
  • the determining that the first condition is satisfied by the network warehouse function includes: the network warehouse function receives the first information from the service consumer network function, and then determines that the first condition is satisfied; or, The local configuration of the network warehouse function indicates that the first service or the requested service provider network function supports hypertext transfer protocol HTTP redirection, then it is determined that the first condition is satisfied; or, the first service or the If the network function file of the requested service provider network function indicates that the first service or the feature supported by the requested service provider network function includes HTTP redirection, then it is determined that the first condition is satisfied.
  • the first access token includes a network function type of the requested service provider network function, and/or a network function set identifier of the requested service provider network function;
  • the second access token includes instance identifiers of a plurality of service provider network functions; wherein the service provider network function can provide the first service;
  • the third access token includes an instance identifier of a service provider network function that can provide the first service.
  • the first request message includes first information, and the first information is used to indicate that the service consumer network function supports HTTP redirection, or to indicate that the service consumer network function
  • the function requests that the first service supports HTTP redirection, or is used to indicate that the service consumer network function requests the service provider network function to support HTTP redirection, or is used to indicate that the first service supports HTTP redirection, or is used to indicate The requested service provider web function supports HTTP redirection.
  • the network warehouse function before the network warehouse function generates the first access token, the second access token, or multiple third access tokens, it further includes: the network warehouse function checks the service consumption or the service access authorization of the network function is successful.
  • a communication device including: one or more processors; one or more memories; wherein, the one or more memories store one or more computer programs, and the one or more computers
  • the program includes instructions, and when the instructions are executed by the one or more processors, the communication device is made to execute the method described in any one of the first aspect, the second aspect, and the third aspect.
  • a computer-readable storage medium includes a computer program, and when the computer program is run on a computing device, the computing device is made to perform the above-mentioned first aspect, second aspect and The method of any one of the third aspects.
  • a chip is coupled with a memory, and is used to read and execute program instructions stored in the memory, so as to realize any one of the above-mentioned first aspect, second aspect and third aspect the method described.
  • a computer program product is provided.
  • the computer program product When the computer program product is invoked by a computer, the computer executes the method described in any one of the first aspect, the second aspect, and the third aspect.
  • FIG. 1 is a system architecture applicable to the embodiment of the present application
  • FIG. 2 is a schematic diagram of the registration process of the service provider network function in the embodiment of the present application.
  • FIG. 3 is a schematic diagram of a service discovery process in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a service authorization flow in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a network function service authorization flow provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of signaling interaction in a direct communication scenario based on the flow shown in FIG. 5;
  • FIG. 7 is a schematic diagram of signaling interaction in an indirect communication scenario based on the flow shown in FIG. 5;
  • FIG. 8 is a schematic diagram of another signaling interaction in a direct communication scenario based on the flow shown in FIG. 5;
  • FIG. 9 is a schematic diagram of another signaling interaction in an indirect communication scenario based on the flow shown in FIG. 5;
  • FIG. 10 is a schematic diagram of another network function service authorization flow provided by the embodiment of the present application.
  • FIG. 11 is a schematic diagram of a signaling interaction process in an indirect communication scenario based on the process shown in FIG. 10;
  • FIG. 12 is a schematic diagram of another network function authorization process provided by the embodiment of the present application.
  • FIG. 13 is a schematic diagram of a signaling interaction process in a direct communication scenario based on the process shown in FIG. 12;
  • FIG. 14 is a schematic diagram of a signaling interaction process in an indirect communication scenario based on the process shown in FIG. 12;
  • FIG. 15 is a schematic structural diagram of a service consumer network function provided by an embodiment of the present application.
  • FIG. 16 is a schematic structural diagram of a service communication agent provided by an embodiment of the present application.
  • FIG. 17 is a schematic structural diagram of a network warehouse function provided by an embodiment of the present application.
  • FIG. 18 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the embodiment of the present application provides a service authorization method and device, which are used to authorize the service consumer's network function to access the first service (that is, the service requested by the consumer's network function).
  • the method and the device described in this application are based on the same technical concept. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition will not be repeated.
  • first and second are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order. It should be noted that the order of appearance of the first, second, etc. is not limited in the present application, for example, the fifth may appear first, and then the third, which is not limited in the present application.
  • At least one (item) refers to one (item) or multiple (items), and multiple (items) refers to two (items) or more than two (items).
  • a possible communication system architecture to which the service authorization method provided in the embodiment of the present application is applicable may include: a radio access network, a terminal device, and a core network.
  • FIG. 1 shows a possible example of a communication system architecture.
  • a radio access network may include an access network device.
  • the core network may include: network exposure function (network exposure function, NEF) network element, policy control function (policy control function, PCF) network element, unified data management function (unified data management, UDM) network element, application function (application function, AF) network element, authentication server function (authentication server function, AUSF) network element, access and mobility management function (access and mobility management function, AMF) network element, session management function network element (session management function, SMF) network elements, network data analysis function (network data analytic function, NWDAF) network elements, network storage function (network repository function, NRF) network elements, user plane function (user plane function, UPF) network elements, may also include network Slice selection function (network slice selection function, NSSF) network element.
  • the AMF network element and the access network device can be connected through the N2 interface
  • the access network device and the UPF can be connected through the N3 interface
  • the SMF and the UPF can be connected through the N4 interface
  • the AMF network element and the UE can be connected through the N3 interface. It can be connected through the N1 interface.
  • the name of the interface is just an example, which is not specifically limited in this embodiment of the present application. It should be understood that the embodiment of the present application is not limited to the communication system shown in FIG. 1, and the names of the network elements shown in FIG. The limit of network elements. The functions of each network element or device in the communication system are described in detail below:
  • Terminal equipment also called user equipment (UE), mobile station (MS), mobile terminal (MT), etc.
  • UE user equipment
  • MS mobile station
  • MT mobile terminal
  • the terminal device may include a handheld device with a wireless connection function, a vehicle-mounted device, and the like.
  • the terminal equipment can be: mobile phone (mobile phone), tablet computer, notebook computer, palmtop computer, mobile Internet device (mobile internet device, MID), wearable device, virtual reality (virtual reality, VR) equipment, augmented reality (augmented reality (AR) equipment, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, and smart grids wireless terminals in transportation safety (transportation safety), wireless terminals in smart city (smart city), or wireless terminals in smart home (smart home), etc.
  • the terminal device in FIG. 1 is shown as a UE, which is only used as an example, and does not limit the terminal device.
  • R radio access network
  • AN radio access network
  • AN access network
  • the RAN device is mainly a 3GPP network wireless network device
  • the AN may be an access network device defined by non-3GPP.
  • RAN equipment mainly responsible for radio resource management, quality of service (QoS) management, data compression and encryption on the air interface side.
  • the access network equipment may include base stations in various forms, for example: macro base stations, micro base stations (also called small stations), relay stations, access points, and the like.
  • the names of devices with base station functions may be different, for example, in a 5G system, it is called RAN or gNB (5G NodeB), etc.
  • Access and mobility management function element It can be used to manage the access control and mobility of terminal equipment. In practical applications, it includes mobility management in the network framework of long term evolution (LTE)
  • the mobility management function in the entity (mobility management entity, MME) has added the access management function, which can be responsible for the registration of terminal equipment, mobility management, tracking area update process, reachability detection, and session management function network elements selection, mobile state transition management, etc.
  • the access and mobility management function network element can be an AMF network element, as shown in Figure 1; in future communications, such as 6G, the access and mobility management function network element can still be an AMF network element , or have other names, which are not limited in this application.
  • the access and mobility management functional network element is an AMF network element, the AMF can provide the Namf service.
  • Session management function network element It can be used for session management of terminal equipment (including session establishment, modification and release), selection and reselection of user plane function network elements, and Internet protocol (internet protocol, IP) of terminal equipment Address allocation, quality of service (QoS) control, etc.
  • the network element with the session management function can be an SMF network element, as shown in Figure 1; in future communication, such as in 6G, the network element with the session management function can still be an SMF network element, or have other names. Applications are not limited.
  • the SMF can provide the Nsmf service.
  • NWDAF Network Data Analysis Element
  • NWDAF can be used for big data analysis. For example, acquire data, analyze the data, and provide the analysis results to other network elements or application functions.
  • the functions of NWDAF may also include: training models, and performing inferences based on the trained models.
  • the functions of the NWDAF can be decomposed into multiple independent instances, and these instances exist independently; or, one NWDAF instance provides certain functions.
  • the functions provided by an NWDAF instance are: model training and providing models to other NWAF embodiments; for another example, an NWDAF embodiment may not provide model training functions, but obtain models from other NWDAF instances, and then perform data processing based on the obtained models. analyze.
  • the network data analysis network element can be a NWDAF network element, such as shown in Figure 1; in future communications, such as 6G, the data analysis network element can still be a NWDAF network element, or have other names, this application No limit.
  • the NWDAF network element can provide the Nnwdaf service.
  • User plane function network element responsible for forwarding and receiving user data in terminal equipment. It can receive user data from the data network and transmit it to the terminal device through the access network device; the UPF network element can also receive user data from the terminal device through the access network device and forward it to the data network.
  • the transmission resources and scheduling functions that provide services for terminal equipment in the UPF network element are managed and controlled by the SMF network element.
  • the user plane functional network element can be a UPF network element, such as shown in Figure 1; in future communications, such as 6G, the user plane functional network element can still be a UPF network element, or have other names, This application is not limited.
  • Policy control function network element mainly supports the provision of a unified policy framework to control network behavior, provides policy rules to the control layer network functions, and is responsible for obtaining user subscription information related to policy decisions.
  • the network element with the policy control function can be a PCF network element, as shown in Figure 1; in future communication, such as in 6G, the network element with the policy control function can still be a PCF network element, or have other names. Applications are not limited.
  • the policy control function network element is a PCF network element, the PCF network element can provide the Npcf service.
  • Network Opening Function Network Element It mainly supports the secure interaction between the 3GPP network and third-party applications.
  • the network element with the network opening function can be a NEF network element, as shown in Figure 1; in future communication, such as in 6G, the network element with the network opening function can still be a NEF network element, or have other names. Applications are not limited.
  • the network opening function network element is an NEF, the NEF can provide Nnef services to other network function network elements.
  • Application function element It mainly supports interaction with the 3GPP core network to provide services, such as influencing data routing decisions, policy control functions, or providing some third-party services to the network side.
  • the application function network element can be an AF network element, such as shown in Figure 1; in future communications, such as 6G, the application function network element can still be an AF network element, or have other names, which are not covered by this application. Do limited.
  • the application function network element is an AF network element, the AF network element can provide the Naf service.
  • Unified data management function network element used to generate authentication credentials, user identification processing (such as storing and managing user permanent identities, etc.), access authorization control and subscription data management, etc.
  • the unified data management function network element can be a UDM network element, such as shown in Figure 1; in future communications, such as 6G, the unified data management function network element can still be a UDM network element, or have other names , which is not limited in this application.
  • the UDM network element can provide the Nudm service.
  • Authentication server function network element used to support the authentication function when the UE accesses the network, and to support the authentication and authorization process specific to the network element slice.
  • the authentication server function network element can be an AUSF network element, such as shown in Figure 1; in future communication, such as in 6G, the authentication server function network element can still be an AUSF network element, or have other names. Applications are not limited.
  • the AUSF network element can provide the Nausf service.
  • the Network Repository Function Network Element can be used to provide a network element discovery function, and provide network element information corresponding to the network element type based on the request of other network elements.
  • NRF network elements also provide network element management services, such as network element registration, update, de-registration, and network element status subscription and push.
  • the network element with network storage function can be an NRF network element, such as shown in Figure 1; in future communication, such as in 6G, the network element with network storage function can still be an NRF network element, or have other names. Applications are not limited.
  • the network element with the network storage function is an NRF network element, the NRF network element can provide the Nnrf service.
  • Data network refers to a service network that provides data transmission services for users, such as IP multimedia service (IP multi-media service, IMS), Internet (Internet), etc.
  • IP multimedia service IP multi-media service, IMS
  • Internet Internet
  • the UE accesses the DN through a protocol data unit (protocol data unit, PDU) session established between the UE and the DN.
  • PDU protocol data unit
  • Service communication proxy (service communication proxy, SCP), which can be used to provide one or more of the following functions: forwarding and routing messages to target network functions or target network function services, forwarding and routing messages to next-hop SCPs, agent discovery (that is, SCP performing service discovery or performing discovery of a network function providing a service or performing discovery of an instance of a network function providing a service), indirect communication (that is, the service consumer network function and the target service provider network function communicate through SCP), communication security, load Balance, overload control, etc.
  • SCP Service communication proxy
  • each network element in the core network can also be called a functional entity or device or network function, which can be a network element implemented on dedicated hardware, or a software instance running on dedicated hardware, or a
  • An example of the above virtualization function, for example, the above virtualization platform may be a cloud platform.
  • a network element may also be referred to as a network function or function or entity, which is not limited in this application.
  • the communication system shown in FIG. 1 does not constitute a limitation to the applicable communication system of the embodiment of the present application.
  • the communication system architecture shown in FIG. 1 is a 5G system architecture.
  • the method in the embodiment of the present application is also applicable to various communication systems in the future, such as 6G or other communication networks.
  • the service provider network function involved in the embodiment of the present application refers to a network function that provides network function services, and the service provider network function may also be called a network function service provider (NF service producer), service provider or other Name; service consumer network function refers to the network function that accesses or uses the network function service.
  • the service consumer network function can also be called the network function service consumer (NF service consumer), service consumer or other names, and this application does not make any reference to it. limited.
  • a network service may also be referred to as a service.
  • the service provider network function can also be named according to the specific service provided, and similarly, the service consumer network function can also be named according to the specific service requested, which is not limited in this application.
  • the service provider network function may be any network element or device or entity that can provide network function services in the above-mentioned communication system
  • the service consumer network function may be any network element or device that requests network function services in the above-mentioned communication system or entity.
  • the service provider network function can be AUSF, which can provide authentication services
  • the service consumer network function can be AMF, and AMF can request authentication services from AUSF, which is not limited in this application.
  • the network function of the service consumer and the network function of the service provider can communicate directly, which is called direct communication; the network function of the service consumer and the network function of the service provider can communicate indirectly, that is, through the service communication proxy (SCP ) to communicate, which is called indirect communication.
  • SCP service communication proxy
  • the standard protocol specifies the registration process of the service provider's network function in the NRF (Network Repository Function). Through this registration process, the service provider's network function can provide the network function file (NF profile) to the NRF.
  • Fig. 2 shows the NF registration process.
  • the service provider network function sends a message (such as Nnrf_NFManagement_NRFRegister Request) for requesting registration to the network warehouse function (such as NRF), which includes the network function file (NF profile) of the service provider network function, the NF
  • the profile includes the instance identifier (nfInstanceId) and network function type (nfType) of the service provider's network function.
  • the NF profile may also include a network service list (nfServiceList).
  • the network service list includes one or more network function services (NFService), and each network function service includes a service name (serviceName), a service instance (serviceInstanceId) and the like.
  • NFService may also include the characteristics (supportedFeatures) supported by the service instance.
  • supportedFeatures may include HTTP 307 redirection or HTTP 308 redirection, which is used to indicate that the service provider network function or the service provider network function instance, or the service or the service instance supports the HTTP 307 feature and/or supports the HTTP 308 feature.
  • the service provider network function or service provider network function instance or service or service instance supports HTTP 307 and/or 308 features, that is, the service provider network function can send a temporary redirect to the service consumer network function or SCP (ie 307 temporary redirect ) or the HTTP status code (HTTP status code) of permanent redirection (that is, 308 permanent redirection), and information about the network function of the target service provider to which it is redirected.
  • the NRF saves the NF profile of the service provider's network function.
  • the NRF sends a response message to the request to the service provider network function.
  • supporting HTTP 307 and/or 308 features may also be referred to as supporting redirection or as supporting HTTP redirection or supporting service request redirection or supporting request redirection.
  • the service provider network function supports hypertext transfer protocol (hypertext transfer protocol, HTTP) redirection, which also means that the service provider network function instance supports HTTP redirection or the service of the service provider network function supports HTTP redirection , or the service instance of the service provider network function supports HTTP redirection.
  • hypertext transfer protocol hypertext transfer protocol
  • HTTP status code of temporary redirection (ie 307 temporary redirect) or permanent redirection (ie 308 permanent redirect) is also called HTTP redirection status code.
  • a service consumer web function may perform web function service discovery before sending a service request to a service provider web function.
  • FIG. 3 shows a network function service discovery process.
  • the service consumer network function sends a message (such as Nnrf_NFDiscovery_Request) to NRF to request a discovery service, which includes the type of the requested network function, the network function type (NF type) of the service consumer network function, etc.
  • the service name, etc. of the service including the requested network function.
  • the message may also include the features supported by the service consumer's network function that needs to be supported by the requested network function service.
  • the NRF checks the service consumer network function's authorization for service discovery.
  • NRF returns a response message to the service consumer network function
  • NRF checks that the service consumer network function is authorized for service discovery
  • the response message includes the discovery result, which may include the validity period of the discovery result , a network function profile (NF profile) for one or more network functions.
  • the network function file is a network function file corresponding to the network function or service discovered by the service consumer's network function request.
  • the service consumer web function requests an access token from the NRF before sending a message to the service provider web function requesting the service of the service provider web function.
  • access tokens There are two types of access tokens that service consumer network functions can request from NRF:
  • An access token used to access a network function (Network Function, NF) type service provider network function service may be referred to as an NF-type access token, that is, an access token (NF type).
  • a service access token used to access a service provider network function instance may be referred to as an NF instance type access token, ie an access token (NF instance).
  • the access token may refer to an access token (NF type) or an access token (NF type) unless otherwise specified.
  • Fig. 4 shows the flow of obtaining an access token (NF type) by a service consumer network function.
  • the service consumer network function sends a message (such as Nnrf_AccessToken_Get Request) for requesting an access token to NRF, and the message includes the instance identifier of the service consumer network function, the service consumer network The service name of the service requested by the function, the NF type of the service provider network function requested by the service consumer network function, etc.
  • a message such as Nnrf_AccessToken_Get Request
  • NRF checks the authorization of the service requested by the service consumer's network function access, and if the check is successful, NRF generates an access token (NF type), which includes the service provider requested by the service consumer's network function
  • NF type an access token
  • NRF after NRF checks that the service authorization of the service consumer network function access request is successful, NRF returns a response message (such as Nnrf_AccessToken_Get Response) to the service consumer network function, which includes the generated access token (NF type ).
  • the process of requesting an access token (NF instance) by a service consumer network function is basically the same as the above process of requesting an access token (NF type), except that the message sent by the service consumer network function to NRF for requesting an access token Include the NF instance identifier of the service provider network function requested by the service consumer network function, and the access token (NF instance) generated and returned by NRF includes the NF of the service provider network function requested by the service consumer network function Instance ID.
  • the service consumer network function After the service consumer network function obtains the access token, it sends a service request message to the service provider network function, which includes the access token obtained from NRF; the service provider network function verifies the access token , and only after successful authentication of the access token is the service provided to the service consumer web function.
  • the service provider network function verifies that the access token includes: If the network function type of the service provider network function requested by the service consumer network function is included in the access token, the service provider network function verifies the network included in the token Whether the function type is consistent with its own network function type; if the access token includes the instance ID of the service provider network function requested by the service consumer network function, the service provider network function verifies whether the instance ID is consistent with its own instance ID unanimous.
  • the Hypertext Transfer Protocol (Hypertext Transfer Protocol) redirection mechanism is defined in the standard protocol.
  • the service provider network function in direct communication, when the service provider network function in the overload state or about to enter the overload state receives the service request from the service consumer network function, in order to alleviate the overload state or avoid entering the overload state, the service provider network function can perform HTTP redirection, that is, sending the HTTP status code (HTTP status code) "307 temporary redirect" to the service consumer's network function.
  • HTTP redirection status code is used to notify the service consumer's network function that there are other available service providers
  • the network function that is, the target service provider network function can provide the service requested by the service consumer network function.
  • the service provider network function also sends the information of the target service provider network function to the service consumer network function, including the uniform resource identifier (uniform resource identifier, URI) and/or instance identifier of the target service provider network function.
  • the service consumer network function sends a service request to the target service provider network function according to the received "307 temporary redirect" HTTP redirection status code and the information of the target service provider network function.
  • the service provider network function to which the service consumer network function first sends a service request is called the initial service provider network function (Initial NF service producer) Alternatively referred to as the first SPNF, the target SPNF may be referred to as the second SPNF.
  • the service provider network function needs to support HTTP redirection, that is, the service provider network function can send the HTTP redirection status code and the information of the target service provider network function to the service consumer network function; It is also required that the service consumer network function supports HTTP redirection, that is, the service consumer network function sends a service request message to the target service provider network function after receiving the HTTP redirection status code and the information of the target service provider network function.
  • the service provider network function and the service consumer network function communicate through the service communication proxy (SCP).
  • the service consumer network function sends a message for requesting the service of the service provider network function to the SCP, and the message includes the requested service and information of the service provider network function, for example, may include an instance identifier of the service provider network function.
  • the SCP sends a service requesting message to the service provider network function according to the received information of the service provider network function, and the message includes the service requested by the service consumer network function.
  • the service provider network function after the service provider network function receives the request message sent by the SCP, it can initiate HTTP redirection, that is, the service provider network function sends a response message to the SCP, including the HTTP redirection status code (HTTP status code) and information about the network capabilities of the target service provider.
  • the SCP After receiving the response message, the SCP sends the HTTP redirection status code and the information of the target service provider network function to the service consumer network function, and the service consumer network function Provider network function information, send a service request to the target service provider network function.
  • the SCP may also directly send a service request message to the target service provider network function according to local configuration, instead of sending the received HTTP redirection status code and target service provider information to the service consumer network function.
  • the service provider network function to which the SCP first sends a service request is called the initial service provider network function (Initial NF service producer) or the first service provider network function, and the target service provider
  • the provider network function may be referred to as a second service provider network function.
  • the service provider network function and SCP are required to support redirection, that is, the service provider network function can send the HTTP redirection status code and the information of the target service provider network function to the service consumer network function , after the SCP receives the HTTP redirection status code and the information of the network function of the target service provider, it can forward the received HTTP redirection status code and the information of the network function of the target service provider to the service consumer, or provide or network function to send a service request.
  • the network function of the service consumer is also required to support HTTP redirection, that is, after receiving the status code of the HTTP redirection and the information of the network function of the target service provider, the network function of the service consumer provides The Desire function sends a service request message.
  • the service consumer network function may not be able to access the services provided by the target service provider network function because the corresponding access token is not obtained.
  • the embodiment of the present application provides a network function service authorization method and device, which can enable the service consumer network function to obtain services from the target service provider network function when HTTP redirection occurs.
  • the first service provider network function can also be expressed as the first service provider network function instance, or the initial service provider network function, or the initial service provider network function instance;
  • the second service provider The provider network function can also be expressed as a second service provider network function instance, or a target service provider network function, or a target service provider network function instance;
  • the first service can also be expressed as a first service instance.
  • a network function service authorization method provided in the embodiment of the present application may be applicable to the communication system shown in FIG. 1 .
  • the specific process of the method may include:
  • the service consumer network function sends a first request message to the Network Repository Function (NRF) according to the first information, the first request message includes the second information and the service name of the first service, and the first request message is used to request Obtain an access token, which is used for authorization check when the service consumer network function accesses the first service.
  • the first request message further includes a network function type or a network function instance of the requested network function;
  • the first service is a service requested by the service consumer network function.
  • the first information is used to indicate that the service consumer network function, and/or the first service, and/or the service provider network function that provides the first service, and/or the requested service provision Or the network function supports the HTTP redirection feature. That is, if at least one of the service consumer web function, the first service, the service provider web function providing the first service, and the requesting service provider web function supports the HTTP redirect feature, then the service consumer The second information should be included in the first request message sent by the network function to the NRF.
  • the service consumer network function may check the service consumer network function, and/or the first service, and/or the service provider network function providing the first service, and/or Whether the requested service provider network function supports HTTP redirection.
  • the service consumer network function checks whether it supports HTTP redirection by checking local configuration information, and if the local configuration information indicates support, then the service consumer network function supports HTTP redirection.
  • the service consumer network function checks whether the first service, or the service provider network function providing the first service, or the requested service provider network function supports HTTP redirection, by checking the , or the network function of the service provider that provides the first service, or the network function file (NF Profile) corresponding to the network function of the service provider of the request, if the first service or the service provider of the request in the network function file If the features supported by the network function, or the network function of the service provider providing the first service include HTTP redirection, then the first service, or the network function of the service provider providing the first service, or the requested service provider network Function supports HTTP redirection.
  • FIG. 6 or FIG. 7 refer to related content in FIG. 6 or FIG. 7 below.
  • the first information includes instance identifiers of multiple service provider network functions. That is to say, if the first information obtained by the service consumer network function includes instance identifiers of multiple service provider network functions, for example, the consumer network function obtains the first information from the NRF during the service discovery process, the second If the information includes multiple service provider network function instance identifiers, the first request message sent by the service consumer network function to the NRF includes the second information.
  • the first information includes instance identifiers of multiple service provider network functions. That is to say, if the first information obtained by the service consumer network function includes instance identifiers of multiple service provider network functions, for example, the consumer network function obtains the first information from the NRF during the service discovery process, the second If the information includes multiple service provider network function instance identifiers, the first request message sent by the service consumer network function to the NRF includes the second information.
  • FIG. 6 or FIG. 7 refer to related content in FIG. 6 or FIG. 7 below.
  • the first information indicates that there are multiple service provider network function instances that provide the first service. That is to say, if there are multiple service provider network function instances providing the first service, the service consumer network function should include the second information in the first request message sent to the NRF.
  • the first information indicates that there are multiple network function instances in the network function set of the service provider network function that provides the first service. That is to say, if the network function set of the service provider network function providing the first service includes multiple network function instances, the first request message sent by the service consumer network function to the NRF should include the second information.
  • the first information is used to instruct the service consumer network function to use a service communication proxy (service communication proxy, SCP) to communicate with the service provider network function. That is to say, if the service consumer network function uses the SCP to communicate with the service provider network function, the first request message sent by the service consumer network function to the NRF should include the second information.
  • the service consumer network function may determine whether to use the SCP to communicate with the service provider network function through local configuration. For an example of this implementation manner, refer to related content in FIG. 7 below.
  • the first information includes the first indication and/or information about the network function of the second service provider. That is to say, if the first information includes the first indication and/or the information of the second service provider network function, the service consumer network function should include the second information in the first request message sent to the NRF.
  • the information of the second service provider network function may include the URI of the second service provider network function and/or the instance identifier of the second service provider network function.
  • the first indication is used to indicate service access authorization failure or HTTP redirection or access token acquisition or other available service provider network functions.
  • the first information may be sent by the first service provider network function to the service consumer network function. For an example of this implementation, refer to the relevant content in FIG. 8 below.
  • the first information may be sent by the SCP to the service consumer network function after receiving the HTTP redirection status code sent by the first service provider network function and the information of the second service provider network function.
  • the HTTP redirection status code sent by the first service provider network function and the information of the second service provider network function.
  • the first information is a message, which is used to notify the service consumer network function, service access authorization failure or HTTP redirection or access token or other available service provider network Function; in this implementation manner, the first information optionally includes information about the network function of the second service provider.
  • the first information may be sent by the first service provider network function to the service consumer network function.
  • the first information may be sent by the SCP to the service consumer network function after receiving the HTTP redirection status code sent by the first service provider network function and the information of the second service provider network function.
  • the service consumer network function receives the first information. That is, the first information may be received by the service consumer network function.
  • the first information may come from the network repository function or the service communication agent or the first service provider network function, that is, the service consumer network function may receive information from the network repository function (NRF) or The first information sent by a Service Communication Proxy (SCP) or a first service provider network function.
  • NRF network repository function
  • SCP Service Communication Proxy
  • the first information from the first service provider network function may include a first indication (for indicating HTTP redirection, or other available service provider network functions, or service access authorization failure, or obtaining access Tokens, such as HTTP redirection status codes) and information about the second service provider's network capabilities (such as URIs and instance identifiers).
  • the second service provider network function is the target service provider network function to which HTTP is redirected. For an example of this implementation manner, refer to related content in FIG. 8 or FIG. 9 below.
  • the first information from the SCP may include: the first indication, and/or information about the network function of the second service provider.
  • the first indication may include: information indicating HTTP redirection or other available service provider network functions, or service access authorization failure or HTTP redirection or access token acquisition.
  • the information of the second service provider network function includes a URI or instance identification of the second service provider network function.
  • the second service provider network function is the target service provider network function to which HTTP is redirected.
  • the first information from the SCP may be a message, which is used to notify the service consumer network function, service access authorization failure or HTTP redirection or access token or other available service provider network function .
  • the message optionally includes information about the network function of the second service provider.
  • the information of the second service provider network function includes a URI or instance identification of the second service provider network function.
  • the second service provider network function is the target service provider network function to which HTTP is redirected. For an example of this implementation manner, refer to related content in FIG. 10 or FIG. 11 below.
  • the second information may include: the NF type and/or NF Set identifier of the service provider network function requested by the service consumer network function, or the service provider network that provides the first service
  • the service provider network function providing the first service includes a first service provider network function and a second service provider network function. Since the first request message includes the second information, the network repository function also includes the second information in the corresponding access token generated after checking that the authorization of the service consumer network function is successful.
  • the service consumer web function can use the token to access the first service instance of the second service provider web function.
  • a network function set may include one or more network functions, specifically, may include one or more instance identifiers of network functions, and these network functions have the same network function type and can provide the same service.
  • the network function type of the service provider network function requested by the service consumer network function, the network function type of the second service provider network function, and the network function type of the first service provider network function are all the same.
  • the NF Set identifier of the service provider network function requested by the service consumer network function, the NF Set identifier of the second service provider network function, and the NF Set identifier of the first service provider network function are all the same.
  • the second information may include the instance identifier of the network function of the second service provider, and since the first request message includes the instance identifier of the network function of the second service provider, the network repository function is After verifying that the network function service access authorization of the service consumer is successful, the generated access token also includes the instance identifier of the network function of the second service provider. The service consumer can thus use the access token to access the first service of the second service provider.
  • the second information may include instance identifiers of multiple service provider network functions, for example, these service provider network functions can all provide the first service, such as the first service provider network function, or a second service provider network function. Since the first request message includes the instance identifiers of multiple service provider network functions, the access token generated by the network warehouse function also includes the instance identifiers of multiple service provider network functions, including the second service provider network function , so the service consumer can use the generated access token to access the first service of the second service provider.
  • NRF Network Repository Function
  • the NRF After receiving the first request message sent by the service consumer network function, the NRF can check the service access authorization of the service consumer network function. After the check is successful, the NRF generates an access token, which includes the service name of the first service and the second information, and send the generated access token to the service consumer network function through the first response message, otherwise NRF refuses to generate an access token for the service consumer network function, and sends the generated access token to the service consumer network function
  • the first response message which includes the reason for the error, such as authorization failure.
  • the NRF generates access tokens, ie the NRF generates a first access token, or a second access token, or at least two third access tokens, or a fourth access token.
  • NRF sends the generated access token to the service consumer network function through the first response message, that is, NRF sends the first access token, or the second access token, or at least two third access tokens, or the fourth
  • the access token is sent to the service consumer web function. See the description of the first access token, or the second access token, the third access token, and the fourth access token in S503.
  • S503 The service consumer network function receives the first response message from the NRF.
  • the access token in the first response message may include a first access token, the first access token includes the NF type of the service provider network function, and/or the service provider The NF set identifier for the network function.
  • the type of the first access token may be "access token (NF type)".
  • the service provider network function is the service provider network function requested by the service consuming network function, or the service provider network function that can provide the first service, or the first service provider network function, or the first service provider network function .
  • the first access token includes second information, that is, the first access token includes the NF type and/or NF Set identifier of the service provider network function requested by the service consumer network function, or the second service The NF type and/or NF Set identification of the provider network function, or the NF type and/or NF Set identification of the first service provider network function.
  • the NF Set identifier included in the first access token is the same as the NF set of the second service provider's network function
  • the NF Set identifiers are the same, so when redirection occurs, the service consumer network function can use the first access token to access the first service of the second service provider network function.
  • the service consumer web function requests an access token from the NRF before sending a message requesting a service to a first service provider web function or a second service provider web function
  • the NRF may take the first
  • the access token is sent to the service consumer web function.
  • the access token in the first response message may include a second access token, where the second access token includes instance identifiers of multiple service provider network functions.
  • the second access token includes second information.
  • the second information includes instance identifiers of multiple service provider network functions, and the service provider network function instances included in the second access token
  • the identifiers are all service provider network function instance identifiers in the second information.
  • these providers can all provide the first service, that is, these service providers include the network function of the second service provider, that is, the second access token includes the instance identifier of the network function of the second service provider, so When redirection occurs, the service consumer web function can use the second access token to access the first service of the second service provider web function.
  • the type of the second access token may be "Access Token (NF Instance)".
  • NF Instance Access Token
  • the service consumer network function requests an access token from the NRF before sending a service request to the first service provider network function or the second service provider network function
  • the NRF can use the second access token Sent to this service consumer web function.
  • this implementation manner refer to related content in FIG. 6 or FIG. 7 .
  • the access token in the first response message may include multiple third access tokens, and each third access token includes an instance identifier of a service provider network function, the A service provider network function may provide the first service, such as a first service provider network function and a second service provider network function.
  • the third access function includes the second information. It can be understood that the instance identifier of the service provider network function in each third access token is the instance identifier of the plurality of service provider network functions in the second information. one.
  • the service consumer web function can access the first service of the second service provider web function using the third access token comprising the instance identification of the second service provider web function.
  • the type of the third access token may be "Access Token (NF Instance)".
  • the service consumer network function when the service consumer network function sends a service request to the first service provider network function or the second service provider network function, when the NRF requests access tokens from the NRF, the multiple third access The token is sent to the service consumer web function.
  • the service consumer network function when the service consumer network function sends a service request to the first service provider network function or the second service provider network function, when the NRF requests access tokens from the NRF, the multiple third access The token is sent to the service consumer web function.
  • the access token in the first response message may include a fourth access token, where the fourth access token includes the instance identifier of the network function of the second service provider.
  • the fourth access token includes the second information. It can be understood that the second information includes the instance identifier of the network function of the second service provider, and the instance identifier in the fourth access token also includes the instance identifier of the network function of the second service provider , the second information.
  • the service consumer web function can use the fourth access token to access the first service of the second service provider web function.
  • the type of the fourth access token may be "Access Token (NF Instance)".
  • the service consumer network function After the service consumer network function receives the first information from the first service provider network function or SCP, wherein the first information includes the instance identifier of the second service provider network function, the service consumer network function Sending a first request message to the NRF for requesting to obtain an access token, where the first request message includes the received instance identifier of the network function of the second service provider.
  • the NRF sends a fourth token to the service consumer web function, which includes the instance identifier of the second service provider web function.
  • An example of this implementation manner may refer to related content in FIG. 8 or FIG. 9 or FIG. 10 or FIG. 11 .
  • the above process may further include the following steps: after receiving the first response message from the NRF, the service consumer network function sends the second response message to the first service provider network function or the second service provider network function or the service communication agent A request message, the second request message is used to request a service, and the second request message includes the first access token or the second access token or the third access token or the fourth access token.
  • the service consumer network function may send a second request message (that is, the requested message).
  • the service request message may include the first access token or the second access token or the third access token.
  • the service consuming network function may send a second request message (ie, a message for service request) to the second service provider network function.
  • the service request message may include the first access token or the second access token or the third access token or the fourth access token.
  • the above process may further include the following step: before the service consumer network function receives the first information, send a third request message to the first service provider network function or the service communication agent, and the third service request message is used for To request said first service (ie the service requested by the consumer network function), the third request message includes a fifth access token. That is, after the service consumer network function sends the third request message (that is, the message for service request) to the first service provider network function (in the direct communication scenario) or the SCP (in the indirect communication scenario), it receives the first A first message sent by a service provider network function or SCP. According to the first information, the service consumer network function sends a first request message to the NRF to request to obtain an access token.
  • the service consumer network function before the service consumer network function sends the first request to the NRF, the service consumer checks the fifth access token, and if the second condition is met in the fifth access token, the service consumer network function sends the NRF Send the first request message, otherwise the service consumer does not send the first request message to the NRF, but directly initiates a service request message to the SCP or the second service provider network function, wherein the message includes the fifth access token.
  • the second condition is: the fifth access token includes the instance identifier of the first service provider network function, and/or, the fifth access token does not include the NF type of the service provider network function, and/or, the fifth access The token does not include the NF Set identity of the service provider network function, and/or, the fifth access token does not include the NF Set identity and the NF type of the service provider network function, and/or the fifth access token does not include the second The instance ID of the service provider network function.
  • the fifth access token includes the instance identity of the first service provider network function, and/or, the fifth access token does not include the NF type of the service provider network function, and/or, the fifth access token does not include The NF Set identity of the service provider network function, and/or, the fifth access token does not include the NF Set identity and NF type of the service provider network function, and/or the fifth access token does not include the second service provider network If the instance identifier of the function is used, the service consumer network function sends a first request message to the NRF, which includes the second information.
  • the fifth access token includes the instance identity of the second service provider network function, and/or, the fifth access token includes the NF type of the service provider network function, and/or, the fifth access token includes the service provider If the NF Set identifier of the provider network function, and/or, the fifth access token includes the NF Set identifier and NF type of the service provider network function, then the service consumer network function directly initiates the usage to the SCP or the second service provider network function A message for requesting a service, wherein the message includes a fifth access token.
  • the above process may further include the following steps: before the service consumer network function receives the first information, send a fourth request message to the NRF, the fourth request message includes the first service (that is, the consumer network function request service), the fourth request message is used to request to discover the first service or to discover a network function instance that can provide the first service. That is, the service consumer network function first sends a fourth request message to the NRF to perform service discovery, and the NRF can send multiple service provider network function network function files (NF profiles) to the service consumer network function, including service provider Instance identifications of or network functions, and the network functions may provide the first service. It can be understood that the network function of the service consumer can obtain the identifiers (that is, the first information) of multiple service provider network functions from the NRF.
  • An example of a service discovery process may refer to the process shown in FIG. 3 .
  • the first service is the service requested by the service consumer network function.
  • the second information is the network function type of the service provider network function providing the first service or the network function set identifier of the service provider network function providing the first service or the second service provider network function (that is, the target service provider or the network function type of the first service provider network function or the network function set identification of the first service provider network function or the network function type of the second service provider network function or the second service provider The network capability set ID of the network function.
  • the service consumer web function can obtain an access token, the access token including the second information.
  • the access token is used for an authorization check when the service consumer web function accesses the first service (ie the requested service) of the second service provider web function.
  • the service consumer web function needs to access the first service of the second service provider web function, and since the service consumer web function has obtained an access token, the access token can be used to access the second service provider web function.
  • the first service-time authorization check of the service provider web function so the second service provider web function can check the access token successfully, and then serve the service consumer web function, so that when the redirect occurs, It can be guaranteed that the service consumer network function can obtain the service provided by the second service provider network function.
  • FIG. 6 it is a schematic flow diagram of a network function service authorization method in the direct communication scenario in the embodiment of the present application. As shown in the figure, the flow may include:
  • Step 0 The service consumer web function determines or receives the first information before requesting the access token.
  • the service consumer network function determining the first information includes checking whether the service consumer network function, and/or the requested service, and/or the requested service provider network function support HTTP redirection. If supported, the service consumer network function determines the first information, that is, it determines that the service consumer network function, and/or the requested service, and/or the requested service provider network function supports HTTP redirection, that is, the first information uses Used to represent service consumer web functions, and/or requested services, and/or requested service provider web functions that support the HTTP redirection feature, or used to represent service consumer web functions, requested services, and requested service providers At least one of the network functions supports the HTTP redirection feature.
  • the service requested here is the first service;
  • the requested service provider network function may be the first service provider network function, or a service provider network function that provides the first service. It can be understood that the service provider network function providing the first service includes the first service provider network function and the second service provider network function.
  • the first information indicates that the service consumer network function, and/or the first service, and/or the service provider network function providing the first service support HTTP redirection.
  • the service consumer network function receives the first information, including the service consumer network function receiving the NF Profile of multiple network functions sent by NRF or the instance identifiers of multiple network functions, where these network functions can provide the first One serving.
  • the first information here includes NF Profiles of multiple network functions or instance identifiers of multiple network functions. It can be understood that, before receiving the first information, the network function of the service consumer sends a message for requesting service discovery to the NRF, the message includes the service name of the first service, and the NRF sends the discovery result to the service consumer, including the first One piece of information, that is, network function files (NF profiles) of multiple network functions or instance identifiers of multiple network functions. Each NF Profile includes the instance identifier of the network function. These network functions can all provide the first service.
  • the determination of the first information by the service consumer network function includes checking whether there are multiple service provider network function instances that can provide the first service. If so, the service consumer network function determines the first information, that is, determines that there are multiple service provider network function instances providing the first service. Here, the first information indicates that there are multiple service provider network function instances providing the first service.
  • the service consumer network function determines the first information, including checking whether there are multiple network function instances in the network function set of the service provider network function that can provide the first service, and if so, the service consumer network The function determines the first information, that is, it is determined that there are multiple network function instances in the network function set of the service provider network function that can provide the first service.
  • the first information here is used to indicate that there are multiple network function instances in the network function set of the service provider network function that can provide the first service.
  • HTTP redirection feature is also referred to as HTTP redirection for short.
  • the service consumer network function checks whether it supports HTTP redirection, it can be based on the local configuration. If the local configuration indicates that the service consumer network function supports HTTP redirection, it indicates that the service consumer network function supports HTTP redirection .
  • the service consumer network function checks whether the requested service provider network function or the requested service (that is, the first service) or the requested service instance (that is, the first service instance) supports HTTP redirection, it may be based on Configure locally or check against the NF Profile obtained from NRF.
  • the NRF returns the NF Profile to the service consumer network function. If the supported features (supportedFeatures) in the NF Profile of the requested service provider network function include HTTP redirection, it indicates that the requested server network function or the requested service or the requested service instance supports HTTP redirection. If the features (supportedFeatures) supported by the first service or the first service instance in the NF Profile include HTTP redirection, it indicates that the first service or the first service instance supports HTTP redirection.
  • Step 1 The service consumer network function sends a message for requesting an access token to the NRF according to the first information, and the message includes the second information. This message corresponds to the first request message in FIG. 5 .
  • the service consumer network function sends a message for requesting an access token to the NRF according to the first information, the message includes the service name of the first service and the second information, it should be understood that the service consumer network function determines or receives After the first information, a message for requesting an access token is sent to the NRF, and the message should include the second information. That is,
  • the service consumer web function sends a message requesting an access token to the NRF, the message shall include the second information;
  • the service consumer web function sends a message requesting an access token to the NRF, in which shall include the second information;
  • the network function of the service consumer sends a message for requesting an access token to the NRF, in which shall include the second information;
  • the service consumer network function sends a message for requesting an access token to the NRF, and the message should include the second information;
  • the service consumer network function sends a message for requesting an access token to the NRF, and the message should include the second information;
  • the second information includes: the NF type and/or NF Set identification of the requested service provider network function, or the NF type and/or NF Set identification of the first service provider network function, or instances of multiple service provider network functions Identify, where each service provider network function can provide the first service.
  • the service provider network function requested by the service consumer may be the first service provider network function, or the service provider network function that provides the first service.
  • the service provider network function providing the first service includes a first service provider network function and a second service provider network function.
  • the NF type of the first service provider network function, the NF type of the second service provider network function, and the NF type of the requesting service provider network function are the same.
  • the NF Set identifier of the first service provider network function, the NF Set identifier of the second service provider network function, and the NF Set identifier of the requested service provider network function are the same.
  • Step 2 The NRF checks if the service consumer network function has authorization to access the requested first service. After the check is successful, NRF generates one or more access tokens, which can include the following three situations:
  • Case 1 Generate a first access token, the first access token includes the NF type and/or NF set of the requested service provider network function, or the NF type and/or NF Set identifier of the first service provider network function , that is, the first access token includes the second information.
  • Case 2 Generate a second access token.
  • the second access token includes instance identifiers of multiple service provider network functions, and the instance identifiers of each service provider network function in the second token are included in the second information.
  • An instance identifier of a service provider network function of , that is, the second access token includes the second information.
  • Case 3 Multiple third access tokens are generated, and each third access token includes the instance identifier of the service provider network function, and the instance identifier of the service provider network function is a plurality of service providers in the second information One of the instance IDs of the network function.
  • the above-mentioned first access token, second access token and third access token also include the name of the first service, the instance identifier of the service consumer network function, and the like.
  • Step 3 The NRF returns the generated one or more access tokens to the service consumer web function.
  • Step 4 The service consumer network function sends a message for requesting services (ie, a service request) to the first service provider network function (ie, the initial service provider network function), and the message includes the access token obtained in step 3 Card.
  • the service consumer network function may include the multiple received access tokens or one of the third access tokens in the message card, the third access token includes the instance identifier of the network function of the first service provider.
  • This message corresponds to the second request message sent to the network function of the first service provider in the process shown in FIG. 5 .
  • the first service provider network function may send a response message to the service consumer network function, which includes an HTTP redirect status code (such as HTTP 307 redirection or HTTP 308 redirection) and the second service provider network function (ie, the target Service Provider Network Functions) information (such as instance ID and/or URI).
  • HTTP redirect status code such as HTTP 307 redirection or HTTP 308 redirection
  • second service provider network function ie, the target Service Provider Network Functions
  • instance ID and/or URI such as instance ID and/or URI
  • Step 6 The service consumer network function sends a message for requesting services to the second service provider network function according to the HTTP redirection status code and the information of the second service provider network function, and the message includes the information received in step 3. access token for .
  • the service request message corresponds to the second request message sent to the second service provider network function in the process shown in FIG. 5 .
  • the service consumer web function when the service consumer web function receives multiple access tokens in step 3, the service consumer web function selects the access token that includes the instance ID of the second service provider web function, and in step The message in step 6 includes the access token, or the service consumer network function includes the multiple received access tokens in the message in step 6.
  • Step 7 The second service provider network function verifies the received access token, and if the verification passes, it provides services for the service consumer network function.
  • the second service provider network function checks whether the instance identifier of the second service provider network function is included, and if not If yes, the verification of the access token fails, the second service provider network function does not perform the service requested by the service consumer network function, and returns a response message including an error reason. If the verification of the access token is successful, the second service provider web function performs access to the service requested by the consumer web function.
  • steps 1-3 the process of obtaining an access token
  • steps 4-7 namely the process of service access, belong to two independent processes and can be executed independently.
  • FIG. 7 it is a schematic flowchart of a network function service authorization method in the indirect communication scenario in the embodiment of the present application. As shown in the figure, the process may include:
  • Step 0 The service consumer web function determines or receives the first information before requesting the access token.
  • the specific implementation of this step is basically the same as step 0 in FIG. 6 . The difference is:
  • the service consumer network function determines the first information, including checking whether the service consumer network function communicates with the service provider network function through the SCP. If yes, the service consumer network function determines the first information, that is, it is determined that the service consumer network function communicates with the service provider network function through the SCP.
  • the first information here is used to indicate that the service consumer network function communicates with the service provider network function through the SCP.
  • the NRF is checking whether the network function of the service consumer communicates with the network function of the service provider through the SCP, which may be checked according to local configuration. If the local configuration indicates that the network or service consumer network function supports or uses indirect communication or whether the service consumer network function communicates with the service provider network function through SCP, indicates whether the service consumer network function communicates with the service provider network function through SCP .
  • Step 1 The service consumer network function sends a message for requesting an access token to the NRF according to the first information, including the second information.
  • the specific implementation of this step is basically the same as step 1 in FIG. 6 .
  • Step 2 The NRF checks if the service consumer network function has authorization to access the requested first service. After a successful check, NRF generates one or more access tokens.
  • the specific implementation of this step is basically the same as step 2 in FIG. 6 .
  • Step 3 The NRF returns the generated one or more access tokens to the service consumer web function.
  • Step 4 The Service Consumer Network Function sends a message requesting the service (ie Service Request) to the First Service Provider Network Function (ie the Initial Service Provider Network Function), which is sent to the First Service Provider via the SCP Internet function.
  • the Service Consumer Network Function sends a message requesting the service (ie Service Request) to the First Service Provider Network Function (ie the Initial Service Provider Network Function), which is sent to the First Service Provider via the SCP Internet function.
  • the first service provider network function may send a response message, which includes an HTTP redirect status code (such as HTTP 307 redirection or HTTP 308 redirection) and the second service provider network function (ie, the target service provider network function) Information (such as URI and/or instance identification), the response message is sent to the service consumer web function via SCP.
  • HTTP redirect status code such as HTTP 307 redirection or HTTP 308 redirection
  • the second service provider network function ie, the target service provider network function
  • Information such as URI and/or instance identification
  • Step 6 After receiving the message sent in step 4, the service consumer network function sends a service request message to the second service provider network function according to the HTTP redirection status code and the information of the second service provider network function, and the message Including the access token received in step 3, the service request message is sent to the second service provider network function via SCP.
  • the service request message is sent to the second service provider network function via SCP.
  • Step 7 The second service provider network function verifies the received access token, and if the verification passes, it provides services for the service consumer network function.
  • the second service provider network function verifies the received access token, and if the verification passes, it provides services for the service consumer network function.
  • the SCP directly sends the service request message to the second service provider's network function after receiving the redirection HTTP redirection status code sent by the network function of the first service provider and the information of the network function of the second service provider.
  • steps 1-3 namely, the process of obtaining an access token
  • steps 4-7 namely, the process of service access
  • FIG. 8 it is a schematic flowchart of a network function service authorization method in the direct communication scenario in the embodiment of the present application. As shown in the figure, the process may include:
  • Step 1 The service consumer web function sends a message to the NRF requesting an access token.
  • the message includes the instance identifier of the service consumer network function and the service name of the service requested by the service consumer network function.
  • the message may also include the NF type or instance identifier of the service provider network function requested by the service consumer network function.
  • the service requested by the service consumer network function is the first service.
  • the service provider network function requested by the service consumer network function is the service provider network function that provides the first service, such as the first service provider network function.
  • Step 2 The NRF checks whether the service consumer network function has authorization to access the requested service. After a successful check, NRF generates an access token, called the fifth access token.
  • the fifth access token may be an access token (NF type) or an access token (NF instance). If in the message in step 1, the service consumer network function includes the NF type of the requested service provider network function, then the fifth access token is (NF type), that is, the fifth access token includes the requested service provider The NF type of the network function (such as the NF type of the first service provider network function); if in the message of step 1, the service consumer network function includes the instance identifier of the requested service provider network function, then the fifth access token is (NF instance), that is, the fifth access token includes the instance identifier of the requested service provider network function (such as the instance identifier of the first service provider network function).
  • the fifth token also includes the instance identifier of the service consumer network function, the name of the requested service, the instance identifier of the NRF, and the like.
  • Step 3 NRF returns the generated fifth access token to the service consumer web function.
  • Step 4 The service consumer network function sends a message for requesting the first service to the first service provider network function (ie, the initial service provider network function), including the fifth access token and so on.
  • the first service provider network function ie, the initial service provider network function
  • Step 5 When the first service provider network function is in the overload state or is about to enter the overload state, it can return a response message to the service consumer network function, which includes the HTTP redirection status code and the second service provider network function (ie Target Service Provider Network Capabilities) information.
  • the second service provider network function is the service provider network function to which HTTP is redirected, that is, the available service provider network function, that is, the service provider network function that can provide the first service.
  • the HTTP redirection status code here corresponds to the first indication in FIG. 5
  • the HTTP redirection status code and the information of the second service provider network function (that is, the target service provider network function) correspond to the first information in FIG. 5 .
  • Step 6 The service consumer network function sends a message for requesting an access token to the NRF according to the received HTTP redirection status code and the information of the second service provider network function, and the message includes the second information. This message corresponds to the first request message in S501 in FIG. 5 .
  • the second information may include: information about the network function of the second service provider, such as the instance identifier of the network function of the second service provider, or the NF type of the network function of the second service provider, or the The NF type and NF Set identifier of the network function of the second service provider, or the NF Set identifier of the network function of the second service provider.
  • the second information may include: information about the network function of the first service provider, such as the NF type of the network function of the first service provider, or the NF type and NF of the network function of the first service provider Set identification, or the NF Set identification of the first service provider network function.
  • the second information may include: identifiers of multiple instances that provide network functions of the service provider.
  • These service provider network functions meet one or more of the following conditions: the first service can be provided, and the first service provider network function belongs to the same network function set (that is, the NF Set identifier of the first service provider network function same), belong to the same network function type as the first service provider network function. It should be understood that these service provider network functions include the second service provider network function.
  • the service consumer network function checks whether the second condition is satisfied, and if so, the service consumer network function performs step 6 , otherwise step 6 is not performed, but a message for requesting the first service is sent to the second service provider network function, carrying the fifth access token.
  • the second condition is: the fifth access token includes the instance identifier of the first service provider network function, and/or, the fifth access token does not include the NF type of the service provider network function, and/or, the fifth access token
  • the token does not include the NF Set identity of the service provider network function, and/or, the fifth access token does not include the NF Set identity and the NF type of the service provider network function, and/or the fifth access token does not include the second service The instance ID of the provider web function.
  • the fifth access token includes the instance identity of the first service provider network function, and/or, the fifth access token does not include the NF type of the service provider network function, and/or, the fifth access token does not include the service
  • the service consumer network function executes step 6; otherwise, when the fifth access token includes the NF type of the service provider network function, and/or, the fifth access token includes the NF Set of the service provider network function
  • the identification, and/or, the fifth access token comprises the NF Set identification and the NF type of the service provider network function, and/or the fifth access token comprises the instance identification of the second service provider network function
  • the service consumer The network function executes step 9.
  • the NF type of the service provider's network function can also be the NF type of the first service provider's network function or the NF type of the second service provider's network function
  • the NF Set identifier of the service provider's network function can also be the first service The NF Set identifier of the provider network function or the NF Set identifier of the second service provider network function.
  • Step 7 NRF checks whether the service consumer network function is authorized to access the requested service. After the check is successful, an access token is generated, that is, the NRF generates a first, or a second access token, or at least two third access tokens, or a fourth access token. See the description in Figure 5 for details.
  • Step 8 The NRF returns the generated access token to the service consumer network function, that is, returns the generated first or second access token, or at least two third access tokens, or the fourth access token. See the description in Figure 5 for details. This message corresponds to the first response message of S503 in FIG. 5 .
  • Step 9 The service consumer network function sends a message for the requested service (that is, a service request) to the second service provider network function, and the message includes the obtained first access token or the second access token or the obtained first access token. A third access token or a fourth access token. This message corresponds to the second request message in FIG. 5 .
  • Step 10 The second service provider network function verifies the received access token, and provides services for the service consumer network function after the verification is passed.
  • steps 1-3, 4-5, 6-8, and 9-10 are all independent processes and can be used independently.
  • FIG. 9 it is a schematic flowchart of a network function service authorization method in the indirect communication scenario in the embodiment of the present application. As shown in the figure, the process may include:
  • Step 1 The service consumer web function sends a message to the NRF requesting an access token.
  • the specific implementation of this step is basically the same as step 1 in FIG. 8 .
  • Step 2 The NRF checks if the service consumer network function has authorization to access the requested first service. After a successful check, the NRF generates a fifth access token.
  • the specific implementation of this step is basically the same as step 2 in FIG. 8 .
  • Step 3 NRF returns the generated fifth access token to the service consumer web function. Same as step 3 in Figure 8.
  • Step 4 The service consumer network function sends a message for requesting a service (ie, a service request) to the first service provider network function (ie, the initial service provider network function).
  • the request message is sent to the first service provider network function via the SCP.
  • the message includes a fifth access token.
  • Step 5 The first service provider network function returns a response message to the service consumer network function, which includes first information, and the first information includes the first indication and the second service provider network function (ie, the target service provider network function) information (such as URI and/or instance ID).
  • the first indication is used to indicate HTTP redirection, or other available service provider network functions, or service access authorization failure, or access token acquisition.
  • This response message is sent to the service consumer web function via the SCP.
  • Step 6 The service consumer network function sends a message for requesting an access token to the NRF according to the received first information, and the message carries the second information.
  • the specific implementation of this step is the same as step 6 in FIG. 8 .
  • Step 7 NRF checks whether the service consumer network function is authorized to access the requested service. After the check is successful, an access token is generated, that is, the NRF generates a first, or a second access token, or at least two third access tokens, or a fourth access token. See the description in Figure 5 for details.
  • Step 8 The NRF returns the generated access token to the service consumer network function, that is, returns the generated first or second access token, or at least two third access tokens, or the fourth access token. See the description in Figure 5 for details.
  • Step 9 The service consumer network function sends a message for the requested service (that is, a service request) to the second service provider network function, and the message includes the obtained first access token or the second access token or the obtained first access token. A third access token or a fourth access token. This message corresponds to the second request message in FIG. 5 . This message is sent to the second service provider network function via the SCP.
  • Step 10 The second service provider network function verifies the received access token, and provides services for the service consumer network function after the verification is passed.
  • steps 1-3, 4-5, 6-8, and 9-10 are all independent processes and can be used independently.
  • FIG. 10 it is a network function service authorization flow in an indirect communication scenario provided by another embodiment of the present application. As shown, the process can include:
  • a service communication proxy receives a first request message of a service consumer network function, where the first request message includes a first access token. The first request message is used to request access to the first service.
  • the first access token carried in the service request is obtained by the service consumer from the NRF, see the flow shown in FIG. 4 .
  • the first token also includes the instance identifier of the service consumer network function, the name of the requested service, the instance identifier of the NRF, and the like.
  • the requested service is the first service.
  • the first access token may be an access token (NF type), that is, the first access token includes the NF type of the requested service provider network function, or the first access token is an access token (NF instance), that is The first access token includes the instance identifier of the requested service provider network function (such as the instance identifier of the first service provider network function).
  • the service provider network function requested here is a network function that provides the first service, such as the first service provider network function.
  • the SCP sends a second request message to the first service provider network function, where the second request message includes the first access token.
  • the second request message is used to request the first service.
  • the SCP receives a second response message from the network function of the first service provider, the second response message includes the information of the network function of the second service provider and an HTTP redirect status code, and the HTTP redirect status code uses Used to indicate service access authorization failures or HTTP redirects or to obtain access tokens or other service provider network functions available.
  • the first service provider network function receives the second request message, for some reason (for example, the first service provider network function is in the overload state or is about to enter the overload state, in order to alleviate the overload state or avoid entering the overload state), sending the second response message, which includes the HTTP redirection status code and the information of the second service provider network function (that is, the target service provider network function).
  • the first information includes the first indication and/or the instance identifier of the network function of the second service provider.
  • the first indication is used to indicate that HTTP redirection has occurred, or used to indicate that the access consumer network function acquires an access token, or service access authorization fails, or there are other available service provider network functions.
  • the information of the second service provider network function includes a URI or instance identification of the second service provider network function.
  • the SCP sending the first information to the service consumer network function includes sending the SCP to the service consumer network function a first response message, where the first response message includes the first information.
  • the first information is a message
  • the message is used to notify the service consumer network function that the service access authorization fails or HTTP redirects or obtains an access token or there are other service provider network functions available; the message may Optionally includes information about the network capabilities of the second service provider.
  • the SCP determines that the first condition is met. That is to say, the SCP sends the first information to the service consumer network function only if the first condition is met.
  • the first condition includes at least one of the following conditions:
  • the first access token does not include the instance identifier of the second service provider network function
  • the first access token cannot be used to authorize services accessing the second service provider's network functionality
  • the first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, the specific service provider network function including the first service provider network function Function;
  • the first access token does not include the network function type or network function set identifier of the service provider network function
  • the first access token includes the instance identifier of the first service provider network function.
  • the SCP sends a third request message to the second service provider network function, the third request message is a message for requesting a service, and the third request message includes the first access token.
  • the service consumer network function re-requests the NRF for obtaining an access token according to the first information.
  • the SCP sends the first information to the service consumer network function, and after the service consumer network function obtains the access token again, the consumer network function uses the obtained access token to the second service A provider network function requests a service.
  • the process may include the following steps:
  • the service consumer network function sends a fourth request message, the fourth request message is a message for requesting a service, and the fourth request message includes a reacquired access token; after receiving the fourth request message, the SCP sends The second service provider network function sends a fifth request message, the fifth message is a service request, and the fifth request message includes the received access token.
  • the second service provider network function verifies the received access token, and provides services for the service consumer network function after the verification is passed.
  • the service consumer network function uses the first access token to request a service from the first service provider network function
  • HTTP redirection occurs
  • the service communication agent can receive the request from After the second response message of the first service provider network function (which includes the information of the second service provider network function and the redirection status code), the first information is sent to the service consumer network function, so that the service consumer The network function requests to reacquire the access token, so that the service consumer network function can use the retrieved access token to request services from the second service provider network function (ie, the redirected target service provider network function).
  • FIG. 11 shows a schematic diagram of a signaling interaction process in an indirect communication scenario. As shown in the figure, the process may include the following steps:
  • Step 1 The service consumer web function sends a message to the NRF requesting an access token. See step 1 in Figure 9 for details.
  • Step 2 The NRF checks if the service consumer network function has authorization to access the requested first service. After a successful check, the NRF generates a first access token.
  • the first access token may be an access token (NF type) or an access token (NF instance). If in the message in step 1, the service consumer network function includes the NF type of the requested service provider network function, then the first access token is (NF type), that is, the first access token includes the requested service provider The NF type of the network function (such as the NF type of the first service provider network function); if in the message in step 1, the service consumer network function includes the instance identifier of the requested service provider network function, then the first access token is (NF instance), that is, the first access token includes the instance identifier of the requested service provider network function (such as the instance identifier of the first service provider network function).
  • the first token also includes the instance identifier of the service consumer network function, the name of the requested service, the instance identifier of the NRF, and the like.
  • Step 3 NRF returns the generated first access token to the service consumer web function.
  • Step 4 The service consumer network function sends a message for requesting a service (ie, a service request) to the first service provider network function (ie, the initial service provider network function), and the message includes the first access token.
  • the request message is sent to the first service provider network function via the SCP.
  • the service request message received by the SCP from the first service provider network function corresponds to the first request message in Figure 10; the service request message sent by the SCP to the service consumer network function corresponds to the first request message in Figure 10 Two request messages.
  • Step 5 The first service provider network function returns a response message to the SCP, which includes an HTTP redirection status code, such as HTTP 307 redirection or HTTP 308 redirection, and the second service provider network function (ie, the target service provider network function ) information (such as URI and/or instance ID).
  • HTTP redirection status code such as HTTP 307 redirection or HTTP 308 redirection
  • the second service provider network function ie, the target service provider network function
  • information such as URI and/or instance ID
  • Step 6 After receiving the response message sent by the first service provider network function and including the HTTP redirection status code and the information of the second service provider network function, the SCP determines whether the first condition is satisfied, and if it is satisfied , then proceed to step 7; if not satisfied, the SCP sends a message (not shown in the figure) for requesting a service to the second service provider network function, carrying the first access token.
  • the first condition includes at least one of the following:
  • the first access token does not include the instance identifier of the second service provider network function
  • the first access token cannot be used to authorize services accessing the second service provider's network functionality
  • the first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, the specific service provider network function including the first service provider network function Function;
  • the first access token does not include the network function type or network function set identifier of the service provider network function
  • the first access token includes the instance identifier of the first service provider network function.
  • the first condition it means that the first access token does not include the instance identifier of the second service provider network function, and/or, the first access token cannot be used to authorize access to the service of the second service provider network function , and/or, the first access token can only be used to access a specific service provider network function instance or can only be used to access services of the first service provider network function (the specific service provider network function includes the first service provider network function A service provider network function), and/or, the first access token does not include the network function type or network function set identifier of the service provider network function, and/or the first access token includes the first service provider The instance ID of the network function.
  • the SCP executes step 7, sending the first information to the service consumer network function.
  • the first condition is not satisfied, it means that the first access token includes the instance identifier of the second service provider network function, and/or, the first access token can be used to authorize access to the service of the second service provider network function, and /or, the first access token includes the network function type or network function set identifier of the service provider network function.
  • the SCP sends the service for the request to the second service provider network function, carrying the first access token.
  • Step 7 The SCP sends the first message to the CNF.
  • the first information includes the first indication and/or the instance identifier of the network function of the second service provider.
  • the first indication is used to indicate that HTTP redirection has occurred, or used to indicate that the access consumer network function obtains an access token, or service access authorization fails, or there are other available service provider network functions.
  • the information of the second service provider network function includes a URI or instance identification of the second service provider network function.
  • the SCP sending the first information to the service consumer network function includes sending the SCP to the service consumer network function a first response message, where the first response message includes the first information.
  • the first information is a message, and the message is used to notify the service consumer network function that the service access authorization fails or HTTP redirects or obtains an access token or has other available service provider network functions; in the message Optionally includes information of the second service provider network function, including the second service provider network function URI and/or instance identifier.
  • Step 8 After receiving the first information from the SCP, the service consumer network function sends a message for requesting an access token to the NRF.
  • the message may include second information, for details, refer to the second information in the process shown in FIG. 5 .
  • Step 9 The NRF checks whether the service consumer network function has authorization to access the requested service. After a successful check, the NRF generates an access token, including a second access token, a third access token, a plurality of fourth access tokens, or a fifth access token. See the description in step 10 for the second access token, the third access token, multiple fourth access tokens or the fifth access token.
  • Step 10 NRF returns the generated access token to the service consumer network function, that is, returns the generated second access token, third access token, multiple fourth access tokens or fifth access tokens.
  • the generated access token includes the second information.
  • the second access token includes the NF type of the service provider network function, and/or the NF set identifier of the service provider network function.
  • the service provider network function here is the service provider network function providing the first service, the first service provider network function, or the second service provider network function.
  • the third access token includes instance identifications of the plurality of service provider network functions. It should be noted that each instance identifier included in the third access token is an instance identifier in the second information. These providers can all provide the first service, that is, these service providers include the network function of the second service provider.
  • Each fourth access token respectively includes an instance identifier of a service provider network function that can provide the first service.
  • the fourth access token includes the second information. It can be understood that the instance identifiers of the service provider network functions in each fourth access token are among the instance identifiers of multiple service provider network functions in the second information. one of.
  • the fifth access token includes the instance identifier of the second service provider network function.
  • the fifth access token includes the second information. It can be understood that the second information includes the instance identifier of the second service provider network function, and the instance identifier in the fifth access token is the instance identifier of the second service provider network function.
  • Step 11 The service consumer network function sends a message for requesting a service (ie a service request) to the SCP, which includes the second access token, the third access token, the fourth access token or the fifth access token.
  • the SCP sends a message requesting the service to the second service provider network function (i.e. the target service provider network function), which includes the second access token, third access token, fourth access token or fifth access token .
  • the service request message received by the SCP from the consumer network function corresponds to the fourth request message in the process shown in Figure 10;
  • the service request message sent by the SCP to the second service provider network function corresponds to the fourth request message in Figure 10.
  • Step 12 The second service provider network function verifies the received access token, and provides services for the service consumer network function after the verification is passed.
  • the first access token can be used for the service consumer network function to access the first service provider network function (that is, the initial service provider network function) and A service-time authorization check of the second service provider network function (ie the target service provider network function).
  • the process may include the following steps:
  • the Network Repository Function receives a first request message from a service consumer network function, where the first request message is used to request to acquire an access token.
  • the first request message includes the service name of the first service requested by the service consumer network function, and the network function type or instance identifier of the requested service provider network function;
  • the first request message may further include first information, and the first information is used to indicate that the service consumer network function supports HTTP redirection, or use For indicating that the service consumer network function requests that the first service support HTTP redirection, or for indicating that the service consumer network function requests that the service provider network function supports HTTP redirection, or for indicating that the first service supports HTTP redirection The redirection, or service provider network function used to indicate the request supports HTTP redirection.
  • the web repository function After receiving the first request message, the web repository function determines whether the first condition is satisfied, and if so, generates a first access token, or a second access token, or a plurality of third access tokens.
  • the first condition is met if the web repository function receives the first information from the service consumer web function.
  • the first condition is met if the local configuration of the web repository function indicates that the first service or the requested service provider web function supports HTTP redirection.
  • the first condition is met.
  • the first condition is satisfied if the service consumer web function communicates with the service provider web function using SCP.
  • the first access token includes the network function type of the requested service provider network function, or the network function set identifier of the requested service provider network function; or the requested service provider network function.
  • the second access token includes instance identifiers of multiple service provider network functions, where the service provider network function can provide the first service. It should be understood that the service provider network function that can provide the first service includes the first service provider network function and the second service provider network function, so the second access token includes the first service provider network function The instance identifier and the second service provider network function instance identifier.
  • the third access token includes an instance identifier of a service provider network function, where the service provider network function can provide the first service. It should be understood that since both the first service provider network function and the second service provider network function can provide the first service, one of the third tokens includes the instance identifier of the first service provider network function, and one third The token includes the instance identifier of the network function of the second service provider,
  • the NRF before the NRF generates access to the first access token, the second access token or multiple third access tokens, it also needs to check whether the service consumer network function has a service authorized to access the request. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
  • the NRF if the first condition is not satisfied, the NRF generates a fourth access token, for example, the fourth access token carries the instance identifier of the requested service provider network function.
  • the NRF before the NRF generates the fourth access token, it also needs to check whether the service consumer network function is authorized to access the requested service. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
  • the network warehouse function sends a first response message to the service consumer network function, and the first response message may include the first access token, or the second service token, or multiple third access tokens .
  • the service consumer network function After the service consumer network function obtains the first access token, or the second service token or multiple third access tokens, it can send a service request to the first service provider network function (that is, the initial service function) to request the first A service provider network function performs the requested service.
  • the first service provider network function is the service provider network function requested by the service consumer network function.
  • the first service provider network function may perform HTTP redirection, that is, send the HTTP redirection status code and the information of the second service provider network function (ie, the target service provider network function) to the service consumer network function.
  • the first access token, or the second access token, or a plurality of third access tokens obtained by the service consumer network function can be used for the service consumer network function to access the second service provider network function.
  • the first service is authorized so that the service consumer web function can invoke the service of the second service provider web function. In this way, even if HTTP redirection occurs, the service consumer web function can obtain services from the target service provider web function.
  • FIG. 13 is a schematic flow diagram in a direct communication scenario based on the flow shown in FIG. 12. As shown in the figure, the flow may include:
  • Step 1 The service consumer network function sends a message for requesting an access token to the NRF (that is, the first request message), which includes the service name of the requested first service, the instance identifier of the service consumer network function, and The NF type or instance identifier of the requested service provider network function.
  • the NRF that is, the first request message
  • the first request message may further include first information, and the first information is used to indicate that the service consumer network function supports HTTP redirection, or use For indicating that the service consumer network function requests that the first service support HTTP redirection, or for indicating that the service consumer network function requests that the service provider network function supports HTTP redirection, or for indicating that the first service supports HTTP redirection The redirection, or service provider network function used to indicate the request supports HTTP redirection.
  • Step 2 After the NRF receives the first request message, the NRF determines whether the first condition is met, and if so, generates a first access token, or a second access token, or a plurality of third access tokens.
  • the first condition is met if the web repository function receives the first information from the service consumer web function.
  • the first condition is met if the local configuration of the web repository function indicates that the first service or the requested service provider web function supports HTTP redirection.
  • the features supported by the first service or the requested service provider network function include HTTP redirection, the first condition is met.
  • the first access token includes the network function type of the requested service provider network function, or the network function set identifier of the requested service provider network function; or the requested service provider network function The network function type and network function set identifier.
  • the second access token includes instance identifiers of multiple service provider network functions, where the service provider network function can provide the first service. It should be understood that the service provider network function that can provide the first service includes the first service provider network function and the second service provider network function, so the second access token includes the first service provider network function The instance identifier and the second service provider network function instance identifier.
  • the third access token includes an instance identifier of a service provider network function, where the service provider network function can provide the first service. It should be understood that since both the first service provider network function and the second service provider network function can provide the first service, one of the third tokens includes the instance identifier of the first service provider network function, and one third The token includes the instance identifier of the network function of the second service provider.
  • the NRF before the NRF generates access to the first access token, or the second access token, or multiple third access tokens, it also needs to check whether the service consumer network function has a service authorized to access the request. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
  • the NRF if the first condition is not satisfied, the NRF generates a fourth access token, for example, the fourth access token carries the instance identifier of the requested service provider network function.
  • the NRF before the NRF generates the fourth access token, it also needs to check whether the service consumer network function is authorized to access the requested service. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
  • Step 3 The network warehouse function sends a first response message to the service consumer network function, and the first response message may include a first access token, or a second service token, or a plurality of third access tokens.
  • Step 4 The service consumer network function sends a message for requesting a service (ie, a service request message) to the first service provider network function (ie, the initial service provider network function), and the message includes the first access token , or the second service token or the third access token.
  • a service ie, a service request message
  • the first service provider network function ie, the initial service provider network function
  • the service consumer network function may include the multiple third access tokens or the included third access tokens in the service request message.
  • the access token includes an instance identifier of the first service provider network function.
  • Step 5 The first service provider network function may send a response message carrying the HTTP redirection status code and the information of the second service provider network function to the service consumer network function, the HTTP redirection code may be "307 temporary redirect " or "308 permanent redirect”.
  • Step 6 After receiving the message in step 4, the service consumer network function sends a service request message to the second service provider network function according to the HTTP redirect status code and the information of the second service provider network function, including step 3 The first access token, or the second service token, or a plurality of third access tokens obtained in
  • the service consumer network function when the service consumer network function obtains multiple third access tokens, the service consumer network function may include the multiple third access tokens in the service request message, or A third access token is included, and the third access token includes the instance identifier of the network function of the first service provider.
  • Step 7 The second service provider network function verifies the received access token, and if the verification is successful, executes the first service requested by the service consumer network function.
  • the second service provider network function when the second service provider network function receives a second access token containing multiple instance identifiers of the service provider network function, the second service provider network function checks whether the second access token includes the The instance identifier of the second service provider network function, if not included, the verification of the access token fails, the second service provider network function does not execute the first service requested by the service consumer network function, and returns a response with the cause of the error information.
  • steps 1-3 namely, the process of obtaining an access token
  • steps 4-7 namely, the process of service access
  • FIG. 14 is a schematic diagram of signaling interaction in an indirect communication scenario based on the process shown in FIG. 12. As shown in the figure, the process may include:
  • Step 1 The service consumer network function sends a message (namely the first request message) for requesting an access token to the NRF, see step 1 in Figure 13 for details, and will not be repeated here.
  • Step 2 After receiving the first request message, the network warehouse function determines whether the first condition is met, and if so, generates a first access token, or a second access token, or a plurality of third access tokens.
  • the first condition is met if the web repository function receives the first information from the service consumer web function.
  • the first condition is met if the local configuration of the web repository function indicates that the first service or the requested service provider web function supports HTTP redirection.
  • the first condition is met.
  • the first condition is satisfied if the service consumer web function communicates with the service provider web function using SCP.
  • the first access token includes the network function type of the requested service provider network function, or the network function set identifier of the requested service provider network function; or the requested service provider network function The network function type and network function set identifier.
  • the second access token includes instance identifiers of multiple service provider network functions, where the service provider network function can provide the first service. It should be understood that the service provider network function that can provide the first service includes the first service provider network function and the second service provider network function, so the second access token includes the first service provider network function The instance identifier and the second service provider network function instance identifier.
  • the third access token includes an instance identifier of a service provider network function, where the service provider network function can provide the first service. It should be understood that since both the first service provider network function and the second service provider network function can provide the first service, one of the third tokens includes the instance identifier of the first service provider network function, and one third The token includes the instance identifier of the network function of the second service provider.
  • the NRF before the NRF generates access to the first access token, the second access token or multiple third access tokens, it also needs to check whether the service consumer network function has a service authorized to access the request. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
  • the NRF if the first condition is not satisfied, the NRF generates a fourth access token, for example, the fourth access token carries the instance identifier of the requested service provider network function.
  • the NRF before the NRF generates the fourth access token, it also needs to check whether the service consumer network function is authorized to access the requested service. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
  • Step 3 The NRF sends a response message to the service consumer network function, and the message carries the first access token, or the second access token, or multiple third access tokens generated by the NRF. See step 3 in Figure 12 for details.
  • Step 4 The service consumer network function sends a message for requesting a service to the SCP, including the received first access token, or the second access token, or multiple third access tokens.
  • the SCP sends a message requesting the service to the first service consumer web function, including the access token received from the service consumer web function.
  • the service consumer network function when the service consumer network function obtains multiple third access tokens, the service consumer network function may include the multiple third access tokens in the service request message, or A third access token is included, and the third access token includes the instance identifier of the network function of the first service provider.
  • Step 5 The first service provider network function sends a response message to the service consumer network function, and the response message is sent to the service consumer network function via the SCP.
  • the response message carries the HTTP redirection status code and information about the network function of the second service provider (such as URI and/or instance identifier).
  • Step 6 The service request message sent by the service consumer network function to the second service provider network function is sent to the second service consumer network function via the SCP.
  • the message includes the first access token, or the second access token, or a plurality of third access tokens.
  • the service consumer network function when the service consumer network function obtains multiple third access tokens, the service consumer network function may include the multiple third access tokens in the service request message, or A third access token is included, and the third access token includes the instance identifier of the network function of the second service provider.
  • Step 7 The second service provider network function verifies the received access token, and if the verification is successful, executes the first service requested by the service consumer network function.
  • the SCP after receiving the redirection HTTP redirection status code sent by the network function of the first service provider and the information of the network function of the second service provider, the SCP directly sends a message to the network function of the second service provider. Send a message for the request, carrying the access token received in receive step 4.
  • steps 1-3 namely, the process of obtaining an access token
  • steps 4-7 namely, the process of service access
  • the embodiment of the present application also provides a service consumer network function, as shown in FIG. 15 , the service consumer network function 1500 may include a transceiver unit 1501 and a processing unit 1502 .
  • the transceiver unit 1501 is used for the service consumer network function 1500 to receive information (message or data) or send information (message or data)
  • the processing unit 1502 is used for controlling and managing the actions of the service consumer network function 1500 .
  • the processing unit 1502 may also control the steps performed by the transceiver unit 1501 .
  • the network function 1500 may be used to realize the function of the service consumer network function in the embodiment shown in FIG. 5 . Specifically can include:
  • the transceiver unit 1501 is configured to send a first request message to the network warehouse function according to the first information, the first request message includes the second information and the service name of the first service, and the first request message is used to request access to a token, the access token is used for an authorization check when the service consumer web function accesses the first service; and, receiving a first response message from the web repository function.
  • the first information is used to indicate that at least one of the service consumer network function, the first service, and the service provider network function that provides the first service supports HTTP replay.
  • the first information includes a first indication and/or an instance identifier of a second service provider network function, and the first indication is used to indicate service access authorization failure or HTTP redirection or obtaining an access token or There are other service provider network functions available, the second service provider network function being the target service provider network function of the HTTP redirect; or.
  • the first information includes instance identifiers of multiple service provider network functions; or, the first information is used to instruct the service consumer network function to use a service communication proxy to communicate with the service provider network function.
  • the transceiving unit 1501 is further configured to: receive the first information before sending the first request message to the network warehouse function according to the first information.
  • the transceiving unit 1501 is specifically configured to: receive the first information sent from the network warehouse function or the service communication agent or the network function of the first service provider.
  • the second information includes: the network function type of the service provider network function requested by the service consumer network function; or the service provider network function requested by the service consumer network function or the instance identifier of the second service provider network function, where the second service provider network function is the target service provider network function of HTTP redirection; or multiple services in the first information The instance ID of the provider web function.
  • the response message includes any of the following:
  • a first access token where the first access token includes a network function type of the service provider network function, and/or a network function set identifier of the service provider network function;
  • a second access token comprising instance identifications of a plurality of service provider network functions
  • a plurality of third access tokens each of which includes an instance identifier of a service provider network function
  • a fourth access token where the fourth access token includes an instance identifier of a second service provider network function, and the second service provider network function is a target service provider network function for HTTP redirection.
  • the transceiver unit 1501 is further configured to: after receiving the first response message from the network warehouse function, send a second request to the first service provider network function or the second service provider network function or the service communication agent message, the second request message is used to request a service, and the second request message includes the first access token or the second access token or the third access token or the fourth access token token.
  • the transceiver unit 1501 is further configured to: send a third request message to the first service provider network function or service communication agent before sending the first request message to the network warehouse function according to the first information,
  • the third service request message is used to request the first service.
  • the transceiver unit 1501 is further configured to: send a fourth request message to the network warehouse function before sending the first request message to the network warehouse function according to the first information, and the fourth request message includes the service name of the first service, and the fourth request message is used to request to discover the first service or to discover a network function instance that can provide the first service.
  • the service communication agent 1600 may include a transceiver unit 1601 and a processing unit 1602 .
  • the transceiver unit 1601 is used for the service communication agent 1600 to receive information (message or data) or send information (message or data), and the processing unit 1602 is used to control and manage the actions of the service communication agent 1600 .
  • the processing unit 1602 can also control the steps performed by the transceiver unit 1601 .
  • the service communication agent 1600 may be used to realize the function of the service communication agent in the embodiment shown in FIG. 10 . Specifically can include:
  • the transceiver unit 1601 is configured to receive a first request message from a service consumer network function, the first request message includes a first access token; send a second request message to the first service provider network function, and the second request message including the first access token; receiving a second response message from the first service provider network function, the second response message including information of the second service provider network function and a redirection status code, the The redirection status code is used to indicate service access authorization failure or HTTP redirection or obtaining an access token or other available service provider network functions; and, sending a first response message to the service consumer network function, the The first response message is used for the consumer network function to request to obtain a second access token.
  • the first response message includes first information, where the first information includes the first indication and/or the instance identifier of the network function of the second service provider.
  • the first indication is used to indicate that HTTP redirection has occurred, or used to indicate that the access consumer network function obtains an access token, or service access authorization fails, or there are other available service provider network functions.
  • the processing unit 1602 is further configured to: before sending the first response message to the service consumer network function, determine that a first condition is satisfied; where the first condition includes at least one of the following conditions:
  • the first access token does not include the instance identifier of the second service provider network function
  • said first access token cannot be used to authorize services accessing said second service provider network functionality
  • the first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, and the specific service provider network function includes the first Service Provider Network Functions;
  • the first access token does not include the network function type or network function set identifier of the service provider network function
  • the first access token includes the instance identifier of the first service provider network function.
  • the transceiver unit 1601 is further configured to: if the first condition is not met, send a third request message to the second service provider network function, the third request message includes the first access token.
  • the transceiver unit 1601 is further configured to: receive a fourth request message sent by the service consumer network function after sending the first response message to the service consumer network function, the fourth request message includes the the second access token; and, sending a fifth request message to the second service provider network function, the fifth request message including the second access token.
  • the second access token includes the instance identifier of the second service provider network function, or the network function type of the service provider network function, or the network function set identifier of the service provider network function.
  • the embodiment of the present application also provides a network warehouse function, as shown in FIG. 17 , the network warehouse function 1700 may include a transceiver unit 1701 and a processing unit 1702 .
  • the transceiver unit 1701 is used for the network warehouse function 1700 to receive information (message or data) or send information (message or data)
  • the processing unit 1702 is used for controlling and managing the actions of the network warehouse function 1700 .
  • the processing unit 1702 can also control the steps performed by the transceiver unit 1701 .
  • the network warehouse function 1700 can be used to implement the functions of the network warehouse function in the embodiment shown in FIG. 12 . Specifically can include:
  • the transceiver unit 1701 is configured to receive a first request message from the service consumer network function, the first request message is used to request to obtain an access token, and the first request message includes the first request message requested by the service consumer network function The service name of a service, and the network function type or instance identifier of the requested service provider network function; the processing unit 1702 is used to determine that the first condition is met, then generate the first access token, or the second access token or multiple The third access token; the transceiver unit 1701 is further configured to: send a first response message to the service consumer network function, the first response message includes the first access token or the second access token card or the plurality of third access tokens.
  • the processing unit 1702 is specifically configured to: receive the first information from the service consumer network function, then determine that the first condition is met; or, the local configuration of the network warehouse function indicates that the The first service or the requested service provider network function supports HTTP redirection, then it is determined that the first condition is satisfied; or, the network function file of the first service or the requested service provider network function indicates that the If the feature supported by the network function of the first service or the requested service provider includes HTTP redirection, it is determined that the first condition is met.
  • the first access token includes a network function type of the requested service provider network function, and/or a network function set identifier of the requested service provider network function;
  • the second access token includes instance identifiers of a plurality of service provider network functions; wherein the service provider network function can provide the first service;
  • the third access token includes an instance identifier of a service provider network function that can provide the first service.
  • the first request message includes first information, and the first information is used to indicate that the service consumer network function supports HTTP redirection, or to indicate that the service consumer network function
  • the function requests that the first service supports HTTP redirection, or is used to indicate that the service consumer network function requests the service provider network function to support HTTP redirection, or is used to indicate that the first service supports HTTP redirection, or is used to indicate The requested service provider web function supports HTTP redirection.
  • the processing unit 1702 is further configured to: before generating the first access token, the second access token, or multiple third access tokens, further include: checking the service consumer network function Authorization for service access was successful.
  • each functional unit in the embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
  • a communication device 1800 may include a transceiver 1801 and a processor 1802 .
  • the communication device 1800 may further include a memory 1803 .
  • the memory 1803 can be set inside the communication device 1800 , and can also be set outside the communication device 1800 .
  • the processor 1802 may control the transceiver 1801 to receive and send information or data, and the like.
  • the processor 1802 may be a central processing unit (central processing unit, CPU), a network processor (network processor, NP) or a combination of CPU and NP.
  • the processor 1102 may further include a hardware chip.
  • the aforementioned hardware chip may be an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or a combination thereof.
  • the aforementioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
  • the transceiver 1801, the processor 1802 and the memory 1803 are connected to each other.
  • the transceiver 1801, the processor 1802 and the memory 1803 are connected to each other by a bus 1804;
  • the bus 1804 can be a peripheral component interconnection standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA ) bus, etc.
  • PCI peripheral component interconnection standard
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 18 , but it does not mean that there is only one bus or one type of bus.
  • the memory 1803 is used to store programs and the like.
  • the program may include program code including computer operation instructions.
  • the memory 1803 may include RAM, and may also include non-volatile memory (non-volatile memory), such as one or more disk memories.
  • the processor 1802 executes the application program stored in the memory 1803 to realize the above functions, thereby realizing the functions of the communication device 1800 .
  • the communication device 1800 can be used to implement the function of the service consumer network function in the embodiment shown in FIG. 5, or the function of the service communication agent in FIG. 10, or the function of the data warehouse function in FIG. 12, specifically Reference may be made to relevant descriptions in the corresponding processes, which will not be described in detail here.
  • this embodiment of the present application provides a communication system, which may include the service consumer network function and the service provider network function (including the first service consumer network function and/or the second (2) service consumer network function), network warehouse function, and further include communication service agent, etc.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a computer, the computer can realize the network function service authorization provided by the above-mentioned method embodiment Methods.
  • An embodiment of the present application further provides a computer program product, the computer program product is used to store a computer program, and when the computer program is executed by a computer, the computer can implement the method for network function service authorization provided by the above method embodiment.
  • the embodiment of the present application further provides a chip, including a processor, the processor is coupled with a memory, and is configured to call a program in the memory so that the chip implements the method for network function service authorization provided by the above method embodiment.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A network function service authorization method and apparatus, which are used for authorizing a service consumer network function to access a first service (i.e. a service that is requested by the consumer network function). The method comprises: a service consumer network function sending a first request message to a network repository function according to first information, wherein the first request message comprises second information and the service name of a first service, the first request message is used for requesting the acquisition of an access token, and the access token is used for checking authorization when the service consumer network function accesses the first service; and the service consumer network function receiving a first response message from the network repository function.

Description

一种网络功能服务授权方法及装置A network function service authorization method and device
相关申请的交叉引用Cross References to Related Applications
本申请要求在2021年08月09日提交中国专利局、申请号为202110909303.5、申请名称为“一种网络功能服务授权方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the China Patent Office on August 9, 2021 with the application number 202110909303.5 and the application name "A Method and Device for Authorizing Network Function Services", the entire contents of which are incorporated herein by reference. Applying.
技术领域technical field
本申请涉及通信技术领域,尤其涉及一种网络功能服务授权方法及装置。The present application relates to the field of communication technologies, and in particular to a method and device for network function service authorization.
背景技术Background technique
第五代通信系统提供了服务化架构。在服务化架构下,服务提供者网络功能提供服务,服务消费者网络功能访问服务提供者网络功能提供的服务。目前,标准协议中定义了服务消费者网络功能访问服务提供者网络功能提供的服务时的授权机制,以保证只有授权的服务消费者网络功能才能访问服务提供者网络功能提供的服务。The fifth generation communication system provides a service architecture. Under the service architecture, the service provider network function provides services, and the service consumer network function accesses the services provided by the service provider network function. At present, the standard protocol defines the authorization mechanism when the service consumer network function accesses the service provided by the service provider network function, so as to ensure that only the authorized service consumer network function can access the service provided by the service provider network function.
当服务提供者网络功能或服务提供者网络功能实例接收到来自服务消费者网络功能的服务请求后,由于某种原因(比如,该服务提供者网络功能或该服务提供者网络功能实例处于过载状态或者即将进入过载状态,为了缓解过载状态或避免进入过载状态),该服务提供者网络功能可以进行超文本传输协议(Hypertext Transfer Protocol,HTTP)重定向,即,将其他可用的服务提供者网络功能或其他可用的服务提供者网络功能实例(即目标服务提供者网络功能或目标服务提供者网络功能实例)通知给该服务消费者网络功能,使得该服务消费者网络功能可以访问该目标服务提供者网络功能或该目标服务提供者网络功能实例的服务。但由于该服务消费者网络功能可能尚未获得访问该目标服务提供者网络功能的服务的授权或该目标服务提供者网络功能实例的服务的授权,因此该服务消费者网络功能无法从该目标服务提供者网络功能或该目标服务提供者网络功能实例获得服务。When a service provider network function or a service provider network function instance receives a service request from a service consumer network function, due to some reason (for example, the service provider network function or the service provider network function instance is in an overloaded state Or about to enter the overload state, in order to alleviate the overload state or avoid entering the overload state), the service provider network function can perform Hypertext Transfer Protocol (Hypertext Transfer Protocol, HTTP) redirection, that is, other available service provider network functions or other available service provider network function instances (that is, target service provider network function or target service provider network function instance) to notify the service consumer network function, so that the service consumer network function can access the target service provider The network function or service of this target service provider network function instance. However, since the service consumer web function may not have been authorized to access the services of the target service provider web function or the services of the target service provider web function instance, the service consumer web function cannot be provided from the target service The provider web function or the target service provider web function instance obtains the service.
发明内容Contents of the invention
本申请实施例提供了一种网络功能服务授权方法及装置,用以实现对服务消费者网络功能访问第一服务(即该消费者网络功能所请求的服务)进行授权。Embodiments of the present application provide a network function service authorization method and device for authorizing a service consumer's network function to access a first service (that is, a service requested by the consumer's network function).
第一方面,提供一种网络功能服务授权方法,包括:服务消费者网络功能根据第一信息,向网络仓库功能发送第一请求消息,所述第一请求消息中包括第二信息和第一服务的服务名称,所述第一请求消息用于请求获取访问令牌,所述访问令牌用于所述服务消费者网络功能访问所述第一服务时的授权检查;所述服务消费者网络功能接收来自所述网络仓库功能的第一响应消息。According to the first aspect, a network function service authorization method is provided, including: the service consumer network function sends a first request message to the network warehouse function according to the first information, and the first request message includes the second information and the first service The service name of the service, the first request message is used to request to obtain an access token, and the access token is used for the authorization check when the service consumer network function accesses the first service; the service consumer network function A first response message is received from the web repository function.
其中,所述第一信息可用于表明所述服务消费者网络功能满足发送包含所述第二信息的第一请求消息以请求获取所述访问令牌的条件。所述第二信息可包括服务提供者网络功能的信息,比如第二信息为提供该第一服务的服务提供者网络功能的网络功能类型或网络功能集标识或第二服务提供者网络功能(即第二服务提供者网络功能)的实例标识。所述 第一服务为所述服务消费者网络功能所请求的服务。Wherein, the first information may be used to indicate that the service consumer network function satisfies the condition of sending the first request message including the second information to request to acquire the access token. The second information may include service provider network function information, for example, the second information is the network function type or network function set identifier of the service provider network function that provides the first service, or the second service provider network function (i.e. Instance ID of the second service provider network function). The first service is the service requested by the service consumer network function.
上述实现方式中,由于服务消费者网络功能发送的第一请求消息携带第一服务的服务名称和第二信息,该第一服务即为该服务消费者网络功能请求的服务,该第二信息为提供该第一服务的服务提供者网络功能的网络功能类型或网络功能集标识或目标服务提供者网络功能的实例标识,通过该第一请求消息,该服务消费者网络功能可获得访问令牌,该访问令牌包括第二信息,用于该服务消费者网络功能访问该第一服务(即所请求的服务)时的授权检查,该第一服务由该网络功能类型的服务提供者网络功能提供、或由该网络功能集的服务提供者网络功能提供、或由该目标服务提供者网络功能提供。这样,当发生重定向时(即该服务消费者网络功能需要向目标服务提供者网络功能(本文中,该目标服务提者网络功能也称为第二服务提供者网络功能)进行服务请求时),该服务消费者网络功能由于已经获得访问令牌,该访问令牌可用于访问该目标服务提供者网络功能提供的该第一服务时的授权检查,因此该目标服务提供者网络功能能够检查该第一访问令成功,然后为该服务消费者网络功能提供服务,从而在发生重定向时,可以保证服务消费者网络功能能够获得目标服务提供者网络功能提供的服务。In the above implementation, since the first request message sent by the service consumer network function carries the service name of the first service and the second information, the first service is the service requested by the service consumer network function, and the second information is The network function type or network function set identifier of the service provider network function that provides the first service, or the instance identifier of the target service provider network function, through the first request message, the service consumer network function can obtain an access token, The access token includes second information for an authorization check when the service consumer web function accesses the first service (i.e. the requested service) provided by the service provider web function of the web function type , or provided by the service provider network function of the network function set, or provided by the target service provider network function. In this way, when redirection occurs (that is, when the service consumer network function needs to make a service request to the target service provider network function (herein, the target service provider network function is also referred to as the second service provider network function)) , since the service consumer web function has obtained an access token that can be used for authorization checks when accessing the first service provided by the target service provider web function, the target service provider web function can check the The first access command is successful, and then services are provided for the service consumer network function, so that when redirection occurs, it can be ensured that the service consumer network function can obtain the service provided by the target service provider network function.
在一种可能的实现方式中,所述第一信息用于表示所述服务消费者网络功能支持超文本传输协议HTTP重定向特性,和/或所述第一服务支持HTTP重定向特性,和/或提供所述第一服务的服务提供者网络功能支持HTTP重定向特性;或者,所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识,所述第一指示用于指示服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;或者,所述第一信息包括多个服务提供者网络功能的实例标识;所述服务提供者网络功能可提供所述第一服务;或者,所述第一信息用于指示所述服务消费者网络功能使用服务通信代理与服务提供者网络功能进行通信。In a possible implementation manner, the first information is used to indicate that the service consumer network function supports the Hypertext Transfer Protocol HTTP redirection feature, and/or the first service supports the HTTP redirection feature, and/or Or the service provider network function that provides the first service supports the HTTP redirection feature; or, the first information includes the first indication and/or the instance identifier of the second service provider network function, and the first indication uses Indicates service access authorization failure or HTTP redirection or obtaining an access token or other service provider network functions available; or, the first information includes instance identifiers of multiple service provider network functions; the service provider The network function may provide the first service; or, the first information is used to instruct the service consumer network function to use a service communication agent to communicate with the service provider network function.
可选的,所述服务消费者网络功能根据第一信息,向网络仓库功能发送第一请求消息之前,还包括:所述服务消费者网络功能接收第一信息。Optionally, before the service consumer network function sends the first request message to the network warehouse function according to the first information, the method further includes: the service consumer network function receives the first information.
进一步的,所述服务消费者网络功能接收第一信息,包括:所述服务消费者网络功能接收来自于所述网络仓库功能或服务通信代理或第一服务提供者网络功能发送的所述第一信息。Further, the service consumer network function receiving the first information includes: the service consumer network function receiving the first message sent by the network warehouse function or the service communication agent or the first service provider network function. information.
其中,来自于第一服务提供者网络功能的第一信息可包括第一指示(用于指示HTTP重定向,或有其他可用的服务提供者网络功能,比如HTTP重定向状态码)以及第二服务提供者网络功能(即目标服务提供者功能)的信息。Among them, the first information from the first service provider network function may include the first indication (for indicating HTTP redirection, or there are other available service provider network functions, such as HTTP redirection status code) and the second service provider Information about the provider network function (i.e. the target service provider function).
其中,来自于服务通信代理的第一信息可包括:第一指示,进一步的还可包括第二服务提供者网络功能(即目标服务提供者网络功能)的信息。其中,第一指示可包括:用于指示HTTP重定向或有其他可用的服务提供者网络功能的信息,比如HTTP重定向状态码;或者,用于指示服务访问授权失败或发生HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能的信息(即服务通信代理根据来自于第一服务提供者网络功能的HTTP重定向指示生成的指示)。Wherein, the first information from the service communication agent may include: the first indication, and may further include information of the second service provider network function (that is, the target service provider network function). Among them, the first indication may include: information used to indicate HTTP redirection or other available service provider network functions, such as HTTP redirection status code; or, used to indicate service access authorization failure or HTTP redirection or acquisition An access token or other information about the available service provider network function (ie, the indication generated by the service communication agent based on the HTTP redirection indication from the first service provider network function).
在一种可能的实现方式中,所述第二信息包括:所述服务消费者网络功能请求的服务提供者网络功能的网络功能类型;或,所述服务消费者网络功能请求的服务提供者网络功能的网络功能集标识;或,第二服务提供者网络功能的实例标识;或,多个服务提供者网络功能的实例标识,所述服务提供者网络功能可提供所述第一服务。In a possible implementation manner, the second information includes: the network function type of the service provider network function requested by the service consumer network function; or, the service provider network requested by the service consumer network function The network function set identifier of the function; or, the instance identifier of the second service provider network function; or, the instance identifiers of multiple service provider network functions, and the service provider network function can provide the first service.
在一种可能的实现方式中,所述响应消息中包括以下任一项:第一访问令牌,所述第一访问令牌包括服务提供者网络功能的网络功能类型,和/或服务提供者网络功能的网络功能集标识;或者,第二访问令牌,所述第二访问令牌包括多个服务提供者网络功能的实例标识;或者,多个第三访问令牌,每个所述第三访问令牌分别包括一个服务提供者网络功能的实例标识;或者,第四访问令牌,所述第四访问令牌包括所述第二服务提供者网络功能的实例标识。In a possible implementation, the response message includes any of the following: a first access token, where the first access token includes the network function type of the service provider network function, and/or the service provider A network function set identifier of a network function; or a second access token, the second access token including instance identifiers of a plurality of service provider network functions; or a plurality of third access tokens, each of the first The three access tokens respectively include an instance identifier of a service provider network function; or, the fourth access token includes the instance identifier of the second service provider network function.
可选的,所述服务消费者网络功能接收来自所述网络仓库功能的第一响应消息之后,还包括:所述服务消费者网络功能向第一服务提供者网络功能或第二服务提供者网络功能或服务通信代理发送第二请求消息,所述第二请求消息用于请求服务,所述第二请求消息中包括所述第一访问令牌或所述第二访问令牌或所述第三访问令牌或所述第四访问令牌。Optionally, after the service consumer network function receives the first response message from the network warehouse function, the service consumer network function further includes: the service consumer network function sending the first service provider network function or the second service provider network The function or service communication agent sends a second request message, the second request message is used to request a service, and the second request message includes the first access token or the second access token or the third access token or the fourth access token.
在一种可能的实现方式中,所述服务消费者网络功能根据第一信息,向网络仓库功能发送第一请求消息之前,还包括:所述服务消费者网络功能向第一服务提供者网络功能或服务通信代理发送第三请求消息,所述第三服务请求消息用于请求所述第一服务。In a possible implementation manner, before the service consumer network function sends the first request message to the network warehouse function according to the first information, the service consumer network function further includes: the service consumer network function sending the first service provider network function Or the service communication agent sends a third request message, where the third service request message is used to request the first service.
在一种可能的实现方式中,所述服务消费者网络功能根据第一信息,向网络仓库功能发送第一请求消息之前,还包括:所述服务消费者网络功能向所述网络仓库功能发送第四请求消息,所述第四请求消息中包括所述第一服务的服务名称,所述第四请求消息用于请求发现所述第一服务或发现可提供所述第一服务的网络功能的实例。In a possible implementation manner, before the service consumer network function sends the first request message to the network warehouse function according to the first information, the service consumer network function further includes: the service consumer network function sends the first request message to the network warehouse function Four request messages, the fourth request message includes the service name of the first service, and the fourth request message is used to request to discover the first service or to discover an instance of a network function that can provide the first service .
第二方面,提供一种网络功能服务授权方法,包括:服务通信代理接收服务消费者网络功能的第一请求消息,所述第一请求消息包括第一访问令牌;所述服务通信代理向第一服务提供者网络功能发送第二请求消息,所述第二请求消息包括所述第一访问令牌;所述服务通信代理接收来自于所述第一服务提供者网络功能的第二响应消息,所述第二响应消息包括第二服务提供者网络功能的信息和重定向状态码,所述重定向状态码用于指示服务访问授权失败或超文本传输协议HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;所述服务通信代理向所述服务消费者网络功能发送第一响应消息,所述第一响应消息用于所述消费者网络功能请求获取第二访问令牌。In a second aspect, a network function service authorization method is provided, including: a service communication agent receives a first request message of a network function of a service consumer, and the first request message includes a first access token; the service communication agent sends a request to the second a service provider network function sending a second request message, the second request message including the first access token; the service communication agent receiving a second response message from the first service provider network function, The second response message includes information on the network function of the second service provider and a redirection status code, and the redirection status code is used to indicate that the service access authorization fails or the hypertext transfer protocol HTTP redirects or acquires an access token or has Other available service provider network functions; the service communication agent sends a first response message to the service consumer network function, and the first response message is used for the consumer network function to request to obtain a second access token.
上述实现方式中,在间接通信场景下,当服务消费者网络功能使用第一访问令牌向第一服务提供者网络功能请求服务时,发生了HTTP重定向,则服务通信代理可在接收到来自第一服务提供者网络功能的第二响应消息(其中包括第二服务提供者网络功能的信息和重定向状态码)后,向该服务消费者网络功能发送第一响应消息,以使该服务消费者网络功能请求获取第二访问令牌,该第二访问令牌可以用于该服务消费者网络功能访问所请求的服务时的授权检查,这样,该服务消费者网络功能可使用该第二访问令牌向第二服务提供者网络功能(即重定向到的目标服务提供者网络功能)请求服务。In the above implementation, in the indirect communication scenario, when the service consumer network function uses the first access token to request a service from the first service provider network function, HTTP redirection occurs, and the service communication agent can receive the request from After the second response message of the first service provider network function (which includes the information of the second service provider network function and the redirection status code), send the first response message to the service consumer network function, so that the service consumer The consumer web function requests a second access token, which can be used for authorization checks when the service consumer web function accesses the requested service, so that the service consumer web function can use the second access token The token requests services from the second service provider network function (ie, the target service provider network function to which it is redirected).
可选的,所述第一响应消息中包括第一信息,所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识;其中,所述第一指示用于指示发生了HTTP重定向,或用于指示所述访问消费者网络功能获取访问令牌,或服务访问授权失败,或有其他可用的服务提供者网络功能。Optionally, the first response message includes first information, and the first information includes a first indication and/or an instance identifier of a network function of the second service provider; wherein the first indication is used to indicate the occurrence of An HTTP redirection, or used to instruct the access consumer web function to obtain an access token, or the service access authorization failed, or there are other service provider web functions available.
在一种可能的实现方式中,所述服务通信代理向所述服务消费者网络功能发送第一响应消息之前,还包括:In a possible implementation manner, before the service communication agent sends the first response message to the service consumer network function, it further includes:
所述服务通信代理确定第一条件满足;其中,第一条件包括以下条件中的至少一个:The service communication agent determines that a first condition is satisfied; wherein the first condition includes at least one of the following conditions:
所述第一访问令牌中不包括所述第二服务提供者网络功能的实例标识;The first access token does not include the instance identifier of the second service provider network function;
所述第一访问令牌不能用于授权访问所述第二服务提供者网络功能的服务;said first access token cannot be used to authorize services accessing said second service provider network functionality;
所述第一访问令牌只能用于访问特定服务提供者网络功能实例或只能用于访问所述第一服务提供者网络功能的服务,所述特定服务提供者网络功能包括所述第一服务提供者网络功能;The first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, and the specific service provider network function includes the first Service Provider Network Functions;
所述第一访问令牌中不包括服务提供者网络功能的网络功能类型或网络功能集标识;The first access token does not include the network function type or network function set identifier of the service provider network function;
所述第一访问令牌中包括所述第一服务提供者网络功能的实例标识。The first access token includes the instance identifier of the first service provider network function.
进一步的,还包括:若所述第一条件不满足,则所述服务通信代理向所述第二服务提供者网络功能发送第三请求消息,所述第三请求消息中包括所述第一访问令牌。Further, it also includes: if the first condition is not satisfied, the service communication agent sends a third request message to the second service provider network function, and the third request message includes the first access token.
在一种可能的实现方式中,所述服务通信代理向所述服务消费者网络功能发送第一响应消息之后,还包括:所述服务通信代理接收所述服务消费者网络功能发送的第四请求消息,所述第四请求消息中包括所述第二访问令牌;所述服务通信代理向所述第二服务提供者网络功能发送第五请求消息,所述第五请求消息包括所述第二访问令牌。In a possible implementation manner, after the service communication agent sends the first response message to the service consumer network function, it further includes: the service communication agent receives a fourth request sent by the service consumer network function message, the fourth request message includes the second access token; the service communication agent sends a fifth request message to the second service provider network function, and the fifth request message includes the second access token.
在一种可能的实现方式中,所述第二访问令牌中包括所述第二服务提供者网络功能的实例标识、或服务提供者网络功能的网络功能类型、或服务提供者网络功能的网络功能集标识。In a possible implementation manner, the second access token includes the instance identifier of the second service provider network function, or the network function type of the service provider network function, or the network Feature set ID.
第三方面,提供一种网络功能服务授权方法,包括:网络仓库功能接收来自服务消费者网络功能的第一请求消息,所述第一请求消息用于请求获取访问令牌;所述第一请求消息中包括所述服务消费者网络功能请求的第一服务的服务名称,以及请求的服务提供者网络功能的网络功能类型或实例标识;所述网络仓库功能确定第一条件满足,则生成第一访问令牌、或第二访问令牌或多个第三访问令牌;所述网络仓库功能向所述服务消费者网络功能发送第一响应消息,所述第一响应消息中包括所述第一访问令牌、或所述第二访问令牌或所述多个第三访问令牌。In a third aspect, a network function service authorization method is provided, including: a network warehouse function receives a first request message from a service consumer network function, and the first request message is used to request an access token; the first request The message includes the service name of the first service requested by the service consumer network function, and the network function type or instance identifier of the requested service provider network function; the network warehouse function determines that the first condition is satisfied, and then generates the first an access token, or a second access token, or a plurality of third access tokens; the web repository function sends a first response message to the service consumer web function, the first response message including the first an access token, or the second access token, or the plurality of third access tokens.
在一种可能的实现方式中,所述网络仓库功能确定第一条件满足,包括:所述网络仓库功能接收来自所述服务消费者网络功能的第一信息,则确定第一条件满足;或者,所述网络仓库功能的本地配置指示所述第一服务或所述请求的服务提供者网络功能支持超文本传输协议HTTP重定向,则确定第一条件满足;或者,所述第一服务或所述请求的服务提供者网络功能的网络功能文件中指示所述第一服务或所述请求的服务提供者网络功能支持的特性包括HTTP重定向,则确定第一条件满足。In a possible implementation manner, the determining that the first condition is satisfied by the network warehouse function includes: the network warehouse function receives the first information from the service consumer network function, and then determines that the first condition is satisfied; or, The local configuration of the network warehouse function indicates that the first service or the requested service provider network function supports hypertext transfer protocol HTTP redirection, then it is determined that the first condition is satisfied; or, the first service or the If the network function file of the requested service provider network function indicates that the first service or the feature supported by the requested service provider network function includes HTTP redirection, then it is determined that the first condition is satisfied.
在一种可能的实现方式中:In one possible implementation:
所述第一访问令牌包括所述请求的服务提供者网络功能的网络功能类型,和/或所述请求的服务提供者网络功能的网络功能集标识;The first access token includes a network function type of the requested service provider network function, and/or a network function set identifier of the requested service provider network function;
所述第二访问令牌包括多个服务提供者网络功能的实例标识;其中服务提供者网络功能可提供所述第一服务;The second access token includes instance identifiers of a plurality of service provider network functions; wherein the service provider network function can provide the first service;
所述第三访问令牌包括一个服务提供者网络功能的实例标识,其中该服务提供者网络功能可提供第一服务。The third access token includes an instance identifier of a service provider network function that can provide the first service.
在一种可能的实现方式中,所述第一请求消息包括第一信息,所述第一信息用于指示所述服务消费者网络功能支持HTTP重定向、或用于指示所述服务消费者网络功能请求第一服务支持HTTP重定向、或用于指示所述服务消费者网络功能请求服务提供者网络功能支持HTTP重定向、或用于指示所述第一服务支持HTTP重定向、或用于指示所述请求的服务提供者网络功能支持HTTP重定向。In a possible implementation manner, the first request message includes first information, and the first information is used to indicate that the service consumer network function supports HTTP redirection, or to indicate that the service consumer network function The function requests that the first service supports HTTP redirection, or is used to indicate that the service consumer network function requests the service provider network function to support HTTP redirection, or is used to indicate that the first service supports HTTP redirection, or is used to indicate The requested service provider web function supports HTTP redirection.
在一种可能的实现方式中,所述网络仓库功能生成第一访问令牌、第二访问令牌、或多个第三访问令牌之前,还包括:所述网络仓库功能检查所述服务消费者网络功能的服务访问授权成功。In a possible implementation manner, before the network warehouse function generates the first access token, the second access token, or multiple third access tokens, it further includes: the network warehouse function checks the service consumption or the service access authorization of the network function is successful.
第四方面,提供一种通信设备,包括:一个或多个处理器;一个或多个存储器;其中,所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述通信设备执行如上述第一方面、第二方面和第三方面中任一项所述的方法。In a fourth aspect, a communication device is provided, including: one or more processors; one or more memories; wherein, the one or more memories store one or more computer programs, and the one or more computers The program includes instructions, and when the instructions are executed by the one or more processors, the communication device is made to execute the method described in any one of the first aspect, the second aspect, and the third aspect.
第五方面,提供一种计算机可读存储介质,所述计算机可读存储介质包括计算机程序,当计算机程序在计算设备上运行时,使得所述计算设备执行如上述第一方面、第二方面和第三方面中任一项所述的方法。In a fifth aspect, a computer-readable storage medium is provided, the computer-readable storage medium includes a computer program, and when the computer program is run on a computing device, the computing device is made to perform the above-mentioned first aspect, second aspect and The method of any one of the third aspects.
第六方面,提供一种芯片,所述芯片与存储器耦合,用于读取并执行所述存储器中存储的程序指令,以实现如上述第一方面、第二方面和第三方面中任一项所述的方法。In a sixth aspect, there is provided a chip, the chip is coupled with a memory, and is used to read and execute program instructions stored in the memory, so as to realize any one of the above-mentioned first aspect, second aspect and third aspect the method described.
第七方面,提供一种计算机程序产品,所述计算机程序产品在被计算机调用时,使得所述计算机执行如上述第一方面、第二方面和第三方面中任一项所述的方法。In a seventh aspect, a computer program product is provided. When the computer program product is invoked by a computer, the computer executes the method described in any one of the first aspect, the second aspect, and the third aspect.
以上第二方面到第七方面的有益效果,请参见第一方面的有益效果,不重复赘述。For the beneficial effects of the above second to seventh aspects, please refer to the beneficial effects of the first aspect, and will not be repeated.
附图说明Description of drawings
图1为本申请实施例适用的系统架构;FIG. 1 is a system architecture applicable to the embodiment of the present application;
图2为本申请实施例中服务提供者网络功能的注册流程示意图;FIG. 2 is a schematic diagram of the registration process of the service provider network function in the embodiment of the present application;
图3为本申请实施例中的服务发现流程示意图;FIG. 3 is a schematic diagram of a service discovery process in an embodiment of the present application;
图4为本申请实施例中的一种服务授权流程示意图;FIG. 4 is a schematic diagram of a service authorization flow in an embodiment of the present application;
图5为本申请实施例提供的一种网络功能服务授权流程示意图;FIG. 5 is a schematic diagram of a network function service authorization flow provided by an embodiment of the present application;
图6为基于图5所示的流程,在直接通信场景下的一种信令交互示意图;FIG. 6 is a schematic diagram of signaling interaction in a direct communication scenario based on the flow shown in FIG. 5;
图7为基于图5所示的流程,在间接通信场景下的一种信令交互示意图;FIG. 7 is a schematic diagram of signaling interaction in an indirect communication scenario based on the flow shown in FIG. 5;
图8为基于图5所示的流程,在直接通信场景下的另一种信令交互示意图;FIG. 8 is a schematic diagram of another signaling interaction in a direct communication scenario based on the flow shown in FIG. 5;
图9为基于图5所示的流程,在间接通信场景下的另一种信令交互示意图;FIG. 9 is a schematic diagram of another signaling interaction in an indirect communication scenario based on the flow shown in FIG. 5;
图10为本申请实施例提供的另一种网络功能服务授权流程示意图;FIG. 10 is a schematic diagram of another network function service authorization flow provided by the embodiment of the present application;
图11为基于图10所示的流程,在间接通信场景下的一种信令交互流程示意图;FIG. 11 is a schematic diagram of a signaling interaction process in an indirect communication scenario based on the process shown in FIG. 10;
图12为本申请实施例提供的另一种网络功能授权流程的示意图;FIG. 12 is a schematic diagram of another network function authorization process provided by the embodiment of the present application;
图13为基于图12所示的流程,在直接通信场景下的一种信令交互流程示意图;FIG. 13 is a schematic diagram of a signaling interaction process in a direct communication scenario based on the process shown in FIG. 12;
图14为基于图12所示的流程,在间接通信场景下的一种信令交互流程示意图;FIG. 14 is a schematic diagram of a signaling interaction process in an indirect communication scenario based on the process shown in FIG. 12;
图15为本申请实施例提供的一种服务消费者网络功能的结构示意图;FIG. 15 is a schematic structural diagram of a service consumer network function provided by an embodiment of the present application;
图16为本申请实施例提供的一种服务通信代理的结构示意图;FIG. 16 is a schematic structural diagram of a service communication agent provided by an embodiment of the present application;
图17为本申请实施例提供的一种网络仓库功能的结构示意图;FIG. 17 is a schematic structural diagram of a network warehouse function provided by an embodiment of the present application;
图18为本申请实施例提供的一种通信装置的结构示意图。FIG. 18 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请作进一步地详细描述。The application will be described in further detail below in conjunction with the accompanying drawings.
本申请实施例提供一种服务授权方法及装置,用以实现对服务消费者网络功能访问第 一服务(即该消费者网络功能所请求的服务)进行授权。其中,本申请所述方法和装置基于同一技术构思,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。The embodiment of the present application provides a service authorization method and device, which are used to authorize the service consumer's network function to access the first service (that is, the service requested by the consumer's network function). Wherein, the method and the device described in this application are based on the same technical concept. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition will not be repeated.
在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。需要说明的是,在本申请中不限定第一、第二等的出现顺序,例如可以先出现第五,再出现第三,本申请对此不作限定。In the description of the present application, terms such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order. It should be noted that the order of appearance of the first, second, etc. is not limited in the present application, for example, the fifth may appear first, and then the third, which is not limited in the present application.
在本申请的描述中,“至少一个(项)”是指一个(项)或者多个(项),多个(项)是指两个(项)或者两个(项)以上。In the description of this application, "at least one (item)" refers to one (item) or multiple (items), and multiple (items) refers to two (items) or more than two (items).
本申请实施例提供的服务授权的方法适用的一种可能的通信系统的架构,可以包括:无线接入网络、终端设备和核心网。例如,图1示出了通信系统的架构的一种可能的示例,通信系统的架构中,无线接入网络中可以包括接入网设备。核心网中可以包括:网络开放功能(network exposure function,NEF)网元、策略控制功能(policy control function,PCF)网元、统一数据管理功能(unified data management,UDM)网元、应用功能(application function,AF)网元、鉴权服务器功能(authentication server function,AUSF)网元、接入和移动性管理功能(access and mobility management function,AMF)网元、会话管理功能网元(session management function,SMF)网元、网络数据分析功能(network data analytic function,NWDAF)网元、网络存储功能(network repository function,NRF)网元、用户面功能(user plane function,UPF)网元,还可能包括网络切片选择功能(network slice selection function,NSSF)网元。其中,AMF网元与接入网设备之间可以通过N2接口相连,接入网设备与UPF之间可以通过N3接口相连,SMF与UPF之间可以通过N4接口相连,AMF网元与UE之间可以通过N1接口相连。接口名称只是一个示例说明,本申请实施例对此不作具体限定。应理解,本申请实施例并不限于图1所示通信系统,图1中所示的网元的名称在这里仅作为一种示例说明,并不作为对本申请的方法适用的通信系统架构中包括的网元的限定。下面对通信系统中的各个网元或设备的功能进行详细描述:A possible communication system architecture to which the service authorization method provided in the embodiment of the present application is applicable may include: a radio access network, a terminal device, and a core network. For example, FIG. 1 shows a possible example of a communication system architecture. In the communication system architecture, a radio access network may include an access network device. The core network may include: network exposure function (network exposure function, NEF) network element, policy control function (policy control function, PCF) network element, unified data management function (unified data management, UDM) network element, application function (application function, AF) network element, authentication server function (authentication server function, AUSF) network element, access and mobility management function (access and mobility management function, AMF) network element, session management function network element (session management function, SMF) network elements, network data analysis function (network data analytic function, NWDAF) network elements, network storage function (network repository function, NRF) network elements, user plane function (user plane function, UPF) network elements, may also include network Slice selection function (network slice selection function, NSSF) network element. Among them, the AMF network element and the access network device can be connected through the N2 interface, the access network device and the UPF can be connected through the N3 interface, the SMF and the UPF can be connected through the N4 interface, and the AMF network element and the UE can be connected through the N3 interface. It can be connected through the N1 interface. The name of the interface is just an example, which is not specifically limited in this embodiment of the present application. It should be understood that the embodiment of the present application is not limited to the communication system shown in FIG. 1, and the names of the network elements shown in FIG. The limit of network elements. The functions of each network element or device in the communication system are described in detail below:
终端设备,又可以称之为用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)等,是一种向用户提供语音和/或数据连通性的设备。例如,终端设备可以包括具有无线连接功能的手持式设备、车载设备等。目前,终端设备可以是:手机(mobile phone)、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(mobile internet device,MID)、可穿戴设备,虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial control)中的无线终端、无人驾驶(self-driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端,或智慧家庭(smart home)中的无线终端等。其中,图1中终端设备以UE示出,仅作为示例,并不对终端设备进行限定。Terminal equipment, also called user equipment (UE), mobile station (MS), mobile terminal (MT), etc., is a device that provides voice and/or data connectivity to users. equipment. For example, the terminal device may include a handheld device with a wireless connection function, a vehicle-mounted device, and the like. At present, the terminal equipment can be: mobile phone (mobile phone), tablet computer, notebook computer, palmtop computer, mobile Internet device (mobile internet device, MID), wearable device, virtual reality (virtual reality, VR) equipment, augmented reality ( augmented reality (AR) equipment, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, and smart grids wireless terminals in transportation safety (transportation safety), wireless terminals in smart city (smart city), or wireless terminals in smart home (smart home), etc. Wherein, the terminal device in FIG. 1 is shown as a UE, which is only used as an example, and does not limit the terminal device.
(R)AN设备:为终端设备提供接入的设备,包含无线接入网(radio access network,AN)设备和接入网(access network,AN)设备。RAN设备主要是3GPP网络无线网络设备,AN可以是non-3GPP定义的接入网设备。RAN设备:主要负责空口侧的无线资源管理、服务质量(quality of service,QoS)管理、数据压缩和加密等功能。所述接入网设备可以包括各种形式的基站,例如:宏基站,微基站(也称为小站),中继站,接入点等。在采用不同的无线接入技术的系统中,具备基站功能的设备的名称可能会有所不同,例如, 在5G系统中,称为RAN或者gNB(5G NodeB)等。(R) AN equipment: equipment that provides access for terminal equipment, including radio access network (radio access network, AN) equipment and access network (access network, AN) equipment. The RAN device is mainly a 3GPP network wireless network device, and the AN may be an access network device defined by non-3GPP. RAN equipment: mainly responsible for radio resource management, quality of service (QoS) management, data compression and encryption on the air interface side. The access network equipment may include base stations in various forms, for example: macro base stations, micro base stations (also called small stations), relay stations, access points, and the like. In systems using different radio access technologies, the names of devices with base station functions may be different, for example, in a 5G system, it is called RAN or gNB (5G NodeB), etc.
接入和移动性管理功能网元(AMF):可用于对终端设备的接入控制和移动性进行管理,在实际应用中,其包括了长期演进(long term evolution,LTE)中网络框架中移动管理实体(mobility management entity,MME)里的移动性管理功能,并加入了接入管理功能,具体可以负责终端设备的注册、移动性管理、跟踪区更新流程、可达性检测、会话管理功能网元的选择、移动状态转换管理等。例如,在5G中,接入和移动性管理功能网元可以是AMF网元,例如图1所示;在未来通信,如6G中,接入和移动性管理功能网元仍可以是AMF网元,或有其它的名称,本申请不做限定。当接入和移动性管理功能网元是AMF网元时,AMF可以提供Namf服务。Access and mobility management function element (AMF): It can be used to manage the access control and mobility of terminal equipment. In practical applications, it includes mobility management in the network framework of long term evolution (LTE) The mobility management function in the entity (mobility management entity, MME) has added the access management function, which can be responsible for the registration of terminal equipment, mobility management, tracking area update process, reachability detection, and session management function network elements selection, mobile state transition management, etc. For example, in 5G, the access and mobility management function network element can be an AMF network element, as shown in Figure 1; in future communications, such as 6G, the access and mobility management function network element can still be an AMF network element , or have other names, which are not limited in this application. When the access and mobility management functional network element is an AMF network element, the AMF can provide the Namf service.
会话管理功能网元(SMF):可用于负责终端设备的会话管理(包括会话的建立、修改和释放),用户面功能网元的选择和重选、终端设备的互联网协议(internet protocol,IP)地址分配、服务质量(quality of service,QoS)控制等。例如,在5G中,会话管理功能网元可以是SMF网元,例如图1所示;在未来通信,如6G中,会话管理功能网元仍可以是SMF网元,或有其它的名称,本申请不做限定。当会话管理功能网元时SMF网元时,SMF可以提供Nsmf服务。Session management function network element (SMF): It can be used for session management of terminal equipment (including session establishment, modification and release), selection and reselection of user plane function network elements, and Internet protocol (internet protocol, IP) of terminal equipment Address allocation, quality of service (QoS) control, etc. For example, in 5G, the network element with the session management function can be an SMF network element, as shown in Figure 1; in future communication, such as in 6G, the network element with the session management function can still be an SMF network element, or have other names. Applications are not limited. When the network element with the session management function is the SMF network element, the SMF can provide the Nsmf service.
网络数据分析网元(NWDAF):可用于进行大数据分析。例如获取数据,对数据进行分析,并将分析的结果提供给其他网元或者应用功能等使用。其中,NWDAF实现对数据的分析时,NWDAF具备的功能还可以包括:训练模型,并根据训练的模型进行推理等功能。具体的,NWDAF的功能可分解到多个独立的实例,这些实例独立存在;或者,一个NWDAF实例提供某些功能。比如一个NWDAF实例提供的功能为:模型训练以及向其他NWAF实施例提供模型;又比如一个NWDAF实施例可能不提供模型训练功能,而是从其他NWDAF实例中获取模型,然后基于获取的模型进行数据分析。例如,在5G中,网络数据分析网元可以是NWDAF网元,例如图1所示;在未来通信,如6G中,数据分析网元仍可以是NWDAF网元,或有其它的名称,本申请不做限定。当网络数据分析网元是NWDAF网元时,NWDAF网元可以提供Nnwdaf服务。Network Data Analysis Element (NWDAF): Can be used for big data analysis. For example, acquire data, analyze the data, and provide the analysis results to other network elements or application functions. Wherein, when NWDAF implements data analysis, the functions of NWDAF may also include: training models, and performing inferences based on the trained models. Specifically, the functions of the NWDAF can be decomposed into multiple independent instances, and these instances exist independently; or, one NWDAF instance provides certain functions. For example, the functions provided by an NWDAF instance are: model training and providing models to other NWAF embodiments; for another example, an NWDAF embodiment may not provide model training functions, but obtain models from other NWDAF instances, and then perform data processing based on the obtained models. analyze. For example, in 5G, the network data analysis network element can be a NWDAF network element, such as shown in Figure 1; in future communications, such as 6G, the data analysis network element can still be a NWDAF network element, or have other names, this application No limit. When the network data analysis network element is an NWDAF network element, the NWDAF network element can provide the Nnwdaf service.
用户面功能网元(UPF):负责终端设备中用户数据的转发和接收。可以从数据网络接收用户数据,通过接入网设备传输给终端设备;UPF网元还可以通过接入网设备从终端设备接收用户数据,转发到数据网络。UPF网元中为终端设备提供服务的传输资源和调度功能由SMF网元管理控制的。例如,在5G系统中,用户面功能网元可以是UPF网元,例如图1所示;在未来通信,如6G中,用户面功能网元仍可以是UPF网元,或有其它的名称,本申请不做限定。User plane function network element (UPF): responsible for forwarding and receiving user data in terminal equipment. It can receive user data from the data network and transmit it to the terminal device through the access network device; the UPF network element can also receive user data from the terminal device through the access network device and forward it to the data network. The transmission resources and scheduling functions that provide services for terminal equipment in the UPF network element are managed and controlled by the SMF network element. For example, in a 5G system, the user plane functional network element can be a UPF network element, such as shown in Figure 1; in future communications, such as 6G, the user plane functional network element can still be a UPF network element, or have other names, This application is not limited.
策略控制功能网元(PCF):主要支持提供统一的策略框架来控制网络行为,提供策略规则给控制层网络功能,同时负责获取与策略决策相关的用户签约信息。例如,在5G中,策略控制功能网元可以是PCF网元,例如图1所示;在未来通信,如6G中,策略控制功能网元仍可以是PCF网元,或有其它的名称,本申请不做限定。当策略控制功能网元是PCF网元,PCF网元可以提供Npcf服务。Policy control function network element (PCF): mainly supports the provision of a unified policy framework to control network behavior, provides policy rules to the control layer network functions, and is responsible for obtaining user subscription information related to policy decisions. For example, in 5G, the network element with the policy control function can be a PCF network element, as shown in Figure 1; in future communication, such as in 6G, the network element with the policy control function can still be a PCF network element, or have other names. Applications are not limited. When the policy control function network element is a PCF network element, the PCF network element can provide the Npcf service.
网络开放功能网元(NEF):主要支持3GPP网络和第三方应用安全的交互。例如,在5G中,网络开放功能网元可以是NEF网元,例如图1所示;在未来通信,如6G中,网络开放功能网元仍可以是NEF网元,或有其它的名称,本申请不做限定。当网络开放功能网元是NEF时,NEF可以向其他网络功能网元提供Nnef服务。Network Opening Function Network Element (NEF): It mainly supports the secure interaction between the 3GPP network and third-party applications. For example, in 5G, the network element with the network opening function can be a NEF network element, as shown in Figure 1; in future communication, such as in 6G, the network element with the network opening function can still be a NEF network element, or have other names. Applications are not limited. When the network opening function network element is an NEF, the NEF can provide Nnef services to other network function network elements.
应用功能网元(AF):主要支持与3GPP核心网交互来提供服务,例如影响数据路由决策,策略控制功能或者向网络侧提供第三方的一些服务。例如,在5G中,应用功能网元可以是AF网元,例如图1所示;在未来通信,如6G中,应用功能网元仍可以是AF网元,或有其它的名称,本申请不做限定。当应用功能网元是AF网元时,AF网元可以提供Naf服务。Application function element (AF): It mainly supports interaction with the 3GPP core network to provide services, such as influencing data routing decisions, policy control functions, or providing some third-party services to the network side. For example, in 5G, the application function network element can be an AF network element, such as shown in Figure 1; in future communications, such as 6G, the application function network element can still be an AF network element, or have other names, which are not covered by this application. Do limited. When the application function network element is an AF network element, the AF network element can provide the Naf service.
统一数据管理功能网元(UDM):用于生成认证信任状,用户标识处理(如存储和管理用户永久身份等),接入授权控制和签约数据管理等。例如,在5G中,统一数据管理功能网元可以是UDM网元,例如图1所示;在未来通信,如6G中,统一数据管理功能网元仍可以是UDM网元,或有其它的名称,本申请不做限定。当统一数据管理功能网元是UDM网元时,UDM网元可以提供Nudm服务。Unified data management function network element (UDM): used to generate authentication credentials, user identification processing (such as storing and managing user permanent identities, etc.), access authorization control and subscription data management, etc. For example, in 5G, the unified data management function network element can be a UDM network element, such as shown in Figure 1; in future communications, such as 6G, the unified data management function network element can still be a UDM network element, or have other names , which is not limited in this application. When the network element with the unified data management function is a UDM network element, the UDM network element can provide the Nudm service.
认证服务器功能网元(AUSF):用于支持UE接入网时的认证功能,以及用于支持网元切片特定的认证和授权流程。例如,在5G中,认证服务器功能网元可以是AUSF网元,例如图1所示;在未来通信,如6G中,认证服务器功能网元仍可以是AUSF网元,或有其它的名称,本申请不做限定。当认证服务器功能网元是AUSF网元时,AUSF网元可以提供Nausf服务。Authentication server function network element (AUSF): used to support the authentication function when the UE accesses the network, and to support the authentication and authorization process specific to the network element slice. For example, in 5G, the authentication server function network element can be an AUSF network element, such as shown in Figure 1; in future communication, such as in 6G, the authentication server function network element can still be an AUSF network element, or have other names. Applications are not limited. When the authentication server function network element is an AUSF network element, the AUSF network element can provide the Nausf service.
网络仓库功能网元(NRF),可用于提供网元发现功能,基于其他网元的请求,提供网元类型对应的网元信息。NRF网元还提供网元管理服务,如网元注册、更新、去注册以及网元状态订阅和推送等。例如,在5G中,网络存储功能网元可以是NRF网元,例如图1所示;在未来通信,如6G中,网络存储功能网元仍可以是NRF网元,或有其它的名称,本申请不做限定。当网络存储功能网元是NRF网元时,NRF网元可以提供Nnrf服务。The Network Repository Function Network Element (NRF) can be used to provide a network element discovery function, and provide network element information corresponding to the network element type based on the request of other network elements. NRF network elements also provide network element management services, such as network element registration, update, de-registration, and network element status subscription and push. For example, in 5G, the network element with network storage function can be an NRF network element, such as shown in Figure 1; in future communication, such as in 6G, the network element with network storage function can still be an NRF network element, or have other names. Applications are not limited. When the network element with the network storage function is an NRF network element, the NRF network element can provide the Nnrf service.
数据网络(data network,DN),指的是为用户提供数据传输服务的服务网络,如IP多媒体业务(IP multi-media service,IMS)、互联网(Internet)等。UE通过UE到DN之间建立的协议数据单元(protocol data unit,PDU)会话,来访问DN。Data network (data network, DN) refers to a service network that provides data transmission services for users, such as IP multimedia service (IP multi-media service, IMS), Internet (Internet), etc. The UE accesses the DN through a protocol data unit (protocol data unit, PDU) session established between the UE and the DN.
服务通信代理(service communication proxy,SCP),可用于提供以下一个或者多个功能:转发和路由消息到目标网络功能或目标网络功能服务、转发和路由消息到下一跳SCP,代理发现(即SCP进行服务发现或进行提供服务的网络功能的发现或进行提供服务的网络功能实例的发现)、间接通信(即服务消费者网络功能和目标服务提供者网络功能通过SCP进行通信)、通信安全、负载均衡、过载控制等。Service communication proxy (service communication proxy, SCP), which can be used to provide one or more of the following functions: forwarding and routing messages to target network functions or target network function services, forwarding and routing messages to next-hop SCPs, agent discovery (that is, SCP performing service discovery or performing discovery of a network function providing a service or performing discovery of an instance of a network function providing a service), indirect communication (that is, the service consumer network function and the target service provider network function communicate through SCP), communication security, load Balance, overload control, etc.
其中,核心网中的各个网元也可以称为功能实体或者设备或者网络功能,既可以是在专用硬件上实现的网络元件,也可以是在专用硬件上运行的软件实例,或者是在适当平台上虚拟化功能的实例,例如,上述虚拟化平台可以为云平台。Among them, each network element in the core network can also be called a functional entity or device or network function, which can be a network element implemented on dedicated hardware, or a software instance running on dedicated hardware, or a An example of the above virtualization function, for example, the above virtualization platform may be a cloud platform.
在本申请中,网元也可以称之为网络功能或功能或实体等,本申请对此不作限定。In this application, a network element may also be referred to as a network function or function or entity, which is not limited in this application.
需要说明的是,图1所示的通信系统的架构中不限于仅包含图中所示的网元,还可以包含其它未在图中表示的设备,具体本申请在此处不再一一列举。It should be noted that the architecture of the communication system shown in Figure 1 is not limited to include only the network elements shown in the figure, but may also include other devices not shown in the figure, and the specific application will not list them here. .
需要说明的是,本申请实施例并不限定各个网元的分布形式,图1所示的分布形式只是示例性的,本申请不作限定。It should be noted that the embodiment of the present application does not limit the distribution form of each network element, and the distribution form shown in FIG. 1 is only exemplary, and is not limited in this application.
为方便说明,本申请后续均以图1所示的网元为例进行说明,并将XX网元直接简称为XX。应理解,本申请中所有网元的名称仅仅作为示例,在未来通信中还可以称为其它名称,或者在未来通信中本申请涉及的网元还可以通过其它具有相同功能的实体或者设备等来替代,本申请对此均不作限定。这里做统一说明,后续不再赘述。For the convenience of description, the subsequent description of this application will take the network element shown in FIG. 1 as an example, and the XX network element will be directly referred to as XX for short. It should be understood that the names of all network elements in this application are only examples, and may be called other names in future communications, or the network elements involved in this application may be identified by other entities or devices with the same functions in future communications. Instead, the present application does not limit this. A unified explanation is made here, and no further details will be given later.
需要说明的是,图1所示的通信系统并不构成本申请实施例能够适用的通信系统的限定。图1所示的通信系统架构为5G系统架构,可选的,本申请实施例的方法还适用于未来的各种通信系统,例如6G或者其他通信网络等。It should be noted that the communication system shown in FIG. 1 does not constitute a limitation to the applicable communication system of the embodiment of the present application. The communication system architecture shown in FIG. 1 is a 5G system architecture. Optionally, the method in the embodiment of the present application is also applicable to various communication systems in the future, such as 6G or other communication networks.
需要说明的是,本申请实施例涉及的服务提供者网络功能表示提供网络功能服务的网络功能,服务提供者网络功能也可以称为网络功能服务提供者(NF service producer)、服务提供者或者其他名称;服务消费者网络功能表示访问或使用网络功能服务的网络功能,服务消费者网络功能也可以称为网络功能服务消费者(NF service consumer)、服务消费者或者其他名称,本申请对此不作限定。本申请中,网络服务也可以称为服务。示例性的,所述服务提供者网络功能还可以根据提供的具体服务来命名,同理,所述服务消费者网络功能还可以根据请求的具体服务来命名,本申请对此不作限定。It should be noted that the service provider network function involved in the embodiment of the present application refers to a network function that provides network function services, and the service provider network function may also be called a network function service provider (NF service producer), service provider or other Name; service consumer network function refers to the network function that accesses or uses the network function service. The service consumer network function can also be called the network function service consumer (NF service consumer), service consumer or other names, and this application does not make any reference to it. limited. In this application, a network service may also be referred to as a service. Exemplarily, the service provider network function can also be named according to the specific service provided, and similarly, the service consumer network function can also be named according to the specific service requested, which is not limited in this application.
示例性的,服务提供者网络功能可以是上述通信系统中任何可提供网络功能服务的网元或设备或实体,服务消费者网络功能可以是上述通信系统中任何请求网络功能服务的网元或设备或实体。比如,服务提供者网络功能可以是AUSF,可以提供认证服务,服务消费者网络功能可以是AMF,AMF可以向AUSF请求认证服务,本申请对此不作限定。Exemplarily, the service provider network function may be any network element or device or entity that can provide network function services in the above-mentioned communication system, and the service consumer network function may be any network element or device that requests network function services in the above-mentioned communication system or entity. For example, the service provider network function can be AUSF, which can provide authentication services, and the service consumer network function can be AMF, and AMF can request authentication services from AUSF, which is not limited in this application.
服务消费者网络功能和服务提供者网络功能之间可以直接通信,这种通信方式称为直接通信;服务消费者网络功能和服务提供者网络功能之间可以间接通信,即通过服务通信代理(SCP)进行通信,这种通信方式称为间接通信。The network function of the service consumer and the network function of the service provider can communicate directly, which is called direct communication; the network function of the service consumer and the network function of the service provider can communicate indirectly, that is, through the service communication proxy (SCP ) to communicate, which is called indirect communication.
标准协议规定了服务提供者网络功能在NRF(网络仓库功能)注册的流程,通过该注册流程,服务提供者网络功能可将网络功能文件(NF profile)提供给NRF。示例性的,图2为NF注册流程。在步骤1,服务提供者网络功能向网络仓库功能(如NRF)发送用于请求注册的消息(如Nnrf_NFManagement_NRFRegister Request),该消息中包括服务提供者网络功能的网络功能文件(NF profile),该NF profile包括该服务提供者网络功能的实例标识(nfInstanceId)、网络功能类型(nfType)等。该NF profile中还可能包括网络服务列表(nfServiceList)。网络服务列表(nfServiceList)中包括一个或多个网络功能服务(NFService),每个网络功能服务中包括服务名称(serviceName)、服务实例(serviceInstanceId)等。每个NFService中还可能包括该服务实例支持的特性(supportedFeatures)。supportedFeatures可能包括HTTP 307 redirection或HTTP 308 redirection,用于表示该服务提供者网络功能或该服务提供者网络功能实例、或该服务或该服务实例支持HTTP 307特性和/或支持HTTP 308特性。服务提供者网络功能或服务提供者网络功能实例或服务或服务实例支持HTTP 307和/或308特性,即服务提供者网络功能可以向服务消费者网络功能或者SCP发送临时重定向(即307 temporary redirect)或永久重定向(即308 permanent redirect)的HTTP状态码(HTTP status code),以及重定向到的目标服务提供者网络功能的信息。在步骤2,NRF保存该服务提供者网络功能的NF profile。在步骤3,NRF向服务提供者网络功能发送对该请求的响应消息。The standard protocol specifies the registration process of the service provider's network function in the NRF (Network Repository Function). Through this registration process, the service provider's network function can provide the network function file (NF profile) to the NRF. Exemplarily, Fig. 2 shows the NF registration process. In step 1, the service provider network function sends a message (such as Nnrf_NFManagement_NRFRegister Request) for requesting registration to the network warehouse function (such as NRF), which includes the network function file (NF profile) of the service provider network function, the NF The profile includes the instance identifier (nfInstanceId) and network function type (nfType) of the service provider's network function. The NF profile may also include a network service list (nfServiceList). The network service list (nfServiceList) includes one or more network function services (NFService), and each network function service includes a service name (serviceName), a service instance (serviceInstanceId) and the like. Each NFService may also include the characteristics (supportedFeatures) supported by the service instance. supportedFeatures may include HTTP 307 redirection or HTTP 308 redirection, which is used to indicate that the service provider network function or the service provider network function instance, or the service or the service instance supports the HTTP 307 feature and/or supports the HTTP 308 feature. The service provider network function or service provider network function instance or service or service instance supports HTTP 307 and/or 308 features, that is, the service provider network function can send a temporary redirect to the service consumer network function or SCP (ie 307 temporary redirect ) or the HTTP status code (HTTP status code) of permanent redirection (that is, 308 permanent redirection), and information about the network function of the target service provider to which it is redirected. In step 2, the NRF saves the NF profile of the service provider's network function. In step 3, the NRF sends a response message to the request to the service provider network function.
在本文中,支持HTTP 307和/或308特性,也可称为支持重定向或称为支持HTTP重定向或支持服务请求重定向或支持请求重定向。在本文中,服务提供者网络功能支持超文本传输协议(hypertext transfer protocol,HTTP)重定向,也表示该服务提供者网络功能实例支持HTTP重定向或该服务提供者网络功能的服务支持HTTP重定向,或该服务提供者网络功能的服务实例支持HTTP重定向。In this article, supporting HTTP 307 and/or 308 features may also be referred to as supporting redirection or as supporting HTTP redirection or supporting service request redirection or supporting request redirection. In this article, the service provider network function supports hypertext transfer protocol (hypertext transfer protocol, HTTP) redirection, which also means that the service provider network function instance supports HTTP redirection or the service of the service provider network function supports HTTP redirection , or the service instance of the service provider network function supports HTTP redirection.
在本文中,临时重定向(即307 temporary redirect)或永久重定向(即308 permanent  redirect)的HTTP状态码(HTTP status code)也称为HTTP重定向状态码。In this article, the HTTP status code (HTTP status code) of temporary redirection (ie 307 temporary redirect) or permanent redirection (ie 308 permanent redirect) is also called HTTP redirection status code.
服务消费者网络功能在向服务提供者网络功能发送服务请求之前,可进行网络功能服务发现。示例性的,图3示出了网络功能服务发现流程。在步骤1,服务消费者网络功能向NRF发送用于请求发现服务的消息(如Nnrf_NFDiscovery_Request),其中包括请求的网络功能的类型、服务消费者网络功能的网络功能类型(NF类型)等,还可包括请求的网络功能的服务的服务名称等。当该消息中包括请求的网络功能的服务的服务名称时,该消息中还可以包括服务消费者网络功能需要请求的网络功能服务所支持的特性。在步骤2,NRF检查该服务消费者网络功能进行服务发现的授权。在步骤3,NRF向服务消费者网络功能返回响应消息,如果步骤2中,NRF检查该服务消费者网络功能进行服务发现的授权成功,则响应消息中包括发现结果,其中可包括发现结果的有效期、一个或多个网络功能的网络功能文件(NF profile)。该网络功能文件为服务消费者网络功能请求发现的网络功能或服务对应的网络功能文件。A service consumer web function may perform web function service discovery before sending a service request to a service provider web function. Exemplarily, FIG. 3 shows a network function service discovery process. In step 1, the service consumer network function sends a message (such as Nnrf_NFDiscovery_Request) to NRF to request a discovery service, which includes the type of the requested network function, the network function type (NF type) of the service consumer network function, etc. The service name, etc. of the service including the requested network function. When the message includes the service name of the service of the requested network function, the message may also include the features supported by the service consumer's network function that needs to be supported by the requested network function service. In step 2, the NRF checks the service consumer network function's authorization for service discovery. In step 3, NRF returns a response message to the service consumer network function, if in step 2, NRF checks that the service consumer network function is authorized for service discovery, the response message includes the discovery result, which may include the validity period of the discovery result , a network function profile (NF profile) for one or more network functions. The network function file is a network function file corresponding to the network function or service discovered by the service consumer's network function request.
服务消费者网络功能在向服务提供者网络功能发送用于请求服务提供者网络功能的服务的消息之前,向NRF请求访问令牌。服务消费者网络功能可以向NRF请求的访问令牌有两种:The service consumer web function requests an access token from the NRF before sending a message to the service provider web function requesting the service of the service provider web function. There are two types of access tokens that service consumer network functions can request from NRF:
(1)用于访问一种网络功能(Network Function,NF)类型的服务提供者网络功能的服务的访问令牌。本文中,该访问令牌可称为NF类型的访问令牌,即访问令牌(NF类型)。(1) An access token used to access a network function (Network Function, NF) type service provider network function service. Herein, the access token may be referred to as an NF-type access token, that is, an access token (NF type).
(2)用于访问一个服务提供者网络功能实例的服务访问令牌。本文中,该访问令牌可称为NF实例类型访问令牌,即访问令牌(NF实例)。(2) A service access token used to access a service provider network function instance. Herein, the access token may be referred to as an NF instance type access token, ie an access token (NF instance).
在本文中,在无说明的情况下,访问令牌可以指访问令牌(NF类型)或访问令牌(NF类型)。Herein, the access token may refer to an access token (NF type) or an access token (NF type) unless otherwise specified.
图4示出了服务消费者网络功能获取访问令牌(NF类型)的流程。如图所示,在步骤1,服务消费者网络功能向NRF发送用于请求访问令牌的消息(如Nnrf_AccessToken_Get Request),该消息中包括该服务消费者网络功能的实例标识、该服务消费者网络功能请求的服务的服务名称、该服务消费者网络功能请求的服务提供者网络功能的NF类型等。在步骤2,NRF检查该服务消费者网络功能访问请求的服务的授权,如果检查成功,则NRF生成访问令牌(NF类型),该访问令牌中包括该服务消费者网络功能请求的服务提供者网络功能的NF类型、该服务消费者网络功能的实例标识、该服务消费者网络功能请求的服务的服务名称、NRF的实例标识等。在步骤3,NRF检查该服务消费者网络功能访问请求的服务的授权成功之后,NRF向该服务消费者网络功能返回响应消息(如Nnrf_AccessToken_Get Response),该消息中包括生成的访问令牌(NF类型)。Fig. 4 shows the flow of obtaining an access token (NF type) by a service consumer network function. As shown in the figure, in step 1, the service consumer network function sends a message (such as Nnrf_AccessToken_Get Request) for requesting an access token to NRF, and the message includes the instance identifier of the service consumer network function, the service consumer network The service name of the service requested by the function, the NF type of the service provider network function requested by the service consumer network function, etc. In step 2, NRF checks the authorization of the service requested by the service consumer's network function access, and if the check is successful, NRF generates an access token (NF type), which includes the service provider requested by the service consumer's network function The NF type of the consumer network function, the instance identifier of the service consumer network function, the service name of the service requested by the service consumer network function, the instance identifier of the NRF, etc. In step 3, after NRF checks that the service authorization of the service consumer network function access request is successful, NRF returns a response message (such as Nnrf_AccessToken_Get Response) to the service consumer network function, which includes the generated access token (NF type ).
服务消费者网络功能请求访问令牌(NF实例)的流程,与上述请求访问令牌(NF类型)的流程基本相同,区别在于服务消费者网络功能向NRF发送的用于请求访问令牌的消息中包括该服务消费者网络功能请求的服务提供者网络功能的NF实例标识,并且NRF生成并返回的访问令牌(NF实例)中包括服务消费者网络功能所请求的服务提供者网络功能的NF实例标识。The process of requesting an access token (NF instance) by a service consumer network function is basically the same as the above process of requesting an access token (NF type), except that the message sent by the service consumer network function to NRF for requesting an access token Include the NF instance identifier of the service provider network function requested by the service consumer network function, and the access token (NF instance) generated and returned by NRF includes the NF of the service provider network function requested by the service consumer network function Instance ID.
服务消费者网络功能在获取到访问令牌后,向服务提供者网络功能发送用于请求服务的消息,该消息中包括从NRF处获取的访问令牌;服务提供者网络功能验证该访问令牌,只有在验证访问令牌成功之后才向该服务消费者网络功能提供服务。服务提供者网络功能验证该访问令牌包括:如果该访问令牌中包括服务消费者网络功能请求的服务提供者网络 功能的网络功能类型,则服务提供者网络功能验证该令牌中包括的网络功能类型与自身的网络功能类型是否一致;如果该访问令牌中包括服务消费者网络功能请求的服务提供者网络功能的实例标识,则服务提供者网络功能验证该实例标识与自身的实例标识是否一致。After the service consumer network function obtains the access token, it sends a service request message to the service provider network function, which includes the access token obtained from NRF; the service provider network function verifies the access token , and only after successful authentication of the access token is the service provided to the service consumer web function. The service provider network function verifies that the access token includes: If the network function type of the service provider network function requested by the service consumer network function is included in the access token, the service provider network function verifies the network included in the token Whether the function type is consistent with its own network function type; if the access token includes the instance ID of the service provider network function requested by the service consumer network function, the service provider network function verifies whether the instance ID is consistent with its own instance ID unanimous.
标准协议中定义了超文本传输协议(Hypertext Transfer Protocol)重定向机制。在直接通信中,当处于过载状态或者即将进入过载状态的服务提供者网络功能接收到来自服务消费者网络功能的服务请求之后,为了缓解过载状态或避免进入过载状态,服务提供者网络功能可以进行HTTP重定向,即向服务消费者网络功能发送HTTP重定向状态码(HTTP status code)“307 temporary redirect”,该HTTP重定向状态码用于通知服务消费者网络功能,有其他可用的服务提供者网络功能,即目标服务提供者网络功能可以提供服务消费者网络功能请求的服务。同时,服务提供者网络功能还向服务消费者网络功能发送目标服务提供者网络功能的信息,包括目标服务提供者网络功能的统一资源标识符(uniform resource identifier,URI)和/或实例标识。服务消费者网络功能根据接收到的“307 temporary redirect”HTTP重定向状态码以及目标服务提供者网络功能的信息,向目标服务提供者网络功能发送服务请求。为了区别于目标服务提供者网络功能,在本文中,为了方便阐述,将服务消费者网络功能首先向其发送服务请求的服务提供者网络功能称为初始服务提供者网络功能(Initial NF service producer)或称为第一服务提供者网络功能,目标服务提供者网络功能可称为第二服务提供者网络功能。The Hypertext Transfer Protocol (Hypertext Transfer Protocol) redirection mechanism is defined in the standard protocol. In direct communication, when the service provider network function in the overload state or about to enter the overload state receives the service request from the service consumer network function, in order to alleviate the overload state or avoid entering the overload state, the service provider network function can perform HTTP redirection, that is, sending the HTTP status code (HTTP status code) "307 temporary redirect" to the service consumer's network function. The HTTP redirection status code is used to notify the service consumer's network function that there are other available service providers The network function, that is, the target service provider network function can provide the service requested by the service consumer network function. At the same time, the service provider network function also sends the information of the target service provider network function to the service consumer network function, including the uniform resource identifier (uniform resource identifier, URI) and/or instance identifier of the target service provider network function. The service consumer network function sends a service request to the target service provider network function according to the received "307 temporary redirect" HTTP redirection status code and the information of the target service provider network function. In order to distinguish it from the target service provider network function, in this paper, for the convenience of explanation, the service provider network function to which the service consumer network function first sends a service request is called the initial service provider network function (Initial NF service producer) Alternatively referred to as the first SPNF, the target SPNF may be referred to as the second SPNF.
在上述定义的HTTP重定向机制中,需要服务提供者网络功能支持HTTP重定向,即服务提供者网络功能可以向服务消费者网络功能发送HTTP重定向状态码以及目标服务提供者网络功能的信息;还需要服务消费者网络功能支持HTTP重定向,即服务消费者网络功能在接收到HTTP重定向状态码和目标服务提供者网络功能的信息后,向目标服务提供者网络功能发送服务请求消息。In the HTTP redirection mechanism defined above, the service provider network function needs to support HTTP redirection, that is, the service provider network function can send the HTTP redirection status code and the information of the target service provider network function to the service consumer network function; It is also required that the service consumer network function supports HTTP redirection, that is, the service consumer network function sends a service request message to the target service provider network function after receiving the HTTP redirection status code and the information of the target service provider network function.
在间接通信中,服务提供者网络功能和服务消费者网络功能之间通过服务通信代理(SCP)进行通信。服务消费者网络功能向SCP发送用于请求服务提供者网络功能的服务的消息,该消息中包括请求的服务以及服务提供者网络功能的信息,比如可包括服务提供者网络功能的实例标识。SCP根据接收到的服务提供者网络功能的信息,向该服务提供者网络功能发送用于请求服务的消息,该消息中包括服务消费者网络功能请求的服务。在上述流程中,该服务提供者网络功能接收到SCP发送的请求消息之后,可发起HTTP重定向,即服务提供者网络功能向SCP发送一个响应消息,包括HTTP重定向状态码(HTTP status code)以及目标服务提供者网络功能的信息。SCP在接收到该响应消息之后,向服务消费者网络功能发送该HTTP重定向状态码以及该目标服务提供者网络功能的信息,服务消费者网络功能根据接收到的HTTP重定向状态码和目标服务提供者网络功能的信息,向该目标服务提供者网络功能发送服务请求。SCP根据本地配置也可以直接向目标服务提供者网络功能发送服务请求消息,而不是向该服务消费者网络功能发送接收到的HTTP重定向状态码和目标服务提供者的信息。在本文中,为了方便阐述,将SCP首先向其发送服务请求的服务提供者网络功能称为初始服务提供者网络功能(Initial NF service producer)或称为第一服务提供者网络功能,目标服务提供者网络功能可称为第二服务提供者网络功能。In indirect communication, the service provider network function and the service consumer network function communicate through the service communication proxy (SCP). The service consumer network function sends a message for requesting the service of the service provider network function to the SCP, and the message includes the requested service and information of the service provider network function, for example, may include an instance identifier of the service provider network function. The SCP sends a service requesting message to the service provider network function according to the received information of the service provider network function, and the message includes the service requested by the service consumer network function. In the above process, after the service provider network function receives the request message sent by the SCP, it can initiate HTTP redirection, that is, the service provider network function sends a response message to the SCP, including the HTTP redirection status code (HTTP status code) and information about the network capabilities of the target service provider. After receiving the response message, the SCP sends the HTTP redirection status code and the information of the target service provider network function to the service consumer network function, and the service consumer network function Provider network function information, send a service request to the target service provider network function. The SCP may also directly send a service request message to the target service provider network function according to local configuration, instead of sending the received HTTP redirection status code and target service provider information to the service consumer network function. In this paper, for the convenience of explanation, the service provider network function to which the SCP first sends a service request is called the initial service provider network function (Initial NF service producer) or the first service provider network function, and the target service provider The provider network function may be referred to as a second service provider network function.
在上述定义的HTTP重定向机制中,需要服务提供者网络功能和SCP支持重定向,即服务提供者网络功能可以向服务消费者网络功能发送HTTP重定向状态码以及目标服务提供者网络功能的信息,SCP在接收到HTTP重定向状态码以及目标服务提供者网络功能 的信息之后,可以向服务消费者转发接收到的HTTP重定向状态码以及目标服务提供者网络功能的信息、或者向目标服务提供者网络功能发送服务请求。在上述定义的HTTP重定向机制中还需要服务消费者网络功能支持HTTP重定向,即服务消费者网络功能在接收到HTTP重定向状态码和目标服务提供者网络功能的信息后,向目标服务提供者望功能发送服务请求消息。In the HTTP redirection mechanism defined above, the service provider network function and SCP are required to support redirection, that is, the service provider network function can send the HTTP redirection status code and the information of the target service provider network function to the service consumer network function , after the SCP receives the HTTP redirection status code and the information of the network function of the target service provider, it can forward the received HTTP redirection status code and the information of the network function of the target service provider to the service consumer, or provide or network function to send a service request. In the HTTP redirection mechanism defined above, the network function of the service consumer is also required to support HTTP redirection, that is, after receiving the status code of the HTTP redirection and the information of the network function of the target service provider, the network function of the service consumer provides The Desire function sends a service request message.
无论是在直接通信还是在间接通信中,当发生HTTP重定向时,可能导致服务消费者网络功能因未获得相应的访问令牌,而无法访问目标服务提供者网络功能提供的服务。Whether in direct communication or indirect communication, when HTTP redirection occurs, the service consumer network function may not be able to access the services provided by the target service provider network function because the corresponding access token is not obtained.
为此,本申请实施例提供了一种网络功能服务授权方法及装置,可以在发生HTTP重定向时,使服务消费者网络功能能够从目标服务提供者网络功能获得服务。To this end, the embodiment of the present application provides a network function service authorization method and device, which can enable the service consumer network function to obtain services from the target service provider network function when HTTP redirection occurs.
为了更加清晰地描述本申请实施例的技术方案,下面结合附图,对本申请实施例提供的服务授权的方法及装置进行详细说明。In order to describe the technical solution of the embodiment of the present application more clearly, the method and device for service authorization provided by the embodiment of the present application will be described in detail below in conjunction with the accompanying drawings.
需要说明的是,本文中,第一服务提供者网络功能,也可表述为第一服务提供者网络功能实例,或初始服务提供者网络功能,或初始服务提供者网络功能实例;第二服务提供者网络功能,也可表述为第二服务提供者网络功能实例,或目标服务提供者网络功能,或目标服务提供者网络功能实例;第一服务也可表述为第一服务实例。It should be noted that, in this paper, the first service provider network function can also be expressed as the first service provider network function instance, or the initial service provider network function, or the initial service provider network function instance; the second service provider The provider network function can also be expressed as a second service provider network function instance, or a target service provider network function, or a target service provider network function instance; the first service can also be expressed as a first service instance.
本申请实施例提供的一种网络功能服务授权的方法,可以适用于如图1所示的通信系统。参阅图5所示,该方法的具体流程可以包括:A network function service authorization method provided in the embodiment of the present application may be applicable to the communication system shown in FIG. 1 . Referring to Figure 5, the specific process of the method may include:
S501:服务消费者网络功能根据第一信息,向网络仓库功能(NRF)发送第一请求消息,该第一请求消息包括第二信息和第一服务的服务名称,该第一请求消息用于请求获取访问令牌,该访问令牌用于该服务消费者网络功能访问第一服务时的授权检查。该第一请求消息中还包括请求的网络功能的网络功能类型或网络功能实例;S501: The service consumer network function sends a first request message to the Network Repository Function (NRF) according to the first information, the first request message includes the second information and the service name of the first service, and the first request message is used to request Obtain an access token, which is used for authorization check when the service consumer network function accesses the first service. The first request message further includes a network function type or a network function instance of the requested network function;
其中,该第一服务为该服务消费者网络功能所请求的服务。Wherein, the first service is a service requested by the service consumer network function.
在一种可能的实现方式中,第一信息用于表示该服务消费者网络功能、和/或第一服务、和/或提供第一服务的服务提供者网络功能、和/或请求的服务提供者网络功能支持HTTP重定向特性。也就是说,若该服务消费者网络功能、第一服务、提供第一服务的服务提供者网络功能、和请求的服务提供者网络功能中的至少一个支持HTTP重定向特性,则该服务消费者网络功能向NRF发送第一请求消息中应包括第二信息。服务消费者网络功能可在向NRF请求获取访问令牌前,检查该服务消费者网络功能、和/或该第一服务、和/或提供该第一服务的服务提供者网络功能、和/或请求的服务提供者网络功能是否支持HTTP重定向。示例地,该服务消费者网络功能检查自身是否支持HTTP重定向,可以通过检查本地配置信息,如果本地配置信息指示支持,则该服务消费者网络功能支持HTTP重定向。示例地,该服务消费者网络功能检查该第一服务、或提供该第一服务的服务提供者网络功能、或请求的服务提供者网络功能是否支持HTTP重定向,可以通过检查提供该第一服务、或提供第一服务的服务提供者网络功能、或请求的服务提供者网络能所对应的网络功能文件(NF Profile),如果该网络功能文件中的该第一服务或该请求的服务提供者网络功能、或该提供第一服务的服务提供者网络功能支持的特性中包括HTTP重定向,则该第一服务、或提供该第一服务的服务提供者网络功能、或请求的服务提供者网络功能支持HTTP重定向。该实现方式的一个示例可参见下文中图6或图7的相关内容。In a possible implementation manner, the first information is used to indicate that the service consumer network function, and/or the first service, and/or the service provider network function that provides the first service, and/or the requested service provision Or the network function supports the HTTP redirection feature. That is, if at least one of the service consumer web function, the first service, the service provider web function providing the first service, and the requesting service provider web function supports the HTTP redirect feature, then the service consumer The second information should be included in the first request message sent by the network function to the NRF. The service consumer network function may check the service consumer network function, and/or the first service, and/or the service provider network function providing the first service, and/or Whether the requested service provider network function supports HTTP redirection. Exemplarily, the service consumer network function checks whether it supports HTTP redirection by checking local configuration information, and if the local configuration information indicates support, then the service consumer network function supports HTTP redirection. Exemplarily, the service consumer network function checks whether the first service, or the service provider network function providing the first service, or the requested service provider network function supports HTTP redirection, by checking the , or the network function of the service provider that provides the first service, or the network function file (NF Profile) corresponding to the network function of the service provider of the request, if the first service or the service provider of the request in the network function file If the features supported by the network function, or the network function of the service provider providing the first service include HTTP redirection, then the first service, or the network function of the service provider providing the first service, or the requested service provider network Function supports HTTP redirection. For an example of this implementation manner, refer to related content in FIG. 6 or FIG. 7 below.
在一种可能的实现方式中,第一信息包括多个服务提供者网络功能的实例标识。也就 是说,若该服务消费者网络功能获得到的第一信息中包括多个服务提供者网络功能的实例标识,比如该消费者网络功能在服务发现过程中从NRF处获取第一信息,第一信息中包括多个服务提供者网络功能的实例标识,则该服务消费者网络功能向NRF发送的第一请求消息包括第二信息。该实现方式的一个示例可参见下文中图6或图7的相关内容。In a possible implementation manner, the first information includes instance identifiers of multiple service provider network functions. That is to say, if the first information obtained by the service consumer network function includes instance identifiers of multiple service provider network functions, for example, the consumer network function obtains the first information from the NRF during the service discovery process, the second If the information includes multiple service provider network function instance identifiers, the first request message sent by the service consumer network function to the NRF includes the second information. For an example of this implementation manner, refer to related content in FIG. 6 or FIG. 7 below.
一种可能的实现方式中,第一信息表示提供第一服务的服务提供者网络功能实例有多个。也就是说,若提供第一服务的服务提供者网络功能实例有多个,则该服务消费者网络功能向NRF发送第一请求消息中应包括第二信息。In a possible implementation manner, the first information indicates that there are multiple service provider network function instances that provide the first service. That is to say, if there are multiple service provider network function instances providing the first service, the service consumer network function should include the second information in the first request message sent to the NRF.
一种可能的实现方式中,第一信息表示提供第一服务的服务提供者网络功能的网络功能集中有多个网络功能实例。也就是说,若提供第一服务的服务提供者网络功能的网络功能集中包括多个网络功能实例,则该服务消费者网络功能向NRF发送第一请求消息中应包括第二信息。In a possible implementation manner, the first information indicates that there are multiple network function instances in the network function set of the service provider network function that provides the first service. That is to say, if the network function set of the service provider network function providing the first service includes multiple network function instances, the first request message sent by the service consumer network function to the NRF should include the second information.
在一种可能的实现方式中,第一信息用于指示该服务消费者网络功能使用服务通信代理(service communication proxy,SCP)与服务提供者网络功能进行通信。也就是说,若该服务消费者网络功能使用SCP与服务提供者网络功能通信,则该服务消费者网络功能向NRF发送第一请求消息中应包括第二信息。示例地,该服务消费者网络功能可以通过本地配置确定是否使用SCP与服务提供者网络功能进行通信。该实现方式的一个示例可参见下文图7中的相关内容。In a possible implementation manner, the first information is used to instruct the service consumer network function to use a service communication proxy (service communication proxy, SCP) to communicate with the service provider network function. That is to say, if the service consumer network function uses the SCP to communicate with the service provider network function, the first request message sent by the service consumer network function to the NRF should include the second information. Exemplarily, the service consumer network function may determine whether to use the SCP to communicate with the service provider network function through local configuration. For an example of this implementation manner, refer to related content in FIG. 7 below.
在一种可能的实现方式中,第一信息包括第一指示和/或第二服务提供者网络功能的信息。也就是说,若第一信息包括第一指示和/或第二服务提供者网络功能的信息,则该服务消费者网络功能向NRF发送第一请求消息中应包括第二信息。在本文件中,第二服务提供者网络功能的信息可包括第二服务提供者网络功能的URI和/或第二服务提供者网络功能的实例标识。所述第一指示用于指示服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能。在直接通信中,所述第一信息可以是第一服务提供者网络功能向服务消费者网络功能发送。该实现方式的一个示例可参见下文图8中的相关内容。在间接通信中,所述第一信息可以是SCP在接收到第一服务提供者网络功能发送的HTTP重定向状态码和第二服务提供者网络功能的信息后,向服务消费者网络功能发送。该实现方式的一个示例可参见下文图9或图10或图11中的相关内容。In a possible implementation manner, the first information includes the first indication and/or information about the network function of the second service provider. That is to say, if the first information includes the first indication and/or the information of the second service provider network function, the service consumer network function should include the second information in the first request message sent to the NRF. In this document, the information of the second service provider network function may include the URI of the second service provider network function and/or the instance identifier of the second service provider network function. The first indication is used to indicate service access authorization failure or HTTP redirection or access token acquisition or other available service provider network functions. In direct communication, the first information may be sent by the first service provider network function to the service consumer network function. For an example of this implementation, refer to the relevant content in FIG. 8 below. In indirect communication, the first information may be sent by the SCP to the service consumer network function after receiving the HTTP redirection status code sent by the first service provider network function and the information of the second service provider network function. For an example of this implementation manner, refer to related content in FIG. 9 or FIG. 10 or FIG. 11 below.
在一种可能的实现方式中,该第一信息为一个消息,该消息用于通知服务消费者网络功能,服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;在该实现方式中,第一信息中可选地包括第二服务提供者网络功能的信息。在直接通信中,所述第一信息可以是第一服务提供者网络功能向服务消费者网络功能发送。该实现方式的一个示例可参见下文图8中的相关内容。在间接通信中,所述第一信息可以是SCP在接收到第一服务提供者网络功能发送的HTTP重定向状态码和第二服务提供者网络功能的信息后,向服务消费者网络功能发送。该实现方式的一个示例可参见下文图9或图10或图11中的相关内容。In a possible implementation, the first information is a message, which is used to notify the service consumer network function, service access authorization failure or HTTP redirection or access token or other available service provider network Function; in this implementation manner, the first information optionally includes information about the network function of the second service provider. In direct communication, the first information may be sent by the first service provider network function to the service consumer network function. For an example of this implementation, refer to the relevant content in FIG. 8 below. In indirect communication, the first information may be sent by the SCP to the service consumer network function after receiving the HTTP redirection status code sent by the first service provider network function and the information of the second service provider network function. For an example of this implementation manner, refer to related content in FIG. 9 or FIG. 10 or FIG. 11 below.
可选的,服务消费者网络功能向网络仓库功能发送第一请求消息之前,服务消费者网络功能接收第一信息。即,该第一信息可以是服务消费者网络功能接收到的。在一种可能的实现方式中,该第一信息可能来自于网络仓库功能或服务通信代理或第一服务提供者网络功能,即,服务消费者网络功能可能接收来自于网络仓库功能(NRF)或服务通信代理(SCP)或第一服务提供者网络功能发送的所述第一信息。Optionally, before the service consumer network function sends the first request message to the network warehouse function, the service consumer network function receives the first information. That is, the first information may be received by the service consumer network function. In a possible implementation, the first information may come from the network repository function or the service communication agent or the first service provider network function, that is, the service consumer network function may receive information from the network repository function (NRF) or The first information sent by a Service Communication Proxy (SCP) or a first service provider network function.
示例性的,来自于第一服务提供者网络功能的第一信息可包括第一指示(用于指示HTTP重定向,或有其他可用的服务提供者网络功能,或服务访问授权失败,或获取访问令牌,比如HTTP重定向状态码)以及第二服务提供者网络功能的信息(如URI和示例标识)。第二服务提供者网络功能为HTTP重定向到的目标服务提供者网络功能。该实现方式的一个示例可参见下文中图8或图9中的相关内容。Exemplarily, the first information from the first service provider network function may include a first indication (for indicating HTTP redirection, or other available service provider network functions, or service access authorization failure, or obtaining access Tokens, such as HTTP redirection status codes) and information about the second service provider's network capabilities (such as URIs and instance identifiers). The second service provider network function is the target service provider network function to which HTTP is redirected. For an example of this implementation manner, refer to related content in FIG. 8 or FIG. 9 below.
示例性的,来自于SCP的第一信息可包括:第一指示,和/或,第二服务提供者网络功能的信息。其中,第一指示可包括:用于指示HTTP重定向或有其他可用的服务提供者网络功能的信息或服务访问授权失败或发生HTTP重定向或获取访问令牌。第二服务提供者网络功能的信息包括第二服务提供者网络功能的URI或示例标识。第二服务提供者网络功能为HTTP重定向到的目标服务提供者网络功能。Exemplarily, the first information from the SCP may include: the first indication, and/or information about the network function of the second service provider. Wherein, the first indication may include: information indicating HTTP redirection or other available service provider network functions, or service access authorization failure or HTTP redirection or access token acquisition. The information of the second service provider network function includes a URI or instance identification of the second service provider network function. The second service provider network function is the target service provider network function to which HTTP is redirected.
示例性的,来自于SCP的第一信息可以为一个消息,该消息用于通知服务消费者网络功能,服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能。该消息中可选地包括第二服务提供者网络功能的信息。第二服务提供者网络功能的信息包括第二服务提供者网络功能的URI或示例标识。第二服务提供者网络功能为HTTP重定向到的目标服务提供者网络功能。该实现方式的一个示例可参见下文中图10或图11中的相关内容。Exemplarily, the first information from the SCP may be a message, which is used to notify the service consumer network function, service access authorization failure or HTTP redirection or access token or other available service provider network function . The message optionally includes information about the network function of the second service provider. The information of the second service provider network function includes a URI or instance identification of the second service provider network function. The second service provider network function is the target service provider network function to which HTTP is redirected. For an example of this implementation manner, refer to related content in FIG. 10 or FIG. 11 below.
在一种可能的实现方式中,所述第二信息可包括:服务消费者网络功能请求的服务提供者网络功能的NF类型和/或NF Set标识、或提供该第一服务的服务提供者网络功能的网络功能类型和/或网络功能集(NF Set)标识、或第一服务提供者网络功能的网络功能类型和/或网络功能集(NF Set)标识、或第二服务提供者网络功能的网络功能类型和/或网络功能集(NF Set)标识。提供第一服务的服务提供者网络功能包括第一服务提供者网络功能和第二服务提供者网络功能。由于第一请求消息中包括第二信息,则网络仓库功能在检查服务消费者网络功能的授权成功之后,生成的相应的访问令牌中也包括第二信息。因为该访问令牌中包括的网络功能类型第二服务提供者的网络功能类型相同、和/或、该访问令牌中包括的网络功能集标识第二服务提供者的网络功能集标识相同,因此服务消费者网络功能可以使用该令牌访问第二服务提供者网络功能的第一服务时。In a possible implementation manner, the second information may include: the NF type and/or NF Set identifier of the service provider network function requested by the service consumer network function, or the service provider network that provides the first service The network function type and/or network function set (NF Set) identification of the function, or the network function type and/or network function set (NF Set) identification of the network function of the first service provider, or the network function of the second service provider Network function type and/or network function set (NF Set) identification. The service provider network function providing the first service includes a first service provider network function and a second service provider network function. Since the first request message includes the second information, the network repository function also includes the second information in the corresponding access token generated after checking that the authorization of the service consumer network function is successful. Because the network function type included in the access token is the same as the network function type of the second service provider, and/or the network function set identifier included in the access token is the same as the network function set identifier of the second service provider, therefore The service consumer web function can use the token to access the first service instance of the second service provider web function.
本文中,网络功能集(NF Set)可以包括一个或多个网络功能,具体的,可以包括一个或多个网络功能的实例标识,这些网络功能的网络功能类型相同,并可以提供相同的服务。In this paper, a network function set (NF Set) may include one or more network functions, specifically, may include one or more instance identifiers of network functions, and these network functions have the same network function type and can provide the same service.
本文中,服务消费者网络功能请求的服务提供者网络功能的网络功能类型、第二服务提供者网络功能的网络功能类型、和第一服务提供者网络功能的网络功能类型都是一样的。服务消费者网络功能请求的服务提供者网络功能的NF Set标识、第二服务提供者网络功能的NF Set标识、和第一服务提供者网络功能的NF Set标识都是一样的。Herein, the network function type of the service provider network function requested by the service consumer network function, the network function type of the second service provider network function, and the network function type of the first service provider network function are all the same. The NF Set identifier of the service provider network function requested by the service consumer network function, the NF Set identifier of the second service provider network function, and the NF Set identifier of the first service provider network function are all the same.
在一种可能的实现方式中,所述第二信息可包括第二服务提供者网络功能的实例标识,由于第一请求消息中包括第二服务提供者网络功能的实例标识,使得网络仓库功能在验证该服务消费者网络功能服务访问授权成功之后,生成的访问令牌中也包括第二服务提供者网络功能的实例标识。因此服务消费者可使用访问令牌访问第二服务提供者的第一服务。In a possible implementation manner, the second information may include the instance identifier of the network function of the second service provider, and since the first request message includes the instance identifier of the network function of the second service provider, the network repository function is After verifying that the network function service access authorization of the service consumer is successful, the generated access token also includes the instance identifier of the network function of the second service provider. The service consumer can thus use the access token to access the first service of the second service provider.
在一种可能的实现方式中,所述第二信息可包括多个服务提供者网络功能的实例标识,比如这些服务提供者网络功能都能提供第一服务,如第一服务提供者网络功能、或第二服务提供者网络功能。由于第一请求消息中包括多个服务提供者网络功能的实例标识,使得 网络仓库功能生成的访问令牌中也包括多个服务提供者网络功能的实例标识,也包括第二服务提供者网络功能的实例标识,因此服务消费者可使用生成的访问令牌访问第二服务提供者的第一服务。In a possible implementation manner, the second information may include instance identifiers of multiple service provider network functions, for example, these service provider network functions can all provide the first service, such as the first service provider network function, or a second service provider network function. Since the first request message includes the instance identifiers of multiple service provider network functions, the access token generated by the network warehouse function also includes the instance identifiers of multiple service provider network functions, including the second service provider network function , so the service consumer can use the generated access token to access the first service of the second service provider.
S502:网络仓库功能(NRF)生成访问令牌。S502: The Network Repository Function (NRF) generates an access token.
NRF在接收到服务消费者网络功能发送的第一请求消息后,可检查该服务消费者网络功能的服务访问授权,检查成功之后NRF生成访问令牌,该访问令牌包括第一服务的服务名称和第二信息,并通过第一响应消息将生成的访问令牌发送给该服务消费者网络功能,否则NRF拒绝为该服务消费者网络功能生成访问令牌,并向该服务消费者网络功能发送第一响应消息,其中包括错误原因,比如授权失败。After receiving the first request message sent by the service consumer network function, the NRF can check the service access authorization of the service consumer network function. After the check is successful, the NRF generates an access token, which includes the service name of the first service and the second information, and send the generated access token to the service consumer network function through the first response message, otherwise NRF refuses to generate an access token for the service consumer network function, and sends the generated access token to the service consumer network function The first response message, which includes the reason for the error, such as authorization failure.
NRF生成访问令牌,即NRF生成第一访问令牌、或第二访问令牌、或至少两个第三访问令牌、或第四访问令牌。NRF通过第一响应消息将生成的访问令牌发送给该服务消费者网络功能,即NRF将第一访问令牌、或第二访问令牌、或至少两个第三访问令牌、或第四访问令牌发送给服务消费者网络功能。见S503中对第一访问令牌、或第二访问令牌、第三访问令牌、以及第四访问令牌的描述。The NRF generates access tokens, ie the NRF generates a first access token, or a second access token, or at least two third access tokens, or a fourth access token. NRF sends the generated access token to the service consumer network function through the first response message, that is, NRF sends the first access token, or the second access token, or at least two third access tokens, or the fourth The access token is sent to the service consumer web function. See the description of the first access token, or the second access token, the third access token, and the fourth access token in S503.
S503:服务消费者网络功能接收来自NRF的第一响应消息。S503: The service consumer network function receives the first response message from the NRF.
在一种可能的实现方式中,所述第一响应消息中的访问令牌可包括第一访问令牌,该第一访问令牌包括服务提供者网络功能的NF类型,和/或服务提供者网络功能的NF set标识。该第一访问令牌的类型可以是“访问令牌(NF类型)”。该服务提供者网络功能为该服务消费网络功能请求的服务提供者网络功能、或可提供第一服务的服务提供者网络功能、或第一服务提供者网络功能、或第一服务提供者网络功能。示例性的,该第一访问令牌包括第二信息,即该第一访问令牌中包括服务消费者网络功能请求的服务提供者网络功能的NF类型和/或NF Set标识、或第二服务提供者网络功能的NF类型和/或NF Set标识、或第一服务提供者网络功能的NF类型和/或NF Set标识。由于第一访问令牌中所包括的NF类型与第二服务提供者网络功能的NF类型相同、和/或、第一访问令牌中所包括的NF Set标识与第二服务提供者网络功能的NF Set标识相同,因此当发生重定向时,该服务消费者网络功能可以使用第一访问令牌访问第二服务提供者网络功能的第一服务。示例地,当服务消费者网络功能在向第一服务提供者网络功能或第二服务提供者网络功能发送用于请求服务的消息之前,向NRF请求获取访问令牌时,NRF可将该第一访问令牌发送给该服务消费者网络功能。该实现方式的一个示例可参见图6或图7中的相关内容。In a possible implementation manner, the access token in the first response message may include a first access token, the first access token includes the NF type of the service provider network function, and/or the service provider The NF set identifier for the network function. The type of the first access token may be "access token (NF type)". The service provider network function is the service provider network function requested by the service consuming network function, or the service provider network function that can provide the first service, or the first service provider network function, or the first service provider network function . Exemplarily, the first access token includes second information, that is, the first access token includes the NF type and/or NF Set identifier of the service provider network function requested by the service consumer network function, or the second service The NF type and/or NF Set identification of the provider network function, or the NF type and/or NF Set identification of the first service provider network function. Since the NF type included in the first access token is the same as the NF type of the second service provider's network function, and/or, the NF Set identifier included in the first access token is the same as the NF set of the second service provider's network function The NF Set identifiers are the same, so when redirection occurs, the service consumer network function can use the first access token to access the first service of the second service provider network function. For example, when a service consumer web function requests an access token from the NRF before sending a message requesting a service to a first service provider web function or a second service provider web function, the NRF may take the first The access token is sent to the service consumer web function. For an example of this implementation manner, refer to related content in FIG. 6 or FIG. 7 .
在一种可能的实现方式中,所述第一响应消息中的访问令牌可包括第二访问令牌,该第二访问令牌包括多个服务提供者网络功能的实例标识。示例性的,该第二访问令牌包括第二信息,应理解为,第二信息中包括多个服务提供者网络功能的实例标识,第二访问令牌中所包括的服务提供者网络功能实例标识都是第二信息中的服务提供者网络功能实例标识。示例性的,这些提供者都可以提供第一服务,也即这些服务提供者包括第二服务提供者网络功能,也即第二访问令牌中包括第二服务提供者网络功能的实例标识,因此当发生重定向时,该服务消费者网络功能可以使用第二访问令牌访问第二服务提供者网络功能的第一服务。该第二访问令牌的类型可以是“访问令牌(NF实例)”。示例性的,当服务消费者网络功能在向第一服务提供者网络功能或第二服务提供者网络功能发送服务请求之前,向NRF请求获取访问令牌时,NRF可将该第二访问令牌发送给该服务消费者网络功能。该实现方式的一个示例可参见图6或图7中的相关内容。In a possible implementation manner, the access token in the first response message may include a second access token, where the second access token includes instance identifiers of multiple service provider network functions. Exemplarily, the second access token includes second information. It should be understood that the second information includes instance identifiers of multiple service provider network functions, and the service provider network function instances included in the second access token The identifiers are all service provider network function instance identifiers in the second information. Exemplarily, these providers can all provide the first service, that is, these service providers include the network function of the second service provider, that is, the second access token includes the instance identifier of the network function of the second service provider, so When redirection occurs, the service consumer web function can use the second access token to access the first service of the second service provider web function. The type of the second access token may be "Access Token (NF Instance)". Exemplarily, when the service consumer network function requests an access token from the NRF before sending a service request to the first service provider network function or the second service provider network function, the NRF can use the second access token Sent to this service consumer web function. For an example of this implementation manner, refer to related content in FIG. 6 or FIG. 7 .
在一种可能的实现方式中,所述第一响应消息中的访问令牌可包括多个第三访问令牌,每个第三访问令牌分别包括一个服务提供者网络功能的实例标识,该服务提供者网络功能可以提供第一服务,如第一服务提供者网络功能和第二服务提供者网络功能。该第三访问功能包括第二信息,可以理解为,每个第三访问令牌中的服务提供者网络功能的实例标识都是第二信息中的多个服务提供者网络功能的实例标识中的一个。这样,当发生重定向时,该服务消费者网络功能可以使用包括第二服务提供者网络功能的实例标识的第三访问令牌访问第二服务提供者网络功能的第一服务。该第三访问令牌的类型可以是“访问令牌(NF实例)”。示例性的,当服务消费者网络功能在向第一服务提供者网络功能或第二服务提供者网络功能发送服务请求之前,向NRF请求获取访问令牌时,NRF可将该多个第三访问令牌发送给该服务消费者网络功能。该实现方式的一个示例可参见图5中的相关内容。In a possible implementation manner, the access token in the first response message may include multiple third access tokens, and each third access token includes an instance identifier of a service provider network function, the A service provider network function may provide the first service, such as a first service provider network function and a second service provider network function. The third access function includes the second information. It can be understood that the instance identifier of the service provider network function in each third access token is the instance identifier of the plurality of service provider network functions in the second information. one. Thus, when redirection occurs, the service consumer web function can access the first service of the second service provider web function using the third access token comprising the instance identification of the second service provider web function. The type of the third access token may be "Access Token (NF Instance)". Exemplarily, when the service consumer network function sends a service request to the first service provider network function or the second service provider network function, when the NRF requests access tokens from the NRF, the multiple third access The token is sent to the service consumer web function. For an example of this implementation manner, reference may be made to related content in FIG. 5 .
在一种可能的实现方式中,所述第一响应消息中的访问令牌可包括第四访问令牌,该第四访问令牌包括第二服务提供者网络功能的实例标识。第四访问令牌包括第二信息,可以理解为,第二信息包括第二服务提供者网络功能的实例标识,第四访问令牌中的实例标识也包括第二服务提供者网络功能的实例标识,即第二信息。当发生重定向时,该服务消费者网络功能可以使用该第四访问令牌访问第二服务提供者网络功能的第一服务。该第四访问令牌的类型可以是“访问令牌(NF实例)”。示例性的,当服务消费者网络功能接收到来自第一服务提供者网络功能或SCP发送的第一信息之后,其中第一信息包括第二服务提供者网络功能的实例标识,服务消费者网络功能向NRF发送第一请求消息,用于请求获取访问令牌,第一请求消息中包括接收到的第二服务提供者网络功能的实例标识。NRF向服务消费者网络功能发送第四令牌,其中包括第二服务提供者网络功能的实例标识。该实现方式的一个示例可参见图8或图9或图10或图11中的相关内容。In a possible implementation manner, the access token in the first response message may include a fourth access token, where the fourth access token includes the instance identifier of the network function of the second service provider. The fourth access token includes the second information. It can be understood that the second information includes the instance identifier of the network function of the second service provider, and the instance identifier in the fourth access token also includes the instance identifier of the network function of the second service provider , the second information. When redirection occurs, the service consumer web function can use the fourth access token to access the first service of the second service provider web function. The type of the fourth access token may be "Access Token (NF Instance)". Exemplarily, after the service consumer network function receives the first information from the first service provider network function or SCP, wherein the first information includes the instance identifier of the second service provider network function, the service consumer network function Sending a first request message to the NRF for requesting to obtain an access token, where the first request message includes the received instance identifier of the network function of the second service provider. The NRF sends a fourth token to the service consumer web function, which includes the instance identifier of the second service provider web function. An example of this implementation manner may refer to related content in FIG. 8 or FIG. 9 or FIG. 10 or FIG. 11 .
可选的,上述流程还可包括以下步骤:服务消费者网络功能接收来自NRF的第一响应消息之后,向第一服务提供者网络功能或第二服务提供者网络功能或服务通信代理发送第二请求消息,所述第二请求消息用于请求服务,所述第二请求消息中包括第一访问令牌或第二访问令牌或第三访问令牌或第四访问令牌。Optionally, the above process may further include the following steps: after receiving the first response message from the NRF, the service consumer network function sends the second response message to the first service provider network function or the second service provider network function or the service communication agent A request message, the second request message is used to request a service, and the second request message includes the first access token or the second access token or the third access token or the fourth access token.
示例性的,服务消费者网络功能可在获得第一响应消息中的访问令牌后,向第一服务提供者网络功能(即初始服务提供者网络功能)发送第二请求消息(即用于服务请求的消息)。该服务请求消息中可包括第一访问令牌或第二访问令牌或第三访问令牌。该实现方式的一个示例可参见下文图6或图7中的相关内容。Exemplarily, after obtaining the access token in the first response message, the service consumer network function may send a second request message (that is, the requested message). The service request message may include the first access token or the second access token or the third access token. For an example of this implementation manner, refer to related content in FIG. 6 or FIG. 7 below.
示例性的,服务消费网络功能可在获得第一响应消息中的访问令牌后,向第二服务提供者网络功能发送第二请求消息(即用于服务请求的消息)。该服务请求消息中可包括第一访问令牌或第二访问令牌或第三访问令牌或第四访问令牌。该实现方式的一个示例可参见下文中图8、图9或图10或图11中的相关内容。Exemplarily, after obtaining the access token in the first response message, the service consuming network function may send a second request message (ie, a message for service request) to the second service provider network function. The service request message may include the first access token or the second access token or the third access token or the fourth access token. For an example of this implementation manner, refer to related content in FIG. 8 , FIG. 9 , or FIG. 10 or FIG. 11 below.
可选的,上述流程还可包括以下步骤:服务消费者网络功能接收第一信息之前,向第一服务提供者网络功能或服务通信代理发送第三请求消息,所述第三服务请求消息用于请求所述第一服务(即该消费者网络功能所请求的服务),该第三请求消息包括第五访问令牌。即,服务消费者网络功能向第一服务提供者网络功能(在直接通信场景下)或SCP(在间接通信场景下)发送第三请求消息(即用于服务请求的消息)后,接收到第一服务提供者网络功能或SCP发送的第一信息。根据第一信息,该服务消费者网络功能向NRF发送第一请求消息,用以请求获取访问令牌。一种可能的实现中,服务消费者网络功能向NRF 发送第一请求之前,服务消费者检查第五访问令牌,如果第五访问令牌中满足第二条件,则服务消费者网络功能向NRF发送第一请求消息,否则服务消费者不向NRF发送第一请求消息,而是直接向SCP或第二服务提供者网络功能发起用于请求服务的消息,其中该消息包括第五访问令牌。该第二条件为:第五访问令牌包括第一服务提供者网络功能的实例标识、和/或、第五访问令牌不包括服务提供者网络功能的NF类型、和/或、第五访问令牌不包括服务提供者网络功能的NF Set标识、和/或、第五访问令牌不包括服务提供者网络功能的NF Set标识和NF类型、和/或第五访问令牌不包括第二服务提供者网络功能的实例标识。即如果第五访问令牌包括第一服务提供者网络功能的实例标识、和/或、第五访问令牌不包括服务提供者网络功能的NF类型、和/或、第五访问令牌不包括服务提供者网络功能的NF Set标识、和/或、第五访问令牌不包括服务提供者网络功能的NF Set标识和NF类型、和/或第五访问令牌不包括第二服务提供者网络功能的实例标识,则服务消费者网络功能向NRF发送第一请求消息,其中包括第二信息。否则如果第五访问令牌包括第二服务提供者网络功能的实例标识、和/或、第五访问令牌包括服务提供者网络功能的NF类型、和/或、第五访问令牌包括服务提供者网络功能的NF Set标识、和/或、第五访问令牌包括服务提供者网络功能的NF Set标识和NF类型,则服务消费者网络功能直接向SCP或第二服务提供者网络功能发起用于请求服务的消息,其中该消息包括第五访问令牌。Optionally, the above process may further include the following step: before the service consumer network function receives the first information, send a third request message to the first service provider network function or the service communication agent, and the third service request message is used for To request said first service (ie the service requested by the consumer network function), the third request message includes a fifth access token. That is, after the service consumer network function sends the third request message (that is, the message for service request) to the first service provider network function (in the direct communication scenario) or the SCP (in the indirect communication scenario), it receives the first A first message sent by a service provider network function or SCP. According to the first information, the service consumer network function sends a first request message to the NRF to request to obtain an access token. In a possible implementation, before the service consumer network function sends the first request to the NRF, the service consumer checks the fifth access token, and if the second condition is met in the fifth access token, the service consumer network function sends the NRF Send the first request message, otherwise the service consumer does not send the first request message to the NRF, but directly initiates a service request message to the SCP or the second service provider network function, wherein the message includes the fifth access token. The second condition is: the fifth access token includes the instance identifier of the first service provider network function, and/or, the fifth access token does not include the NF type of the service provider network function, and/or, the fifth access The token does not include the NF Set identity of the service provider network function, and/or, the fifth access token does not include the NF Set identity and the NF type of the service provider network function, and/or the fifth access token does not include the second The instance ID of the service provider network function. That is, if the fifth access token includes the instance identity of the first service provider network function, and/or, the fifth access token does not include the NF type of the service provider network function, and/or, the fifth access token does not include The NF Set identity of the service provider network function, and/or, the fifth access token does not include the NF Set identity and NF type of the service provider network function, and/or the fifth access token does not include the second service provider network If the instance identifier of the function is used, the service consumer network function sends a first request message to the NRF, which includes the second information. Otherwise if the fifth access token includes the instance identity of the second service provider network function, and/or, the fifth access token includes the NF type of the service provider network function, and/or, the fifth access token includes the service provider If the NF Set identifier of the provider network function, and/or, the fifth access token includes the NF Set identifier and NF type of the service provider network function, then the service consumer network function directly initiates the usage to the SCP or the second service provider network function A message for requesting a service, wherein the message includes a fifth access token.
该实现方式的一个示例可参见下文图8、图9或图10或图11中的相关内容。For an example of this implementation manner, refer to related content in FIG. 8 , FIG. 9 , or FIG. 10 or FIG. 11 below.
可选的,上述流程还可包括以下步骤:服务消费者网络功能接收到第一信息之前,向NRF发送第四请求消息,该第四请求消息中包括第一服务(即该消费者网络功能请求的服务)的服务名称,该第四请求消息用于请求发现该第一服务或发现可提供第一服务的网络功能实例。即,服务消费者网络功能首先向NRF发送第四请求消息,以进行服务发现,NRF可向服务消费者网络功能发送多个服务提供者网络功能的网络功能文件(NF profile),其中包括服务提供者网络功能的实例标识,并且这些网络功能可提供第一服务。可以理解为,服务消费者网络功能从NRF处可以获取多个服务提供者网络功能的标识(即第一信息)。服务发现流程的一个示例可参见图3所示的流程。Optionally, the above process may further include the following steps: before the service consumer network function receives the first information, send a fourth request message to the NRF, the fourth request message includes the first service (that is, the consumer network function request service), the fourth request message is used to request to discover the first service or to discover a network function instance that can provide the first service. That is, the service consumer network function first sends a fourth request message to the NRF to perform service discovery, and the NRF can send multiple service provider network function network function files (NF profiles) to the service consumer network function, including service provider Instance identifications of or network functions, and the network functions may provide the first service. It can be understood that the network function of the service consumer can obtain the identifiers (that is, the first information) of multiple service provider network functions from the NRF. An example of a service discovery process may refer to the process shown in FIG. 3 .
上述图5所示的流程中,由于服务消费者网络功能发送的第一请求消息携带第一服务的服务名称和第二信息,该第一服务即为该服务消费者网络功能请求的服务,该第二信息为提供该第一服务的服务提供者网络功能的网络功能类型或提供该第一服务的服务提供者网络功能的网络功能集标识或第二服务提供者网络功能(也即目标服务提供者网络功能)的实例标识或第一服务提供者网络功能的网络功能类型或第一服务提供者网络功能的网络功能集标识或第二服务提供者网络功能的网络功能类型或第二服务提供者网络功能的网络功能集标识。通过该第一请求消息,该服务消费者网络功能可获得访问令牌,该访问令牌包括第二信息。该访问令牌用于该服务消费者网络功能访问第二服务提供者网络功能的第一服务(即所请求的服务)时的授权检查。这样,当发生重定向时,服务消费者网络功能需要访问第二服务提供者网络功能的第一服务,该服务消费者网络功能由于已经获得访问令牌,该访问令牌可用于访问该第二服务提供者网络功能的该第一服务时的授权检查,因此该第二服务提供者网络功能能够检查该访问令牌成功,然后为该服务消费者网络功能提供服务,从而在发生重定向时,可以保证服务消费者网络功能能够获得第二服务提供者网络功能提供的服务。In the process shown in FIG. 5 above, since the first request message sent by the service consumer network function carries the service name and second information of the first service, the first service is the service requested by the service consumer network function. The second information is the network function type of the service provider network function providing the first service or the network function set identifier of the service provider network function providing the first service or the second service provider network function (that is, the target service provider or the network function type of the first service provider network function or the network function set identification of the first service provider network function or the network function type of the second service provider network function or the second service provider The network capability set ID of the network function. Through the first request message, the service consumer web function can obtain an access token, the access token including the second information. The access token is used for an authorization check when the service consumer web function accesses the first service (ie the requested service) of the second service provider web function. In this way, when a redirection occurs, the service consumer web function needs to access the first service of the second service provider web function, and since the service consumer web function has obtained an access token, the access token can be used to access the second service provider web function. The first service-time authorization check of the service provider web function, so the second service provider web function can check the access token successfully, and then serve the service consumer web function, so that when the redirect occurs, It can be guaranteed that the service consumer network function can obtain the service provided by the second service provider network function.
参见图6,为本申请实施例中的直接通信场景下的一种网络功能服务授权方法的流程 示意图,如图所示,该流程可包括:Referring to Figure 6, it is a schematic flow diagram of a network function service authorization method in the direct communication scenario in the embodiment of the present application. As shown in the figure, the flow may include:
步骤0:服务消费者网络功能在请求访问令牌之前,确定或接收第一信息。Step 0: The service consumer web function determines or receives the first information before requesting the access token.
一种可能的实现中,服务消费者网络功能确定第一信息包括检查该服务消费者网络功能、和/或请求的服务、和/或请求的服务提供者网络功能是否支持HTTP重定向。若支持,服务消费者网络功能确定第一信息,即确定该服务消费者网络功能、和/或请求的服务、和/或请求的服务提供者网络功能支持HTTP重定向,也即第一信息用于表示服务消费者网络功能、和/或请求的服务、和/或请求的服务提供者网络功能支持HTTP重定向特性、或者用于表示服务消费者网络功能、请求的服务、和请求的服务提供者网络功能中至少一个支持HTTP重定向特性。这里请求的服务为第一服务;请求的服务提供者网络功能可以为第一服务提供者网络功能、或提供第一服务的服务提供者网络功能。可以理解为提供第一服务的服务提供者网络功能包括第一服务提供者网络功能和第二服务提供者网络功能。In a possible implementation, the service consumer network function determining the first information includes checking whether the service consumer network function, and/or the requested service, and/or the requested service provider network function support HTTP redirection. If supported, the service consumer network function determines the first information, that is, it determines that the service consumer network function, and/or the requested service, and/or the requested service provider network function supports HTTP redirection, that is, the first information uses Used to represent service consumer web functions, and/or requested services, and/or requested service provider web functions that support the HTTP redirection feature, or used to represent service consumer web functions, requested services, and requested service providers At least one of the network functions supports the HTTP redirection feature. The service requested here is the first service; the requested service provider network function may be the first service provider network function, or a service provider network function that provides the first service. It can be understood that the service provider network function providing the first service includes the first service provider network function and the second service provider network function.
这里的,第一信息表示服务消费者网络功能、和/或第一服务、和/或提供第一服务的服务提供者网络功能支持HTTP重定向。Here, the first information indicates that the service consumer network function, and/or the first service, and/or the service provider network function providing the first service support HTTP redirection.
一种可能的实现中,服务消费者网络功能接收第一信息,包括服务消费者网络功能接收NRF发送的多个网络功能的NF Profile或多个网络功能的实例标识,其中这些网络功能可提供第一服务。这里的第一信息包括多个网络功能的NF Profile或多个网络功能的实例标识。可以理解为,服务消费者网络功能在接收到第一信息之前,向NRF发送用于请求服务发现的消息,该消息包括第一服务的服务名称,NRF向服务消费者发送发现结果,其中包括第一信息,即多个网络功能的网络功能文件(NF profile)或多个网络功能的实例标识。每个NF Profile中都包括网络功能的实例标识。这些网络功能都可提供第一服务。In a possible implementation, the service consumer network function receives the first information, including the service consumer network function receiving the NF Profile of multiple network functions sent by NRF or the instance identifiers of multiple network functions, where these network functions can provide the first One serving. The first information here includes NF Profiles of multiple network functions or instance identifiers of multiple network functions. It can be understood that, before receiving the first information, the network function of the service consumer sends a message for requesting service discovery to the NRF, the message includes the service name of the first service, and the NRF sends the discovery result to the service consumer, including the first One piece of information, that is, network function files (NF profiles) of multiple network functions or instance identifiers of multiple network functions. Each NF Profile includes the instance identifier of the network function. These network functions can all provide the first service.
一种可能的实现中,服务消费者网络功能确定第一信息,包括检查可以提供第一服务的服务提供者网络功能实例是否有多个。如果包括,则服务消费者网络功能确定第一信息,即确定提供第一服务的服务提供者网络功能实例有多个。这里第一信息表示提供第一服务的服务提供者网络功能实例有多个。In a possible implementation, the determination of the first information by the service consumer network function includes checking whether there are multiple service provider network function instances that can provide the first service. If so, the service consumer network function determines the first information, that is, determines that there are multiple service provider network function instances providing the first service. Here, the first information indicates that there are multiple service provider network function instances providing the first service.
一种可能的实现中,服务消费者网络功能确定第一信息,包括检查可以提供第一服务的服务提供者网络功能的网络功能集中是否有多个网络功能实例,如果是,则服务消费者网络功能确定第一信息,即确定可以提供第一服务的服务提供者网络功能的网络功能集中有多个网络功能实例。这里的第一信息用于表示可以提供第一服务的服务提供者网络功能的网络功能集中有多个网络功能实例。In a possible implementation, the service consumer network function determines the first information, including checking whether there are multiple network function instances in the network function set of the service provider network function that can provide the first service, and if so, the service consumer network The function determines the first information, that is, it is determined that there are multiple network function instances in the network function set of the service provider network function that can provide the first service. The first information here is used to indicate that there are multiple network function instances in the network function set of the service provider network function that can provide the first service.
本文中,HTTP重定向特性也简称为HTTP重定向。In this document, the HTTP redirection feature is also referred to as HTTP redirection for short.
可选的,服务消费者网络功能检查自己是否支持HTTP重定向时,可以根据本地配置,如果本地配置指示该服务消费者网络功能支持HTTP重定向,则表明该服务消费者网络功能支持HTTP重定向。Optionally, when the service consumer network function checks whether it supports HTTP redirection, it can be based on the local configuration. If the local configuration indicates that the service consumer network function supports HTTP redirection, it indicates that the service consumer network function supports HTTP redirection .
可选的,服务消费者网络功能检查请求的服务提供者网络功能或者请求的服务(也即第一服务)或请求的服务实例(也即第一服务实例)是否支持HTTP重定向时,可以根据本地配置或根据从NRF中获得的网络功能文件(NF Profile)进行检查。一种可能的实现方式中,在服务发现流程中,NRF向服务消费者网络功能返回NF Profile。如果请求的服务提供者网络功能的NF Profile中的支持特性(supportedFeatures)包括HTTP重定向,则表明请求的服务者网络功能或者请求的服务或者请求的服务实例支持HTTP重定向。如果NF Profile中第一服务或第一服务实例支持的特性(supportedFeatures)包括HTTP重定向, 则表明第一服务或第一服务实例支持HTTP重定向。Optionally, when the service consumer network function checks whether the requested service provider network function or the requested service (that is, the first service) or the requested service instance (that is, the first service instance) supports HTTP redirection, it may be based on Configure locally or check against the NF Profile obtained from NRF. In a possible implementation, in the service discovery process, the NRF returns the NF Profile to the service consumer network function. If the supported features (supportedFeatures) in the NF Profile of the requested service provider network function include HTTP redirection, it indicates that the requested server network function or the requested service or the requested service instance supports HTTP redirection. If the features (supportedFeatures) supported by the first service or the first service instance in the NF Profile include HTTP redirection, it indicates that the first service or the first service instance supports HTTP redirection.
步骤1:服务消费者网络功能根据第一信息,向NRF发送用于请求访问令牌的消息,该消息中包括第二信息。该消息对应于图5中的第一请求消息。Step 1: The service consumer network function sends a message for requesting an access token to the NRF according to the first information, and the message includes the second information. This message corresponds to the first request message in FIG. 5 .
服务消费者网络功能根据第一信息,向NRF发送用于请求访问令牌的消息,该消息中包括第一服务的服务名称和第二信息,应理解为,服务消费者网络功能确定或接收到第一信息之后,向NRF发送用于请求访问令牌的消息,该消息中应包括第二信息。也即,The service consumer network function sends a message for requesting an access token to the NRF according to the first information, the message includes the service name of the first service and the second information, it should be understood that the service consumer network function determines or receives After the first information, a message for requesting an access token is sent to the NRF, and the message should include the second information. That is,
若该服务消费者网络功能、和/或请求的服务、和/或请求的服务提供者网络功能支持HTTP重定向,则服务消费者网络功能向NRF发送用于请求访问令牌的消息,该消息中应包括第二信息;或If the service consumer web function, and/or the requested service, and/or the requested service provider web function supports HTTP redirection, the service consumer web function sends a message requesting an access token to the NRF, the message shall include the second information; or
若该服务消费者网络功能、请求的服务、和请求的服务提供者网络功能中的至少一个支持HTTP重定向,则服务消费者网络功能向NRF发送用于请求访问令牌的消息,该消息中应包括第二信息;或If at least one of the service consumer web function, the requested service, and the requested service provider web function supports HTTP redirection, the service consumer web function sends a message requesting an access token to the NRF, in which shall include the second information; or
若服务消费者网络功能接收的第一信息中包括多个网络功能的NF Profile或多个网络功能的实例标识,则服务消费者网络功能向NRF发送用于请求访问令牌的消息,该消息中应包括第二信息;或If the first information received by the network function of the service consumer includes NF Profiles of multiple network functions or instance identifiers of multiple network functions, the network function of the service consumer sends a message for requesting an access token to the NRF, in which shall include the second information; or
若可以提供第一服务的服务提供者网络功能实例有多个,则服务消费者网络功能向NRF发送用于请求访问令牌的消息,该消息中应包括第二信息;If there are multiple service provider network function instances that can provide the first service, the service consumer network function sends a message for requesting an access token to the NRF, and the message should include the second information;
若可以提供第一服务的服务提供者网络功能的网络功能集中有多个网络功能实例,则服务消费者网络功能向NRF发送用于请求访问令牌的消息,该消息中应包括第二信息;If there are multiple network function instances in the network function set of the service provider network function that can provide the first service, the service consumer network function sends a message for requesting an access token to the NRF, and the message should include the second information;
第二信息包括:请求的服务提供者网络功能的NF类型和/或NF Set标识、或第一服务提供者网络功能的NF类型和/或NF Set标识、或者多个服务提供者网络功能的实例标识,其中每个服务提供者网络功能都可以提供第一服务。应理解,服务消费者请求的服务提供者网络功能可以为第一服务提供者网络功能、或提供第一服务的服务提供者网络功能。提供第一服务的服务提供者网络功能包括第一服务提供者网络功能和第二服务提供者网络功能。第一服务提供者网络功能的NF类型、第二服务提供者网络功能的NF类型、和请求的服务提供者网络功能的NF类型是一样的。第一服务提供者网络功能的NF Set标识、第二服务提供者网络功能的NF Set标识、和请求的服务提供者网络功能的NF Set标识是一样的。The second information includes: the NF type and/or NF Set identification of the requested service provider network function, or the NF type and/or NF Set identification of the first service provider network function, or instances of multiple service provider network functions Identify, where each service provider network function can provide the first service. It should be understood that the service provider network function requested by the service consumer may be the first service provider network function, or the service provider network function that provides the first service. The service provider network function providing the first service includes a first service provider network function and a second service provider network function. The NF type of the first service provider network function, the NF type of the second service provider network function, and the NF type of the requesting service provider network function are the same. The NF Set identifier of the first service provider network function, the NF Set identifier of the second service provider network function, and the NF Set identifier of the requested service provider network function are the same.
步骤2:NRF检查服务消费者网络功能是否有授权访问请求的第一服务。检查成功之后,NRF生成一个或多个访问令牌,具体可包括以下三种情况:Step 2: The NRF checks if the service consumer network function has authorization to access the requested first service. After the check is successful, NRF generates one or more access tokens, which can include the following three situations:
情况一:生成第一访问令牌,该第一访问令牌包括请求的服务提供者网络功能的NF类型和/或NF set、或第一服务提供者网络功能的NF类型和/或NF Set标识,也即第一访问令牌包括第二信息。Case 1: Generate a first access token, the first access token includes the NF type and/or NF set of the requested service provider network function, or the NF type and/or NF Set identifier of the first service provider network function , that is, the first access token includes the second information.
情况二:生成第二访问令牌,访第二问令牌包括多个服务提供者网络功能的实例标识,第二令牌中的每个服务提供者网络功能的实例标识都是第二信息中的一个服务提供者网络功能的实例标识,也即第二访问令牌包括第二信息。Case 2: Generate a second access token. The second access token includes instance identifiers of multiple service provider network functions, and the instance identifiers of each service provider network function in the second token are included in the second information. An instance identifier of a service provider network function of , that is, the second access token includes the second information.
情况三:生成多个第三访问令牌,每个第三访问令牌中包括服务提供者网络功能的实例标识,该服务提供者网络功能的实例标识为第二信息中的多个服务提供者网络功能的实例标识中的一个。Case 3: Multiple third access tokens are generated, and each third access token includes the instance identifier of the service provider network function, and the instance identifier of the service provider network function is a plurality of service providers in the second information One of the instance IDs of the network function.
上述第一访问令牌、第二访问令牌和第三访问令牌中,还包括第一服务的名称、服务消费者网络功能的实例标识等。The above-mentioned first access token, second access token and third access token also include the name of the first service, the instance identifier of the service consumer network function, and the like.
步骤3:NRF向服务消费者网络功能返回生成的一个或多个访问令牌。Step 3: The NRF returns the generated one or more access tokens to the service consumer web function.
步骤4:服务消费者网络功能向第一服务提供者网络功能(即初始服务提供者网络功能)发送用于请求服务的消息(即服务请求),该消息中包括步骤3中获取到的访问令牌。Step 4: The service consumer network function sends a message for requesting services (ie, a service request) to the first service provider network function (ie, the initial service provider network function), and the message includes the access token obtained in step 3 Card.
可选的,当服务消费者网络功能在步骤3中接收到多个访问令牌时,服务消费者网络功能可以在该消息中包括接收到的多个访问令牌、或其中一个第三访问令牌,该第三访问令牌中包括第一服务提供者网络功能的实例标识。该消息对应图5所示流程中发送给第一服务提供者网络功能的第二请求消息。Optionally, when the service consumer network function receives multiple access tokens in step 3, the service consumer network function may include the multiple received access tokens or one of the third access tokens in the message card, the third access token includes the instance identifier of the network function of the first service provider. This message corresponds to the second request message sent to the network function of the first service provider in the process shown in FIG. 5 .
步骤5:第一服务提供者网络功能可能向该服务消费者网络功能发送响应消息,其中包括HTTP重定向状态码(比如HTTP 307 redirection或HTTP 308 redirection)以及第二服务提供者网络功能(即目标服务提供者网络功能)的信息(如实例标识和/或URI)。Step 5: The first service provider network function may send a response message to the service consumer network function, which includes an HTTP redirect status code (such as HTTP 307 redirection or HTTP 308 redirection) and the second service provider network function (ie, the target Service Provider Network Functions) information (such as instance ID and/or URI).
步骤6:服务消费者网络功能根据HTTP重定向状态码以及第二服务提供者网络功能的信息,向第二服务提供者网络功能发送用于请求服务的消息,该消息中包括步骤3中接收到的访问令牌。该服务请求消息对应于图5所示流程中发送给第二服务提供者网络功能的第二请求消息。Step 6: The service consumer network function sends a message for requesting services to the second service provider network function according to the HTTP redirection status code and the information of the second service provider network function, and the message includes the information received in step 3. access token for . The service request message corresponds to the second request message sent to the second service provider network function in the process shown in FIG. 5 .
一种可能的实现,当服务消费者网络功能在步骤3中接收到多个访问令牌时,服务消费者网络功能选择包括第二服务提供者网络功能的实例标识的访问令牌,并在步骤6的消息中包括该访问令牌,或者,服务消费者网络功能在步骤6的消息中包括接收到的多个访问令牌。In one possible implementation, when the service consumer web function receives multiple access tokens in step 3, the service consumer web function selects the access token that includes the instance ID of the second service provider web function, and in step The message in step 6 includes the access token, or the service consumer network function includes the multiple received access tokens in the message in step 6.
步骤7:第二服务提供者网络功能验证接收的访问令牌,若验证通过,则为该服务消费者网络功能提供服务。Step 7: The second service provider network function verifies the received access token, and if the verification passes, it provides services for the service consumer network function.
一种可能的实现中,当访问令牌中包括多个服务提供者网络功能的实例标识时,第二服务提供者网络功能检查其中是否包括该第二服务提供者网络功能的实例标识,如果不包括,则验证访问令牌失败,第二服务提供者网络功能不执行服务消费者网络功能请求的服务,并返回包括有错误原因的响应消息。若验证访问令牌成功,则第二服务提供者网络功能执行访问消费者网络功能请求的服务。In a possible implementation, when the access token includes multiple instance identifiers of the service provider network function, the second service provider network function checks whether the instance identifier of the second service provider network function is included, and if not If yes, the verification of the access token fails, the second service provider network function does not perform the service requested by the service consumer network function, and returns a response message including an error reason. If the verification of the access token is successful, the second service provider web function performs access to the service requested by the consumer web function.
需要说明的是,上述图6所示的流程中,步骤1-3,即访问令牌获取的流程,与步骤4-7,即服务访问的流程,属于两个独立的流程,可独立执行。It should be noted that in the process shown in Figure 6 above, steps 1-3, the process of obtaining an access token, and steps 4-7, namely the process of service access, belong to two independent processes and can be executed independently.
参见图7,为本申请实施例中的间接通信场景下的一种网络功能服务授权方法的流程示意图,如图所示,该流程可包括:Referring to FIG. 7 , it is a schematic flowchart of a network function service authorization method in the indirect communication scenario in the embodiment of the present application. As shown in the figure, the process may include:
步骤0:服务消费者网络功能在请求访问令牌之前,确定或接收第一信息。该步骤的具体实现方式与图6中的步骤0基本相同。不同之处在于:Step 0: The service consumer web function determines or receives the first information before requesting the access token. The specific implementation of this step is basically the same as step 0 in FIG. 6 . The difference is:
一种可能的实现中,服务消费者网络功能确定第一信息,包括检查服务消费者网络功能是否通过SCP跟服务提供者网络功能通信。如果是,则服务消费者网络功能确定第一信息,即确定服务消费者网络功能通过SCP跟服务提供者网络功能通信。这里的第一信息用于表示服务消费者网络功能通过SCP跟服务提供者网络功能通信。In a possible implementation, the service consumer network function determines the first information, including checking whether the service consumer network function communicates with the service provider network function through the SCP. If yes, the service consumer network function determines the first information, that is, it is determined that the service consumer network function communicates with the service provider network function through the SCP. The first information here is used to indicate that the service consumer network function communicates with the service provider network function through the SCP.
可选的,NRF在检查服务消费者网络功能是否通过SCP跟服务提供者网络功能通信,可以根据本地配置来进行检查。如果本地配置指示网络或者服务消费者网络功能支持或使用间接通信或服务消费者网络功能是否通过SCP跟服务提供者网络功能通信,则表明服务 消费者网络功能是否通过SCP跟服务提供者网络功能通信。Optionally, the NRF is checking whether the network function of the service consumer communicates with the network function of the service provider through the SCP, which may be checked according to local configuration. If the local configuration indicates that the network or service consumer network function supports or uses indirect communication or whether the service consumer network function communicates with the service provider network function through SCP, indicates whether the service consumer network function communicates with the service provider network function through SCP .
步骤1:服务消费者网络功能根据第一信息向NRF发送用于请求访问令牌的消息,包括第二信息。该步骤的具体实现方式与图6中的步骤1基本相同。Step 1: The service consumer network function sends a message for requesting an access token to the NRF according to the first information, including the second information. The specific implementation of this step is basically the same as step 1 in FIG. 6 .
步骤2:NRF检查服务消费者网络功能是否有授权访问请求的第一服务。检查成功之后,NRF生成一个或多个访问令牌。该步骤的具体实现方式与图6中的步骤2基本相同。Step 2: The NRF checks if the service consumer network function has authorization to access the requested first service. After a successful check, NRF generates one or more access tokens. The specific implementation of this step is basically the same as step 2 in FIG. 6 .
步骤3:NRF向服务消费者网络功能返回生成的一个或多个访问令牌。Step 3: The NRF returns the generated one or more access tokens to the service consumer web function.
步骤4:服务消费者网络功能向第一服务提供者网络功能(即初始服务提供者网络功能)发送用于请求服务的消息(即服务请求),该消息经由SCP被发送到第一服务提供者网络功能。该消息中包括的内容可参见图6中的相关步骤描述。Step 4: The Service Consumer Network Function sends a message requesting the service (ie Service Request) to the First Service Provider Network Function (ie the Initial Service Provider Network Function), which is sent to the First Service Provider via the SCP Internet function. For the content included in the message, refer to the description of related steps in FIG. 6 .
步骤5:第一服务提供者网络功能可能发送响应消息,其中包括HTTP重定向状态码(比如HTTP 307 redirection或HTTP 308 redirection)以及第二服务提供者网络功能(即目标服务提供者网络功能)的信息(如URI和/或实例标识),该响应消息经由SCP被发送到该服务消费者网络功能。Step 5: The first service provider network function may send a response message, which includes an HTTP redirect status code (such as HTTP 307 redirection or HTTP 308 redirection) and the second service provider network function (ie, the target service provider network function) Information (such as URI and/or instance identification), the response message is sent to the service consumer web function via SCP.
步骤6:服务消费者网络功能接收到步骤4中发送的消息之后,根据HTTP重定向状态码以及第二服务提供者网络功能的信息,向第二服务提供者网络功能发送服务请求消息,该消息中包括步骤3中接收到的访问令牌,该服务请求消息经由SCP被发送到第二服务提供者网络功能。该步骤的具体实现方式可参见图6中的相关步骤描述。Step 6: After receiving the message sent in step 4, the service consumer network function sends a service request message to the second service provider network function according to the HTTP redirection status code and the information of the second service provider network function, and the message Including the access token received in step 3, the service request message is sent to the second service provider network function via SCP. For a specific implementation manner of this step, reference may be made to the description of related steps in FIG. 6 .
步骤7:第二服务提供者网络功能验证接收的访问令牌,若验证通过,则为该服务消费者网络功能提供服务。该步骤的具体实现方式可参见图6中的相关步骤描述。Step 7: The second service provider network function verifies the received access token, and if the verification passes, it provides services for the service consumer network function. For a specific implementation manner of this step, reference may be made to the description of related steps in FIG. 6 .
在一种可能的实现方式中,SCP在接收到第一服务提供者网络功能发送的重定向HTTP重定向状态码以及第二服务提供者网络功能的信息之后,直接将服务请求消息发送给该第二服务提供者网络功能。In a possible implementation, the SCP directly sends the service request message to the second service provider's network function after receiving the redirection HTTP redirection status code sent by the network function of the first service provider and the information of the network function of the second service provider. 2. Service provider network functions.
需要说明的是,上述图7所示的流程中,步骤1-3,即访问令牌获取的流程,与步骤4-7,即服务访问的流程,属于两个独立的流程,可独立执行。It should be noted that, in the process shown in Figure 7 above, steps 1-3, namely, the process of obtaining an access token, and steps 4-7, namely, the process of service access, belong to two independent processes and can be executed independently.
参见图8,为本申请实施例中的直接通信场景下的一种网络功能服务授权方法的流程示意图,如图所示,该流程可包括:Referring to FIG. 8 , it is a schematic flowchart of a network function service authorization method in the direct communication scenario in the embodiment of the present application. As shown in the figure, the process may include:
步骤1:服务消费者网络功能向NRF发送用于请求访问令牌的消息。该消息中包括该服务消费者网络功能的实例标识、服务消费者网络功能请求的服务的服务名称。该消息还可能包括服务消费者网络功能请求的服务提供者网络功能的NF类型或实例标识。服务消费者网络功能请求的服务为第一服务。服务消费者网络功能请求的服务提供者网络功能为提供第一服务的服务提供者网络功能,比如第一服务提供者网络功能。Step 1: The service consumer web function sends a message to the NRF requesting an access token. The message includes the instance identifier of the service consumer network function and the service name of the service requested by the service consumer network function. The message may also include the NF type or instance identifier of the service provider network function requested by the service consumer network function. The service requested by the service consumer network function is the first service. The service provider network function requested by the service consumer network function is the service provider network function that provides the first service, such as the first service provider network function.
步骤2:NRF检查服务消费者网络功能是否有授权访问请求的服务。检查成功之后,NRF生成访问令牌,称为第五访问令牌。第五访问令牌可能是访问令牌(NF类型)或访问令牌(NF实例)。如果步骤1的消息中,服务消费者网络功能包括请求的服务提供者网络功能的NF类型,则第五访问令牌为(NF类型),即该第五访问令牌中包括请求的服务提供者网络功能的NF类型(如第一服务提供者网络功能的NF类型);如果步骤1的消息中,服务消费者网络功能包括请求的服务提供者网络功能的实例标识,则第五访问令牌为(NF实例),即该第五访问令牌中包括请求的服务提供者网络功能的实例标识(如第一服务提供者网络功能的实例标识)。第五令牌还包括服务消费者网络功能的实例标识、请求的服务的名称、NRF的实例标识等。Step 2: The NRF checks whether the service consumer network function has authorization to access the requested service. After a successful check, NRF generates an access token, called the fifth access token. The fifth access token may be an access token (NF type) or an access token (NF instance). If in the message in step 1, the service consumer network function includes the NF type of the requested service provider network function, then the fifth access token is (NF type), that is, the fifth access token includes the requested service provider The NF type of the network function (such as the NF type of the first service provider network function); if in the message of step 1, the service consumer network function includes the instance identifier of the requested service provider network function, then the fifth access token is (NF instance), that is, the fifth access token includes the instance identifier of the requested service provider network function (such as the instance identifier of the first service provider network function). The fifth token also includes the instance identifier of the service consumer network function, the name of the requested service, the instance identifier of the NRF, and the like.
步骤3:NRF向服务消费者网络功能返回生成的第五访问令牌。Step 3: NRF returns the generated fifth access token to the service consumer web function.
步骤4:服务消费者网络功能向第一服务提供者网络功能(即初始服务提供者网络功能)发送用于请求第一服务的消息,其中包括第五访问令牌等。Step 4: The service consumer network function sends a message for requesting the first service to the first service provider network function (ie, the initial service provider network function), including the fifth access token and so on.
步骤5:第一服务提供者网络功能在过载状态或即将进入过载状态时,可向该服务消费者网络功能返回一个响应消息,其中包括HTTP重定向状态码以及第二服务提供者网络功能(即目标服务提供者网络功能)的信息。在本文中,第二服务提供者网络功能为HTTP重定向到的服务提供者网络功能,也即可用的服务提供者网络功能,也即可提供第一服务的服务提供者网络功能。这里的HTTP重定向状态码对应图5中的第一指示,HTTP重定向状态码以及第二服务提供者网络功能(即目标服务提供者网络功能)的信息对应图5的第一信息。Step 5: When the first service provider network function is in the overload state or is about to enter the overload state, it can return a response message to the service consumer network function, which includes the HTTP redirection status code and the second service provider network function (ie Target Service Provider Network Capabilities) information. Herein, the second service provider network function is the service provider network function to which HTTP is redirected, that is, the available service provider network function, that is, the service provider network function that can provide the first service. The HTTP redirection status code here corresponds to the first indication in FIG. 5 , and the HTTP redirection status code and the information of the second service provider network function (that is, the target service provider network function) correspond to the first information in FIG. 5 .
步骤6:服务消费者网络功能根据接收到的HTTP重定向状态码以及第二服务提供者网络功能的信息,向NRF发送用于请求访问令牌的消息,该消息中包括第二信息。该消息对应于图5中S501中的第一请求消息。Step 6: The service consumer network function sends a message for requesting an access token to the NRF according to the received HTTP redirection status code and the information of the second service provider network function, and the message includes the second information. This message corresponds to the first request message in S501 in FIG. 5 .
一种可能的实现方式中,第二信息可包括:第二服务提供者网络功能的信息,比如第二服务提供者网络功能的实例标识,或者第二服务提供者网络功能的NF类型,或者第二服务提供者网络功能的NF类型和NF Set标识、或者第二服务提供者网络功能的NF Set标识。In a possible implementation manner, the second information may include: information about the network function of the second service provider, such as the instance identifier of the network function of the second service provider, or the NF type of the network function of the second service provider, or the The NF type and NF Set identifier of the network function of the second service provider, or the NF Set identifier of the network function of the second service provider.
又一种可能的实现方式中,第二信息可包括:第一服务提供者网络功能的信息,比如第一服务提供者网络功能的NF类型,或者第一服务提供者网络功能的NF类型和NF Set标识、或者第一服务提供者网络功能的NF Set标识。In yet another possible implementation, the second information may include: information about the network function of the first service provider, such as the NF type of the network function of the first service provider, or the NF type and NF of the network function of the first service provider Set identification, or the NF Set identification of the first service provider network function.
一种可能的实现方式中,第二信息可包括:多个提供服务提供者网络功能的实例标识。这些服务提供者网络功能满足以下条件中的一个或者多个:可以提供第一服务、与第一服务提供者网络功能属于同一个网络功能集(即与第一服务提供者网络功能的NF Set标识相同)、与第一服务提供者网络功能属于同一个网络功能类型。应理解,这些服务提供者网络功能中包括第二服务提供者网络功能。In a possible implementation manner, the second information may include: identifiers of multiple instances that provide network functions of the service provider. These service provider network functions meet one or more of the following conditions: the first service can be provided, and the first service provider network function belongs to the same network function set (that is, the NF Set identifier of the first service provider network function same), belong to the same network function type as the first service provider network function. It should be understood that these service provider network functions include the second service provider network function.
可选地,服务消费者网络功能发送步骤6中的该用于请求访问令牌的消息之前,服务消费者网络功能检查第二条件是否满足,如果满足,则服务消费者网络功能则执行步骤6,否则不执行步骤6,而是向第二服务提供者网络功能发送用于请求第一服务消息,携带第五访问令牌。第二条件为:第五访问令牌包括第一服务提供者网络功能的实例标识、和/或、第五访问令牌不包括服务提供者网络功能的NF类型、和/或、第五访问令牌不包括服务提供者网络功能的NF Set标识、和/或、第五访问令牌不包括服务提供者网络功能的NF Set标识和NF类型、和/或第五访问令牌不包括第二服务提供者网络功能的实例标识。即第五访问令牌包括第一服务提供者网络功能的实例标识、和/或、第五访问令牌不包括服务提供者网络功能的NF类型、和/或、第五访问令牌不包括服务提供者网络功能的NF Set标识、和/或、第五访问令牌不包括服务提供者网络功能的NF Set标识和NF类型、和/或第五访问令牌不包括第二服务提供者网络功能的实例标识时,服务消费者网络功能执行第6步;否则当第五访问令牌包括服务提供者网络功能的NF类型、和/或、第五访问令牌包括服务提供者网络功能的NF Set标识、和/或、第五访问令牌包括服务提供者网络功能的NF Set标识和NF类型、和/或第五访问令牌包括第二服务提供者网络功能的实例标识时,则服务消费者网络功能执行第9步。这里,服务提供者网络功能的NF类型也可以是第一 服务提供者网络功能的NF类型或第二服务提供者网络功能的NF类型,服务提供者网络功能的NF Set标识也可以是第一服务提供者网络功能的NF Set标识或第二服务提供者网络功能的NF Set标识。Optionally, before the service consumer network function sends the message for requesting the access token in step 6, the service consumer network function checks whether the second condition is satisfied, and if so, the service consumer network function performs step 6 , otherwise step 6 is not performed, but a message for requesting the first service is sent to the second service provider network function, carrying the fifth access token. The second condition is: the fifth access token includes the instance identifier of the first service provider network function, and/or, the fifth access token does not include the NF type of the service provider network function, and/or, the fifth access token The token does not include the NF Set identity of the service provider network function, and/or, the fifth access token does not include the NF Set identity and the NF type of the service provider network function, and/or the fifth access token does not include the second service The instance ID of the provider web function. That is, the fifth access token includes the instance identity of the first service provider network function, and/or, the fifth access token does not include the NF type of the service provider network function, and/or, the fifth access token does not include the service The NF Set identity of the provider network function, and/or, the fifth access token does not include the NF Set identity and NF type of the service provider network function, and/or the fifth access token does not include the second service provider network function , the service consumer network function executes step 6; otherwise, when the fifth access token includes the NF type of the service provider network function, and/or, the fifth access token includes the NF Set of the service provider network function When the identification, and/or, the fifth access token comprises the NF Set identification and the NF type of the service provider network function, and/or the fifth access token comprises the instance identification of the second service provider network function, then the service consumer The network function executes step 9. Here, the NF type of the service provider's network function can also be the NF type of the first service provider's network function or the NF type of the second service provider's network function, and the NF Set identifier of the service provider's network function can also be the first service The NF Set identifier of the provider network function or the NF Set identifier of the second service provider network function.
步骤7:NRF检查服务消费者网络功能是否有授权访问所请求的服务。检查成功之后,生成访问令牌,即NRF生成第一、或第二访问令牌、或至少两个第三访问令牌、或第四访问令牌。具体见图5中描述。Step 7: NRF checks whether the service consumer network function is authorized to access the requested service. After the check is successful, an access token is generated, that is, the NRF generates a first, or a second access token, or at least two third access tokens, or a fourth access token. See the description in Figure 5 for details.
步骤8:NRF向服务消费者网络功能返回生成的访问令牌,即返回生成的第一、或第二访问令牌、或至少两个第三访问令牌、或第四访问令牌。具体见图5中描述。该消息对应与图5中S503的第一响应消息。Step 8: The NRF returns the generated access token to the service consumer network function, that is, returns the generated first or second access token, or at least two third access tokens, or the fourth access token. See the description in Figure 5 for details. This message corresponds to the first response message of S503 in FIG. 5 .
步骤9:服务消费者网络功能向第二服务提供者网络功能发送用于请求的服务的消息(即服务请求),该消息中包括获取到的第一访问令牌或第二访问令牌或第三访问令牌或第四访问令牌。该消息对应图5的第二请求消息。Step 9: The service consumer network function sends a message for the requested service (that is, a service request) to the second service provider network function, and the message includes the obtained first access token or the second access token or the obtained first access token. A third access token or a fourth access token. This message corresponds to the second request message in FIG. 5 .
步骤10:第二服务提供者网络功能验证接收的访问令牌,验证通过后,为该服务消费者网络功能提供服务。Step 10: The second service provider network function verifies the received access token, and provides services for the service consumer network function after the verification is passed.
在图8所示的流程中,步骤1-3、步骤4-5、步骤6-8、步骤9-10均为独立的流程,可独立使用。In the process shown in Figure 8, steps 1-3, 4-5, 6-8, and 9-10 are all independent processes and can be used independently.
参见图9,为本申请实施例中的间接通信场景下的一种网络功能服务授权方法的流程示意图,如图所示,该流程可包括:Referring to FIG. 9 , it is a schematic flowchart of a network function service authorization method in the indirect communication scenario in the embodiment of the present application. As shown in the figure, the process may include:
步骤1:服务消费者网络功能向NRF发送用于请求访问令牌的消息。该步骤的具体实现方式与图8中的步骤1基本相同。Step 1: The service consumer web function sends a message to the NRF requesting an access token. The specific implementation of this step is basically the same as step 1 in FIG. 8 .
步骤2:NRF检查服务消费者网络功能是否有授权访问请求的第一服务。检查成功之后,NRF生成第五访问令牌。该步骤的具体实现方式与图8中的步骤2基本相同。Step 2: The NRF checks if the service consumer network function has authorization to access the requested first service. After a successful check, the NRF generates a fifth access token. The specific implementation of this step is basically the same as step 2 in FIG. 8 .
步骤3:NRF向服务消费者网络功能返回生成的第五访问令牌。同图8中的步骤3。Step 3: NRF returns the generated fifth access token to the service consumer web function. Same as step 3 in Figure 8.
步骤4:服务消费者网络功能向第一服务提供者网络功能(即初始服务提供者网络功能)发送用于请求服务的消息(即服务请求)。该请求消息经由SCP被发送到第一服务提供者网络功能。该消息包括第五访问令牌。Step 4: The service consumer network function sends a message for requesting a service (ie, a service request) to the first service provider network function (ie, the initial service provider network function). The request message is sent to the first service provider network function via the SCP. The message includes a fifth access token.
步骤5:第一服务提供者网络功能向该服务消费者网络功能返回一个响应消息,其中包括第一信息,该第一信息包括第一指示以及第二服务提供者网络功能(即目标服务提供者网络功能)的信息(如URI和/或实例标识)。第一指示用于指示HTTP重定向,或有其他可用的服务提供者网络功能,或服务访问授权失败,或获取访问令牌。该响应消息经由SCP被发送到服务消费者网络功能。Step 5: The first service provider network function returns a response message to the service consumer network function, which includes first information, and the first information includes the first indication and the second service provider network function (ie, the target service provider network function) information (such as URI and/or instance ID). The first indication is used to indicate HTTP redirection, or other available service provider network functions, or service access authorization failure, or access token acquisition. This response message is sent to the service consumer web function via the SCP.
步骤6:服务消费者网络功能根据接收到的第一信息,向NRF发送用于请求访问令牌的消息,该消息携带第二信息。该步骤的具体实现与图8中的步骤6相同。Step 6: The service consumer network function sends a message for requesting an access token to the NRF according to the received first information, and the message carries the second information. The specific implementation of this step is the same as step 6 in FIG. 8 .
步骤7:NRF检查服务消费者网络功能是否有授权访问所请求的服务。检查成功之后,生成访问令牌,即NRF生成第一、或第二访问令牌、或至少两个第三访问令牌、或第四访问令牌。具体见图5中描述。Step 7: NRF checks whether the service consumer network function is authorized to access the requested service. After the check is successful, an access token is generated, that is, the NRF generates a first, or a second access token, or at least two third access tokens, or a fourth access token. See the description in Figure 5 for details.
步骤8:NRF向服务消费者网络功能返回生成的访问令牌,即返回生成的第一、或第二访问令牌、或至少两个第三访问令牌、或第四访问令牌。具体见图5中描述。Step 8: The NRF returns the generated access token to the service consumer network function, that is, returns the generated first or second access token, or at least two third access tokens, or the fourth access token. See the description in Figure 5 for details.
步骤9:服务消费者网络功能向第二服务提供者网络功能发送用于请求的服务的消息(即服务请求),该消息中包括获取到的第一访问令牌或第二访问令牌或第三访问令牌或 第四访问令牌。该消息对应图5的第二请求消息。该消息经由SCP被发送到第二服务提供者网络功能。Step 9: The service consumer network function sends a message for the requested service (that is, a service request) to the second service provider network function, and the message includes the obtained first access token or the second access token or the obtained first access token. A third access token or a fourth access token. This message corresponds to the second request message in FIG. 5 . This message is sent to the second service provider network function via the SCP.
步骤10:第二服务提供者网络功能验证接收的访问令牌,验证通过后,为该服务消费者网络功能提供服务。Step 10: The second service provider network function verifies the received access token, and provides services for the service consumer network function after the verification is passed.
在图9所示的流程中,步骤1-3、步骤4-5、步骤6-8、步骤9-10均为独立的流程,可独立使用。In the process shown in Figure 9, steps 1-3, 4-5, 6-8, and 9-10 are all independent processes and can be used independently.
参见图10,为本申请另外的实施例提供的一种间接通信场景下的网络功能服务授权流程。如图所示,该流程可包括:Referring to FIG. 10 , it is a network function service authorization flow in an indirect communication scenario provided by another embodiment of the present application. As shown, the process can include:
S1001:服务通信代理(SCP)接收服务消费者网络功能的第一请求消息,所述第一请求消息包括第一访问令牌。所述第一请求消息用于请求访问第一服务。S1001: A service communication proxy (SCP) receives a first request message of a service consumer network function, where the first request message includes a first access token. The first request message is used to request access to the first service.
该服务请求中携带的第一访问令牌,是该服务消费者通过从NRF获得到的,可参见图4所示的流程。第一令牌还包括服务消费者网络功能的实例标识、请求的服务的名称、NRF的实例标识等。其中请求的服务为第一服务。第一访问令牌可以为访问令牌(NF类型),即第一访问令牌中包括请求的服务提供者网络功能的NF类型,或者第一访问令牌为访问令牌(NF实例),即该第一访问令牌中包括请求的服务提供者网络功能的实例标识(如第一服务提供者网络功能的实例标识)。这里请求的服务提供者网络功能为提供第一服务的网络功能,如第一服务提供者网络功能。The first access token carried in the service request is obtained by the service consumer from the NRF, see the flow shown in FIG. 4 . The first token also includes the instance identifier of the service consumer network function, the name of the requested service, the instance identifier of the NRF, and the like. The requested service is the first service. The first access token may be an access token (NF type), that is, the first access token includes the NF type of the requested service provider network function, or the first access token is an access token (NF instance), that is The first access token includes the instance identifier of the requested service provider network function (such as the instance identifier of the first service provider network function). The service provider network function requested here is a network function that provides the first service, such as the first service provider network function.
S1002:SCP向第一服务提供者网络功能发送第二请求消息,所述第二请求消息包括所述第一访问令牌。所述第二请求消息用于请求第一服务。S1002: The SCP sends a second request message to the first service provider network function, where the second request message includes the first access token. The second request message is used to request the first service.
S1003:SCP接收来自于第一服务提供者网络功能的第二响应消息,所述第二响应消息包括第二服务提供者网络功能的信息和HTTP重定向状态码,所述HTTP重定向状态码用于指示服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能。S1003: The SCP receives a second response message from the network function of the first service provider, the second response message includes the information of the network function of the second service provider and an HTTP redirect status code, and the HTTP redirect status code uses Used to indicate service access authorization failures or HTTP redirects or to obtain access tokens or other service provider network functions available.
示例性的,第一服务提供者网络功能接收到第二请求消息后,出于某种原因(比如,第一服务提供者网络功能处于过载状态或者即将进入过载状态,为了缓解过载状态或避免进入过载状态),发送该第二响应消息,其中包括HTTP重定向状态码和第二服务提供者网络功能(即目标服务提供者网络功能)的信息。Exemplarily, after the first service provider network function receives the second request message, for some reason (for example, the first service provider network function is in the overload state or is about to enter the overload state, in order to alleviate the overload state or avoid entering the overload state), sending the second response message, which includes the HTTP redirection status code and the information of the second service provider network function (that is, the target service provider network function).
S1004:SCP向该服务消费者网络功能发送第一信息S1004: the SCP sends the first message to the service consumer network function
示例的,所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识。其中,所述第一指示用于指示发生了HTTP重定向,或用于指示所述访问消费者网络功能获取访问令牌,或服务访问授权失败,或有其他可用的服务提供者网络功能。第二服务提供者网络功能的信息包括第二服务提供者网络功能的URI或示例标识。示例性的,SCP向该服务消费者网络功能发送第一信息,包括SCP向该服务消费者网络功能发送第一响应消息,所述第一响应消息包括第一信息。Exemplarily, the first information includes the first indication and/or the instance identifier of the network function of the second service provider. Wherein, the first indication is used to indicate that HTTP redirection has occurred, or used to indicate that the access consumer network function acquires an access token, or service access authorization fails, or there are other available service provider network functions. The information of the second service provider network function includes a URI or instance identification of the second service provider network function. Exemplarily, the SCP sending the first information to the service consumer network function includes sending the SCP to the service consumer network function a first response message, where the first response message includes the first information.
示例性的,该第一信息为一个消息,该消息用于通知服务消费者网络功能,服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;该消息可选地包括第二服务提供者网络功能的信息。Exemplarily, the first information is a message, and the message is used to notify the service consumer network function that the service access authorization fails or HTTP redirects or obtains an access token or there are other service provider network functions available; the message may Optionally includes information about the network capabilities of the second service provider.
可选的,图10中,SCP向服务消费者网络功能发送第一信息之前,还可包括如下步骤:SCP确定第一条件满足。也就是说,若满足第一条件,SCP才向服务消费者网络功能发送第一信息。Optionally, in FIG. 10 , before the SCP sends the first information to the service consumer network function, the following step may also be included: the SCP determines that the first condition is met. That is to say, the SCP sends the first information to the service consumer network function only if the first condition is met.
示例性的,所述第一条件包括以下条件中的至少一个:Exemplarily, the first condition includes at least one of the following conditions:
第一访问令牌中不包括第二服务提供者网络功能的实例标识;The first access token does not include the instance identifier of the second service provider network function;
第一访问令牌不能用于授权访问第二服务提供者网络功能的服务;the first access token cannot be used to authorize services accessing the second service provider's network functionality;
第一访问令牌只能用于访问特定服务提供者网络功能实例或只能用于访问第一服务提供者网络功能的服务,所述特定服务提供者网络功能包括所述第一服务提供者网络功能;The first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, the specific service provider network function including the first service provider network function Function;
第一访问令牌中不包括服务提供者网络功能的网络功能类型或网络功能集标识;The first access token does not include the network function type or network function set identifier of the service provider network function;
第一访问令牌中包括第一服务提供者网络功能的实例标识。The first access token includes the instance identifier of the first service provider network function.
进一步的,若上述第一条件不满足,则SCP向第二服务提供者网络功能发送第三请求消息,该第三请求消息为用于请求服务的消息,该第三请求消息中包括第一访问令牌。Further, if the above-mentioned first condition is not satisfied, the SCP sends a third request message to the second service provider network function, the third request message is a message for requesting a service, and the third request message includes the first access token.
可选的,图10中,SCP向服务消费者网络功能发送第一信息之后,该服务消费者网络功能根据该第一信息,重新向NRF请求获取访问令牌。Optionally, in FIG. 10 , after the SCP sends the first information to the service consumer network function, the service consumer network function re-requests the NRF for obtaining an access token according to the first information.
可选的,在图10中,SCP向服务消费者网络功能发送第一信息,且该服务消费者网络功能重新获得访问令牌后,该消费者网络功能使用获取的访问令牌向第二服务提供者网络功能请求服务。该流程可包括以下步骤:Optionally, in FIG. 10, the SCP sends the first information to the service consumer network function, and after the service consumer network function obtains the access token again, the consumer network function uses the obtained access token to the second service A provider network function requests a service. The process may include the following steps:
该服务消费者网络功能发送第四请求消息,该第四请求消息为用于请求服务的消息,该第四请求消息中包括重新获取的访问令牌;SCP接收到该第四请求消息后,向第二服务提供者网络功能发送第五请求消息,该第五消息为服务请求,该第五请求消息包括接收到的访问令牌。第二服务提供者网络功能验证接收的访问令牌,验证通过后,为该服务消费者网络功能提供服务。The service consumer network function sends a fourth request message, the fourth request message is a message for requesting a service, and the fourth request message includes a reacquired access token; after receiving the fourth request message, the SCP sends The second service provider network function sends a fifth request message, the fifth message is a service request, and the fifth request message includes the received access token. The second service provider network function verifies the received access token, and provides services for the service consumer network function after the verification is passed.
上述实现方式中,在间接通信场景下,当服务消费者网络功能使用第一访问令牌向第一服务提供者网络功能请求服务时,发生了HTTP重定向,则服务通信代理可在接收到来自第一服务提供者网络功能的第二响应消息(其中包括第二服务提供者网络功能的信息和重定向状态码)后,向该服务消费者网络功能发送第一信息,以使该服务消费者网络功能请求重新获取访问令牌,这样,该服务消费者网络功能可使用重新获取到的访问令牌向第二服务提供者网络功能(即重定向到的目标服务提供者网络功能)请求服务。In the above implementation, in the indirect communication scenario, when the service consumer network function uses the first access token to request a service from the first service provider network function, HTTP redirection occurs, and the service communication agent can receive the request from After the second response message of the first service provider network function (which includes the information of the second service provider network function and the redirection status code), the first information is sent to the service consumer network function, so that the service consumer The network function requests to reacquire the access token, so that the service consumer network function can use the retrieved access token to request services from the second service provider network function (ie, the redirected target service provider network function).
基于图10所示的流程,图11示出了一种间接通信场景下的信令交互流程示意图,如图所示,该流程可包括如下步骤:Based on the process shown in FIG. 10, FIG. 11 shows a schematic diagram of a signaling interaction process in an indirect communication scenario. As shown in the figure, the process may include the following steps:
步骤1:服务消费者网络功能向NRF发送用于请求访问令牌的消息。具体见图9的步骤1。Step 1: The service consumer web function sends a message to the NRF requesting an access token. See step 1 in Figure 9 for details.
步骤2:NRF检查服务消费者网络功能是否有授权访问请求的第一服务。检查成功之后,NRF生成第一访问令牌。第一访问令牌可能是访问令牌(NF类型)或访问令牌(NF实例)。如果步骤1的消息中,服务消费者网络功能包括请求的服务提供者网络功能的NF类型,则第一访问令牌为(NF类型),即该第一访问令牌中包括请求的服务提供者网络功能的NF类型(如第一服务提供者网络功能的NF类型);如果步骤1的消息中,服务消费者网络功能包括请求的服务提供者网络功能的实例标识,则第一访问令牌为(NF实例),即该第一访问令牌中包括请求的服务提供者网络功能的实例标识(如第一服务提供者网络功能的实例标识)。第一令牌还包括服务消费者网络功能的实例标识、请求的服务的名称、NRF的实例标识等。Step 2: The NRF checks if the service consumer network function has authorization to access the requested first service. After a successful check, the NRF generates a first access token. The first access token may be an access token (NF type) or an access token (NF instance). If in the message in step 1, the service consumer network function includes the NF type of the requested service provider network function, then the first access token is (NF type), that is, the first access token includes the requested service provider The NF type of the network function (such as the NF type of the first service provider network function); if in the message in step 1, the service consumer network function includes the instance identifier of the requested service provider network function, then the first access token is (NF instance), that is, the first access token includes the instance identifier of the requested service provider network function (such as the instance identifier of the first service provider network function). The first token also includes the instance identifier of the service consumer network function, the name of the requested service, the instance identifier of the NRF, and the like.
步骤3:NRF向服务消费者网络功能返回生成的第一访问令牌。Step 3: NRF returns the generated first access token to the service consumer web function.
步骤4:服务消费者网络功能向第一服务提供者网络功能(即初始服务提供者网络功 能)发送用于请求服务的消息(即服务请求),该消息中包括第一访问令牌。该请求消息经由SCP被发送到第一服务提供者网络功能。Step 4: The service consumer network function sends a message for requesting a service (ie, a service request) to the first service provider network function (ie, the initial service provider network function), and the message includes the first access token. The request message is sent to the first service provider network function via the SCP.
该步骤中,SCP从第一服务提供者网络功能接收到的服务请求消息,对应于图10中的第一请求消息;SCP向服务消费者网络功能发送的服务请求消息对应于图10中的第二请求消息。In this step, the service request message received by the SCP from the first service provider network function corresponds to the first request message in Figure 10; the service request message sent by the SCP to the service consumer network function corresponds to the first request message in Figure 10 Two request messages.
上述步骤1-4的具体实现方式,与图9中的相应步骤相同。The specific implementation of the above steps 1-4 is the same as the corresponding steps in FIG. 9 .
步骤5:第一服务提供者网络功能向SCP返回一个响应消息,其中包括HTTP重定向状态码,如HTTP 307 redirection或HTTP 308 redirection,以及第二服务提供者网络功能(即目标服务提供者网络功能)的信息(如URI和/或实例标识)。Step 5: The first service provider network function returns a response message to the SCP, which includes an HTTP redirection status code, such as HTTP 307 redirection or HTTP 308 redirection, and the second service provider network function (ie, the target service provider network function ) information (such as URI and/or instance ID).
步骤6:可选地,SCP接收到第一服务提供者网络功能发送的包括有HTTP重定向状态码和第二服务提供者网络功能的信息的响应消息后,确定第一条件是否满足,如果满足,则进行步骤7;如果不满足,则SCP向第二服务提供者网络功能发送用于请求服务的消息(未在图中示出),携带第一访问令牌。示例地,第一条件包括以下的至少一项:Step 6: Optionally, after receiving the response message sent by the first service provider network function and including the HTTP redirection status code and the information of the second service provider network function, the SCP determines whether the first condition is satisfied, and if it is satisfied , then proceed to step 7; if not satisfied, the SCP sends a message (not shown in the figure) for requesting a service to the second service provider network function, carrying the first access token. Exemplarily, the first condition includes at least one of the following:
第一访问令牌中不包括第二服务提供者网络功能的实例标识;The first access token does not include the instance identifier of the second service provider network function;
第一访问令牌不能用于授权访问第二服务提供者网络功能的服务;the first access token cannot be used to authorize services accessing the second service provider's network functionality;
第一访问令牌只能用于访问特定服务提供者网络功能实例或只能用于访问第一服务提供者网络功能的服务,所述特定服务提供者网络功能包括所述第一服务提供者网络功能;The first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, the specific service provider network function including the first service provider network function Function;
第一访问令牌中不包括服务提供者网络功能的网络功能类型或网络功能集标识;The first access token does not include the network function type or network function set identifier of the service provider network function;
第一访问令牌中包括第一服务提供者网络功能的实例标识。The first access token includes the instance identifier of the first service provider network function.
若第一条件满足,则表示第一访问令牌中不包括第二服务提供者网络功能的实例标识、和/或、第一访问令牌不能用于授权访问第二服务提供者网络功能的服务、和/或、第一访问令牌只能用于访问特定服务提供者网络功能实例或只能用于访问第一服务提供者网络功能的服务(所述特定服务提供者网络功能包括所述第一服务提供者网络功能)、和/或、第一访问令牌中不包括服务提供者网络功能的网络功能类型或网络功能集标识、和/或第一访问令牌中包括第一服务提供者网络功能的实例标识。当第一条件满足时,则SCP执行步骤7,向服务消费者网络功能发送第一信息。If the first condition is satisfied, it means that the first access token does not include the instance identifier of the second service provider network function, and/or, the first access token cannot be used to authorize access to the service of the second service provider network function , and/or, the first access token can only be used to access a specific service provider network function instance or can only be used to access services of the first service provider network function (the specific service provider network function includes the first service provider network function A service provider network function), and/or, the first access token does not include the network function type or network function set identifier of the service provider network function, and/or the first access token includes the first service provider The instance ID of the network function. When the first condition is satisfied, the SCP executes step 7, sending the first information to the service consumer network function.
第一条件不满足,则表示第一访问令牌中包括第二服务提供者网络功能的实例标识、和/或、第一访问令牌可用于授权访问第二服务提供者网络功能的服务、和/或、第一访问令牌中包括服务提供者网络功能的网络功能类型或网络功能集标识。当第一条件不满足时,SCP向第二服务提供者网络功能发送用于请求的服务,携带第一访问令牌。If the first condition is not satisfied, it means that the first access token includes the instance identifier of the second service provider network function, and/or, the first access token can be used to authorize access to the service of the second service provider network function, and /or, the first access token includes the network function type or network function set identifier of the service provider network function. When the first condition is not met, the SCP sends the service for the request to the second service provider network function, carrying the first access token.
步骤7:SCP向该消费者网络功能发送第一信息。Step 7: The SCP sends the first message to the CNF.
示例地,第一信息包括第一指示和/或第二服务提供者网络功能的实例标识。其中,所述第一指示用于指示发生了HTTP重定向,或用于指示所述访问消费者网络功能获取访问令牌,或服务访问授权失败,或有其他可用的服务提供者网络功能。第二服务提供者网络功能的信息包括第二服务提供者网络功能的URI或示例标识。示例性的,SCP向该服务消费者网络功能发送第一信息,包括SCP向该服务消费者网络功能发送第一响应消息,所述第一响应消息包括第一信息。Exemplarily, the first information includes the first indication and/or the instance identifier of the network function of the second service provider. Wherein, the first indication is used to indicate that HTTP redirection has occurred, or used to indicate that the access consumer network function obtains an access token, or service access authorization fails, or there are other available service provider network functions. The information of the second service provider network function includes a URI or instance identification of the second service provider network function. Exemplarily, the SCP sending the first information to the service consumer network function includes sending the SCP to the service consumer network function a first response message, where the first response message includes the first information.
示例性的,该第一信息为一个消息,该消息用于通知服务消费者网络功能,服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;该消息中可选地包括第二服务提供者网络功能的信息,其中包括第二服务提供者网络功能URI和/ 或实例标识。Exemplarily, the first information is a message, and the message is used to notify the service consumer network function that the service access authorization fails or HTTP redirects or obtains an access token or has other available service provider network functions; in the message Optionally includes information of the second service provider network function, including the second service provider network function URI and/or instance identifier.
步骤8.服务消费者网络功能接收到来自SCP的第一信息后,向NRF发送用于请求访问令牌的消息。该消息中可包括第二信息,具体见图5所示流程中的第二信息。Step 8. After receiving the first information from the SCP, the service consumer network function sends a message for requesting an access token to the NRF. The message may include second information, for details, refer to the second information in the process shown in FIG. 5 .
步骤9:NRF检查服务消费者网络功能是否有授权访问请求的服务。检查成功之后,NRF生成访问令牌,包括第二访问令牌、第三访问令牌、多个第四访问令或第五访问令牌。第二访问令牌、第三访问令牌、多个第四访问令或第五访问令牌见步骤10中的描述。Step 9: The NRF checks whether the service consumer network function has authorization to access the requested service. After a successful check, the NRF generates an access token, including a second access token, a third access token, a plurality of fourth access tokens, or a fifth access token. See the description in step 10 for the second access token, the third access token, multiple fourth access tokens or the fifth access token.
步骤10:NRF向服务消费者网络功能返回生成的访问令牌,即返回生成的第二访问令牌、第三访问令牌、多个第四访问令或第五访问令牌。生成的访问令牌包括第二信息。Step 10: NRF returns the generated access token to the service consumer network function, that is, returns the generated second access token, third access token, multiple fourth access tokens or fifth access tokens. The generated access token includes the second information.
第二访问令牌包括服务提供者网络功能的NF类型,和/或服务提供者网络功能的NF set标识。这里的服务提供者网络功能为提供第一服务的服务提供者网络功能、第一服务提供者网络功能、或第二服务提供者网络功能。The second access token includes the NF type of the service provider network function, and/or the NF set identifier of the service provider network function. The service provider network function here is the service provider network function providing the first service, the first service provider network function, or the second service provider network function.
第三访问令牌包括多个服务提供者网络功能的实例标识。需要说明的是,第三访问令牌中包括的每个实例标识都是第二信息中的一个实例标识。这些提供者都可以提供第一服务,也即这些服务提供者包括第二服务提供者网络功能。The third access token includes instance identifications of the plurality of service provider network functions. It should be noted that each instance identifier included in the third access token is an instance identifier in the second information. These providers can all provide the first service, that is, these service providers include the network function of the second service provider.
每个第四访问令牌分别包括一个服务提供者网络功能的实例标识,该服务提供者网络功能可以提供第一服务。该第四访问令牌包括第二信息,可以理解为,每个第四访问令牌中的服务提供者网络功能的实例标识都是第二信息中的多个服务提供者网络功能的实例标识中的一个。Each fourth access token respectively includes an instance identifier of a service provider network function that can provide the first service. The fourth access token includes the second information. It can be understood that the instance identifiers of the service provider network functions in each fourth access token are among the instance identifiers of multiple service provider network functions in the second information. one of.
第五访问令牌中包括第二服务提供者网络功能的实例标识。第五访问令牌包括第二信息,可以理解为,第二信息包括第二服务提供者网络功能的实例标识,第五访问令牌中的实例标识为第二服务提供者网络功能的实例标识。The fifth access token includes the instance identifier of the second service provider network function. The fifth access token includes the second information. It can be understood that the second information includes the instance identifier of the second service provider network function, and the instance identifier in the fifth access token is the instance identifier of the second service provider network function.
步骤11:服务消费者网络功能向SCP发送用于请求服务的消息(即服务请求),其中包括第二访问令牌、第三访问令牌、第四访问令或第五访问令牌。SCP向第二服务提供者网络功能(即目标服务提供者网络功能)发送用于请求服务的消息,其中包括第二访问令牌、第三访问令牌、第四访问令或第五访问令牌。Step 11: The service consumer network function sends a message for requesting a service (ie a service request) to the SCP, which includes the second access token, the third access token, the fourth access token or the fifth access token. The SCP sends a message requesting the service to the second service provider network function (i.e. the target service provider network function), which includes the second access token, third access token, fourth access token or fifth access token .
该步骤中,SCP从该消费者网络功能接收到的服务请求消息,对应于图10所示流程中的第四请求消息;SCP向第二服务提供者网络功能发送的服务请求消息,对应于图10所示流程中的第五请求消息。In this step, the service request message received by the SCP from the consumer network function corresponds to the fourth request message in the process shown in Figure 10; the service request message sent by the SCP to the second service provider network function corresponds to the fourth request message in Figure 10. The fifth request message in the process shown in 10.
步骤12:第二服务提供者网络功能验证接收的访问令牌,验证通过后,为该服务消费者网络功能提供服务。Step 12: The second service provider network function verifies the received access token, and provides services for the service consumer network function after the verification is passed.
参见图12,为本申请另外的实施例提供的一种网络功能服务授权的流程示意图。该流程中,NRF在确定第一条件满足时生成第一访问令牌,该第一访问令牌可用于服务消费者网络功能访问第一服务提供者网络功能(即初始服务提供者网络功能)和第二服务提供者网络功能(即目标服务提供者网络功能)的服务时的授权检查。Referring to FIG. 12 , it is a schematic flowchart of network function service authorization provided by another embodiment of the present application. In this process, when the NRF determines that the first condition is satisfied, the first access token can be used for the service consumer network function to access the first service provider network function (that is, the initial service provider network function) and A service-time authorization check of the second service provider network function (ie the target service provider network function).
如图12所示,该流程可包括如下步骤:As shown in Figure 12, the process may include the following steps:
S1201:网络仓库功能(NRF)接收来自服务消费者网络功能的第一请求消息,该第一请求消息用于请求获取访问令牌。该第一请求消息中包括该服务消费者网络功能请求的第一服务的服务名称,以及请求的服务提供者网络功能的网络功能类型或实例标识;S1201: The Network Repository Function (NRF) receives a first request message from a service consumer network function, where the first request message is used to request to acquire an access token. The first request message includes the service name of the first service requested by the service consumer network function, and the network function type or instance identifier of the requested service provider network function;
可选的,若该服务消费者网络功能支持HTTP重定向,则第一请求消息中还可包括第一信息,所述第一信息用于指示该服务消费者网络功能支持HTTP重定向、或用于指示该 服务消费者网络功能请求第一服务支持HTTP重定向、或用于指示该服务消费者网络功能请求服务提供者网络功能支持HTTP重定向、或用于指示所述第一服务支持HTTP重定向、或用于指示所述请求的服务提供者网络功能支持HTTP重定向。Optionally, if the service consumer network function supports HTTP redirection, the first request message may further include first information, and the first information is used to indicate that the service consumer network function supports HTTP redirection, or use For indicating that the service consumer network function requests that the first service support HTTP redirection, or for indicating that the service consumer network function requests that the service provider network function supports HTTP redirection, or for indicating that the first service supports HTTP redirection The redirection, or service provider network function used to indicate the request supports HTTP redirection.
S1202:网络仓库功能在接收到第一请求消息之后,确定第一条件是否满足,如果满足则生成第一访问令牌、或第二访问令牌或多个第三访问令牌。S1202: After receiving the first request message, the web repository function determines whether the first condition is satisfied, and if so, generates a first access token, or a second access token, or a plurality of third access tokens.
可选地,如果所述网络仓库功能接收来自服务消费者网络功能的第一信息,则第一条件满足。Optionally, the first condition is met if the web repository function receives the first information from the service consumer web function.
可选地,如果所述网络仓库功能本地配置指示所述第一服务或所述请求的服务提供者网络功能支持HTTP重定向,则第一条件满足。Optionally, if the local configuration of the web repository function indicates that the first service or the requested service provider web function supports HTTP redirection, the first condition is met.
可选地,如果所述第一服务或所述请求的服务提供者网络功能的网络功能文件(NF Profile)中指示所述第一服务或所述请求的服务提供者网络功能支持的特性包括HTTP重定向,则第一条件满足。Optionally, if the network function file (NF Profile) of the first service or the requested service provider network function indicates that the features supported by the first service or the requested service provider network function include HTTP redirection, the first condition is met.
可选地,如果服务消费者网络功能使用SCP跟服务提供者网络功能通信,则第一条件满足。Optionally, the first condition is satisfied if the service consumer web function communicates with the service provider web function using SCP.
所述第一访问令牌中包括,所述请求的服务提供者网络功能的网络功能类型,或所述请求的服务提供者网络功能的网络功能集标识;或所述请求的服务提供者网络功能的网络功能类型和网络功能集标识The first access token includes the network function type of the requested service provider network function, or the network function set identifier of the requested service provider network function; or the requested service provider network function The network function type and network function set identification of the
所述第二访问令牌中包括多个服务提供者网络功能的实例标识,其中服务提供者网络功能可提供所述第一服务。应理解,可提供所述第一服务的服务提供者网络功能包括第一服务提供者网络功能和第二服务提供者网络功能,因此第二访问令牌中包括了第一服务提供者网络功能的实例标识和第二服务提供者网络功能实例标识。The second access token includes instance identifiers of multiple service provider network functions, where the service provider network function can provide the first service. It should be understood that the service provider network function that can provide the first service includes the first service provider network function and the second service provider network function, so the second access token includes the first service provider network function The instance identifier and the second service provider network function instance identifier.
所述第三访问令牌中包括一个服务提供者网络功能的实例标识,其中该服务提供者网络功能可提供第一服务。应理解,由于第一服务提供者网络功能和第二服务提供者网络功能都能提供第一服务,因此其中一个第三令牌中包括了第一服务提供者网络功能的实例标识,一个第三令牌中包括了第二服务提供者网络功能的实例标识,The third access token includes an instance identifier of a service provider network function, where the service provider network function can provide the first service. It should be understood that since both the first service provider network function and the second service provider network function can provide the first service, one of the third tokens includes the instance identifier of the first service provider network function, and one third The token includes the instance identifier of the network function of the second service provider,
可选的,NRF在生成访问第一访问令牌、第二访问令牌或多个第三访问令牌之前,还需要检查该服务消费者网络功能是否有授权访问请求的服务。如果没有,则NRF不生成任何访问令牌,并向该服务消费者网络功能返回携带错误原因的响应消息。Optionally, before the NRF generates access to the first access token, the second access token or multiple third access tokens, it also needs to check whether the service consumer network function has a service authorized to access the request. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
进一步的,如果第一条件不满足,则NRF生成第四访问令牌,示例的,第四访问令牌携带请求的服务提供者网络功能的实例标识。可选地,NRF生成第四访问令牌之前,还需要检查该服务消费者网络功能是否有授权访问请求的服务。如果没有,则NRF不生成任何访问令牌,并向该服务消费者网络功能返回携带错误原因的响应消息。Further, if the first condition is not satisfied, the NRF generates a fourth access token, for example, the fourth access token carries the instance identifier of the requested service provider network function. Optionally, before the NRF generates the fourth access token, it also needs to check whether the service consumer network function is authorized to access the requested service. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
S1203:网络仓库功能向所述服务消费者网络功能发送第一响应消息,所述第一响应消息中可包括所述第一访问令牌、或第二服务令牌或多个第三访问令牌。S1203: The network warehouse function sends a first response message to the service consumer network function, and the first response message may include the first access token, or the second service token, or multiple third access tokens .
服务消费者网络功能获得第一访问令牌、或第二服务令牌或多个第三访问令牌后,可向第一服务提供者网络功能(即初始服务功能)发送服务请求,以请求第一服务提供者网络功能执行所请求的服务。这里第一服务提供者网络功能为服务消费者网络功能请求的服务提供者网络功能。After the service consumer network function obtains the first access token, or the second service token or multiple third access tokens, it can send a service request to the first service provider network function (that is, the initial service function) to request the first A service provider network function performs the requested service. Here the first service provider network function is the service provider network function requested by the service consumer network function.
如果第一服务提供者网络功能由于某种原因(比如,该第一服务提供者网络功能或该服务提供者网络功能实例处于过载状态或者即将进入过载状态,为了缓解过载状态或避免 进入过载状态),该第一服务提供者网络功能可能进行HTTP重定向,即,向该服务消费者网络功能发送HTTP重定向状态码和第二服务提供者网络功能(即目标服务提供者网络功能)的信息。由于该服务消费者网络功能获得到的第一访问令牌、或第二访问令牌、或多个第三访问令牌,可以用于该服务消费者网络功能访问第二服务提供者网络功能的第一服务时的授权,因此该服务消费者网络功能可调用第二服务提供者网络功能的服务。这样,即使发生了HTTP重定向,该服务消费者网络功能也可以从目标服务提供者网络功能获得服务。If the first service provider network function is due to some reason (for example, the first service provider network function or the service provider network function instance is in the overload state or is about to enter the overload state, in order to alleviate the overload state or avoid entering the overload state) , the first service provider network function may perform HTTP redirection, that is, send the HTTP redirection status code and the information of the second service provider network function (ie, the target service provider network function) to the service consumer network function. The first access token, or the second access token, or a plurality of third access tokens obtained by the service consumer network function can be used for the service consumer network function to access the second service provider network function The first service is authorized so that the service consumer web function can invoke the service of the second service provider web function. In this way, even if HTTP redirection occurs, the service consumer web function can obtain services from the target service provider web function.
图13为基于图12所示的流程,在直接通信场景下的一种流程示意图,如图所示,该流程可包括:FIG. 13 is a schematic flow diagram in a direct communication scenario based on the flow shown in FIG. 12. As shown in the figure, the flow may include:
步骤1:服务消费者网络功能向NRF发送用于请求访问令牌的消息(即第一请求消息),该消息中包括请求的第一服务的服务名称、服务消费者网络功能的实例标识,以及请求的服务提供者网络功能的NF类型或者实例标识等。Step 1: The service consumer network function sends a message for requesting an access token to the NRF (that is, the first request message), which includes the service name of the requested first service, the instance identifier of the service consumer network function, and The NF type or instance identifier of the requested service provider network function.
可选的,若该服务消费者网络功能支持HTTP重定向,则第一请求消息中还可包括第一信息,所述第一信息用于指示该服务消费者网络功能支持HTTP重定向、或用于指示该服务消费者网络功能请求第一服务支持HTTP重定向、或用于指示该服务消费者网络功能请求服务提供者网络功能支持HTTP重定向、或用于指示所述第一服务支持HTTP重定向、或用于指示所述请求的服务提供者网络功能支持HTTP重定向。Optionally, if the service consumer network function supports HTTP redirection, the first request message may further include first information, and the first information is used to indicate that the service consumer network function supports HTTP redirection, or use For indicating that the service consumer network function requests that the first service support HTTP redirection, or for indicating that the service consumer network function requests that the service provider network function supports HTTP redirection, or for indicating that the first service supports HTTP redirection The redirection, or service provider network function used to indicate the request supports HTTP redirection.
步骤2:NRF接收到该第一请求消息后,NRF确定第一条件是否满足,如果满足则生成第一访问令牌、或第二访问令牌或多个第三访问令牌。Step 2: After the NRF receives the first request message, the NRF determines whether the first condition is met, and if so, generates a first access token, or a second access token, or a plurality of third access tokens.
可选地,如果所述网络仓库功能接收来自服务消费者网络功能的第一信息,则第一条件满足。Optionally, the first condition is met if the web repository function receives the first information from the service consumer web function.
可选地,如果所述网络仓库功能本地配置指示所述第一服务或所述请求的服务提供者网络功能支持HTTP重定向,则第一条件满足。Optionally, if the local configuration of the web repository function indicates that the first service or the requested service provider web function supports HTTP redirection, the first condition is met.
可选地,如果所述第一服务或所述请求的服务提供者网络功能的网络功能文件(NF Profile)中指示,所述第一服务或所述请求的服务提供者网络功能支持的特性包括HTTP重定向,则第一条件满足。Optionally, if indicated in the network function file (NF Profile) of the first service or the requested service provider network function, the features supported by the first service or the requested service provider network function include HTTP redirection, the first condition is met.
所述第一访问令牌中包括,所述请求的服务提供者网络功能的网络功能类型,或所述请求的服务提供者网络功能的网络功能集标识;或所述请求的服务提供者网络功能的网络功能类型和网络功能集标识。The first access token includes the network function type of the requested service provider network function, or the network function set identifier of the requested service provider network function; or the requested service provider network function The network function type and network function set identifier.
所述第二访问令牌中包括多个服务提供者网络功能的实例标识,其中服务提供者网络功能可提供所述第一服务。应理解,可提供所述第一服务的服务提供者网络功能包括第一服务提供者网络功能和第二服务提供者网络功能,因此第二访问令牌中包括了第一服务提供者网络功能的实例标识和第二服务提供者网络功能实例标识。The second access token includes instance identifiers of multiple service provider network functions, where the service provider network function can provide the first service. It should be understood that the service provider network function that can provide the first service includes the first service provider network function and the second service provider network function, so the second access token includes the first service provider network function The instance identifier and the second service provider network function instance identifier.
所述第三访问令牌中包括一个服务提供者网络功能的实例标识,其中该服务提供者网络功能可提供第一服务。应理解,由于第一服务提供者网络功能和第二服务提供者网络功能都能提供第一服务,因此其中一个第三令牌中包括了第一服务提供者网络功能的实例标识,一个第三令牌中包括了第二服务提供者网络功能的实例标识。The third access token includes an instance identifier of a service provider network function, where the service provider network function can provide the first service. It should be understood that since both the first service provider network function and the second service provider network function can provide the first service, one of the third tokens includes the instance identifier of the first service provider network function, and one third The token includes the instance identifier of the network function of the second service provider.
可选的,NRF在生成访问第一访问令牌、或第二访问令牌或多个第三访问令牌之前,还需要检查该服务消费者网络功能是否有授权访问请求的服务。如果没有,则NRF不生成任何访问令牌,并向该服务消费者网络功能返回携带错误原因的响应消息。Optionally, before the NRF generates access to the first access token, or the second access token, or multiple third access tokens, it also needs to check whether the service consumer network function has a service authorized to access the request. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
进一步的,如果第一条件不满足,则NRF生成第四访问令牌,示例的,第四访问令牌携带请求的服务提供者网络功能的实例标识。可选地,NRF生成第四访问令牌之前,还需要检查该服务消费者网络功能是否有授权访问请求的服务。如果没有,则NRF不生成任何访问令牌,并向该服务消费者网络功能返回携带错误原因的响应消息。Further, if the first condition is not satisfied, the NRF generates a fourth access token, for example, the fourth access token carries the instance identifier of the requested service provider network function. Optionally, before the NRF generates the fourth access token, it also needs to check whether the service consumer network function is authorized to access the requested service. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
步骤3:网络仓库功能向所述服务消费者网络功能发送第一响应消息,所述第一响应消息中可包括第一访问令牌、或第二服务令牌或多个第三访问令牌。Step 3: The network warehouse function sends a first response message to the service consumer network function, and the first response message may include a first access token, or a second service token, or a plurality of third access tokens.
步骤4:该服务消费者网络功能向第一服务提供者网络功能(即初始服务提供者网络功能)发送用于请求服务的消息(即服务请求消息),该消息中包括该第一访问令牌、或第二服务令牌或第三访问令牌。Step 4: The service consumer network function sends a message for requesting a service (ie, a service request message) to the first service provider network function (ie, the initial service provider network function), and the message includes the first access token , or the second service token or the third access token.
可选的,当该服务消费者网络功能获取到多个第三访问令牌时,该服务消费者网络功能可以在该服务请求消息中包括该多个第三访问令牌、或包括的第三访问令牌中包括第一服务提供者网络功能的实例标识。Optionally, when the service consumer network function acquires multiple third access tokens, the service consumer network function may include the multiple third access tokens or the included third access tokens in the service request message. The access token includes an instance identifier of the first service provider network function.
步骤5:第一服务提供者网络功能可能向该服务消费者网络功能发送携带HTTP重定向状态码和第二服务提供者网络功能的信息的响应消息,该HTTP重定向码可以是“307 temporary redirect”或“308 permanent redirect”。Step 5: The first service provider network function may send a response message carrying the HTTP redirection status code and the information of the second service provider network function to the service consumer network function, the HTTP redirection code may be "307 temporary redirect " or "308 permanent redirect".
步骤6:服务消费者网络功能接收到步骤4的消息之后,根据HTTP重定向状态码以及第二服务提供者网络功能的信息,向第二服务提供者网络功能发送服务请求消息,其中包括步骤3中获得到的第一访问令牌、或第二服务令牌或多个第三访问令牌。Step 6: After receiving the message in step 4, the service consumer network function sends a service request message to the second service provider network function according to the HTTP redirect status code and the information of the second service provider network function, including step 3 The first access token, or the second service token, or a plurality of third access tokens obtained in
一种可能的实现方式中,当该服务消费者网络功能获取到多个第三访问令牌时,该服务消费者网络功能可以在该服务请求消息中包括该多个第三访问令牌、或包括1个第三访问令牌,该第三访问令牌中包括第一服务提供者网络功能的实例标识。In a possible implementation manner, when the service consumer network function obtains multiple third access tokens, the service consumer network function may include the multiple third access tokens in the service request message, or A third access token is included, and the third access token includes the instance identifier of the network function of the first service provider.
步骤7:第二服务提供者网络功能验证接收的访问令牌,如果验证成功,则执行该服务消费者网络功能请求的第一服务。Step 7: The second service provider network function verifies the received access token, and if the verification is successful, executes the first service requested by the service consumer network function.
一种可能的实现方式中,当第二服务提供者网络功能接收到包含多个服务提供者网络功能的实例标识的第二访问令牌时,第二服务提供者网络功能检查其中是否包括该第二服务提供者网络功能的实例标识,如果不包括,则校验访问令牌失败,第二服务提供者网络功能不执行该服务消费者网络功能请求的第一服务,并返回携带错误原因的响应消息。In a possible implementation manner, when the second service provider network function receives a second access token containing multiple instance identifiers of the service provider network function, the second service provider network function checks whether the second access token includes the The instance identifier of the second service provider network function, if not included, the verification of the access token fails, the second service provider network function does not execute the first service requested by the service consumer network function, and returns a response with the cause of the error information.
需要说明的是,上述图13所示的流程中,步骤1-3,即访问令牌获取的流程,与步骤4-7,即服务访问的流程,属于两个独立的流程,可独立执行。It should be noted that, in the process shown in Figure 13 above, steps 1-3, namely, the process of obtaining an access token, and steps 4-7, namely, the process of service access, belong to two independent processes and can be executed independently.
图14为基于图12所示的流程,在间接通信场景下的一种信令交互示意图,如图所示,该流程可包括:FIG. 14 is a schematic diagram of signaling interaction in an indirect communication scenario based on the process shown in FIG. 12. As shown in the figure, the process may include:
步骤1:服务消费者网络功能向NRF发送用于请求访问令牌的消息(即第一请求消息),具体见图13的步骤1,此处不再赘述。Step 1: The service consumer network function sends a message (namely the first request message) for requesting an access token to the NRF, see step 1 in Figure 13 for details, and will not be repeated here.
步骤2:网络仓库功能在接收到第一请求消息之后,确定第一条件是否满足,如果满足则生成第一访问令牌、或第二访问令牌或多个第三访问令牌。Step 2: After receiving the first request message, the network warehouse function determines whether the first condition is met, and if so, generates a first access token, or a second access token, or a plurality of third access tokens.
可选地,如果所述网络仓库功能接收来自服务消费者网络功能的第一信息,则第一条件满足。Optionally, the first condition is met if the web repository function receives the first information from the service consumer web function.
可选地,如果所述网络仓库功能本地配置指示所述第一服务或所述请求的服务提供者网络功能支持HTTP重定向,则第一条件满足。Optionally, if the local configuration of the web repository function indicates that the first service or the requested service provider web function supports HTTP redirection, the first condition is met.
可选地,如果所述第一服务或所述请求的服务提供者网络功能的网络功能文件(NF  Profile)中指示所述第一服务或所述请求的服务提供者网络功能支持的特性包括HTTP重定向,则第一条件满足。Optionally, if the network function file (NF Profile) of the first service or the requested service provider network function indicates that the features supported by the first service or the requested service provider network function include HTTP redirection, the first condition is met.
可选地,如果服务消费者网络功能使用SCP跟服务提供者网络功能通信,则第一条件满足。Optionally, the first condition is satisfied if the service consumer web function communicates with the service provider web function using SCP.
所述第一访问令牌中包括,所述请求的服务提供者网络功能的网络功能类型,或所述请求的服务提供者网络功能的网络功能集标识;或所述请求的服务提供者网络功能的网络功能类型和网络功能集标识。The first access token includes the network function type of the requested service provider network function, or the network function set identifier of the requested service provider network function; or the requested service provider network function The network function type and network function set identifier.
所述第二访问令牌中包括多个服务提供者网络功能的实例标识,其中服务提供者网络功能可提供所述第一服务。应理解,可提供所述第一服务的服务提供者网络功能包括第一服务提供者网络功能和第二服务提供者网络功能,因此第二访问令牌中包括了第一服务提供者网络功能的实例标识和第二服务提供者网络功能实例标识。The second access token includes instance identifiers of multiple service provider network functions, where the service provider network function can provide the first service. It should be understood that the service provider network function that can provide the first service includes the first service provider network function and the second service provider network function, so the second access token includes the first service provider network function The instance identifier and the second service provider network function instance identifier.
所述第三访问令牌中包括一个服务提供者网络功能的实例标识,其中该服务提供者网络功能可提供第一服务。应理解,由于第一服务提供者网络功能和第二服务提供者网络功能都能提供第一服务,因此其中一个第三令牌中包括了第一服务提供者网络功能的实例标识,一个第三令牌中包括了第二服务提供者网络功能的实例标识。The third access token includes an instance identifier of a service provider network function, where the service provider network function can provide the first service. It should be understood that since both the first service provider network function and the second service provider network function can provide the first service, one of the third tokens includes the instance identifier of the first service provider network function, and one third The token includes the instance identifier of the network function of the second service provider.
可选的,NRF在生成访问第一访问令牌、第二访问令牌或多个第三访问令牌之前,还需要检查该服务消费者网络功能是否有授权访问请求的服务。如果没有,则NRF不生成任何访问令牌,并向该服务消费者网络功能返回携带错误原因的响应消息。Optionally, before the NRF generates access to the first access token, the second access token or multiple third access tokens, it also needs to check whether the service consumer network function has a service authorized to access the request. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
进一步的,如果第一条件不满足,则NRF生成第四访问令牌,示例的,第四访问令牌携带请求的服务提供者网络功能的实例标识。可选地,NRF生成第四访问令牌之前,还需要检查该服务消费者网络功能是否有授权访问请求的服务。如果没有,则NRF不生成任何访问令牌,并向该服务消费者网络功能返回携带错误原因的响应消息。Further, if the first condition is not satisfied, the NRF generates a fourth access token, for example, the fourth access token carries the instance identifier of the requested service provider network function. Optionally, before the NRF generates the fourth access token, it also needs to check whether the service consumer network function is authorized to access the requested service. If not, the NRF does not generate any access token and returns a response message carrying the reason for the error to the service consumer web function.
步骤3:NRF向该服务消费者网络功能发送响应消息,该消息中携带NRF生成的第一访问令牌、或第二访问令牌或多个第三访问令牌。具体见图12的步骤3。Step 3: The NRF sends a response message to the service consumer network function, and the message carries the first access token, or the second access token, or multiple third access tokens generated by the NRF. See step 3 in Figure 12 for details.
步骤4:该服务消费者网络功能向SCP发送用于请求服务的消息,包括接收到的第一访问令牌、或第二访问令牌或多个第三访问令牌。SCP向第一服务消费者网络功能发送用于请求服务的消息,包括从服务消费者网络功能接收到的访问令牌。Step 4: The service consumer network function sends a message for requesting a service to the SCP, including the received first access token, or the second access token, or multiple third access tokens. The SCP sends a message requesting the service to the first service consumer web function, including the access token received from the service consumer web function.
一种可能的实现方式中,当该服务消费者网络功能获取到多个第三访问令牌时,该服务消费者网络功能可以在该服务请求消息中包括该多个第三访问令牌、或包括1个第三访问令牌,该第三访问令牌中包括第一服务提供者网络功能的实例标识。In a possible implementation manner, when the service consumer network function obtains multiple third access tokens, the service consumer network function may include the multiple third access tokens in the service request message, or A third access token is included, and the third access token includes the instance identifier of the network function of the first service provider.
步骤5:第一服务提供者网络功能向该服务消费者网络功能发送响应消息,该响应消息经由SCP发送到该服务消费者网络功能。该响应消息中携带HTTP重定向状态码和第二服务提供者网络功能的信息(如URI和/或实例标识)。Step 5: The first service provider network function sends a response message to the service consumer network function, and the response message is sent to the service consumer network function via the SCP. The response message carries the HTTP redirection status code and information about the network function of the second service provider (such as URI and/or instance identifier).
步骤6:服务消费者网络功能向该第二服务提供者网络功能发送的用于服务请求消息,经由SCP发送到第二服务消费者网络功能。该消息包括第一访问令牌、或第二访问令牌或多个第三访问令牌。Step 6: The service request message sent by the service consumer network function to the second service provider network function is sent to the second service consumer network function via the SCP. The message includes the first access token, or the second access token, or a plurality of third access tokens.
一种可能的实现方式中,当该服务消费者网络功能获取到多个第三访问令牌时,该服务消费者网络功能可以在该服务请求消息中包括该多个第三访问令牌、或包括1个第三访问令牌,该第三访问令牌中包括第二服务提供者网络功能的实例标识。In a possible implementation manner, when the service consumer network function obtains multiple third access tokens, the service consumer network function may include the multiple third access tokens in the service request message, or A third access token is included, and the third access token includes the instance identifier of the network function of the second service provider.
步骤7:第二服务提供者网络功能验证接收的访问令牌,如果验证成功,则执行该服 务消费者网络功能请求的第一服务。Step 7: The second service provider network function verifies the received access token, and if the verification is successful, executes the first service requested by the service consumer network function.
上述步骤4-7的具体实现基本与图13中的相关步骤基本相同,不同之处在于包括,服务消费者网络功能与服务提供者网络功能之间通过SCP进行通信。The specific implementation of the above steps 4-7 is basically the same as the relevant steps in FIG. 13 , the difference is that the communication between the service consumer network function and the service provider network function is carried out through SCP.
在一种可能的实现方式中,SCP在接收到第一服务提供者网络功能发送的重定向HTTP重定向状态码以及第二服务提供者网络功能的信息之后,直接向第二服务提供者网络功能发送用于请求的消息,携带接收步骤4中接收到的访问令牌。In a possible implementation, after receiving the redirection HTTP redirection status code sent by the network function of the first service provider and the information of the network function of the second service provider, the SCP directly sends a message to the network function of the second service provider. Send a message for the request, carrying the access token received in receive step 4.
需要说明的是,上述图14所示的流程中,步骤1-3,即访问令牌获取的流程,与步骤4-7,即服务访问的流程,属于两个独立的流程,可独立执行。It should be noted that, in the process shown in Figure 14 above, steps 1-3, namely, the process of obtaining an access token, and steps 4-7, namely, the process of service access, belong to two independent processes and can be executed independently.
基于以上实施例,本申请实施例还提供了一种服务消费者网络功能,参见图15所示,该服务消费者网络功能1500可以包括收发单元1501和处理单元1502。其中,收发单元1501用于该服务消费者网络功能1500接收信息(消息或数据)或发送信息(消息或数据),处理单元1502用于对该服务消费者网络功能1500的动作进行控制管理。处理单元1502还可以控制收发单元1501执行的步骤。Based on the above embodiments, the embodiment of the present application also provides a service consumer network function, as shown in FIG. 15 , the service consumer network function 1500 may include a transceiver unit 1501 and a processing unit 1502 . Wherein, the transceiver unit 1501 is used for the service consumer network function 1500 to receive information (message or data) or send information (message or data), and the processing unit 1502 is used for controlling and managing the actions of the service consumer network function 1500 . The processing unit 1502 may also control the steps performed by the transceiver unit 1501 .
在一个实施例中,网络功能1500可以用于实现图5所示的实施例中服务消费者网络功能的功能。具体可以包括:In one embodiment, the network function 1500 may be used to realize the function of the service consumer network function in the embodiment shown in FIG. 5 . Specifically can include:
收发单元1501用于根据第一信息,向网络仓库功能发送第一请求消息,所述第一请求消息中包括第二信息和第一服务的服务名称,所述第一请求消息用于请求获取访问令牌,所述访问令牌用于所述服务消费者网络功能访问所述第一服务时的授权检查;以及,接收来自所述网络仓库功能的第一响应消息。The transceiver unit 1501 is configured to send a first request message to the network warehouse function according to the first information, the first request message includes the second information and the service name of the first service, and the first request message is used to request access to a token, the access token is used for an authorization check when the service consumer web function accesses the first service; and, receiving a first response message from the web repository function.
在一种可能的实现方式中,所述第一信息用于表示所述服务消费者网络功能、所述第一服务、提供所述第一服务的服务提供者网络功能中的至少一个支持HTTP重定向特性;或者,所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识,所述第一指示用于指示服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能,所述第二服务提供者网络功能为HTTP重定向的目标服务提供者网络功能;或者。所述第一信息包括多个服务提供者网络功能的实例标识;或者,所述第一信息用于指示所述服务消费者网络功能使用服务通信代理与服务提供者网络功能进行通信。In a possible implementation manner, the first information is used to indicate that at least one of the service consumer network function, the first service, and the service provider network function that provides the first service supports HTTP replay. Orientation characteristics; or, the first information includes a first indication and/or an instance identifier of a second service provider network function, and the first indication is used to indicate service access authorization failure or HTTP redirection or obtaining an access token or There are other service provider network functions available, the second service provider network function being the target service provider network function of the HTTP redirect; or. The first information includes instance identifiers of multiple service provider network functions; or, the first information is used to instruct the service consumer network function to use a service communication proxy to communicate with the service provider network function.
可选的,收发单元1501还用于:在根据第一信息向网络仓库功能发送第一请求消息之前,接收第一信息。Optionally, the transceiving unit 1501 is further configured to: receive the first information before sending the first request message to the network warehouse function according to the first information.
示例性的,收发单元1501具体用于:接收来自于所述网络仓库功能或服务通信代理或第一服务提供者网络功能发送的所述第一信息。Exemplarily, the transceiving unit 1501 is specifically configured to: receive the first information sent from the network warehouse function or the service communication agent or the network function of the first service provider.
在一种可能的实现方式中,所述第二信息包括:所述服务消费者网络功能请求的服务提供者网络功能的网络功能类型;或所述服务消费者网络功能请求的服务提供者网络功能的网络功能集标识;或第二服务提供者网络功能的实例标识,所述第二服务提供者网络功能为HTTP重定向的目标服务提供者网络功能;或所述第一信息中的多个服务提供者网络功能的实例标识。In a possible implementation manner, the second information includes: the network function type of the service provider network function requested by the service consumer network function; or the service provider network function requested by the service consumer network function or the instance identifier of the second service provider network function, where the second service provider network function is the target service provider network function of HTTP redirection; or multiple services in the first information The instance ID of the provider web function.
在一种可能的实现方式中,所述响应消息中包括以下任一项:In a possible implementation manner, the response message includes any of the following:
第一访问令牌,所述第一访问令牌包括服务提供者网络功能的网络功能类型,和/或服务提供者网络功能的网络功能集标识;A first access token, where the first access token includes a network function type of the service provider network function, and/or a network function set identifier of the service provider network function;
第二访问令牌,所述第二访问令牌包括多个服务提供者网络功能的实例标识;a second access token comprising instance identifications of a plurality of service provider network functions;
多个第三访问令牌,每个所述第三访问令牌分别包括一个服务提供者网络功能的实例 标识;A plurality of third access tokens, each of which includes an instance identifier of a service provider network function;
第四访问令牌,所述第四访问令牌包括第二服务提供者网络功能的实例标识,所述第二服务提供者网络功能为HTTP重定向的目标服务提供者网络功能。A fourth access token, where the fourth access token includes an instance identifier of a second service provider network function, and the second service provider network function is a target service provider network function for HTTP redirection.
可选的,收发单元1501还用于:在接收来自所述网络仓库功能的第一响应消息之后,向第一服务提供者网络功能或第二服务提供者网络功能或服务通信代理发送第二请求消息,所述第二请求消息用于请求服务,所述第二请求消息中包括所述第一访问令牌或所述第二访问令牌或所述第三访问令牌或所述第四访问令牌。Optionally, the transceiver unit 1501 is further configured to: after receiving the first response message from the network warehouse function, send a second request to the first service provider network function or the second service provider network function or the service communication agent message, the second request message is used to request a service, and the second request message includes the first access token or the second access token or the third access token or the fourth access token token.
在一种可能的实现方式中,收发单元1501还用于:根据第一信息,向网络仓库功能发送第一请求消息之前,向第一服务提供者网络功能或服务通信代理发送第三请求消息,所述第三服务请求消息用于请求所述第一服务。In a possible implementation manner, the transceiver unit 1501 is further configured to: send a third request message to the first service provider network function or service communication agent before sending the first request message to the network warehouse function according to the first information, The third service request message is used to request the first service.
在一种可能的实现方式中,收发单元1501还用于:根据第一信息,向网络仓库功能发送第一请求消息之前,向所述网络仓库功能发送第四请求消息,所述第四请求消息中包括所述第一服务的服务名称,所述第四请求消息用于请求发现所述第一服务或发现可提供所述第一服务的网络功能的实例。In a possible implementation manner, the transceiver unit 1501 is further configured to: send a fourth request message to the network warehouse function before sending the first request message to the network warehouse function according to the first information, and the fourth request message includes the service name of the first service, and the fourth request message is used to request to discover the first service or to discover a network function instance that can provide the first service.
基于以上实施例,本申请实施例还提供了一种服务通信代理,参见图16所示,服务通信代理1600可以包括收发单元1601和处理单元1602。其中,收发单元1601用于服务通信代理1600接收信息(消息或数据)或发送信息(消息或数据),处理单元1602用于对服务通信代理1600的动作进行控制管理。处理单元1602还可以控制收发单元1601执行的步骤。Based on the above embodiments, this embodiment of the present application also provides a service communication agent. Referring to FIG. 16 , the service communication agent 1600 may include a transceiver unit 1601 and a processing unit 1602 . Among them, the transceiver unit 1601 is used for the service communication agent 1600 to receive information (message or data) or send information (message or data), and the processing unit 1602 is used to control and manage the actions of the service communication agent 1600 . The processing unit 1602 can also control the steps performed by the transceiver unit 1601 .
在一个实施例中,服务通信代理1600可以用于实现图10所示的实施例中服务通信代理的功能。具体可以包括:In one embodiment, the service communication agent 1600 may be used to realize the function of the service communication agent in the embodiment shown in FIG. 10 . Specifically can include:
收发单元1601用于接收服务消费者网络功能的第一请求消息,所述第一请求消息包括第一访问令牌;向第一服务提供者网络功能发送第二请求消息,所述第二请求消息包括所述第一访问令牌;接收来自于所述第一服务提供者网络功能的第二响应消息,所述第二响应消息包括第二服务提供者网络功能的信息和重定向状态码,所述重定向状态码用于指示服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;以及,向所述服务消费者网络功能发送第一响应消息,所述第一响应消息用于所述消费者网络功能请求获取第二访问令牌。The transceiver unit 1601 is configured to receive a first request message from a service consumer network function, the first request message includes a first access token; send a second request message to the first service provider network function, and the second request message including the first access token; receiving a second response message from the first service provider network function, the second response message including information of the second service provider network function and a redirection status code, the The redirection status code is used to indicate service access authorization failure or HTTP redirection or obtaining an access token or other available service provider network functions; and, sending a first response message to the service consumer network function, the The first response message is used for the consumer network function to request to obtain a second access token.
在一种可能的实现方式中,所述第一响应消息中包括第一信息,所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识。其中,所述第一指示用于指示发生了HTTP重定向,或用于指示所述访问消费者网络功能获取访问令牌,或服务访问授权失败,或有其他可用的服务提供者网络功能。In a possible implementation manner, the first response message includes first information, where the first information includes the first indication and/or the instance identifier of the network function of the second service provider. Wherein, the first indication is used to indicate that HTTP redirection has occurred, or used to indicate that the access consumer network function obtains an access token, or service access authorization fails, or there are other available service provider network functions.
在一种可能的实现方式中,处理单元1602还用于:向所述服务消费者网络功能发送第一响应消息之前,确定第一条件满足;其中,第一条件包括以下条件中的至少一个:In a possible implementation manner, the processing unit 1602 is further configured to: before sending the first response message to the service consumer network function, determine that a first condition is satisfied; where the first condition includes at least one of the following conditions:
所述第一访问令牌中不包括所述第二服务提供者网络功能的实例标识;The first access token does not include the instance identifier of the second service provider network function;
所述第一访问令牌不能用于授权访问所述第二服务提供者网络功能的服务;said first access token cannot be used to authorize services accessing said second service provider network functionality;
所述第一访问令牌只能用于访问特定服务提供者网络功能实例或只能用于访问所述第一服务提供者网络功能的服务,所述特定服务提供者网络功能包括所述第一服务提供者网络功能;The first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, and the specific service provider network function includes the first Service Provider Network Functions;
所述第一访问令牌中不包括服务提供者网络功能的网络功能类型或网络功能集标识;The first access token does not include the network function type or network function set identifier of the service provider network function;
所述第一访问令牌中包括所述第一服务提供者网络功能的实例标识。The first access token includes the instance identifier of the first service provider network function.
可选的,收发单元1601还用于:若所述第一条件不满足,则向所述第二服务提供者网络功能发送第三请求消息,所述第三请求消息中包括所述第一访问令牌。Optionally, the transceiver unit 1601 is further configured to: if the first condition is not met, send a third request message to the second service provider network function, the third request message includes the first access token.
可选的,收发单元1601还用于:向所述服务消费者网络功能发送第一响应消息之后,接收所述服务消费者网络功能发送的第四请求消息,所述第四请求消息中包括所述第二访问令牌;以及,向所述第二服务提供者网络功能发送第五请求消息,所述第五请求消息包括所述第二访问令牌。Optionally, the transceiver unit 1601 is further configured to: receive a fourth request message sent by the service consumer network function after sending the first response message to the service consumer network function, the fourth request message includes the the second access token; and, sending a fifth request message to the second service provider network function, the fifth request message including the second access token.
可选的,所述第二访问令牌中包括所述第二服务提供者网络功能的实例标识、或服务提供者网络功能的网络功能类型、或服务提供者网络功能的网络功能集标识。Optionally, the second access token includes the instance identifier of the second service provider network function, or the network function type of the service provider network function, or the network function set identifier of the service provider network function.
基于以上实施例,本申请实施例还提供了一种网络仓库功能,参见图17所示,网络仓库功能1700可以包括收发单元1701和处理单元1702。其中,收发单元1701用于网络仓库功能1700接收信息(消息或数据)或发送信息(消息或数据),处理单元1702用于对网络仓库功能1700的动作进行控制管理。处理单元1702还可以控制收发单元1701执行的步骤。Based on the above embodiments, the embodiment of the present application also provides a network warehouse function, as shown in FIG. 17 , the network warehouse function 1700 may include a transceiver unit 1701 and a processing unit 1702 . Among them, the transceiver unit 1701 is used for the network warehouse function 1700 to receive information (message or data) or send information (message or data), and the processing unit 1702 is used for controlling and managing the actions of the network warehouse function 1700 . The processing unit 1702 can also control the steps performed by the transceiver unit 1701 .
在一个实施例中,网络仓库功能1700可以用于实现图12所示的实施例中网络仓库功能的功能。具体可以包括:In one embodiment, the network warehouse function 1700 can be used to implement the functions of the network warehouse function in the embodiment shown in FIG. 12 . Specifically can include:
收发单元1701用于接收来自服务消费者网络功能的第一请求消息,所述第一请求消息用于请求获取访问令牌,所述第一请求消息中包括所述服务消费者网络功能请求的第一服务的服务名称,以及请求的服务提供者网络功能的网络功能类型或实例标识;处理单元1702用于确定第一条件满足,则生成第一访问令牌、或第二访问令牌或多个第三访问令牌;收发单元1701还用于:向所述服务消费者网络功能发送第一响应消息,所述第一响应消息中包括所述第一访问令牌、或所述第二访问令牌或所述多个第三访问令牌。The transceiver unit 1701 is configured to receive a first request message from the service consumer network function, the first request message is used to request to obtain an access token, and the first request message includes the first request message requested by the service consumer network function The service name of a service, and the network function type or instance identifier of the requested service provider network function; the processing unit 1702 is used to determine that the first condition is met, then generate the first access token, or the second access token or multiple The third access token; the transceiver unit 1701 is further configured to: send a first response message to the service consumer network function, the first response message includes the first access token or the second access token card or the plurality of third access tokens.
在一种可能的实现方式中,处理单元1702具体用于:接收来自所述服务消费者网络功能的第一信息,则确定第一条件满足;或者,所述网络仓库功能的本地配置指示所述第一服务或所述请求的服务提供者网络功能支持HTTP重定向,则确定第一条件满足;或者,所述第一服务或所述请求的服务提供者网络功能的网络功能文件中指示所述第一服务或所述请求的服务提供者网络功能支持的特性包括HTTP重定向,则确定第一条件满足。In a possible implementation manner, the processing unit 1702 is specifically configured to: receive the first information from the service consumer network function, then determine that the first condition is met; or, the local configuration of the network warehouse function indicates that the The first service or the requested service provider network function supports HTTP redirection, then it is determined that the first condition is satisfied; or, the network function file of the first service or the requested service provider network function indicates that the If the feature supported by the network function of the first service or the requested service provider includes HTTP redirection, it is determined that the first condition is met.
在一种可能的实现方式中:In one possible implementation:
所述第一访问令牌包括所述请求的服务提供者网络功能的网络功能类型,和/或所述请求的服务提供者网络功能的网络功能集标识;The first access token includes a network function type of the requested service provider network function, and/or a network function set identifier of the requested service provider network function;
所述第二访问令牌包括多个服务提供者网络功能的实例标识;其中服务提供者网络功能可提供所述第一服务;The second access token includes instance identifiers of a plurality of service provider network functions; wherein the service provider network function can provide the first service;
所述第三访问令牌包括一个服务提供者网络功能的实例标识,其中该服务提供者网络功能可提供第一服务。The third access token includes an instance identifier of a service provider network function that can provide the first service.
在一种可能的实现方式中,所述第一请求消息包括第一信息,所述第一信息用于指示所述服务消费者网络功能支持HTTP重定向、或用于指示所述服务消费者网络功能请求第一服务支持HTTP重定向、或用于指示所述服务消费者网络功能请求服务提供者网络功能支持HTTP重定向、或用于指示所述第一服务支持HTTP重定向、或用于指示所述请求的服务提供者网络功能支持HTTP重定向。In a possible implementation manner, the first request message includes first information, and the first information is used to indicate that the service consumer network function supports HTTP redirection, or to indicate that the service consumer network function The function requests that the first service supports HTTP redirection, or is used to indicate that the service consumer network function requests the service provider network function to support HTTP redirection, or is used to indicate that the first service supports HTTP redirection, or is used to indicate The requested service provider web function supports HTTP redirection.
在一种可能的实现方式中,处理单元1702还用于:生成第一访问令牌、第二访问令 牌、或多个第三访问令牌之前,还包括:检查所述服务消费者网络功能的服务访问授权成功。In a possible implementation, the processing unit 1702 is further configured to: before generating the first access token, the second access token, or multiple third access tokens, further include: checking the service consumer network function Authorization for service access was successful.
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。It should be noted that the division of units in the embodiment of the present application is schematic, and is only a logical function division, and there may be another division manner in actual implementation. Each functional unit in the embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
基于以上实施例,本申请实施例还提供了一种通信装置,参见图18所示,通信装置1800可以包括收发器1801和处理器1802。可选的,通信装置1800中还可以包括存储器1803。其中,存储器1803可以设置于通信装置1800内部,还可以设置于通信装置1800外部。其中,处理器1802可以控制收发器1801接收和发送信息或数据等。Based on the above embodiments, this embodiment of the present application also provides a communication device. Referring to FIG. 18 , a communication device 1800 may include a transceiver 1801 and a processor 1802 . Optionally, the communication device 1800 may further include a memory 1803 . Wherein, the memory 1803 can be set inside the communication device 1800 , and can also be set outside the communication device 1800 . Wherein, the processor 1802 may control the transceiver 1801 to receive and send information or data, and the like.
具体地,处理器1802可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。所述处理器1102还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。Specifically, the processor 1802 may be a central processing unit (central processing unit, CPU), a network processor (network processor, NP) or a combination of CPU and NP. The processor 1102 may further include a hardware chip. The aforementioned hardware chip may be an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or a combination thereof. The aforementioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
其中,收发器1801、处理器1802和存储器1803之间相互连接。可选的,收发器1801、处理器1802和存储器1803通过总线1804相互连接;总线1804可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图18中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Wherein, the transceiver 1801, the processor 1802 and the memory 1803 are connected to each other. Optionally, the transceiver 1801, the processor 1802 and the memory 1803 are connected to each other by a bus 1804; the bus 1804 can be a peripheral component interconnection standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA ) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 18 , but it does not mean that there is only one bus or one type of bus.
在一种可选的实施方式中,存储器1803用于存放程序等。具体地,程序可以包括程序代码,该程序代码包括计算机操作指令。存储器1803可能包括RAM,也可能还包括非易失性存储器(non-volatile memory),例如一个或多个磁盘存储器。处理器1802执行存储器1803所存放的应用程序,实现上述功能,从而实现通信装置1800的功能。In an optional implementation manner, the memory 1803 is used to store programs and the like. Specifically, the program may include program code including computer operation instructions. The memory 1803 may include RAM, and may also include non-volatile memory (non-volatile memory), such as one or more disk memories. The processor 1802 executes the application program stored in the memory 1803 to realize the above functions, thereby realizing the functions of the communication device 1800 .
在一个实施例中,通信装置1800可以用于实现图5所示的实施例中服务消费者网络功能的功能,或者图10中服务通信代理的功能,或者图12中数据仓库功能的功能,具体可以参见相应流程中的相关描述,此处不再详细描述。In one embodiment, the communication device 1800 can be used to implement the function of the service consumer network function in the embodiment shown in FIG. 5, or the function of the service communication agent in FIG. 10, or the function of the data warehouse function in FIG. 12, specifically Reference may be made to relevant descriptions in the corresponding processes, which will not be described in detail here.
基于以上实施例,本申请实施例提供了一种通信系统,该通信系统可以包括上述实施例涉及的服务消费者网络功能、服务提供者网络功能(包括第一服务消费者网络功能和/ 或第二服务消费者网络功能)、网络仓库功能,进一步的还可包括通信服务代理等。Based on the above embodiments, this embodiment of the present application provides a communication system, which may include the service consumer network function and the service provider network function (including the first service consumer network function and/or the second (2) service consumer network function), network warehouse function, and further include communication service agent, etc.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,该计算机程序被计算机执行时,所述计算机可以实现上述方法实施例提供的网络功能服务授权的方法。The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a computer, the computer can realize the network function service authorization provided by the above-mentioned method embodiment Methods.
本申请实施例还提供一种计算机程序产品,所述计算机程序产品用于存储计算机程序,该计算机程序被计算机执行时,所述计算机可以实现上述方法实施例提供的网络功能服务授权的方法。An embodiment of the present application further provides a computer program product, the computer program product is used to store a computer program, and when the computer program is executed by a computer, the computer can implement the method for network function service authorization provided by the above method embodiment.
本申请实施例还提供一种芯片,包括处理器,所述处理器与存储器耦合,用于调用所述存储器中的程序使得所述芯片实现上述方法实施例提供的网络功能服务授权的方法。The embodiment of the present application further provides a chip, including a processor, the processor is coupled with a memory, and is configured to call a program in the memory so that the chip implements the method for network function service authorization provided by the above method embodiment.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Apparently, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims (44)

  1. 一种网络功能服务授权方法,其特征在于,包括:A network function service authorization method, characterized in that it includes:
    服务消费者网络功能根据第一信息,向网络仓库功能发送第一请求消息,所述第一请求消息中包括第二信息和第一服务的服务名称,所述第一请求消息用于请求获取访问令牌,所述访问令牌用于所述服务消费者网络功能访问所述第一服务时的授权检查;The service consumer network function sends a first request message to the network warehouse function according to the first information, the first request message includes the second information and the service name of the first service, and the first request message is used to request access to a token, the access token is used for an authorization check when the service consumer network function accesses the first service;
    所述服务消费者网络功能接收来自所述网络仓库功能的第一响应消息。The service consumer web function receives a first response message from the web store function.
  2. 如权利要求1所述的方法,其特征在于:The method of claim 1, characterized in that:
    所述第一信息用于表示所述服务消费者网络功能支持超文本传输协议HTTP重定向特性,和/或所述第一服务支持HTTP重定向特性,和/或提供所述第一服务的服务提供者网络功能支持HTTP重定向特性;或者The first information is used to indicate that the service consumer network function supports the hypertext transfer protocol HTTP redirection feature, and/or the first service supports the HTTP redirection feature, and/or provides the service of the first service The provider network function supports the HTTP redirection feature; or
    所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识,所述第一指示用于指示服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;或者The first information includes a first indication and/or an instance identifier of the network function of the second service provider, and the first indication is used to indicate that service access authorization fails or HTTP redirects or obtains an access token or has other available services Provider Network Features; or
    所述第一信息包括多个服务提供者网络功能的实例标识;所述服务提供者网络功能提供所述第一服务;或者The first information includes instance identifications of a plurality of service provider network functions; the service provider network functions provide the first service; or
    所述第一信息用于指示所述服务消费者网络功能使用服务通信代理与服务提供者网络功能进行通信。The first information is used to instruct the service consumer network function to use the service communication proxy to communicate with the service provider network function.
  3. 如权利要求2所述的方法,其特征在于,所述服务消费者网络功能根据第一信息,向网络仓库功能发送第一请求消息之前,还包括:The method according to claim 2, wherein the service consumer network function further comprises: before sending the first request message to the network warehouse function according to the first information:
    所述服务消费者网络功能接收所述第一信息。The service consumer network function receives the first information.
  4. 如权利要求3所述的方法,其特征在于,所述服务消费者网络功能接收所述第一信息,包括:The method according to claim 3, wherein the service consumer network function receiving the first information comprises:
    所述服务消费者网络功能接收来自于所述网络仓库功能或服务通信代理或第一服务提供者网络功能发送的所述第一信息。The service consumer web function receives the first information sent from the web warehouse function or the service communication agent or the first service provider web function.
  5. 如权利要求1-4任一项所述的方法,其特征在于,所述第二信息包括:The method according to any one of claims 1-4, wherein the second information includes:
    所述服务消费者网络功能请求的服务提供者网络功能的网络功能类型;或the network function type of the service provider network function requested by said service consumer network function; or
    所述服务消费者网络功能请求的服务提供者网络功能的网络功能集标识;或the network function set identification of the service provider network function requested by said service consumer network function; or
    第二服务提供者网络功能的实例标识;或Instance identification of the second service provider network function; or
    多个服务提供者网络功能的实例标识,所述服务提供者网络功能提供所述第一服务。Instance identifications of a plurality of service provider network functions that provide the first service.
  6. 如权利要求1-5任一项所述的方法,其特征在于,所述第一响应消息中包括以下任一项:The method according to any one of claims 1-5, wherein the first response message includes any of the following:
    第一访问令牌,所述第一访问令牌包括服务提供者网络功能的网络功能类型,和/或服务提供者网络功能的网络功能集标识;或者a first access token comprising a network function type of a service provider network function, and/or a network function set identifier of a service provider network function; or
    第二访问令牌,所述第二访问令牌包括多个服务提供者网络功能的实例标识;或者a second access token comprising instance identifications of a plurality of service provider network functions; or
    多个第三访问令牌,每个所述第三访问令牌分别包括一个服务提供者网络功能的实例标识;或者a plurality of third access tokens, each of which respectively includes an instance identifier of a service provider network function; or
    第四访问令牌,所述第四访问令牌包括第二服务提供者网络功能的实例标识。A fourth access token, the fourth access token including the instance identifier of the second service provider network function.
  7. 如权利要求6所述的方法,其特征在于,所述服务消费者网络功能接收来自所述网络仓库功能的第一响应消息之后,还包括:The method according to claim 6, wherein after the service consumer network function receives the first response message from the network warehouse function, further comprising:
    所述服务消费者网络功能向第一服务提供者网络功能或第二服务提供者网络功能或服务通信代理发送第二请求消息,所述第二请求消息用于请求服务,所述第二请求消息中包括所述第一访问令牌或所述第二访问令牌或所述第三访问令牌或所述第四访问令牌。The service consumer network function sends a second request message to the first service provider network function or the second service provider network function or the service communication agent, the second request message is used to request the service, the second request message includes the first access token or the second access token or the third access token or the fourth access token.
  8. 如权利要求1-7任一项所述的方法,其特征在于,所述服务消费者网络功能根据第一信息,向网络仓库功能发送第一请求消息之前,还包括:The method according to any one of claims 1-7, wherein, before the service consumer network function sends the first request message to the network warehouse function according to the first information, it further includes:
    所述服务消费者网络功能向第一服务提供者网络功能或服务通信代理发送第三请求消息,所述第三服务请求消息用于请求所述第一服务。The service consumer network function sends a third request message to the first service provider network function or the service communication agent, the third service request message for requesting the first service.
  9. 如权利要求1-8任一项所述的方法,其特征在于,所述服务消费者网络功能根据第一信息,向网络仓库功能发送第一请求消息之前,还包括:The method according to any one of claims 1-8, wherein, before the service consumer network function sends the first request message to the network warehouse function according to the first information, it further includes:
    所述服务消费者网络功能向所述网络仓库功能发送第四请求消息,所述第四请求消息中包括所述第一服务的服务名称,所述第四请求消息用于请求发现所述第一服务或发现可提供所述第一服务的网络功能的实例。The service consumer network function sends a fourth request message to the network warehouse function, the fourth request message includes the service name of the first service, and the fourth request message is used to request to discover the first service A service or discovery may provide an instance of the network function of the first service.
  10. 一种网络功能服务授权方法,其特征在于,包括:A network function service authorization method, characterized in that it includes:
    服务通信代理接收服务消费者网络功能的第一请求消息,所述第一请求消息包括第一访问令牌;The service communication agent receives a first request message for a service consumer network function, the first request message including a first access token;
    所述服务通信代理向第一服务提供者网络功能发送第二请求消息,所述第二请求消息包括所述第一访问令牌;the service communication agent sending a second request message to the first service provider network function, the second request message including the first access token;
    所述服务通信代理接收来自于所述第一服务提供者网络功能的第二响应消息,所述第二响应消息包括第二服务提供者网络功能的信息和重定向状态码,所述重定向状态码用于指示服务访问授权失败或超文本传输协议HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;The service communication agent receives a second response message from the first service provider network function, the second response message includes information of the second service provider network function and a redirection status code, and the redirection status Code used to indicate service access authorization failure or hypertext transfer protocol HTTP redirect or obtain access token or other available service provider network functions;
    所述服务通信代理向所述服务消费者网络功能发送第一响应消息,所述第一响应消息用于所述消费者网络功能请求获取第二访问令牌。The service communication agent sends a first response message to the service consumer network function, and the first response message is used for the consumer network function to request to acquire a second access token.
  11. 如权利要求10所述的方法,其特征在于,所述第一响应消息中包括第一信息,所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识;The method according to claim 10, wherein the first response message includes first information, and the first information includes the first indication and/or the instance identifier of the network function of the second service provider;
    其中,所述第一指示用于指示发生了HTTP重定向,或用于指示所述访问消费者网络功能获取访问令牌,或服务访问授权失败,或有其他可用的服务提供者网络功能。Wherein, the first indication is used to indicate that HTTP redirection has occurred, or used to indicate that the access consumer network function obtains an access token, or service access authorization fails, or there are other available service provider network functions.
  12. 如权利要求10或11所述的方法,其特征在于,所述服务通信代理向所述服务消费者网络功能发送第一响应消息之前,还包括:The method according to claim 10 or 11, wherein, before the service communication agent sends the first response message to the service consumer network function, further comprising:
    所述服务通信代理确定第一条件满足;其中,第一条件包括以下条件中的至少一个:The service communication agent determines that a first condition is satisfied; wherein the first condition includes at least one of the following conditions:
    所述第一访问令牌中不包括所述第二服务提供者网络功能的实例标识;The first access token does not include the instance identifier of the second service provider network function;
    所述第一访问令牌不能用于授权访问所述第二服务提供者网络功能的服务;said first access token cannot be used to authorize services accessing said second service provider network functionality;
    所述第一访问令牌只能用于访问特定服务提供者网络功能实例或只能用于访问所述第一服务提供者网络功能的服务,所述特定服务提供者网络功能包括所述第一服务提供者网络功能;The first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, and the specific service provider network function includes the first Service Provider Network Functions;
    所述第一访问令牌中不包括服务提供者网络功能的网络功能类型或网络功能集标识;The first access token does not include the network function type or network function set identifier of the service provider network function;
    所述第一访问令牌中包括所述第一服务提供者网络功能的实例标识。The first access token includes the instance identifier of the first service provider network function.
  13. 如权利要求12所述的方法,其特征在于,还包括:The method of claim 12, further comprising:
    若所述第一条件不满足,则所述服务通信代理向所述第二服务提供者网络功能发送第三请求消息,所述第三请求消息中包括所述第一访问令牌。If the first condition is not satisfied, the service communication agent sends a third request message to the second service provider network function, and the third request message includes the first access token.
  14. 如权利要求10-13任一项所述的方法,其特征在于,所述服务通信代理向所述服务消费者网络功能发送第一响应消息之后,还包括:The method according to any one of claims 10-13, wherein, after the service communication agent sends the first response message to the service consumer network function, further comprising:
    所述服务通信代理接收所述服务消费者网络功能发送的第四请求消息,所述第四请求消息中包括所述第二访问令牌;The service communication agent receives a fourth request message sent by the service consumer network function, and the fourth request message includes the second access token;
    所述服务通信代理向所述第二服务提供者网络功能发送第五请求消息,所述第五请求消息包括所述第二访问令牌。The service communication proxy sends a fifth request message to the second service provider network function, the fifth request message including the second access token.
  15. 如权利要求10-14任一项所述的方法,其特征在于,所述第二访问令牌中包括所述第二服务提供者网络功能的实例标识、或服务提供者网络功能的网络功能类型、或服务提供者网络功能的网络功能集标识。The method according to any one of claims 10-14, wherein the second access token includes the instance identifier of the second service provider network function or the network function type of the service provider network function , or the network function set identifier of the service provider network function.
  16. 一种通信方法,其特征在于,包括:A communication method, characterized in that, comprising:
    服务消费者网络功能根据第一信息,向网络仓库功能发送第一请求消息,所述第一请求消息中包括第二信息和第一服务的服务名称,所述第一请求消息用于请求获取访问令牌,所述访问令牌用于所述服务消费者网络功能访问所述第一服务时的授权检查;The service consumer network function sends a first request message to the network warehouse function according to the first information, the first request message includes the second information and the service name of the first service, and the first request message is used to request access to a token, the access token is used for an authorization check when the service consumer network function accesses the first service;
    所述网络仓库功能向所述服务消费者网络功能发送第一响应消息。The web repository function sends a first response message to the service consumer web function.
  17. 如权利要求16所述的方法,其特征在于:The method of claim 16, wherein:
    所述第一信息用于表示所述服务消费者网络功能支持超文本传输协议HTTP重定向特性,和/或所述第一服务支持HTTP重定向特性,和/或提供所述第一服务的服务提供者网络功能支持HTTP重定向特性;或者The first information is used to indicate that the service consumer network function supports the hypertext transfer protocol HTTP redirection feature, and/or the first service supports the HTTP redirection feature, and/or provides the service of the first service The provider network function supports the HTTP redirection feature; or
    所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识,所述第一指示用于指示服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;或者The first information includes a first indication and/or an instance identifier of the network function of the second service provider, and the first indication is used to indicate that service access authorization fails or HTTP redirects or obtains an access token or has other available services Provider Network Features; or
    所述第一信息包括多个服务提供者网络功能的实例标识;所述服务提供者网络功能提供所述第一服务;或者The first information includes instance identifications of a plurality of service provider network functions; the service provider network functions provide the first service; or
    所述第一信息用于指示所述服务消费者网络功能使用服务通信代理与服务提供者网络功能进行通信。The first information is used to instruct the service consumer network function to use the service communication proxy to communicate with the service provider network function.
  18. 如权利要求16所述的方法,其特征在于,所述第二信息包括:The method according to claim 16, wherein the second information includes:
    所述服务消费者网络功能请求的服务提供者网络功能的网络功能类型;或the network function type of the service provider network function requested by said service consumer network function; or
    所述服务消费者网络功能请求的服务提供者网络功能的网络功能集标识;或the network function set identification of the service provider network function requested by said service consumer network function; or
    第二服务提供者网络功能的实例标识;或Instance identification of the second service provider network function; or
    多个服务提供者网络功能的实例标识,所述服务提供者网络功能提供所述第一服务。Instance identifications of a plurality of service provider network functions that provide the first service.
  19. 如权利要求16-18任一项所述的方法,其特征在于,所述第一响应消息中包括以下任一项:The method according to any one of claims 16-18, wherein the first response message includes any of the following:
    第一访问令牌,所述第一访问令牌包括服务提供者网络功能的网络功能类型,和/或服务提供者网络功能的网络功能集标识;或者a first access token comprising a network function type of a service provider network function, and/or a network function set identifier of a service provider network function; or
    第二访问令牌,所述第二访问令牌包括多个服务提供者网络功能的实例标识;或者a second access token comprising instance identifications of a plurality of service provider network functions; or
    多个第三访问令牌,每个所述第三访问令牌分别包括一个服务提供者网络功能的实例标识;或者a plurality of third access tokens, each of which respectively includes an instance identifier of a service provider network function; or
    第四访问令牌,所述第四访问令牌包括第二服务提供者网络功能的实例标识。A fourth access token, the fourth access token including the instance identifier of the second service provider network function.
  20. 一种通信方法,其特征在于,包括:A communication method, characterized in that, comprising:
    服务消费者网络功能向服务通信代理发送第一请求消息,所述第一请求消息包括第一 访问令牌;The service consumer web function sends a first request message to the service communication agent, the first request message including the first access token;
    所述服务通信代理向第一服务提供者网络功能发送第二请求消息,所述第二请求消息包括所述第一访问令牌;the service communication agent sending a second request message to the first service provider network function, the second request message including the first access token;
    所述第一服务提供者网络功能向所述服务通信代理发送第二响应消息,所述第二响应消息包括第二服务提供者网络功能的信息和重定向状态码,所述重定向状态码用于指示服务访问授权失败或超文本传输协议HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;The first service provider network function sends a second response message to the service communication agent, the second response message includes information of the second service provider network function and a redirection status code, and the redirection status code uses To indicate service access authorization failure or hypertext transfer protocol HTTP redirection or to obtain an access token or other available service provider network functions;
    所述服务通信代理向所述服务消费者网络功能发送第一响应消息,所述第一响应消息用于所述消费者网络功能请求获取第二访问令牌。The service communication agent sends a first response message to the service consumer network function, and the first response message is used for the consumer network function to request to acquire a second access token.
  21. 如权利要求20所述的方法,其特征在于,所述第一响应消息中包括第一信息,所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识;The method according to claim 20, wherein the first response message includes first information, and the first information includes the first indication and/or the instance identifier of the network function of the second service provider;
    其中,所述第一指示用于指示发生了HTTP重定向,或用于指示所述访问消费者网络功能获取访问令牌,或服务访问授权失败,或有其他可用的服务提供者网络功能。Wherein, the first indication is used to indicate that HTTP redirection has occurred, or used to indicate that the access consumer network function obtains an access token, or service access authorization fails, or there are other available service provider network functions.
  22. 如权利要求20-21任一项所述的方法,其特征在于,所述第二访问令牌中包括所述第二服务提供者网络功能的实例标识、或服务提供者网络功能的网络功能类型、或服务提供者网络功能的网络功能集标识。The method according to any one of claims 20-21, wherein the second access token includes the instance identifier of the second service provider network function or the network function type of the service provider network function , or the network function set identifier of the service provider network function.
  23. 如权利要求20-22任一项所述的方法,其特征在于,所述服务通信代理向所述服务消费者网络功能发送第一响应消息之前,还包括:The method according to any one of claims 20-22, wherein, before the service communication agent sends the first response message to the service consumer network function, further comprising:
    所述服务通信代理确定第一条件满足;其中,第一条件包括以下条件中的至少一个:The service communication agent determines that a first condition is satisfied; wherein the first condition includes at least one of the following conditions:
    所述第一访问令牌中不包括所述第二服务提供者网络功能的实例标识;The first access token does not include the instance identifier of the second service provider network function;
    所述第一访问令牌不能用于授权访问所述第二服务提供者网络功能的服务;said first access token cannot be used to authorize services accessing said second service provider network functionality;
    所述第一访问令牌只能用于访问特定服务提供者网络功能实例或只能用于访问所述第一服务提供者网络功能的服务,所述特定服务提供者网络功能包括所述第一服务提供者网络功能;The first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, and the specific service provider network function includes the first Service Provider Network Functions;
    所述第一访问令牌中不包括服务提供者网络功能的网络功能类型或网络功能集标识;The first access token does not include the network function type or network function set identifier of the service provider network function;
    所述第一访问令牌中包括所述第一服务提供者网络功能的实例标识。The first access token includes the instance identifier of the first service provider network function.
  24. 一种通信设备,其特征在于,所述通信设备为服务消费者网络功能,所述服务消费者网络功能包括:处理单元、收发单元;A communication device, characterized in that the communication device is a service consumer network function, and the service consumer network function includes: a processing unit, a transceiver unit;
    所述处理单元,用于根据第一信息,通过所述收发单元向网络仓库功能发送第一请求消息,所述第一请求消息中包括第二信息和第一服务的服务名称,所述第一请求消息用于请求获取访问令牌,所述访问令牌用于所述服务消费者网络功能访问所述第一服务时的授权检查;The processing unit is configured to send a first request message to the network warehouse function through the transceiver unit according to the first information, the first request message includes the second information and the service name of the first service, and the first request message includes the second information and the service name of the first service. The request message is used to request to obtain an access token, and the access token is used for an authorization check when the service consumer network function accesses the first service;
    所述收发单元,用于接收来自所述网络仓库功能的第一响应消息。The transceiver unit is configured to receive a first response message from the network warehouse function.
  25. 如权利要求24所述的通信设备,其特征在于:The communications device of claim 24, wherein:
    所述第一信息用于表示所述服务消费者网络功能支持超文本传输协议HTTP重定向特性,和/或所述第一服务支持HTTP重定向特性,和/或提供所述第一服务的服务提供者网络功能支持HTTP重定向特性;或者The first information is used to indicate that the service consumer network function supports the hypertext transfer protocol HTTP redirection feature, and/or the first service supports the HTTP redirection feature, and/or provides the service of the first service The provider network function supports the HTTP redirection feature; or
    所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识,所述第一指示用于指示服务访问授权失败或HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;或者The first information includes a first indication and/or an instance identifier of the network function of the second service provider, and the first indication is used to indicate that service access authorization fails or HTTP redirects or obtains an access token or has other available services Provider Network Features; or
    所述第一信息包括多个服务提供者网络功能的实例标识;所述服务提供者网络功能提供所述第一服务;或者The first information includes instance identifications of a plurality of service provider network functions; the service provider network functions provide the first service; or
    所述第一信息用于指示所述服务消费者网络功能使用服务通信代理与服务提供者网络功能进行通信。The first information is used to instruct the service consumer network function to use the service communication proxy to communicate with the service provider network function.
  26. 如权利要求25所述的通信设备,其特征在于,所述处理单元,还用于:The communication device according to claim 25, wherein the processing unit is further configured to:
    根据所述第一信息,通过所述收发单元向所述网络仓库功能发送所述第一请求消息之前,通过所述收发单元接收所述第一信息。According to the first information, before sending the first request message to the network warehouse function by the transceiver unit, the first information is received by the transceiver unit.
  27. 如权利要求26所述的通信设备,其特征在于,所述收发单元,具体用于:The communication device according to claim 26, wherein the transceiver unit is specifically used for:
    接收来自于所述网络仓库功能或服务通信代理或第一服务提供者网络功能发送的所述第一信息。The first information sent from the network warehouse function or service communication agent or the first service provider network function is received.
  28. 如权利要求24-27任一项所述的通信设备,其特征在于,所述第二信息包括:The communication device according to any one of claims 24-27, wherein the second information includes:
    所述服务消费者网络功能请求的服务提供者网络功能的网络功能类型;或the network function type of the service provider network function requested by said service consumer network function; or
    所述服务消费者网络功能请求的服务提供者网络功能的网络功能集标识;或the network function set identification of the service provider network function requested by said service consumer network function; or
    第二服务提供者网络功能的实例标识;或Instance identification of the second service provider network function; or
    多个服务提供者网络功能的实例标识,所述服务提供者网络功能提供所述第一服务。Instance identifications of a plurality of service provider network functions that provide the first service.
  29. 如权利要求24-28任一项所述的通信设备,其特征在于,所述第一响应消息中包括以下任一项:The communication device according to any one of claims 24-28, wherein the first response message includes any of the following:
    第一访问令牌,所述第一访问令牌包括服务提供者网络功能的网络功能类型,和/或服务提供者网络功能的网络功能集标识;或者a first access token comprising a network function type of a service provider network function, and/or a network function set identifier of a service provider network function; or
    第二访问令牌,所述第二访问令牌包括多个服务提供者网络功能的实例标识;或者a second access token comprising instance identifications of a plurality of service provider network functions; or
    多个第三访问令牌,每个所述第三访问令牌分别包括一个服务提供者网络功能的实例标识;或者a plurality of third access tokens, each of which respectively includes an instance identifier of a service provider network function; or
    第四访问令牌,所述第四访问令牌包括第二服务提供者网络功能的实例标识。A fourth access token, the fourth access token including the instance identifier of the second service provider network function.
  30. 如权利要求29所述的通信设备,其特征在于,所述收发单元,还用于:The communication device according to claim 29, wherein the transceiver unit is also used for:
    接收来自所述网络仓库功能的第一响应消息之后,向第一服务提供者网络功能或第二服务提供者网络功能或服务通信代理发送第二请求消息,所述第二请求消息用于请求服务,所述第二请求消息中包括所述第一访问令牌或所述第二访问令牌或所述第三访问令牌或所述第四访问令牌。after receiving a first response message from said network warehouse function, sending a second request message to a first service provider network function or a second service provider network function or a service communication agent, said second request message being used to request a service , the second request message includes the first access token or the second access token or the third access token or the fourth access token.
  31. 如权利要求24-30任一项所述的通信设备,其特征在于,所述处理单元,还用于:The communication device according to any one of claims 24-30, wherein the processing unit is further configured to:
    根据所述第一信息,通过所述收发单元向所述网络仓库功能发送所述第一请求消息之前,通过所述收发单元向第一服务提供者网络功能或服务通信代理发送第三请求消息,所述第三服务请求消息用于请求所述第一服务。According to the first information, before sending the first request message to the network warehouse function through the sending and receiving unit, sending a third request message to the first service provider network function or service communication agent through the sending and receiving unit, The third service request message is used to request the first service.
  32. 如权利要求24-31任一项所述的通信设备,其特征在于,所述处理单元,还用于:The communication device according to any one of claims 24-31, wherein the processing unit is further configured to:
    根据所述第一信息,通过所述收发单元向所述网络仓库功能发送所述第一请求消息之前,通过所述收发单元向所述网络仓库功能发送第四请求消息,所述第四请求消息中包括所述第一服务的服务名称,所述第四请求消息用于请求发现所述第一服务或发现可提供所述第一服务的网络功能的实例。According to the first information, before sending the first request message to the network warehouse function through the transceiver unit, send a fourth request message to the network warehouse function through the transceiver unit, the fourth request message includes the service name of the first service, and the fourth request message is used to request to discover the first service or to discover a network function instance that can provide the first service.
  33. 一种通信设备,其特征在于,所述通信设备为服务通信代理,所述服务通信代理包括:处理单元、收发单元;A communication device, characterized in that the communication device is a service communication agent, and the service communication agent includes: a processing unit, a transceiver unit;
    所述收发单元,用于:The transceiver unit is used for:
    接收服务消费者网络功能的第一请求消息,所述第一请求消息包括第一访问令牌;receiving a first request message for a service consumer web function, the first request message including a first access token;
    根据所述处理单元的控制,向第一服务提供者网络功能发送第二请求消息,所述第二请求消息包括所述第一访问令牌;according to the control of the processing unit, sending a second request message to the first service provider network function, the second request message including the first access token;
    接收来自于所述第一服务提供者网络功能的第二响应消息,所述第二响应消息包括第二服务提供者网络功能的信息和重定向状态码,所述重定向状态码用于指示服务访问授权失败或超文本传输协议HTTP重定向或获取访问令牌或有其他可用的服务提供者网络功能;receiving a second response message from the first service provider network function, the second response message including information of the second service provider network function and a redirection status code, the redirection status code being used to indicate that the service Access authorization failure or Hypertext Transfer Protocol HTTP redirection or obtaining an access token or other service provider network functionality available;
    根据所述处理单元的控制,向所述服务消费者网络功能发送第一响应消息,所述第一响应消息用于所述消费者网络功能请求获取第二访问令牌。According to the control of the processing unit, a first response message is sent to the service consumer network function, where the first response message is used for the consumer network function to request to acquire a second access token.
  34. 如权利要求33所述的通信设备,其特征在于,所述第一响应消息中包括第一信息,所述第一信息包括第一指示和/或第二服务提供者网络功能的实例标识;The communication device according to claim 33, wherein the first response message includes first information, and the first information includes the first indication and/or the instance identifier of the network function of the second service provider;
    其中,所述第一指示用于指示发生了HTTP重定向,或用于指示所述访问消费者网络功能获取访问令牌,或服务访问授权失败,或有其他可用的服务提供者网络功能。Wherein, the first indication is used to indicate that HTTP redirection has occurred, or used to indicate that the access consumer network function obtains an access token, or service access authorization fails, or there are other available service provider network functions.
  35. 如权利要求33或34所述的通信设备,其特征在于,所述处理单元,用于:The communication device according to claim 33 or 34, wherein the processing unit is configured to:
    在所述收发单元向所述服务消费者网络功能发送第一响应消息之前,确定第一条件满足;其中,第一条件包括以下条件中的至少一个:Before the sending and receiving unit sends a first response message to the service consumer network function, it is determined that a first condition is satisfied; wherein the first condition includes at least one of the following conditions:
    所述第一访问令牌中不包括所述第二服务提供者网络功能的实例标识;The first access token does not include the instance identifier of the second service provider network function;
    所述第一访问令牌不能用于授权访问所述第二服务提供者网络功能的服务;said first access token cannot be used to authorize services accessing said second service provider network functionality;
    所述第一访问令牌只能用于访问特定服务提供者网络功能实例或只能用于访问所述第一服务提供者网络功能的服务,所述特定服务提供者网络功能包括所述第一服务提供者网络功能;The first access token can only be used to access a specific service provider network function instance or can only be used to access the services of the first service provider network function, and the specific service provider network function includes the first Service Provider Network Functions;
    所述第一访问令牌中不包括服务提供者网络功能的网络功能类型或网络功能集标识;The first access token does not include the network function type or network function set identifier of the service provider network function;
    所述第一访问令牌中包括所述第一服务提供者网络功能的实例标识。The first access token includes the instance identifier of the first service provider network function.
  36. 如权利要求35所述的通信设备,其特征在于,所述处理单元,还用于:The communication device according to claim 35, wherein the processing unit is further configured to:
    若所述第一条件不满足,则通过所述收发单元向所述第二服务提供者网络功能发送第三请求消息,所述第三请求消息中包括所述第一访问令牌。If the first condition is not satisfied, a third request message is sent to the second service provider network function through the transceiving unit, where the third request message includes the first access token.
  37. 如权利要求33-36任一项所述的通信设备,其特征在于,所述收发单元,还用于:The communication device according to any one of claims 33-36, wherein the transceiver unit is further configured to:
    向所述服务消费者网络功能发送第一响应消息之后,接收所述服务消费者网络功能发送的第四请求消息,所述第四请求消息中包括所述第二访问令牌;以及,向所述第二服务提供者网络功能发送第五请求消息,所述第五请求消息包括所述第二访问令牌。After sending the first response message to the service consumer network function, receiving a fourth request message sent by the service consumer network function, the fourth request message including the second access token; The second service provider network function sends a fifth request message, where the fifth request message includes the second access token.
  38. 如权利要求33-37任一项所述的通信设备,其特征在于,所述第二访问令牌中包括所述第二服务提供者网络功能的实例标识、或服务提供者网络功能的网络功能类型、或服务提供者网络功能的网络功能集标识。The communication device according to any one of claims 33-37, wherein the second access token includes the instance identifier of the second service provider network function or the network function of the service provider network function Type, or network function set identifier of the service provider network function.
  39. 一种通信设备,其特征在于,包括:一个或多个处理器;一个或多个存储器;其中,所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述通信设备执行如权利要求1-9中任一项所述的方法,或者执行如权利要求10-15中任一项所述的方法。A communication device, characterized in that it includes: one or more processors; one or more memories; wherein, the one or more memories store one or more computer programs, and the one or more computer programs Including instructions, when the instructions are executed by the one or more processors, the communication device performs the method according to any one of claims 1-9, or performs the method according to any one of claims 10-15. one of the methods described.
  40. 一种通信系统,其特征在于,包括服务消费者网络功能以及网络仓库功能,所述服务消费者网络功能用于执行如权利要求1-9中任一项所述的方法。A communication system, characterized by comprising a service consumer network function and a network warehouse function, the service consumer network function is used to execute the method according to any one of claims 1-9.
  41. 一种通信系统,其特征在于,包括服务消费者网络功能、服务提供者网络功能以及服务通信代理;所述服务通信代理用于执行如权利要求10-15任一项所述的方法。A communication system, characterized by comprising a service consumer network function, a service provider network function and a service communication agent; the service communication agent is used to execute the method according to any one of claims 10-15.
  42. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当计算机程序在计算设备上运行时,使得所述计算设备执行如权利要求1-9任一项所述的方法,或者执行如权利要求10-15中任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium includes a computer program, and when the computer program is run on a computing device, the computing device is made to execute the computer program described in any one of claims 1-9. method, or perform the method as described in any one of claims 10-15.
  43. 一种芯片,其特征在于,所述芯片与存储器耦合,用于读取并执行所述存储器中存储的程序指令,以实现如权利要求1-9任一项所述的方法,或者实现如权利要求10-15中任一项所述的方法。A chip, characterized in that the chip is coupled with a memory for reading and executing program instructions stored in the memory, so as to realize the method according to any one of claims 1-9, or to realize the method described in any one of claims 1-9 The method of any one of claims 10-15.
  44. 一种计算机程序产品,其特征在于,所述计算机程序产品在被计算机调用时,使得所述计算机执行如权利要求1-9任一项所述的方法,或者执行如权利要求10-15中任一项所述的方法。A computer program product, characterized in that, when the computer program product is invoked by a computer, the computer executes the method according to any one of claims 1-9, or executes the method according to any one of claims 10-15. one of the methods described.
PCT/CN2022/108155 2021-08-09 2022-07-27 Network function service authorization method and apparatus WO2023016255A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110909303.5A CN115915137A (en) 2021-08-09 2021-08-09 Network function service authorization method and device
CN202110909303.5 2021-08-09

Publications (1)

Publication Number Publication Date
WO2023016255A1 true WO2023016255A1 (en) 2023-02-16

Family

ID=85199853

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/108155 WO2023016255A1 (en) 2021-08-09 2022-07-27 Network function service authorization method and apparatus

Country Status (2)

Country Link
CN (1) CN115915137A (en)
WO (1) WO2023016255A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668542A (en) * 2023-07-27 2023-08-29 之江实验室 Service execution method based on heterogeneous resource binding under enhanced service architecture

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020174119A1 (en) * 2019-02-25 2020-09-03 Nokia Solutions And Networks Oy Combined service discovery and connection setup for service-based architectures
CN111865888A (en) * 2019-04-29 2020-10-30 华为技术有限公司 Proxy subscription authorization method and device
CN112087412A (en) * 2019-06-14 2020-12-15 大唐移动通信设备有限公司 Service access processing method and device based on unique token
CN112367666A (en) * 2020-11-05 2021-02-12 广州爱浦路网络技术有限公司 Method, device and system for allowing pNF in 5G core network to pass NRF authentication cNF

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020174119A1 (en) * 2019-02-25 2020-09-03 Nokia Solutions And Networks Oy Combined service discovery and connection setup for service-based architectures
CN111865888A (en) * 2019-04-29 2020-10-30 华为技术有限公司 Proxy subscription authorization method and device
CN112087412A (en) * 2019-06-14 2020-12-15 大唐移动通信设备有限公司 Service access processing method and device based on unique token
CN112367666A (en) * 2020-11-05 2021-02-12 广州爱浦路网络技术有限公司 Method, device and system for allowing pNF in 5G core network to pass NRF authentication cNF

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668542A (en) * 2023-07-27 2023-08-29 之江实验室 Service execution method based on heterogeneous resource binding under enhanced service architecture
CN116668542B (en) * 2023-07-27 2023-09-22 之江实验室 Service execution method based on heterogeneous resource binding under enhanced service architecture

Also Published As

Publication number Publication date
CN115915137A (en) 2023-04-04

Similar Documents

Publication Publication Date Title
KR102224248B1 (en) Method for establishing protocol data unit in communication system
JP7047113B2 (en) Methods, Devices and Systems for Guaranteeing Service Level Agreements for Applications
CN110049070B (en) Event notification method and related equipment
US20200296142A1 (en) User Group Establishment Method and Apparatus
US20220217587A1 (en) Session Handling Method and Related Device
US11258822B2 (en) Network function service discovery method and device
WO2018141269A1 (en) Network registration and network slice selection system and method
WO2019085753A1 (en) Session establishment method, device and system
WO2021037175A1 (en) Network slice management method and related device
JP7412593B2 (en) Communication methods, devices, electronic devices and computer programs for multicast broadcast services
WO2019042427A1 (en) Method for selecting amf, amf, system, and computer readable storage medium
WO2020224622A1 (en) Information configuration method and device
US8914867B2 (en) Method and apparatus for redirecting data traffic
US20210250344A1 (en) Service authorization method and communications apparatus
WO2020220783A1 (en) Proxy subscription authorization method and device
CN111435932A (en) Token processing method and device
US20220322067A1 (en) Method and apparatus for configuring temporary user equipment (ue) external identifier in wireless communication system
WO2020015649A1 (en) Network slice mutual exclusion relation processing method, device and system, and medium
WO2020108631A1 (en) Load management method, apparatus, and system
KR102490698B1 (en) Communication method for selecting a network slice / service and a communication device performing the same
US20230232228A1 (en) Method and apparatus for establishing secure communication
WO2023016255A1 (en) Network function service authorization method and apparatus
WO2022121589A1 (en) Data information acquisition methods and apparatus, related device, and medium
WO2021233362A1 (en) Authentication authorization method and apparatus
JP2024081633A (en) Processing service requests

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22855238

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE