[go: up one dir, main page]

CN111953781A - Method and device for processing access request and electronic equipment - Google Patents

Method and device for processing access request and electronic equipment Download PDF

Info

Publication number
CN111953781A
CN111953781A CN202010815255.9A CN202010815255A CN111953781A CN 111953781 A CN111953781 A CN 111953781A CN 202010815255 A CN202010815255 A CN 202010815255A CN 111953781 A CN111953781 A CN 111953781A
Authority
CN
China
Prior art keywords
configuration
protocol
communication protocol
domain name
access request
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.)
Pending
Application number
CN202010815255.9A
Other languages
Chinese (zh)
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 Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network 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 Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202010815255.9A priority Critical patent/CN111953781A/en
Publication of CN111953781A publication Critical patent/CN111953781A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/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
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a method, a device and electronic equipment for processing an access request, wherein the method comprises the steps of receiving the access request of a client aiming at a specified domain name; if the access request carries a communication protocol requirement, determining whether the current protocol configuration of the specified domain name meets the communication protocol requirement; if the current protocol configuration does not meet the requirement of the communication protocol, judging whether the user is pre-configured with a standby protocol configuration aiming at the specified domain name; if the backup protocol configuration is configured and the backup protocol configuration conforms to the communication protocol requirements, the access request is responded to according to the communication protocol in the backup protocol configuration. According to the embodiment of the invention, the standby protocol configuration of the specified domain name preset by the user is obtained, and when the current protocol configuration for accessing the specified domain name in the webpage server does not meet the communication protocol requirement of the client, the communication protocol meeting the requirement of the client can be configured according to the standby protocol configuration, so that the communication protocol configuration of the domain name can be configured more flexibly.

Description

