CN113285920A - Service access method, device, equipment and storage medium - Google Patents

Service access method, device, equipment and storage medium Download PDF

Info

Publication number
CN113285920A
CN113285920A CN202110423880.3A CN202110423880A CN113285920A CN 113285920 A CN113285920 A CN 113285920A CN 202110423880 A CN202110423880 A CN 202110423880A CN 113285920 A CN113285920 A CN 113285920A
Authority
CN
China
Prior art keywords
domain name
service request
uniform
target service
target
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202110423880.3A
Other languages
Chinese (zh)
Other versions
CN113285920B (en
Inventor
谈晶晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202110423880.3A priority Critical patent/CN113285920B/en
Publication of CN113285920A publication Critical patent/CN113285920A/en
Application granted granted Critical
Publication of CN113285920B publication Critical patent/CN113285920B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a service access method, a device, equipment and a storage medium. The method comprises the steps of obtaining a first target service request with a uniform domain name based on an access instruction of an access object; and sending a first target service request to a domain name server by adopting the uniform domain name connection corresponding to the uniform domain name. The obtained domain name of the first target service request is a uniform domain name, namely the domain names of the service requests of different services can be converged into the uniform domain name by adopting the scheme of the application, and the first target service request is sent by uniform domain name connection, so that when the service requests of different access objects need to be sent, the phase of domain name resolution, connection establishment and the like does not need to be executed every time, and the phase of sending the request is directly executed, thereby improving the speed of the network request.

Description

Service access method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for service access.
Background
In the current internet technology, different service servers are usually used to provide different service access services for an application program, for example, a first service server is used to provide a login service for an application program in a client, a second service server is used to provide a download service for the application program, and the like. However, each time a service access request is sent, it is necessary to perform the stages of domain name resolution, connection establishment, request sending, response receiving, and the like, which is time consuming.
Disclosure of Invention
The application provides a service access method, a device, equipment and a storage medium, which are used for solving the problem of high time consumption caused by the stages of domain name resolution, connection establishment, request sending, response receiving and the like when a service access request is sent every time in the related technology.
In a first aspect, a service access method is provided, including:
the client obtains a first target service request with a uniform domain name based on an access instruction of an access object; sending the first target service request to a domain name server by adopting a uniform domain name connection corresponding to the uniform domain name;
the domain name server acquires the first target service request sent by the client; analyzing the first target service request to obtain the uniform domain name; forwarding the first target service request to gateway equipment corresponding to the uniform domain name;
the gateway equipment acquires the first target service request sent by the domain name server; acquiring path data of the first target service request; obtaining effective data representing an original service request from the path data, wherein the effective data comprises target data representing a service server address and service data; generating the original service request corresponding to the effective data; and sending the original service request to a service server corresponding to the target data.
Optionally, the obtaining, by the client, the first target service request with the domain name being the uniform domain name based on the access instruction to the access object includes:
the client acquires a service request corresponding to the access instruction;
the client acquires the uniform domain name corresponding to the access object;
and the client side changes the domain name of the service request into the uniform domain name to obtain the first target service request, wherein the path data of the first target service request comprises target data representing the address of a service server.
Optionally, the obtaining, by the client, a first target service request including a uniform domain name based on an access instruction to the access object includes:
the client acquires the uniform domain name corresponding to the access object;
and the client generates the first target service request based on the uniform domain name, wherein the path data of the first target service request comprises target data representing the address of a service server.
Optionally, the sending, by the client, the first target service request to a domain name server by using a uniform domain name connection corresponding to the uniform domain name includes:
the client judges whether a uniform domain name connection corresponding to the uniform domain name exists in a connection pool;
if the uniform domain name connection exists, the client acquires the uniform domain name connection from the connection pool;
if the uniform domain name connection does not exist, the client establishes the uniform domain name connection corresponding to the uniform domain name;
and the client side sends the first target service request to the domain name server by adopting the uniform domain name connection.
Optionally, the creating, by the client, the unified domain name connection corresponding to the unified domain name includes:
and the client generates the uniform domain name connection according to an HTTP/2 protocol.
Optionally, after the client sends the first target service request to the domain name server by using the uniform domain name connection, the method further includes:
the client judges whether to adopt the uniform domain name connection to send a second target service request within the timing time of the timing unit;
if not, the client sends keep-alive data to the domain name server, wherein the keep-alive data comprises heartbeat packets and/or preset requests;
and if so, the client refreshes the timing unit so as to restart timing.
In a second aspect, a service access method is provided, which is applied to a client, and includes:
obtaining a first target service request with a domain name being a uniform domain name based on an access instruction of an access object;
and sending the first target service request to a domain name server by adopting a uniform domain name connection corresponding to the uniform domain name.
Optionally, obtaining the first target service request with the domain name being the uniform domain name based on the access instruction to the access object includes:
acquiring a service request corresponding to the access instruction;
acquiring the uniform domain name corresponding to the access object;
and changing the domain name of the service request into the uniform domain name to obtain the first target service request, wherein the path data of the first target service request comprises target data representing the address of a service server.
Optionally, obtaining a first target service request including a uniform domain name based on an access instruction for an access object includes:
acquiring the uniform domain name corresponding to the access object;
and generating the first target service request based on the uniform domain name, wherein the path data of the first target service request comprises target data representing the address of a service server.
Optionally, sending the first target service request to a domain name server by using a uniform domain name connection corresponding to the uniform domain name, where the sending includes:
judging whether a uniform domain name connection corresponding to the uniform domain name exists in a connection pool;
if the uniform domain name connection exists, acquiring the uniform domain name connection from the connection pool;
if the uniform domain name connection does not exist, establishing the uniform domain name connection corresponding to the uniform domain name;
and sending the first target service request to the domain name server by adopting the uniform domain name connection.
Optionally, creating the unified domain name connection corresponding to the unified domain name includes:
and generating the uniform domain name connection according to an HTTP/2 protocol.
Optionally, after sending the first target service request to the domain name server by using the unified domain name connection, the method further includes:
judging whether a second target service request is sent by adopting the uniform domain name connection within the timing time of the timing unit;
if not, sending keep-alive data to the domain name server, wherein the keep-alive data comprises a heartbeat packet and/or a preset request;
and if so, refreshing the timing unit so as to count again.
In a third aspect, a service access method is provided, which is applied to a gateway device, and includes:
acquiring the first target service request sent by a domain name server;
acquiring path data of the first target service request;
obtaining effective data representing an original service request from the path data, wherein the effective data comprises target data representing a service server address and service data;
generating the original service request corresponding to the effective data;
and sending the original service request to a service server corresponding to the target data.
In a fourth aspect, a service access system is provided, which includes:
the system comprises a client, a domain name server, gateway equipment and a service server;
the client obtains a first target service request with a uniform domain name based on an access instruction of an access object; sending the first target service request to a domain name server by adopting a uniform domain name connection corresponding to the uniform domain name;
the domain name server acquires the first target service request sent by the client; analyzing the first target service request to obtain the uniform domain name; forwarding the first target service request to the gateway device corresponding to the uniform domain name;
the gateway equipment acquires the first target service request sent by the domain name server; acquiring path data of the first target service request; obtaining effective data representing an original service request from the path data, wherein the effective data comprises target data representing the address of the service server and service data; generating the original service request corresponding to the effective data; and sending the original service request to the service server corresponding to the target data.
In a fifth aspect, a service access device is provided, which includes:
the obtaining unit is used for obtaining a first target service request with a uniform domain name based on an access instruction of an access object;
and the first sending unit is used for sending the first target service request to a domain name server by adopting the uniform domain name connection corresponding to the uniform domain name.
In a sixth aspect, a service access device includes:
a first obtaining unit, configured to obtain the first target service request sent by the domain name server;
a second obtaining unit, configured to obtain path data of the first target service request;
a third obtaining unit, configured to obtain, from the path data, effective data representing an original service request, where the effective data includes target data representing an address of a service server and service data;
a generating unit, configured to generate the original service request corresponding to the valid data;
and the second sending unit is used for sending the original service request to the service server corresponding to the target data.
A seventh aspect provides a client, including: the system comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus; the memory for storing a computer program; the processor is configured to execute the program stored in the memory, and implement the service access method according to the second aspect.
In an eighth aspect, a gateway device is provided, which includes: the system comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus; the memory for storing a computer program; the processor is configured to execute the program stored in the memory, and implement the service access method according to the third aspect.
A ninth aspect provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the service access method of the second aspect.
A tenth aspect provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the service access method of the third aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
according to the technical scheme provided by the embodiment of the application, when an access instruction for an access object exists, a first target service request is obtained, the first target service request is sent to a domain name server through unified domain name connection, the first target service request is sent to gateway equipment through the domain name server, the gateway equipment acquires path data from the first target service request, effective data representing the original service request are acquired from the path data, the original service request corresponding to the effective data is generated, and the first target service request is forwarded to a service server corresponding to the target data. The obtained domain name of the first target service request is a uniform domain name, namely the domain names of the service requests of different services can be converged into the uniform domain name by adopting the scheme of the application, and the first target service request is sent by uniform domain name connection, so that when the service requests of different access objects need to be sent, the phase of domain name resolution, connection establishment and the like does not need to be executed every time, and the phase of sending the request is directly executed, thereby improving the speed of the network request.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a schematic structural diagram of a service access system in an embodiment of the present application;
fig. 2 is a schematic flowchart of a service access method in an embodiment of the present application;
fig. 3 is a schematic flowchart of another service access method in an embodiment of the present application;
fig. 4 is a schematic flowchart of another service access method in an embodiment of the present application;
fig. 5 is a schematic flowchart of another service access method in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a service access device in an embodiment of the present application;
fig. 7 is a schematic structural diagram of another service access device in an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
In order to better understand the scheme of the embodiments of the present application, the following first introduces the related terms and concepts that may be involved in the embodiments of the present application.
The client described in the embodiment of the present application may include a smart Phone (such as an Android Phone, an iOS Phone, a Windows Phone, etc.), a tablet computer, a palm computer, a notebook computer, a video matrix, a monitoring platform, a Mobile Internet device (MID, Mobile Internet Devices), or a wearable device, which are merely examples, but are not exhaustive and include but are not limited to the above Devices.
A service access method in the embodiment of the present application is described below with reference to fig. 1, where fig. 1 is a schematic diagram of a system architecture of a service access method provided in the embodiment of the present application, where the system architecture 100 includes a client 110, a domain name server 120, and a gateway device 130, the client 110 is in communication connection with the domain name server 120, and the domain name server 120 is in communication connection with the gateway device 130.
Wherein, the client 110 obtains a first target service request with a uniform domain name based on an access instruction for an access object; a first target service request is sent to the domain name server 120.
In this embodiment, the access object includes, but is not limited to, an application or a website.
When the access object comprises an application:
in one example, the application is an application that is installed in the client.
At this time, the access instruction to the application program may be a login instruction, a file download instruction, or a delivery statistical information instruction of the application program, and accordingly, the first target service request may be a login request, a file download request, or a delivery statistical information request of the application program, or the like.
In another example, the application is an application that is not installed in the client.
At this time, the access instruction to the application program may be an installation package download instruction or the like, and accordingly, the first target service request may be an installation package download request or the like.
When the access object comprises a website:
the access instruction for the application program may be a login instruction of a website, a file download instruction, or a delivery statistical information instruction, and accordingly, the first target service request may be a login request of a website, a file download request, or a delivery statistical information request, and the like.
In this embodiment, each access object corresponds to a unique unified domain name, where the unified domain name includes, but is not limited to, a secondary domain name of the access object.
The second-level domain name is a network name of the access object when the access object is networked, for example, when the access object is a, the second-level domain name of the access object may be a.com.
Optionally, this embodiment provides the following two methods for obtaining the first target service request:
firstly, a first target service request is directly generated based on an access instruction of an access object.
Specifically, a uniform domain name corresponding to an access object is acquired; based on the unified domain name, a first target service request is generated, wherein path data of the first target service request comprises target data representing an address of a service server.
In this embodiment, the first target service request includes, but is not limited to, a Uniform Resource Locator (URL) address.
In practice, a URL typically includes protocol data, domain name data, and path data. The protocol data defines a protocol used when the resource is acquired, the domain name data corresponds to an IP address of the host, and the path data indicates the resource of the requested server. Corresponding to this embodiment, since the domain name of the first target service request converges to the uniform domain name, when the first target service request is generated, the target data representing the address of the service server is placed in the path data of the first target service request.
And secondly, obtaining a first target service request by changing the original service request.
Specifically, a service request corresponding to an access instruction is obtained; acquiring a uniform domain name corresponding to an access object; and changing the domain name of the service request into a uniform domain name to obtain a first target service request, wherein the path data of the first target service request comprises target data representing the address of the service server.
In this case, the client directly generates a service request corresponding to the access instruction based on the access instruction of the access object, and the domain name of the service request is the target data representing the server address at this time. After the domain name of the service request is changed, the domain name of the first target service request is changed into a uniform domain name, and the domain name of the service request is changed into path data.
In practical application, the first target service request can be obtained in one of the two optional modes; of course, the first target service request may also be obtained by selecting one of two ways according to the service requested by the access instruction, which is not limited in this embodiment.
When one mode is selected from the two modes according to the service requested by the access instruction, considering that the current existing service corresponding to the access object directly generates the service request corresponding to the access instruction, the first target service request can be obtained by adopting a second mode for the current existing service; for accessing a subsequent newly added service, it may be set that a first target service request may be obtained in a first manner when a service request corresponding to the service is generated.
Taking an access object as an example of an application program A, assuming that the current existing service of the application program A is a login service and a file download service, and for the service of the type A, a first target service request corresponding to the service can be obtained by adopting a second mode; assuming that a recording service for the application a is newly added by a service person who writes the application a in the future, the service person may set to obtain the first target service request in the first manner while newly adding the recording service, so that the first target service request is obtained in the first manner when there is an access instruction for the recording service.
The following illustrates the process of obtaining the first target service request in the above two ways:
for example, for the access object a, the uniform domain name may be api.a.com, and when the access instruction is directed to the login service of the access object a, the first target service request is directly obtained in the first way: a.com/logic.a.com/pathkey value; if the second mode is adopted, firstly, the service request corresponding to the access instruction is obtained: and secondly, changing the domain name of the service request based on the unified domain name, wherein the obtained first target service request is api.
In this embodiment, the uniform domain name connection refers to a connection established between a uniform domain name and a domain name server, and in the establishing process, a stage of analyzing the uniform domain name and establishing the connection is performed.
In this embodiment, once the uniform domain name connection is successfully established, the uniform domain name connection is stored in the connection pool, so that the service request of the access object is multiplexed in the following process.
Where a connection pool is a buffer pool that creates and manages connections that can be used by threads or processes that need them.
The uniform domain name connection in the connection pool may be established when the first target service request is sent for the first time, or may be established in advance.
In order to realize the multiplexing of the service request of the access object to the uniform domain name connection, when the uniform domain name connection is established for the first time, the HTTP/2 protocol is started, and after the domain name resolution and the connection establishment are performed for the first time, the established connection can be multiplexed by the subsequent service request.
It is understood that the HTTP protocol is based on the TCP protocol, and thus, when creating the uniform domain name connection, the HTTP request is sent based on the HTTP/2 protocol, and the HTTP establishes a connection channel to the corresponding server through the TCP.
It will be appreciated that the HTTP2 connection may simultaneously transmit (send and/or receive) data streams of multiple service requests, and the number of simultaneously transmitted data streams may be set by the client.
When multiple data streams are transmitted through the HTTP2 connection, the data packets of the multiple data streams can be mixed together and transmitted through the HTTP2 connection, and after reaching the domain name resolution server, the domain name resolution server can extract each data stream from the multiple data streams.
Based on the two occasions of establishing the unified domain name connection, when the unified domain name connection corresponding to the unified domain name is adopted to send the first target service request to the domain name server, as shown in fig. 2, the method may include the following steps:
step 201, judging whether a uniform domain name connection corresponding to the uniform domain name exists in a connection pool, if so, executing step 202, otherwise, executing step 203;
step 202, acquiring a uniform domain name connection from a connection pool;
step 203, creating a uniform domain name connection corresponding to the uniform domain name;
step 204, sending a first target service request to the domain name server by adopting the uniform domain name connection.
Optionally, in this embodiment, one connection pool may store one uniform domain name connection, or may store a plurality of uniform domain name connections.
When a uniform domain name connection is stored in the connection pool, determining the connection pool corresponding to the access object, and when the connection pool is not empty, determining that the uniform domain name connection exists in the connection pool, otherwise, determining that the uniform domain name connection exists in the connection pool.
When a plurality of uniform domain name connections are stored in the connection pool, the uniform domain name connections can be searched from the connection pool according to the uniform domain names corresponding to the uniform domain name connections.
For example, the uniform domain name connection stored in the connection pool includes an a connection and a B connection, and when the uniform domain name connection corresponding to the uniform domain name api.a.com needs to be searched from the connection pool, since the a connection corresponds to the uniform domain name api.a.com, it is determined that the connection corresponding to the uniform domain name api.a.com exists in the connection pool, and the a connection is used as the connection corresponding to the uniform domain name api.a.com.
In order to ensure the reuse rate of the uniform domain name connection, the uniform domain name connection can be kept alive, so that the uniform domain name connection can survive for a long enough time as far as possible.
Optionally, referring to fig. 3, after sending the first target service request to the domain name server by using the uniform domain name connection corresponding to the uniform domain name, the method may further include the following steps:
step 301, determining whether a unified domain name connection is adopted to send a second target service request within the timing time of the timing unit, if so, executing step 303, otherwise, executing step 302.
Alternatively, the timing unit may be a timer in the client.
Alternatively, the timing time may be set empirically by a human.
Step 302, sending keep-alive data to the domain name server.
The keep-alive data comprises a heartbeat packet and/or a preset request.
Illustratively, the heartbeat packet may be a custom command word for the client.
Illustratively, the preset request may be a short request comprising a single byte.
When the keep-alive data comprises the heartbeat packet, the heartbeat packet can be sent to a corresponding server through a connection channel established by the TCP;
when the keep-alive data comprises a preset request, the keep-alive data and the uniform domain name are required to be spliced to generate a corresponding uniform domain name request, and the uniform domain name request is sent to the domain name server through uniform domain name connection.
In addition, the server side has different configurations for the holding duration of the TCP/HTTP, so that the TCP and the HTTP are disconnected at different times. Therefore, based on the difference between the holding time of TCP and the holding time of HTTP configured at the server, the present embodiment provides the following two possibilities for sending keep-alive data:
firstly, if the TCP holding time is larger than the HTTP holding time, sending a preset request of HTTP to keep alive the connection of the same domain name;
and secondly, if the TCP holding time is less than the HTTP holding time, sending a TCP heartbeat packet for keeping alive before the TCP holding time comes, and sending a preset HTTP request for keeping alive when the HTTP holding time comes.
Step 303, the timing unit is refreshed for re-timing.
The domain name server 120 acquires a first target service request sent by the client terminal 110; analyzing the first target service request to obtain a uniform domain name; the first target service request is forwarded to the gateway device 130 corresponding to the unified domain name.
The domain name server extracts a domain name, i.e., a uniform domain name, in the first target service request, determines, through a pre-stored address table including a correspondence between the domain name and the IP address, that the IP address corresponding to the uniform domain name is the address of the gateway device 130, and sends the first target service request to the gateway device 130.
When the first target service request is implemented as a URL, the domain name server may parse the first target service request to obtain a uniform domain name according to a format of the URL.
The gateway device 130 acquires a first target service request sent by a domain name server; acquiring path data of a first target service request; obtaining effective data representing an original service request from the path data, wherein the effective data comprises target data representing a service server address and service data; generating an original service request corresponding to the effective data; and sending the original service request to a service server corresponding to the target data.
When the first target service request is implemented as a URL, the gateway device may obtain the path data from the first target service request according to a composition format of the URL.
In this embodiment, when the domain name of the service request needs to converge to the uniform domain name, the gateway device and the client may pre-agree on the format of the valid data in the first target service request, so that the gateway device may obtain the valid data from the first target service request according to the agreed format.
The pre-agreed format includes, but is not limited to, the location of valid data in the path data.
In this embodiment, the gateway device maintains a server cluster composed of at least one service server, where the server cluster is used to respond to a service request corresponding to an access object. And after the target data is acquired, determining the IP address of the server corresponding to the target data, and forwarding the first target service request to the service server corresponding to the IP address.
The service server corresponding to the IP address may be one server or a server group including at least two servers.
And after obtaining the first target service request, the service server obtains a service response of the first target service request and sends the service response to the client through the gateway equipment.
According to the technical scheme provided by the embodiment of the application, when an access instruction for an access object exists, a first target service request is obtained, the first target service request is sent to a domain name server through unified domain name connection, the first target service request is sent to gateway equipment through the domain name server, the gateway equipment acquires path data from the first target service request, effective data representing the original service request are acquired from the path data, the original service request corresponding to the effective data is generated, and the first target service request is forwarded to a service server corresponding to the target data. The obtained domain name of the first target service request is a uniform domain name, namely the domain names of the service requests of different services can be converged into the uniform domain name by adopting the scheme of the application, and the first target service request is sent by uniform domain name connection, so that when the service requests of different access objects need to be sent, the phase of domain name resolution, connection establishment and the like does not need to be executed every time, and the phase of sending the request is directly executed, thereby improving the speed of the network request.
The service access method in the embodiment of the present application is described from the client side and the gateway device side, respectively, and in view of that the methods of the client side and the gateway device side have been described in detail in the above embodiments, detailed descriptions of these two parts of schemes are omitted here, and see the above embodiments for details.
The service access method in the embodiment of the present application is described below from the client side, please refer to fig. 4, and the method may include the following steps:
step 401, obtaining a first target service request with a uniform domain name based on an access instruction of an access object;
step 402, sending a first target service request to a domain name server by adopting a uniform domain name connection corresponding to the uniform domain name.
Optionally, obtaining the first target service request with the domain name being the uniform domain name based on the access instruction to the access object includes:
acquiring a service request corresponding to an access instruction;
acquiring a uniform domain name corresponding to an access object;
and changing the domain name of the service request into a uniform domain name to obtain a first target service request, wherein the path data of the first target service request comprises target data representing the address of the service server.
Optionally, obtaining a first target service request including a uniform domain name based on an access instruction for an access object includes:
acquiring a uniform domain name corresponding to an access object;
based on the unified domain name, a first target service request is generated, wherein path data of the first target service request comprises target data representing an address of a service server.
Optionally, sending the first target service request to the domain name server by using a uniform domain name connection corresponding to the uniform domain name, including:
judging whether a uniform domain name connection corresponding to the uniform domain name exists in the connection pool;
if the uniform domain name connection exists, acquiring the uniform domain name connection from a connection pool;
if no uniform domain name connection exists, creating a uniform domain name connection corresponding to the uniform domain name;
and sending a first target service request to a domain name server by adopting uniform domain name connection.
Optionally, creating a uniform domain name connection corresponding to the uniform domain name includes:
and generating the uniform domain name connection according to the HTTP/2 protocol.
Optionally, after sending the first target service request to the domain name server by using the uniform domain name connection, the method further includes:
judging whether a second target service request is sent by adopting uniform domain name connection within the timing time of the timing unit;
if not, sending keep-alive data to the domain name server, wherein the keep-alive data comprises heartbeat packets and/or preset requests;
if yes, the timing unit is refreshed so as to count again.
The service access method in the embodiment of the present application is described below from the gateway device side, please refer to fig. 5, and the method may include the following steps:
step 501, acquiring a first target service request sent by a domain name server;
step 502, obtaining path data of a first target service request;
step 503, obtaining effective data representing the original service request from the path data, wherein the effective data includes target data representing the address of the service server and service data;
step 504, generating an original service request corresponding to the valid data;
and 505, sending the original service request to a service server corresponding to the target data.
Based on the same inventive concept, an embodiment of the present application provides a service access apparatus, as shown in fig. 6, the apparatus may include:
an obtaining unit 601, configured to obtain, based on an access instruction for an access object, a first target service request with a uniform domain name;
a first sending unit 602, configured to send the first target service request to the domain name server by using a uniform domain name connection corresponding to the uniform domain name.
Based on the same inventive concept, an embodiment of the present application provides a service access apparatus, as shown in fig. 7, the apparatus may include:
a first obtaining unit 701, configured to obtain a first target service request sent by a domain name server;
a second obtaining unit 702, configured to obtain path data of the first target service request;
a third obtaining unit 703, configured to obtain, from the path data, effective data representing an original service request, where the effective data includes target data representing an address of a service server and service data;
a generating unit 704, configured to generate an original service request corresponding to valid data;
a second sending unit 705, configured to send the original service request to the service server corresponding to the target data.
Based on the same concept, an embodiment of the present application further provides an electronic device, as shown in fig. 8, the electronic device mainly includes: a processor 801, a memory 802, and a communication bus 803, wherein the processor 801 and the memory 802 communicate with each other via the communication bus 803. The memory 802 stores a program executable by the processor 801, and the processor 801 executes the program stored in the memory 802, so as to implement the following steps:
obtaining a first target service request with a domain name being a uniform domain name based on an access instruction of an access object; sending a first target service request to a domain name server by adopting a uniform domain name connection corresponding to a uniform domain name;
or the like, or, alternatively,
acquiring a first target service request sent by a domain name server; acquiring path data of a first target service request; obtaining effective data representing an original service request from the path data, wherein the effective data comprises target data representing a service server address and service data; generating an original service request corresponding to the effective data; and sending the original service request to a service server corresponding to the target data.
The communication bus 803 mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 803 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The Memory 802 may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor 801.
The Processor 801 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc., and may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.
In still another embodiment of the present application, there is also provided a computer-readable storage medium having stored therein a computer program which, when run on a computer, causes the computer to execute the person identification method described in the above embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The available media may be magnetic media (e.g., floppy disks, hard disks, tapes, etc.), optical media (e.g., DVDs), or semiconductor media (e.g., solid state drives), among others.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (20)

1. A method for service access, comprising:
the client obtains a first target service request with a uniform domain name based on an access instruction of an access object; sending the first target service request to a domain name server by adopting a uniform domain name connection corresponding to the uniform domain name;
the domain name server acquires the first target service request sent by the client; analyzing the first target service request to obtain the uniform domain name; forwarding the first target service request to gateway equipment corresponding to the uniform domain name;
the gateway equipment acquires the first target service request sent by the domain name server; acquiring path data of the first target service request; obtaining effective data representing an original service request from the path data, wherein the effective data comprises target data representing a service server address and service data; generating the original service request corresponding to the effective data; and sending the original service request to a service server corresponding to the target data.
2. The method according to claim 1, wherein the obtaining, by the client, the first target service request with the uniform domain name based on the access instruction to the access object includes:
the client acquires a service request corresponding to the access instruction;
the client acquires the uniform domain name corresponding to the access object;
and the client side changes the domain name of the service request into the uniform domain name to obtain the first target service request, wherein the path data of the first target service request comprises target data representing the address of a service server.
3. The method of claim 1, wherein the obtaining, by the client, the first target service request including the uniform domain name based on the access instruction to the access object comprises:
the client acquires the uniform domain name corresponding to the access object;
and the client generates the first target service request based on the uniform domain name, wherein the path data of the first target service request comprises target data representing the address of a service server.
4. The method of claim 1, wherein the sending, by the client, the first target service request to a domain name server using a uniform domain name connection corresponding to the uniform domain name comprises:
the client judges whether a uniform domain name connection corresponding to the uniform domain name exists in a connection pool;
if the uniform domain name connection exists, the client acquires the uniform domain name connection from the connection pool;
if the uniform domain name connection does not exist, the client establishes the uniform domain name connection corresponding to the uniform domain name;
and the client side sends the first target service request to the domain name server by adopting the uniform domain name connection.
5. The method of claim 4, wherein the client creating the unified domain name connection corresponding to the unified domain name comprises:
and the client generates the uniform domain name connection according to an HTTP/2 protocol.
6. The method of claim 1, wherein after the client sends the first target service request to the domain name server using the unified domain name connection, further comprising:
the client judges whether to adopt the uniform domain name connection to send a second target service request within the timing time of the timing unit;
if not, the client sends keep-alive data to the domain name server, wherein the keep-alive data comprises heartbeat packets and/or preset requests;
and if so, the client refreshes the timing unit so as to restart timing.
7. A service access method is applied to a client and comprises the following steps:
obtaining a first target service request with a domain name being a uniform domain name based on an access instruction of an access object;
and sending the first target service request to a domain name server by adopting a uniform domain name connection corresponding to the uniform domain name.
8. The method of claim 7, wherein obtaining the first target service request with the uniform domain name based on the access instruction for the access object comprises:
acquiring a service request corresponding to the access instruction;
acquiring the uniform domain name corresponding to the access object;
and changing the domain name of the service request into the uniform domain name to obtain the first target service request, wherein the path data of the first target service request comprises target data representing the address of a service server.
9. The method of claim 7, wherein obtaining the first target service request including the uniform domain name based on the access instruction to the access object comprises:
acquiring the uniform domain name corresponding to the access object;
and generating the first target service request based on the uniform domain name, wherein the path data of the first target service request comprises target data representing the address of a service server.
10. The method of claim 7, wherein sending the first target service request to a domain name server using a uniform domain name connection corresponding to the uniform domain name comprises:
judging whether a uniform domain name connection corresponding to the uniform domain name exists in a connection pool;
if the uniform domain name connection exists, acquiring the uniform domain name connection from the connection pool;
if the uniform domain name connection does not exist, establishing the uniform domain name connection corresponding to the uniform domain name;
and sending the first target service request to the domain name server by adopting the uniform domain name connection.
11. The method of claim 10, wherein creating the unified domain name connection corresponding to the unified domain name comprises:
and generating the uniform domain name connection according to an HTTP/2 protocol.
12. The method of claim 7, wherein after sending the first target service request to the domain name server using the unified domain name connection, further comprising:
judging whether a second target service request is sent by adopting the uniform domain name connection within the timing time of the timing unit;
if not, sending keep-alive data to the domain name server, wherein the keep-alive data comprises a heartbeat packet and/or a preset request;
and if so, refreshing the timing unit so as to count again.
13. A service access method is applied to a gateway device and comprises the following steps:
acquiring the first target service request sent by a domain name server;
acquiring path data of the first target service request;
obtaining effective data representing an original service request from the path data, wherein the effective data comprises target data representing a service server address and service data;
generating the original service request corresponding to the effective data;
and sending the original service request to a service server corresponding to the target data.
14. A business access system, comprising:
the system comprises a client, a domain name server, gateway equipment and a service server;
the client obtains a first target service request with a uniform domain name based on an access instruction of an access object; sending the first target service request to a domain name server by adopting a uniform domain name connection corresponding to the uniform domain name;
the domain name server acquires the first target service request sent by the client; analyzing the first target service request to obtain the uniform domain name; forwarding the first target service request to the gateway device corresponding to the uniform domain name;
the gateway equipment acquires the first target service request sent by the domain name server; acquiring path data of the first target service request; obtaining effective data representing an original service request from the path data, wherein the effective data comprises target data representing the address of the service server and service data; generating the original service request corresponding to the effective data; and sending the original service request to the service server corresponding to the target data.
15. A service access device, comprising:
the obtaining unit is used for obtaining a first target service request with a uniform domain name based on an access instruction of an access object;
and the first sending unit is used for sending the first target service request to a domain name server by adopting the uniform domain name connection corresponding to the uniform domain name.
16. A service access device, comprising:
a first obtaining unit, configured to obtain the first target service request sent by the domain name server;
a second obtaining unit, configured to obtain path data of the first target service request;
a third obtaining unit, configured to obtain, from the path data, effective data representing an original service request, where the effective data includes target data representing an address of a service server and service data;
a generating unit, configured to generate the original service request corresponding to the valid data;
and the second sending unit is used for sending the original service request to the service server corresponding to the target data.
17. A client, comprising: the system comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus; the memory for storing a computer program; the processor, configured to execute the program stored in the memory, and implement the service access method according to any one of claims 7 to 12.
18. A gateway device, comprising: the system comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus; the memory for storing a computer program; the processor, configured to execute the program stored in the memory, and implement the service access method according to claim 13.
19. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the service access method of any of claims 7 to 12.
20. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the service access method of claim 13.
CN202110423880.3A 2021-04-20 2021-04-20 Service access method, device, equipment and storage medium Active CN113285920B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110423880.3A CN113285920B (en) 2021-04-20 2021-04-20 Service access method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110423880.3A CN113285920B (en) 2021-04-20 2021-04-20 Service access method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113285920A true CN113285920A (en) 2021-08-20
CN113285920B CN113285920B (en) 2023-06-30

Family

ID=77276869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110423880.3A Active CN113285920B (en) 2021-04-20 2021-04-20 Service access method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113285920B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114124891A (en) * 2021-10-25 2022-03-01 青岛海尔科技有限公司 Network request processing method and device, storage medium and electronic device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020087707A1 (en) * 2000-12-29 2002-07-04 Stewart Daniel B. Network protocols for distributing functions within a network
CN103152369A (en) * 2011-12-07 2013-06-12 ***通信集团浙江有限公司 Internet access method, system, mobile station, gateway GPRS support node (GGSN) and wireless application protocol (WAP) gateway
CN105306609A (en) * 2014-06-26 2016-02-03 优视科技有限公司 Network loading processing method and device
CN108449442A (en) * 2018-03-10 2018-08-24 北京酷我科技有限公司 A kind of iOS Network Optimization Strategies
CN108462760A (en) * 2018-03-21 2018-08-28 平安科技(深圳)有限公司 Electronic device, cluster access domain name automatic generation method and storage medium
CN109981817A (en) * 2019-03-21 2019-07-05 网宿科技股份有限公司 The processing method and processing device of access request, server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020087707A1 (en) * 2000-12-29 2002-07-04 Stewart Daniel B. Network protocols for distributing functions within a network
CN103152369A (en) * 2011-12-07 2013-06-12 ***通信集团浙江有限公司 Internet access method, system, mobile station, gateway GPRS support node (GGSN) and wireless application protocol (WAP) gateway
CN105306609A (en) * 2014-06-26 2016-02-03 优视科技有限公司 Network loading processing method and device
CN108449442A (en) * 2018-03-10 2018-08-24 北京酷我科技有限公司 A kind of iOS Network Optimization Strategies
CN108462760A (en) * 2018-03-21 2018-08-28 平安科技(深圳)有限公司 Electronic device, cluster access domain name automatic generation method and storage medium
CN109981817A (en) * 2019-03-21 2019-07-05 网宿科技股份有限公司 The processing method and processing device of access request, server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114124891A (en) * 2021-10-25 2022-03-01 青岛海尔科技有限公司 Network request processing method and device, storage medium and electronic device
CN114124891B (en) * 2021-10-25 2023-12-19 青岛海尔科技有限公司 Processing method and device of network request, storage medium and electronic device

Also Published As

Publication number Publication date
CN113285920B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
US10033818B2 (en) Using listen ranges to deliver content to electronic devices from local caching servers
US10320940B1 (en) Managing generic data
WO2017004947A1 (en) Method and apparatus for preventing domain name hijacking
CN102111685B (en) Acceleration method, equipment and system for network video loading
KR102036662B1 (en) Apparatus and method for accessing web in a network system
CN106685947B (en) Access method and system for private cloud equipment of smart television
WO2022057318A1 (en) Stream pulling request processing method, apparatus and system, electronic device, and storage medium
US8949952B2 (en) Multi-stack subscriber sign on
US20150331739A1 (en) Method and Apparatus for Controlling Sending of Heartbeat Signal
WO2013097525A1 (en) Method and system for transmitting network video
CN107135249B (en) Data downloading method and device
CN102763373A (en) Method and apparatus for using service of home network device based on remote access
KR20220167388A (en) Data processing methods, apparatus, computer devices, and storage media
CN110661673B (en) Heartbeat detection method and device
CN110545230B (en) Method and device for forwarding VXLAN message
TW201733314A (en) Method for executing request and associated server
US20150358263A1 (en) Communication between a web application instance connected to a connection server and a calling entity other than said connection server
CN108512889B (en) Application response pushing method based on HTTP and proxy server
CN113285920A (en) Service access method, device, equipment and storage medium
CN116261021B (en) Video stream playing method and device, electronic equipment and storage medium
CN104584514B (en) Apparatus and method for providing services in a communication network
CN110177096B (en) Client authentication method, device, medium and computing equipment
US8615548B1 (en) System and method for deferred data downloading
WO2021082945A1 (en) Remote management method and system, terminal device and server
WO2017067373A1 (en) Data push method and apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant