Connection establishment method and device, storage medium and electronic device
Provided are a connection establishment method and device, a storage medium and an electronic device. In the connection establishment method, a target module acquires a connection request, wherein the connection request is used for requesting establishment of a connection between a terminal application and a target service, and the connection request contains a target service identifier of the target service; and the target module initiates the connection request to the target service based on the target service identifier to request the establishment of the connection between the terminal application and the target service.
1 . A connection establishment method, comprising:
acquiring, by a target module, a connection request, wherein the connection request is used for requesting establishment of a connection between a terminal application and a target service, and the connection request contains a target service identifier of the target service; and
initiating, by the target module, the connection request to the target service based on the target service identifier to request the establishment of the connection between the terminal application and the target service, wherein:
when the target module comprises a first module and the first module comprises a service-agnostic service connection application programming interface, a service aware connection state management module, a service aware connection transport control module and a network transport connection interface module, the connection establishment method further comprises: after acquiring the connection request initiated by the terminal application via the service-agnostic service connection application programming interface, starting, by the service aware connection state management module, a handshake procedure for service connection and a service connection state management function associated with the target service identifier according to the target service identifier contained in the connection request, and invoking, by the service aware connection state management module, the network transport connection interface module; and
when the target module comprises a second module and the second module comprises a service routing management module and a service network policy mapping module, the connection establishment method further comprises: after acquiring the connection request from the first module, querying, in a service routing table by the service routing management module, a latest destination service node Internet Protocol (IP) address corresponding to the target service identifier contained in the connection request, and acquiring, by the service routing management module, an egress router IP address and a service route corresponding to the latest destination service node IP address; and selecting, by the service network policy mapping module, a network layer route corresponding to the target service identifier and a network layer service level policy corresponding to the target service identifier.
2 . The connection establishment method according to claim 1 , wherein the service-agnostic service connection application programming interface contains identifiers of required resources and services and related attributes and parameters, and does not contain location information of a service node corresponding to the target service identifier.
3 . The connection establishment method according to claim 1 , further comprising: performing, by the service aware connection state management module, service connection state management on a connection according to the target service identifier contained in the connection request, wherein the service connection state management at least comprises at least one of: mobility management, streaming media management, deterministic management, and multi-connection management.
4 . The connection establishment method according to claim 1 , wherein the service routing management module acquires the service routing table corresponding to the target service identifier and the network layer service level policy corresponding to the target service identifier through a network centralized controller via an out-of-band method, or acquires the service routing table corresponding to the target service identifier and the network layer service level policy corresponding to the target service identifier through distributed routing advertisement protocol.
5 . The connection establishment method according to claim 1 , wherein when the second module is located in a network edge ingress router, querying, in a service routing table, a latest destination service node Internet Protocol (IP) address corresponding to the target service identifier contained in the connection request comprises: querying, according to the target service identifier, a service node IP address of an optimal service provider corresponding to a local service routing table; and
acquiring an egress router IP address and a service route corresponding to the latest destination service node IP address comprises: determining, according to the network layer service level policy corresponding to the target service identifier, the egress router IP address and the service route corresponding to a server of the service provider, wherein after the connection request reaches an egress router of the service provider, the egress router forwards the connection request to a final serving node of the service provider according to the target service identifier.
6 . The connection establishment method according to claim 1 , wherein the connection request further contains other supplementary parameters, wherein the other supplementary parameters comprise at least one of:
an identity identifier for identity verification, a service type for fast policy indexing, and an associated network layer service level policy parameter for detailed queue scheduling.
7 . The connection establishment method according to claim 1 , wherein before acquiring, by a target module, a connection request, the connection establishment method further comprises one of:
generating, by the terminal application, the target service identifier according to a predetermined algorithm; or
acquiring, by the terminal application, the target service identifier from a cloud network integrated scheduling system, wherein the cloud network integrated scheduling system generates the target service identifier according to the predetermined algorithm.
8 . The connection establishment method according to claim 1 , wherein before acquiring, by a target module, a connection request, the connection establishment method further comprises:
receiving, by a cloud network integrated scheduling system, a service registration request from a server that provides the target service; and
allocating, by the cloud network integrated scheduling system, the target service identifier to the server that provides the target service according to a predetermined algorithm.
9 . The connection establishment method according to claim 1 , wherein the service identifier has a characteristic of being location and identity independent, wherein the service identifier having the characteristic of being location and identity independent refers to that the service identifier does not contain an identity of the service provider and location information of the service provider.
10 . The connection establishment method according to claim 9 , wherein the connection request is initiated in a Transport control Protocol (TCP) handshake procedure, and only contains the service identifier, so that the connection request is location and identity independent.
11 . The connection establishment method according to claim 1 , wherein the connection request contains the service identifier by extending a TCP port number and using extended bits to carry the service identifier.
12 . The connection establishment method according to claim 11 , wherein an identity identifier is placed in an extended header of Internet Protocol version 6 (IPv6) so that a terminal or an intermediate device performs identity verification.
13 . The connection establishment method according to claim 1 , wherein the connection request contains the service identifier by adding the service identifier into a TCP option field in a TCP header.
14 . The connection establishment method according to claim 1 , wherein the connection request is a Sync packet when a Socket connection is initiated, and the Sync packet carries the service identifier, wherein the service identifier identifies a service type and a service parameter.
15 . A non-transitory computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program, when running on a processor, causes the processor to implement the following operations:
acquiring, by a target module, a connection request, wherein the connection request is used for requesting establishment of a connection between a terminal application and a target service, and the connection request contains a target service identifier of the target service; and
initiating, by the target module, the connection request to the target service based on the target service identifier to request the establishment of the connection between the terminal application and the target service, wherein:
when the target module comprises a first module and the first module comprises a service-agnostic service connection application programming interface, a service aware connection state management module, a service aware connection transport control module and a network transport connection interface module, the computer program, when running on the processor, causes the processor to further implement the following operations: after acquiring the connection request initiated by the terminal application via the service-agnostic service connection application programming interface, starting, by the service aware connection state management module, a handshake procedure for service connection and a service connection state management function associated with the target service identifier according to the target service identifier contained in the connection request, and invoking, by the service aware connection state management module, the network transport connection interface module; and
when the target module comprises a second module and the second module comprises a service routing management module and a service network policy mapping module, the computer program, when running on the processor, causes the processor to further implement the following operations: after acquiring the connection request from the first module, querying, in a service routing table by the service routing management module, a latest destination service node Internet Protocol (IP) address corresponding to the target service identifier contained in the connection request, and acquiring, by the service routing management module, an egress router IP address and a service route corresponding to the latest destination service node IP address; and selecting, by the service network policy mapping module, a network layer route corresponding to the target service identifier and a network layer service level policy corresponding to the target service identifier.
16 . An electronic device, comprising:
a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor, when running the computer program, implements the following operations:
acquiring, by a target module, a connection request, wherein the connection request is used for requesting establishment of a connection between a terminal application and a target service, and the connection request contains a target service identifier of the target service; and
initiating, by the target module, the connection request to the target service based on the target service identifier to request the establishment of the connection between the terminal application and the target service, wherein:
when the target module comprises a first module and the first module comprises a service-agnostic service connection application programming interface, a service aware connection state management module, a service aware connection transport control module and a network transport connection interface module, the processor, when running the computer program, further implements the following operations: after acquiring the connection request initiated by the terminal application via the service-agnostic service connection application programming interface, starting, by the service aware connection state management module, a handshake procedure for service connection and a service connection state management function associated with the target service identifier according to the target service identifier contained in the connection request, and invoking, by the service aware connection state management module, the network transport connection interface module; and
when the target module comprises a second module and the second module comprises a service routing management module and a service network policy mapping module, the processor, when running the computer program, further implements the following operations: after acquiring the connection request from the first module, querying, in a service routing table by the service routing management module, a latest destination service node Internet Protocol (IP) address corresponding to the target service identifier contained in the connection request, and acquiring, by the service routing management module, an egress router IP address and a service route corresponding to the latest destination service node IP address; and selecting, by the service network policy mapping module, a network layer route corresponding to the target service identifier and a network layer service level policy corresponding to the target service identifier.
17 . The electronic device according to claim 16 , wherein the service-agnostic service connection application programming interface contains identifiers of required resources and services and related attributes and parameters, and does not contain location information of a service node corresponding to the target service identifier.
18 . The electronic device according to claim 16 , wherein the connection request further contains other supplementary parameters, wherein the other supplementary parameters comprise at least one of:
an identity identifier for identity verification, a service type for fast policy indexing, and an associated network layer service level policy parameter for detailed queue scheduling.