Method and device for processing access request and electronic equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for processing an access request, and an electronic device.
Background
HTTP2.0 (also referred to as HTTP/2), hypertext transfer protocol 2.0, is the next generation HTTP protocol. On the open internet, HTTP2.0 is only used for HTTPs:// web site, and HTTP:// web site will continue to use HTTP/1, aiming at adding encryption technology on the open internet to provide strong protection to inhibit active attacks. HTTP2.0 is also increasingly used more widely on the internet because HTTP2.0 is more advanced than the previous generation HTTP protocol, for example, opening HTTP2.0 can provide higher speed and stability to websites, especially SSL (Secure Sockets Layer) encrypted websites, and HTTP2.0 also includes advantages of transmitting data in binary format, asynchronous connection multiplexing, and the like.
At present, if a web server tenant needs to set a domain name to be accessed, and performs data transmission through the HTTP2.0 protocol, it is necessary to perform an operation on the web server, and start the HTTP2.0 service of the domain name by modifying the communication protocol configuration of a static domain name in the web server. Moreover, after the communication protocol configuration in the web server is modified, the web server needs to reload the configuration to access the domain name based on the HTTP2.0 protocol, and the reloading configuration affects the stability of the web service of the web server.
Overall, the conventional method for starting the HTTP2.0 service for a specific domain name is poor in operation convenience, and may reduce the stability of the network service of the server.
Disclosure of Invention
In view of this, an object of the present invention is to provide a method, an apparatus, and an electronic device for processing an access request, which can open an HTTP2.0 service for a specified domain name more conveniently and improve the stability of a network service of a server.
In a first aspect, an embodiment of the present invention provides a method for processing an access request, including: receiving an access request of a client aiming at a specified domain name; if the access request carries a communication protocol requirement, determining whether the current protocol configuration of the specified domain name meets the communication protocol requirement; if the current protocol configuration does not meet the communication protocol requirement, judging whether the user is pre-configured with a standby protocol configuration aiming at the specified domain name; if a backup protocol configuration is configured and the backup protocol configuration conforms to the communication protocol requirements, the access request is responded to according to the communication protocol in the backup protocol configuration.
In a preferred embodiment of the present invention, the step of determining whether the current protocol configuration of the specified domain name meets the requirement of the communication protocol includes: and determining whether the current protocol configuration of the specified domain name meets the requirement of the communication protocol according to the preset static domain name configuration.
In a preferred embodiment of the present invention, the step of determining whether the user is preconfigured with the standby protocol configuration for the specified domain name includes: reading the user configuration preloaded in the appointed memory; it is determined whether a backup protocol configuration for the specified domain name is included in the user configuration.
In a preferred embodiment of the present invention, the user configuration is loaded to the specified memory by: acquiring user configuration generated by a preset terminal; saving the user configuration as a configuration file with a fixed file name; and loading the configuration file to a specified memory.
In a preferred embodiment of the present invention, the user configuration includes a standby protocol configuration for specifying a domain name, and the standby protocol configuration is generated by: receiving a starting instruction aiming at a preset communication protocol switch; the communication protocol switch is arranged in a preset interactive interface of the terminal, and the preset communication protocol switch is associated with the specified domain name; an alternate protocol configuration for the specified domain name is generated.
In a preferred embodiment of the present invention, the step of obtaining the user configuration generated by the preset terminal includes: and reading user configuration generated by a preset terminal at regular time through a preset protocol.
In a preferred embodiment of the present invention, the step of loading the configuration file into the designated memory includes: monitoring the update state of the configuration file; and if the configuration file is monitored to be updated, loading the updated configuration file to a specified memory.
In a preferred embodiment of the present invention, the format configured by the user is a json character string.
In a preferred embodiment of the present invention, the step of reading the preloaded user configuration in the designated memory includes: and reading the user configuration preloaded in the appointed memory through the callback function.
In a preferred embodiment of the present invention, the designated memory is a shared memory.
In a preferred embodiment of the present invention, the method further includes: and responding the access request according to the communication protocol in the current protocol configuration if the current protocol configuration meets the communication protocol requirement.
In a preferred embodiment of the present invention, the method further includes: and if the access request does not carry the communication protocol requirement, or if the user does not configure the standby protocol configuration for the specified domain name, or if the user configures the standby protocol configuration for the specified domain name and the standby protocol configuration does not conform to the communication protocol requirement, responding to the access request according to the communication protocol in the current protocol configuration.
In a preferred embodiment of the present invention, the communication protocol is required to be HTTP2.0 communication protocol.
In a second aspect, an embodiment of the present invention further provides an apparatus for processing an access request, including: the access request receiving module is used for receiving an access request of a client aiming at a specified domain name; a first judging module, configured to determine whether the current protocol configuration of the specified domain name meets a communication protocol requirement if the access request carries the communication protocol requirement; a second judging module, configured to, if the current protocol configuration does not meet the communication protocol requirement, judge whether the user has preconfigured a standby protocol configuration for the specified domain name; and the response module is used for responding the access request according to the communication protocol in the standby protocol configuration if the standby protocol configuration is configured and conforms to the requirement of the communication protocol.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes a processor and a memory, where the memory stores computer-executable instructions capable of being executed by the processor, and the processor executes the computer-executable instructions to implement the method for processing an access request.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the above-described method of processing an access request.
The embodiment of the invention has the following beneficial effects:
the method, the device and the electronic equipment for processing the access request provided by the embodiment of the invention receive the access request of a client aiming at the specified domain name; if the access request carries a communication protocol requirement, determining whether the current protocol configuration of the specified domain name meets the communication protocol requirement; if the current protocol configuration does not meet the communication protocol requirement, judging whether the user is pre-configured with a standby protocol configuration aiming at the specified domain name; if a backup protocol configuration is configured and the backup protocol configuration conforms to the communication protocol requirements, the access request is responded to according to the communication protocol in the backup protocol configuration. In the mode, a user presets the standby protocol configuration of the specified domain name, and when the current protocol configuration accessed to the specified domain name in the web server does not meet the communication protocol requirement of the client, the communication protocol meeting the requirement of the client can be configured according to the standby protocol configuration, so that the communication protocol configuration of the domain name can be configured more flexibly; in addition, the user can quickly configure the standby protocol configuration through an external device (such as a user terminal) in communication connection with the web server so as to meet the communication protocol requirement of the client when accessing the specified domain name, without operating the static domain name configuration on the web server or reloading the configuration of the server, thereby improving the network service stability of the server.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part may be learned by the practice of the above-described techniques of the disclosure, or may be learned by practice of the disclosure.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a method for processing an access request according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating another method for processing an access request according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an operation interface of a standby protocol configuration according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a process for selecting the HTTP2.0 protocol in the hello phase of the server according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for processing an access request according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Icon: 51-access request receiving module; 52-a first judgment module; 53-a second judgment module; 54-a response module; 61-a processor; 62-a memory; 63-bus; 64-a communication interface.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The HTTP2.0 protocol is a relatively new communication protocol, and when a client communicates with a web server, if the HTTP2.0 protocol is to be implemented, it is also an important consideration that, on one hand, the client can support and use the protocol, and on the other hand, how the server specifies the behavior of the client, so that the client can be used in a relatively safe range to ensure the overall service quality.
In view of the problems that the conventional mode for starting the HTTP2.0 service for a specific domain name is poor in operation convenience and can reduce the stability of the network service of the server, the method, the apparatus, and the electronic device for processing an access request according to the embodiments of the present invention may be applied to various application scenarios of the domain name access service. For the convenience of understanding the present embodiment, a method for processing an access request disclosed in the embodiment of the present invention will be described in detail first.
Referring to fig. 1, there is shown a flow chart of a method for processing an access request, as seen in fig. 1, the method comprising the steps of:
step S102: an access request of a client for a specified domain name is received.
Here, the method may be executed on a web server, and the web server may be a device of a certain node in a Content Delivery Network (CDN) and is used to provide a domain name access service for a client.
The access request includes a specified domain name requested to be accessed by the client, for example, if the access request requests to access the hundred-degree homepage, the domain name corresponding to the hundred-degree homepage is carried in the access request, that is, https:// www.baidu.com/.
Step S104: and if the access request carries the communication protocol requirement, determining whether the current protocol configuration of the specified domain name conforms to the communication protocol requirement.
Here, the protocol configuration refers to a communication protocol configured in advance in the server, and for example, for web page access, the communication protocol may be an http protocol. The http protocol is a simple request-response protocol, which typically runs on top of TCP, and specifies what messages a client may send to a server and what responses to get.
In one possible implementation, it may be determined whether the current protocol configuration of the specified domain name meets the communication protocol requirement according to a preset static domain name configuration. Here, the static domain name refers to a domain name pointing to a fixed IP address, and communication protocols are configured for the specified static domain name in the server, so that when a client accesses any one of the static domain names, communication is performed using a pre-configured communication protocol.
In this embodiment, after receiving an access request from a client, a server determines whether the access request carries a communication protocol requirement, and if so, determines whether the current protocol configuration of the specified domain name meets the communication protocol requirement; if not, the access request is responded according to the communication protocol in the current protocol configuration. The communication protocol requirement may be a communication protocol of a specified version, for example, the communication protocol requirement is an HTTP1.0 protocol, an HTTP1.1 protocol, an HTTP2.0 protocol, or the like. And when the client requests the domain name access with the communication protocol of the specified version, the client is indicated to support the communication protocol of the specified version. For example, assuming that a client requires access to a specified domain name in the HTTP2.0 protocol, the client itself must support conditions (including requirements of software and hardware, etc.) required for communication in the HTTP2.0 protocol.
Step S106: if the current protocol configuration does not meet the communication protocol requirement, judging whether the user is pre-configured with a standby protocol configuration aiming at the specified domain name.
For example, assume that the current protocol is configured to: for an access request of any domain name, an HTTP1.1 protocol is configured; and if the communication protocol requirement carried in the access request received from the client side is that the specified domain name is required to be accessed by the HTTP1.1 protocol, judging that the current protocol configuration conforms to the communication protocol requirement, and responding to the access request according to the communication protocol in the current protocol configuration.
Similarly, under the current protocol configuration, if the client requests to access the specified domain name by the HTTP2.0 protocol, it is determined that the current protocol configuration does not meet the requirement of the communication protocol, and at this time, it is determined whether the user has preconfigured a standby protocol configuration for the specified domain name. Here, the backup protocol configuration is configured by a user, for example, in the CDN network service, a server side may provide a platform, to which a communication protocol corresponding to a domain name is configurable, for a server tenant side, so that the tenant side may set a backup communication protocol for specifying the domain name according to its own service requirement, so that when a client accesses the specified domain name, the client may access the specified domain name according to the set backup communication protocol in a case where the client supports the backup communication protocol. Therefore, the user can more flexibly and conveniently configure the communication protocol corresponding to the domain name.
Step S108: if a backup protocol configuration is configured and the backup protocol configuration conforms to the communication protocol requirements, the access request is responded to according to the communication protocol in the backup protocol configuration.
In actual operation, if the user does not configure the standby protocol configuration for the specified domain name, or, although the user configures the standby protocol configuration for the specified domain name, the standby protocol configuration does not meet the communication protocol requirement, for example, the communication protocol version in the standby protocol configuration is higher or lower than the communication protocol version required by the communication protocol, the access request is still responded according to the communication protocol in the current protocol configuration.
And if the user configures the standby protocol configuration for the specified domain name and the standby protocol configuration meets the requirements of the communication protocol, responding to the access request according to the communication protocol in the standby protocol configuration. For example, the communication protocol requires HTTP2.0 communication protocol, and the backup protocol configuration for the specified domain name is also HTTP2.0, then the access request of the client is responded according to the HTTP2.0 communication protocol, that is, communication is performed between the client and the server according to the HTTP2.0 communication protocol.
It can be seen that, in this embodiment, if the client performs domain name access and requests a specific protocol to perform domain name access, when the server determines which protocol is used to respond to the access request, the priority of the current protocol configuration (such as static domain name configuration) in the server is higher than the priority of the standby protocol configuration configured by the user; and the standby protocol configuration has a higher priority than the protocol configuration indicated by the client to be supported in the access request.
The method for processing the access request provided by the embodiment of the invention receives the access request of the client aiming at the specified domain name; if the access request carries a communication protocol requirement, determining whether the current protocol configuration of the specified domain name meets the communication protocol requirement; if the current protocol configuration does not meet the communication protocol requirement, judging whether the user is pre-configured with a standby protocol configuration aiming at the specified domain name; if a backup protocol configuration is configured and the backup protocol configuration conforms to the communication protocol requirements, the access request is responded to according to the communication protocol in the backup protocol configuration. In the mode, a user presets the standby protocol configuration of the specified domain name, and when the current protocol configuration accessed to the specified domain name in the web server does not meet the communication protocol requirement of the client, the communication protocol meeting the requirement of the client can be configured according to the standby protocol configuration, so that the communication protocol configuration of the domain name can be configured more flexibly.
On the basis of the method for processing an access request shown in fig. 1, the present embodiment further provides another method for processing an access request, and the method mainly describes a specific implementation process of step S106 (if the current protocol configuration does not meet the communication protocol requirement, determine whether the user is preconfigured with the standby protocol configuration for the specified domain name) in the foregoing embodiment.
Referring to fig. 2, a flow chart of another method for processing an access request is shown, wherein the method includes the following steps:
step S202: an access request of a client for a specified domain name is received.
Here, step S202 in this embodiment corresponds to step S102 in the foregoing embodiment, and corresponding descriptions may refer to corresponding parts of the foregoing embodiment, which are not described herein again.
Step S204: judging whether the access request carries a communication protocol requirement or not; if yes, go to step S206; if not, step S216 is performed.
If the access request carries a communication protocol requirement, further judging whether the current protocol configuration of the specified domain name meets the communication protocol requirement; and if the access request does not carry the communication protocol requirement, responding to the access request according to the communication protocol in the current protocol configuration.
Step S206: judging whether the current protocol configuration of the specified domain name meets the requirement of the communication protocol; if yes, go to step S216; if not, step S208 is performed.
If the current protocol configuration of the specified domain name meets the requirement of the communication protocol, responding the access request according to the communication protocol in the current protocol configuration; and if the current protocol configuration of the specified domain name does not meet the requirement of the communication protocol, reading the user configuration loaded in advance in the specified memory, and acquiring the standby protocol configuration of the specified domain name according to the user configuration.
Step S208: and reading the user configuration preloaded in the appointed memory.
Here, the user configuration preloaded in the specified memory may be read through a callback function, where the callback function is a function called through a function pointer, and the specified memory may be a shared memory in the server.
In at least one possible embodiment, the loading of the user configuration into the specified memory may be implemented by the following steps 11-13:
(11) and acquiring user configuration generated by a preset terminal.
In actual operation, a server leasing party can provide a platform for a tenant party, so that the tenant can log in the platform for operation through the terminal to configure access parameters in a designated server according to self requirements, and user configuration is obtained.
Here, the user configuration may or may not include the standby protocol configuration of the specified domain name, and if the standby protocol configuration of the specified domain name is included, it indicates that the user configures the standby protocol for the specified domain name. In other possible embodiments, the user configuration may also include other configurations, such as a configuration of access rights of the client, and the like, which is not limited herein.
In one possible implementation manner, a communication protocol switch associated with a specified domain name may be set in a preset interactive interface of the terminal, and when the terminal receives an on instruction for the communication protocol switch, a standby protocol configuration of the specified domain name is generated. As shown in fig. 3, which is an operation interface diagram of a standby protocol configuration, in the embodiment shown in fig. 3, a selection switch of the HTTP2.0 protocol for specifying a domain name a is provided, and a user can select to turn on or off the selection switch to obtain the standby protocol configuration for the domain name a. Here, the format of the user configuration may be a json string, for example, in the example of fig. 3, after clicking on the open option of HTTP2.0, a service configuration in the form of a json string of the domain name a is generated as follows:
{"host":"xxx.yyy.zzz","conf":[{"http2":"on","location":"\\/","loc_conf":{...}}]}。
(12) the user profile is saved as a profile with a fixed file name.
In actual operation, the server may read the user configuration generated by the preset terminal from the specified memory through a preset protocol. And, the read user configuration is saved to the configuration file with the fixed file name in the server.
(13) And loading the configuration file to a specified memory.
In one possible implementation, the update state of the configuration file is monitored, and if the configuration file is monitored to be updated, the updated configuration file is loaded to a specified memory. Therefore, if the communication protocol of the user aiming at the domain name is modified, the server can timely acquire the latest user configuration so as to respond the access request of the client to the specified domain name according to the communication protocol required by the user.
Step S210: determining whether the user configuration contains a standby protocol configuration for the specified domain name; if yes, go to step S212; if not, step S216 is performed.
If the user configuration comprises a standby protocol configuration aiming at the specified domain name, judging that the standby protocol configuration meets the communication protocol requirement, and responding to the access request based on the judgment result; if the user configuration does not contain a backup protocol configuration for the specified domain name, the access request is responded to according to the communication protocol in the current protocol configuration.
Step S212: judging that the standby protocol configuration meets the communication protocol requirement; if yes, go to step S214; if not, step S216 is performed.
If the standby protocol configuration conforms to the communication protocol requirement, responding to the access request according to the communication protocol in the standby protocol configuration; if the standby protocol configuration does not meet the communication protocol requirements, the access request is responded according to the communication protocol in the current protocol configuration.
Step S214: the access request is responded to according to a communication protocol in the standby protocol configuration.
And establishing a communication connection between the client and the server according to the communication protocol of the specified domain name configured in the standby protocol configuration, so that the client can access the specified domain name through the communication protocol.
Step S216: the access request is responded to according to a communication protocol in the current protocol configuration.
And establishing communication connection between the client and the server according to the communication protocol of the specified domain name configured in the current protocol configuration, and providing domain name access service for the client.
In this embodiment, the server responding to the client access request may be a Nginx web server, and the web server pulls the user configuration from the user terminal through a protocol, and stores the user configuration in the device as a configuration file with a fixed name, and when the configuration file is read and found to be changed, reloads the configuration file, and places the configuration file in a shared memory of the Nginx. When an access request of a client aiming at a specified domain name reaches a Nginx server, if the static server block configuration of the specified domain name cannot be found on the server, entering a default _ server block, wherein the default _ server block is used for reading the domain name configuration so as to select whether to start a corresponding protocol service.
Referring to fig. 4, which is a schematic diagram illustrating a process of selecting an HTTP2.0 protocol in a hello phase of a server, in an embodiment shown in fig. 4, after a client sends a client hello packet to a server, the server reads the packet and performs corresponding processing, for example, selecting a version of the protocol (TLS1.0, TLS1.1, TLS1.2, etc.), and then selects an ALPN protocol through a function, where the protocols such as HTTP1.0, HTTP1.1, HTTP2.0, etc. may be selected, where a callback function is redefined in the function, and a user configuration in a shared memory is called and loaded in s- > ctx- > set _ ALPN _ cb; and when selecting a protocol, the callback function refers to the static domain name configuration and the standby protocol configuration of the domain name, and determines the final application layer protocol in tls1_ alpn _ handle _ client _ hello _ late.
In the method for processing an access request provided by this embodiment, a user may quickly configure the standby protocol configuration through an external device (e.g., a user terminal) in communication connection with the web server, so as to meet a communication protocol requirement when the client accesses the specified domain name, without operating a static domain name configuration on the web server or reloading the configuration of the server, thereby improving the stability of the network service of the server.
Corresponding to the method for processing an access request shown in fig. 1, an embodiment of the present invention further provides an apparatus for processing an access request, as shown in fig. 5, which is a schematic structural diagram of an apparatus for processing an access request, and as can be seen from fig. 5, the apparatus includes an access request receiving module 51, a first determining module 52, a second determining module 53, and a response module 54, which are connected in sequence, where functions of the modules are as follows:
an access request receiving module 51, configured to receive an access request of a client for a specified domain name;
a first determining module 52, configured to determine whether the current protocol configuration of the specified domain name meets a communication protocol requirement if the access request carries the communication protocol requirement;
a second judging module 53, configured to, if the current protocol configuration does not meet the requirement of the communication protocol, judge whether the user is preconfigured with a standby protocol configuration for the specified domain name;
a response module 54, configured to respond to the access request according to the communication protocol in the standby protocol configuration if the standby protocol configuration is configured and the standby protocol configuration conforms to the communication protocol requirement.
The device for processing the access request provided by the embodiment of the invention receives the access request of a client aiming at the specified domain name; if the access request carries a communication protocol requirement, determining whether the current protocol configuration of the specified domain name meets the communication protocol requirement; if the current protocol configuration does not meet the communication protocol requirement, judging whether the user is pre-configured with a standby protocol configuration aiming at the specified domain name; if a backup protocol configuration is configured and the backup protocol configuration conforms to the communication protocol requirements, the access request is responded to according to the communication protocol in the backup protocol configuration. In the device, a user presets the standby protocol configuration of the specified domain name, and when the current protocol configuration accessed to the specified domain name in the web server does not meet the communication protocol requirement of the client, the communication protocol meeting the requirement of the client can be configured according to the standby protocol configuration, so that the communication protocol configuration of the domain name can be configured more flexibly; in addition, the user can quickly configure the standby protocol configuration through an external device (such as a user terminal) in communication connection with the web server so as to meet the communication protocol requirement of the client when accessing the specified domain name, without operating the static domain name configuration on the web server or reloading the configuration of the server, thereby improving the network service stability of the server.
In one possible implementation manner, the first determining module 52 is further configured to: and determining whether the current protocol configuration of the specified domain name meets the requirement of the communication protocol according to the preset static domain name configuration.
In another possible embodiment, the second determining module 53 is further configured to: reading the user configuration preloaded in the appointed memory; it is determined whether a backup protocol configuration for the specified domain name is included in the user configuration.
In another possible implementation, the user configuration is loaded to the specified memory by: acquiring user configuration generated by a preset terminal; saving the user configuration as a configuration file with a fixed file name; and loading the configuration file to a specified memory.
In another possible embodiment, the user configuration includes a standby protocol configuration specifying a domain name, and the standby protocol configuration is generated by: receiving a starting instruction aiming at a preset communication protocol switch; the communication protocol switch is arranged in a preset interactive interface of the terminal, and the preset communication protocol switch is associated with the specified domain name; an alternate protocol configuration for the specified domain name is generated.
In another possible implementation, the step of obtaining the user configuration generated by the preset terminal includes: and reading user configuration generated by a preset terminal at regular time through a preset protocol.
In another possible implementation manner, the step of loading the configuration file into the specified memory includes: monitoring the update state of the configuration file; and if the configuration file is monitored to be updated, loading the updated configuration file to a specified memory.
In another possible embodiment, the format configured by the user is a json character string.
In another possible implementation manner, the step of reading the user configuration preloaded in the specified memory includes: and reading the user configuration preloaded in the appointed memory through the callback function.
In another possible implementation, the designated memory is a shared memory.
In another possible implementation, the first determining module 52 is further configured to: and responding the access request according to the communication protocol in the current protocol configuration if the current protocol configuration meets the communication protocol requirement.
In another possible embodiment, the second determining module 53 is further configured to: and if the access request does not carry the communication protocol requirement, or if the user does not configure the standby protocol configuration for the specified domain name, or if the user configures the standby protocol configuration for the specified domain name and the standby protocol configuration does not conform to the communication protocol requirement, responding to the access request according to the communication protocol in the current protocol configuration.
In another possible embodiment, the communication protocol is required to be the HTTP2.0 communication protocol.
The implementation principle and the generated technical effect of the apparatus for processing an access request provided by the embodiment of the present invention are the same as those of the foregoing method embodiment for processing an access request, and for brief description, reference may be made to corresponding contents in the foregoing method embodiment for processing an access request where no mention is made in part of the embodiment of the apparatus for processing an access request.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, which is a schematic structural diagram of the electronic device, where the electronic device includes a processor 61 and a memory 62, the memory 62 stores machine-executable instructions capable of being executed by the processor 61, and the processor 61 executes the machine-executable instructions to implement the method for processing the access request.
In the embodiment shown in fig. 6, the electronic device further comprises a bus 63 and a communication interface 64, wherein the processor 61, the communication interface 64 and the memory 62 are connected by the bus.
The Memory 62 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 64 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
The processor 61 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 61. The Processor 61 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can 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 Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and the processor 61 reads the information in the memory 62, and in combination with its hardware, performs the steps of the method for processing an access request of the foregoing embodiment.
Embodiments of the present invention further provide a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the method for processing an access request, which is described in the foregoing method embodiments and is not described herein again.
The method for processing an access request, the apparatus for processing an access request, and the computer program product of the electronic device provided in the embodiments of the present invention include a computer-readable storage medium storing program codes, where instructions included in the program codes may be used to execute the method for processing an access request described in the foregoing method embodiments, and specific implementations may refer to the method embodiments and are not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (16)

1. A method of processing an access request, comprising:
receiving an access request of a client aiming at a specified domain name;
if the access request carries a communication protocol requirement, determining whether the current protocol configuration of the specified domain name meets the communication protocol requirement;
if the current protocol configuration does not meet the communication protocol requirement, judging whether a user is pre-configured with a standby protocol configuration aiming at the specified domain name;
and if the standby protocol configuration is configured and conforms to the communication protocol requirement, responding to the access request according to the communication protocol in the standby protocol configuration.
2. The method of processing an access request according to claim 1, wherein the step of determining whether the current protocol configuration for the specified domain name meets the communication protocol requirements comprises:
and determining whether the current protocol configuration of the specified domain name meets the requirement of the communication protocol according to the preset static domain name configuration.
3. The method of claim 1, wherein the step of determining whether the user is preconfigured with a backup protocol configuration for the specified domain name comprises:
reading the user configuration preloaded in the appointed memory;
determining whether a backup protocol configuration for the specified domain name is included in the user configuration.
4. The method of claim 3, wherein the user configuration is loaded into the specified memory by:
acquiring user configuration generated by a preset terminal;
saving the user configuration as a configuration file with a fixed file name;
and loading the configuration file to a specified memory.
5. The method of processing an access request according to claim 4, wherein the user profile includes a backup protocol profile specifying a domain name, the backup protocol profile being generated by:
receiving a starting instruction aiming at a preset communication protocol switch; the communication protocol switch is arranged in a preset interactive interface of the terminal, and the preset communication protocol switch is associated with the specified domain name;
generating a standby protocol configuration for the specified domain name.
6. The method of claim 4, wherein the step of obtaining the user configuration generated by the preset terminal comprises:
and reading user configuration generated by a preset terminal at regular time through a preset protocol.
7. The method of claim 4, wherein the step of loading the configuration file into a specified memory comprises:
monitoring the update state of the configuration file;
and if the configuration file is monitored to be updated, loading the updated configuration file to a specified memory.
8. The method of processing an access request of claim 3, wherein the user-configured format is a json string.
9. The method of claim 3, wherein the step of reading the preloaded user configuration in the specified memory comprises:
and reading the user configuration preloaded in the appointed memory through the callback function.
10. The method of claim 3, wherein the designated memory is a shared memory.
11. The method of processing an access request according to claim 1, the method further comprising:
and responding the access request according to the communication protocol in the current protocol configuration if the current protocol configuration meets the communication protocol requirement.
12. The method of processing an access request according to claim 1, the method further comprising:
and if the access request does not carry communication protocol requirements, or if the user does not configure a standby protocol configuration for the specified domain name, or if the user configures the standby protocol configuration for the specified domain name and the standby protocol configuration does not meet the communication protocol requirements, responding to the access request according to the communication protocol in the current protocol configuration.
13. Method for handling access requests according to any of the claims 1-12, characterized in that said communication protocol requirements are the HTTP2.0 communication protocol.
14. An apparatus for processing an access request, comprising:
the access request receiving module is used for receiving an access request of a client aiming at a specified domain name;
a first judging module, configured to determine whether a current protocol configuration of the specified domain name meets a communication protocol requirement if the access request carries the communication protocol requirement;
a second judging module, configured to, if the current protocol configuration does not meet the communication protocol requirement, judge whether a user has preconfigured a standby protocol configuration for the specified domain name;
and the response module is used for responding the access request according to the communication protocol in the standby protocol configuration if the standby protocol configuration is configured and conforms to the communication protocol requirement.
15. An electronic device, comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of processing an access request of any one of claims 1 to 13.
16. A computer-readable storage medium having stored thereon computer-executable instructions which, when invoked and executed by a processor, cause the processor to carry out the method of handling access requests of any of claims 1 to 13.
CN202010815255.9A 2020-08-13 2020-08-13 Method and device for processing access request and electronic equipment Pending CN111953781A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010815255.9A CN111953781A (en) 2020-08-13 2020-08-13 Method and device for processing access request and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010815255.9A CN111953781A (en) 2020-08-13 2020-08-13 Method and device for processing access request and electronic equipment

Publications (1)

Publication Number Publication Date
CN111953781A true CN111953781A (en) 2020-11-17

Family

ID=73343109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010815255.9A Pending CN111953781A (en) 2020-08-13 2020-08-13 Method and device for processing access request and electronic equipment

Country Status (1)

Country Link
CN (1) CN111953781A (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1753404A (en) * 2004-09-23 2006-03-29 华为技术有限公司 Method of using communication apparatus to select communication protocol
US20070244995A1 (en) * 2006-04-12 2007-10-18 Cisco Technology, Inc. Method and system for automating collateral configuration in a network
CN101114954A (en) * 2007-09-06 2008-01-30 中兴通讯股份有限公司 Protocol testing device
CN101686232A (en) * 2008-09-25 2010-03-31 华为技术有限公司 Method for negotiating communication protocol version, system and equipment thereof
US20110307490A1 (en) * 2010-06-15 2011-12-15 Usm China/Hong Kong Limited Context Level Protocols And Interfaces
CN103067410A (en) * 2006-11-28 2013-04-24 核心无线许可有限公司 Method for delivery of messages in communication system
CN103166996A (en) * 2011-12-14 2013-06-19 华为技术有限公司 Self-adaptation method, device and system of hyper text transport protocol (HTTP) connection and hypertext transfer protocol secure (HTTPS) connection
CN103503420A (en) * 2011-03-11 2014-01-08 高通股份有限公司 Use HTTP protocol to remotely access and manage device content and configuration
US20160094690A1 (en) * 2014-09-26 2016-03-31 Oracle International Corporation Packet transport protocol processing
CN105516185A (en) * 2015-12-30 2016-04-20 广东顺德中山大学卡内基梅隆大学国际联合研究院 Multi-protocol gateway equipment
CN106982222A (en) * 2017-04-24 2017-07-25 华南理工大学 The multi-protocol data cut-in method and device that can configure under a kind of industrial 4.0 environment
CN107294986A (en) * 2017-06-30 2017-10-24 北京海泰方圆科技股份有限公司 A kind of method of access HTTPS websites, apparatus and system
CN107547468A (en) * 2016-06-23 2018-01-05 广州市动景计算机科技有限公司 Switching of network protocol device, method and terminal
CN108156120A (en) * 2016-12-06 2018-06-12 阿里巴巴集团控股有限公司 Encrypted transmission data, cryptographic protocol control and detected method, apparatus and system
US20180262351A1 (en) * 2016-07-20 2018-09-13 Tencent Technology (Shenzhen) Company Limited Content delivery network processing method, content delivery network, device, and storage medium
CN108696381A (en) * 2017-04-12 2018-10-23 腾讯科技(深圳)有限公司 A kind of protocol configuration method and device
CN109115519A (en) * 2018-09-21 2019-01-01 深圳市爱夫卡科技股份有限公司 For the means of communication of automobile communication module, device, module and storage medium

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1753404A (en) * 2004-09-23 2006-03-29 华为技术有限公司 Method of using communication apparatus to select communication protocol
US20070244995A1 (en) * 2006-04-12 2007-10-18 Cisco Technology, Inc. Method and system for automating collateral configuration in a network
CN103067410A (en) * 2006-11-28 2013-04-24 核心无线许可有限公司 Method for delivery of messages in communication system
CN101114954A (en) * 2007-09-06 2008-01-30 中兴通讯股份有限公司 Protocol testing device
CN101686232A (en) * 2008-09-25 2010-03-31 华为技术有限公司 Method for negotiating communication protocol version, system and equipment thereof
US20110307490A1 (en) * 2010-06-15 2011-12-15 Usm China/Hong Kong Limited Context Level Protocols And Interfaces
CN103503420A (en) * 2011-03-11 2014-01-08 高通股份有限公司 Use HTTP protocol to remotely access and manage device content and configuration
CN103166996A (en) * 2011-12-14 2013-06-19 华为技术有限公司 Self-adaptation method, device and system of hyper text transport protocol (HTTP) connection and hypertext transfer protocol secure (HTTPS) connection
US20160094690A1 (en) * 2014-09-26 2016-03-31 Oracle International Corporation Packet transport protocol processing
CN105516185A (en) * 2015-12-30 2016-04-20 广东顺德中山大学卡内基梅隆大学国际联合研究院 Multi-protocol gateway equipment
CN107547468A (en) * 2016-06-23 2018-01-05 广州市动景计算机科技有限公司 Switching of network protocol device, method and terminal
US20180262351A1 (en) * 2016-07-20 2018-09-13 Tencent Technology (Shenzhen) Company Limited Content delivery network processing method, content delivery network, device, and storage medium
CN108156120A (en) * 2016-12-06 2018-06-12 阿里巴巴集团控股有限公司 Encrypted transmission data, cryptographic protocol control and detected method, apparatus and system
CN108696381A (en) * 2017-04-12 2018-10-23 腾讯科技(深圳)有限公司 A kind of protocol configuration method and device
CN106982222A (en) * 2017-04-24 2017-07-25 华南理工大学 The multi-protocol data cut-in method and device that can configure under a kind of industrial 4.0 environment
CN107294986A (en) * 2017-06-30 2017-10-24 北京海泰方圆科技股份有限公司 A kind of method of access HTTPS websites, apparatus and system
CN109115519A (en) * 2018-09-21 2019-01-01 深圳市爱夫卡科技股份有限公司 For the means of communication of automobile communication module, device, module and storage medium

Similar Documents

Publication Publication Date Title
CN109067914B (en) web service proxy method, device, equipment and storage medium
CN107948324B (en) request transmission system, method, device and storage medium
CN108200165B (en) request transmission system, method, device and storage medium
US11184465B2 (en) Network communication for establishing a QUIC connection
US20180124051A1 (en) Response Method and System in Virtual Network Computing Authentication, and Proxy Server
US20250047733A1 (en) Media streaming method and system
US12250098B2 (en) Systems and methods for control channel tunneling
CN115918035A (en) Method and device for realizing home computing cloud
CN114925135B (en) Data export method, device, system, electronic device and storage medium
CN102387201A (en) Method, device and system for processing service data
CN110392069B (en) CDN service scheduling processing method and CDN server
EP1338971B1 (en) Method and terminal for the secure acquisition of applications
CN114285668B (en) Gate testing method and device, storage medium and electronic equipment
CN111953781A (en) Method and device for processing access request and electronic equipment
CN111786932B (en) Account login method and device, electronic equipment and computer storage medium
JP4532238B2 (en) On-demand service provision system
CN116248559A (en) Method, system, device, equipment and medium for acquiring monitoring log
CN107612831A (en) A kind of transmission method and device of the data message for accessing source station
CN109510864B (en) A kind of forwarding method, transmission method and related device of cache request
CN105306238A (en) Terminal access method, terminal access device and terminal access system
CN110769065A (en) Remote management method, system, terminal equipment and server
US20190312929A1 (en) Information synchronization method and device
CN110278271B (en) Network request control method and device and terminal equipment
Tuovinen Network monitoring with Raspberry Pi
CN120301925A (en) A NAS application loading method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20201117

RJ01 Rejection of invention patent application after publication