CN114124891A - Network request processing method and device, storage medium and electronic device - Google Patents

Network request processing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN114124891A
CN114124891A CN202111243773.9A CN202111243773A CN114124891A CN 114124891 A CN114124891 A CN 114124891A CN 202111243773 A CN202111243773 A CN 202111243773A CN 114124891 A CN114124891 A CN 114124891A
Authority
CN
China
Prior art keywords
target
client
server
service server
interactive connection
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
CN202111243773.9A
Other languages
Chinese (zh)
Other versions
CN114124891B (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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202111243773.9A priority Critical patent/CN114124891B/en
Publication of CN114124891A publication Critical patent/CN114124891A/en
Application granted granted Critical
Publication of CN114124891B publication Critical patent/CN114124891B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method and a device for processing a network request, a storage medium and an electronic device, wherein the method comprises the following steps: acquiring a first network request initiated by a target client, wherein the first network request is used for requesting service interaction with a target service server; acquiring a target interactive connection object corresponding to the target client and the target service server from a client server group and an interactive connection object which have a corresponding relation, wherein the target interactive connection object is used for indicating connection information of an established interactive connection between the target client and the target service server; and forwarding the first network request to the target service server through the target interactive connection object. By adopting the technical scheme, the problems of low interaction efficiency of the application program and the service server and the like in the related technology are solved.

Description

Network request processing method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for processing a network request, a storage medium, and an electronic apparatus.
Background
With the development of the internet, APP (Application) has become one of important terminal operation means, and interaction with a service server is becoming more and more intimate. On one hand, the number of service servers interacting with the APP is significantly increased; on the other hand, the interaction frequency between the APP and the service server is also increasing. In the prior art, when an APP needs to perform data interaction with a certain service server, the APP needs to establish connection with the service server, and when the interaction is finished, the connection is destroyed; when the APP needs to interact with the same service server again, the network connection with the service server needs to be reestablished. The mode greatly reduces the interaction efficiency of the APP and the service server, and is difficult to meet the high-frequency network request scene of the user.
Aiming at the problems of low interaction efficiency of an application program and a service server and the like in the related technology, an effective solution is not provided.
Disclosure of Invention
The embodiment of the invention provides a network request processing method and device, a storage medium and an electronic device, and aims to at least solve the problems that in the related art, the interaction efficiency of an application program and a service server is low and the like.
According to an embodiment of the present invention, a method for processing a network request is provided, including: acquiring a first network request initiated by a target client, wherein the first network request is used for requesting service interaction with a target service server;
acquiring a target interactive connection object corresponding to the target client and the target service server from a client server group and an interactive connection object which have a corresponding relation, wherein the target interactive connection object is used for indicating connection information of an established interactive connection between the target client and the target service server;
and forwarding the first network request to the target service server through the target interactive connection object.
Optionally, obtaining a target interactive connection object corresponding to the target client and the target service server from a client server group and an interactive connection object having a corresponding relationship includes:
searching a target parameter carried by the first network request from a server parameter list corresponding to the target client, wherein the target parameter is a server parameter of the target service server, and the server parameter list records a server parameter of a server which is connected with the target client;
and under the condition that the target parameter is found, acquiring an interactive connection object corresponding to the target parameter from the server parameter and the interactive connection object with the corresponding relation as the target interactive connection object.
Optionally, searching for the target parameter carried by the first network request from the server parameter list corresponding to the target client includes:
acquiring a server domain name and a connection port from the first network request;
and searching the server domain name and the connection port from a server parameter list corresponding to the target client, wherein the target parameter carried by the first network request is determined to be searched under the condition that the server domain name and the connection port are searched.
Optionally, forwarding the first network request to the target service server through the target interconnection object includes:
extracting a request message from the first network request to obtain a target request message;
splicing the target request message with request configuration information included in the target interactive connection object to obtain a second network request, wherein the request configuration information is used for indicating configuration parameters of the network request between the target client and the target service server;
and sending the second network request to the target service server.
Optionally, extracting a request packet from the first network request to obtain a target request packet, where the target request packet includes:
extracting a request message from the first network request as an initial request message;
and encrypting the initial request message to obtain an encrypted message as the target request message.
Optionally, after obtaining the target interactive connection object corresponding to the target client and the target service server from the client server group and the interactive connection object having the corresponding relationship, the method further includes:
sending an interactive connection request to the target service server under the condition that the target interactive connection object is not obtained from a client server group and an interactive connection object which have corresponding relations, wherein the interactive connection request is used for requesting to establish interactive connection between the target client and the target service server;
acquiring response information returned by the target service server in response to the interactive connection request, wherein the response information is used for indicating that the interactive connection between the target client and the target service server is successfully established;
and establishing an initial interactive connection object to store the request configuration information carried in the response information to obtain the target interactive connection object.
Optionally, after forwarding the first network request to the target service server through the target interconnection object, the method further includes:
receiving service data returned by the target service server in response to the first network request;
converting the data format of the service data into a target format to obtain target data, wherein the target format is a data format allowed to be used by the target client;
and sending the target data to the target client.
According to another embodiment of the present invention, there is also provided a device for processing a network request, including: the system comprises a first acquisition module, a first service server and a first service module, wherein the first acquisition module is used for acquiring a first network request initiated by a target client, and the first network request is used for requesting service interaction with the target service server;
a second obtaining module, configured to obtain a target interactive connection object corresponding to the target client and the target service server from a client server group and an interactive connection object that have a corresponding relationship, where the target interactive connection object is used to indicate connection information of an established interactive connection between the target client and the target service server;
and the forwarding module is used for forwarding the first network request to the target service server through the target interactive connection object.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the above processing method of a network request when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for processing the network request through the computer program.
In the embodiment of the invention, a first network request initiated by a target client is obtained, wherein the first network request is used for requesting service interaction with a target service server; acquiring a target interactive connection object corresponding to a target client and a target service server from a client server group and an interactive connection object which have a corresponding relation, wherein the target interactive connection object is used for indicating connection information of an established interactive connection between the target client and the target service server; the first network request is forwarded to the target service server through the target interactive connection object, namely, if the first network request initiated by the target client is obtained, the target interactive connection object indicating the connection information of the established interactive connection between the target client and the target service server is obtained from the client server group and the interactive connection object which have corresponding relation, if the target interactive connection object is obtained, the first network request can be directly forwarded to the target service server through the target interactive connection object, namely, the established interactive connection between the client and the service server is not destroyed after the interaction between the client and the service server, but the connection information of the interactive connection is stored, so that when the client and the service server need to interact again, the interactive connection between the client and the service server does not need to be re-established, and the time of the connection establishment process is saved, the interaction efficiency of the application program and the service server is improved. By adopting the technical scheme, the problems of low interaction efficiency of the application program and the service server and the like in the related technology are solved, and the technical effect of improving the interaction efficiency of the application program and the service server is realized.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a computer terminal of a network request processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of processing a network request according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a network request processing procedure according to an embodiment of the invention;
FIG. 4 is a schematic diagram of a method of processing a network request according to an embodiment of the invention;
fig. 5 is a block diagram of a network request processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method provided by the embodiment of the invention can be executed in a computer terminal, a computer terminal or a similar arithmetic device. Taking the example of running on a computer terminal, fig. 1 is a hardware structure block diagram of a computer terminal of a network request processing method according to an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and in an exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration with equivalent functionality to that shown in FIG. 1 or with more functionality than that shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the network request processing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for processing a network request is provided, and is applied to the computer terminal, and fig. 2 is a flowchart of a method for processing a network request according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, a first network request initiated by a target client is obtained, wherein the first network request is used for requesting service interaction with a target service server;
step S204, a target interactive connection object corresponding to the target client and the target service server is obtained from a client server group and an interactive connection object having a corresponding relationship, wherein the target interactive connection object is used for indicating connection information of the established interactive connection between the target client and the target service server;
step S206, forwarding the first network request to the target service server through the target interactive connection object.
Through the steps, if the first network request initiated by the target client is obtained, the target interactive connection object indicating the connection information of the established interactive connection between the target client and the target service server is obtained from the client server group and the interactive connection object with the corresponding relation, if the target interactive connection object is obtained, the first network request can be directly forwarded to the target service server through the target interactive connection object, that is, the established interactive connection between the client and the service server is not destroyed after the interaction between the client and the service server, but the connection information of the interactive connection is stored, therefore, when the client and the service server need to interact again, the client does not need to establish the interactive connection with the service server again, the time of the connection establishing process is saved, and the interaction efficiency of the application program and the service server is improved. By adopting the technical scheme, the problems of low interaction efficiency of the application program and the service server and the like in the related technology are solved, and the technical effect of improving the interaction efficiency of the application program and the service server is realized.
Optionally, in this embodiment, the processing method of the network request may be, but is not limited to, applied to the target client, or may also be, but is not limited to, applied to a functional module or a device deployed between the target client and the target service server, such as: a network adaptation module may be deployed between, but not limited to, the target client and the target service server, and at least the processing method for implementing the network request is implemented on the network adaptation module.
In the technical solution provided in step S202, in the process of executing the processing method of the network request by a different execution subject, the step of acquiring the first network request initiated by the target client may be implemented in different manners, but is not limited to be implemented in different manners. Such as: in the case where the execution subject is a target client, the first network request obtained by the target client may be, but is not limited to being, triggered by an operation performed by a user on the target client. In the case where the execution subject is a functional module or device deployed between the target client and the target service server, the functional module or device deployed between the target client and the target service server may obtain, but is not limited to, the first network request by receiving the first network request sent by the target client.
Optionally, in this embodiment, the service interaction may include, but is not limited to, data interaction or instruction interaction between the client and the service server, and the data interaction may include, but is not limited to: uploading or downloading picture data, uploading or downloading video data, uploading or downloading text data and the like.
Optionally, in this embodiment, the target client may include, but is not limited to, a package in which an application is installed on the user device, and the application may include, but is not limited to, a game application, an instant messaging application, a multimedia application, a live application, and the like.
Optionally, in this embodiment, the target business server may include, but is not limited to, a server device deployed in the background by the application, which may provide business services for a package installed on the user device by the application, and the business services provided by the target business server may include, but are not limited to, transaction services, search services, and the like.
In the technical solution provided in the above step S204, through the corresponding relationship between the client server group and the interactive connection object, a target interactive connection object corresponding to the target client and the target service server may be determined, where the interactive connection object may be, but is not limited to, used to store connection information of an established interactive connection, the connection information may be, but is not limited to, including request configuration information and connection configuration information required to establish an interactive connection between the target client and the target service server, the request configuration information may be, but is not limited to, used to construct a network request that the connection allows to transmit (e.g., identity information of each of the client and the server, format requirements of the network request, and the like), and the connection configuration information may be, but is not limited to, used to construct network information required by the connection (e.g., network bandwidth, transmission protocol, network resources, and the like).
Such as: the request configuration information may include, but is not limited to, identity information of the client, and the connection configuration information may include, but is not limited to: the connection bandwidth of the service server, the transmission protocol used in the interactive connection, the resources allocated by the service server to the client, the resources allocated by the client to the service server, and the like.
Optionally, in this embodiment, each interactive connection object may be implemented, but not limited to, by a service server cache object constructed on a service server. Such as: and constructing a service server cache object on the service server as an interactive connection object, constructing the service server object in the service server cache object, and storing the connection information of the established interactive connection between the client and the service server into the service server object, thereby realizing the storage of the connection information of the established interactive connection by the interactive connection object.
Such as: if the client A and the service server B have service interaction, a service server cache object B is constructed for a client server group consisting of the client A and the service server B and serves as an interactive connection object B, then the service server object B is constructed in the service server cache object B, and the connection information of the established interactive connection between the client A and the service server B is stored in the service server object B, so that the client A, the service server B and the interactive connection object B with corresponding relations are obtained.
Optionally, in this embodiment, the client server group may include, but is not limited to, a combination of a target client and a target service server having service interaction, such as: the client A and the service server B, the service server C and the service server D have service interaction, the client A and the service server B form a client server group 1, the client A and the service server C form a client server group 2, and the client A and the service server D form a client server group 3.
Optionally, in this embodiment, the client server group and the interactive connection object have a corresponding relationship, for example: if the client A and the service server B have service interaction, the client A and the service server B form a client server group 1, the connection information of the established interactive connection between the client A and the service server B is stored in an interactive connection object corresponding to the client server group 1, and under the condition that the client A and the service server B perform service interaction again, the interactive connection object corresponding to the client server group 1 can be uniquely determined through the identification information of the client A and the service server B.
In an exemplary embodiment, the target interactive connection object corresponding to the target client and the target service server may be obtained, but is not limited to, by the following means: searching a target parameter carried by the first network request from a server parameter list corresponding to the target client, wherein the target parameter is a server parameter of the target service server, and the server parameter list records a server parameter of a server which is connected with the target client; and under the condition that the target parameter is found, acquiring an interactive connection object corresponding to the target parameter from the server parameter and the interactive connection object with the corresponding relation as the target interactive connection object.
Optionally, in this embodiment, the server parameter list records server parameters of the service server having service interaction with the target client. Such as: if the target client A requests to perform service interaction with the target service server B, firstly, the server parameter of the target service server B requested by the target client A is searched in the existing server parameter list, and if the server parameter of the target service server B is not found, the fact that the service interaction is not performed before between the target client A and the target service server B can be determined, and the fact that the server parameter with the corresponding relation and the interactive connection object of the target service server B cannot be stored in the interactive connection object can be determined.
For another example: if the target client A requests to perform service interaction with the target service server C, firstly, the server parameter of the target service server C requested by the target client A is searched in the existing server parameter list, and if the server parameter of the target service server C is found, the service interaction performed before the target client A and the target service server C can be determined, and the server parameter with the corresponding relation and the interactive connection object of the target service server C stored in the interactive connection object can be determined.
Optionally, in this embodiment, the target parameter obtained from the first network request may include, but is not limited to, a domain name, a connection port, and the like of the requested target service server.
Optionally, in this embodiment, if the target parameter carried by the first network request is not found from the server parameter list corresponding to the target client, it may be indicated that the target client may request for service interaction with the service server for the first time, so that an interactive connection may be established for the target client and the service server, for example: the target client A requests to perform service interaction with the target service server B, if the domain name and the connection port of the target service server B are not found in the server parameter list corresponding to the target client A, the target client A performs service interaction with the target service server B for the first time, and then the interactive connection between the target client A and the target service server B can be established by establishing an interactive connection object corresponding to the target client A and the target service server B.
In an exemplary embodiment, the target parameter carried by the first network request may be, but is not limited to, searched from a server parameter list corresponding to the target client by the following means: acquiring a server domain name and a connection port from the first network request; and searching the server domain name and the connection port from a server parameter list corresponding to the target client, wherein the target parameter carried by the first network request is determined to be searched under the condition that the server domain name and the connection port are searched.
Alternatively, in this embodiment, the target service server requested by the target client for service interaction may be, but is not limited to, determined by the domain name and the connection port of the service server, and therefore, the service server may be identified by storing the server domain name and the connection port of the service server in the server parameter list.
Optionally, in this embodiment, if the target client requests to perform service interaction with the target service server, the server domain name of the requested target service server may be, but is not limited to, first found in a server parameter list corresponding to the target client, and then, in a case of finding the server domain name of the requested target service server, the connection port of the requested target service server is found in a port corresponding to the found server domain name. Or, but not limited to, first searching for the connection port of the requested target service server in the server parameter list corresponding to the target client, and then searching for the server domain name of the requested target service server in the server domain name corresponding to the searched connection port under the condition that the connection port of the requested target service server is found.
Optionally, in this embodiment, if the target client requests service interaction with the target service server, and under the condition that both the server domain name and the connection port are found in the server parameter list corresponding to the target client, the service server identified by the server domain name and the connection port that are found may be determined as the target service server requested by the first network request.
In an exemplary embodiment, after the step S204, if the target interactive connection object is not obtained, the target interactive connection object may be created for the target client by, but not limited to, the following ways: sending an interactive connection request to the target service server under the condition that the target interactive connection object is not obtained from a client server group and an interactive connection object which have corresponding relations, wherein the interactive connection request is used for requesting to establish interactive connection between the target client and the target service server; acquiring response information returned by the target service server in response to the interactive connection request, wherein the response information is used for indicating that the interactive connection between the target client and the target service server is successfully established; and establishing an initial interactive connection object to store the request configuration information carried in the response information to obtain the target interactive connection object.
Optionally, in this embodiment, if the server domain name and/or the connection port is not found in the server parameter list, it may be determined that the target interactive connection object is not stored in the client server group and the interactive connection object having the corresponding relationship, and the target interactive connection object may be obtained in a creating manner.
Optionally, in this embodiment, the interactive connection request may be, but is not limited to, a request for establishing an interactive connection between the target client and the target service server.
Optionally, in this embodiment, the response information may include, but is not limited to, information of successfully establishing the interactive connection between the target client and the target service server, and a request configuration parameter of the established interactive connection between the target client and the target service server, and the like.
Optionally, in this embodiment, the response information may also, but is not limited to, carry connection configuration information of the interactive connection between the target client and the target service server, and the connection configuration information may also be stored in the initial interactive connection object, so that the obtained connection information of the interactive connection established between the target client and the target service server, which is indicated by the target interactive connection object, includes the request configuration information and the connection configuration information.
Optionally, in this embodiment, the initial interactive connection object corresponding to the target client and the target service server may be established, but is not limited to, by first sending an interactive connection request for requesting establishment of an interactive connection between the target client and the target service server to the target service server, obtaining response information returned by the target service server in response to the interactive connection request, and establishing the initial interactive connection object corresponding to the target client and the target service server when the response information indicates that the requested interactive connection is successfully established.
Optionally, in this embodiment, in a case that the target service server responds to the interactive connection request and successfully establishes the interactive connection object corresponding to the target client and the target service server, request configuration information carried in response information returned by the target service server is stored in the initial interactive connection object, so as to obtain the target interactive connection object.
Optionally, in this embodiment, but not limited to, the established target interactive connection object corresponding to the target client and the target service server may be stored in the client server group and the interactive connection object having the corresponding relationship, and when the target client requests to perform service interaction with the target service server again, the interactive connection object corresponding to the target client and the target service server may be directly obtained through the client server group and the interactive connection object having the corresponding relationship, so that time for re-creating interactive connection is saved, and efficiency of performing service interaction between the target client and the target service server is improved.
In the technical solution provided in step S206, when the target interactive connection object is obtained, the first network request is forwarded to the target service server through the target interactive connection object, so that the target client directly uses the obtained target interactive connection object to forward the first network request to the target service server without re-establishing the interactive connection object with the target service server, thereby improving the interaction efficiency between the client and the service server.
Optionally, in this embodiment, if a target interactive connection object corresponding to a target client and a target service server is obtained, established interactive connection information corresponding to a client server group may be obtained, where the interactive connection information may include, but is not limited to, connection configuration information and request configuration information, where the connection configuration information may include, but is not limited to, network information required to establish an interactive connection between the client and the server.
Optionally, in this embodiment, forwarding the first network request to the target service server through the target interactive connection object may include, but is not limited to, the following two ways: the first mode is that established interactive connection information stored in a target interactive connection object is directly used for forwarding an unprocessed first network request to a target service server; and secondly, performing a series of processing on the first network request to obtain a second network request, and sending the second network request to the target service server through the target interactive connection object.
In an exemplary embodiment, the first network request may be forwarded to the target traffic server by, but is not limited to: extracting a request message from the first network request to obtain a target request message; splicing the target request message with request configuration information included in the target interactive connection object to obtain a second network request, wherein the request configuration information is used for indicating configuration parameters of the network request between the target client and the target service server; and sending the second network request to the target service server.
Optionally, in this embodiment, the request configuration information may include, but is not limited to, Header information stored in the target interactive connection object, such as: app id (Application Identity document, Application identifier), Client Identity document, Token, and the like.
Optionally, in this embodiment, the Header information of the target request packet and the Header information included in the request configuration information may be, but are not limited to, spliced. The splicing order may be, but is not limited to, Header information before Header information after Header information. Alternatively, the Header information may precede the Header information. Or, the Header information and the Header information may be assembled according to a certain rule.
Optionally, in this embodiment, a request packet is extracted from the first network request, the extracted request packet is then spliced with the request configuration information, and the first network request is forwarded in a manner of sending the spliced network request to the target service server, and since configuration parameters of the spliced second network request all conform to the transmission requirement of the network request between the target client and the target service server, the success rate of transmitting the network request between the target client and the target service server can be improved.
Optionally, in this embodiment, the first network request may be, but is not limited to, a network request singleton object sharing one network adaptation module, and may be, but is not limited to, a thread pool and a connection pool. Such as: the first network request initiated by the client a may be but not limited to request an http object 1, an http object 2, and an http object 3, the shared thread pool may be but not limited to include two threads a and b, the shared connection pool may be but not limited to include three connections c, e, and f, when the http object 1 may be but not limited to be acquired through the thread a and the connection c, after the http object 1 is acquired, the remaining unfinished acquired http objects may be but not limited to be acquired through the thread a and the connection c used for acquiring the http object 1, which may not only improve the performance of the network and the reuse rate of network links, but also reduce the consumption of memory.
In an exemplary embodiment, the request packet may be extracted from the first network request, but is not limited to, to obtain the target request packet by: extracting a request message from the first network request as an initial request message; and encrypting the initial request message to obtain an encrypted message as the target request message.
Optionally, in this embodiment, the initial request packet may be encrypted by, but is not limited to, any type of algorithm for encrypting data, so as to obtain the target request packet. Such as: a symmetric Encryption Algorithm, which may include, but is not limited to DES (Data Encryption Standard), 3DES (Triple DES, Triple Data Encryption Algorithm), AES (Advanced Encryption Standard), etc., an asymmetric Encryption Algorithm, which may include, but is not limited to, RSA (RSA Algorithm, RSA Encryption Algorithm), DSA (Digital Signature Algorithm, DSA Encryption Algorithm), etc., and a Hash Algorithm, which may include, but is not limited to, sha-256 Encryption Algorithm (Secure Hash Algorithm), MD5 Encryption Algorithm (MD5 Message-Digest Algorithm, MD5 information Digest Algorithm), etc.
Optionally, in this embodiment, by encrypting the initial request packet, secure encrypted transmission of the first network request is implemented, and the security of service interaction between the target client and the target service server is improved.
In an exemplary embodiment, after the step S206, the data returned by the server may be processed by, but is not limited to, the following ways: receiving service data returned by the target service server in response to the first network request; converting the data format of the service data into a target format to obtain target data, wherein the target format is a data format allowed to be used by the target client; and sending the target data to the target client.
Optionally, in this embodiment, after the target service server obtains the first network request, if the obtained target request packet is encrypted, the target service server may decrypt the target request packet through a decryption algorithm corresponding to the encryption algorithm of the initial request packet, for example: and after the target service server acquires the first network request, decrypting the target request message according to a decryption algorithm matched with the sha-256 encryption algorithm, thereby acquiring the initial request message.
Optionally, in this embodiment, the service interaction requested by the target client and the service data returned by the target service server have a corresponding relationship, for example: the service interaction requested by the target client may include, but is not limited to, picture data interaction, video data interaction, text data interaction, instruction interaction, and the like, and then the service data returned by the target service server may include, but is not limited to, picture data, video data, text data, instruction data, and the like.
Optionally, in this embodiment, the data format allowed to be used by the target client may include, but is not limited to, one or more data formats that the target client can recognize or parse. If the data format allowed to be used by the target client is one, the data format is directly used as the target format. If the data format allowed to be used by the target client is multiple, the data format with the best display effect of the target client can be randomly selected or selected as the target format from the multiple data formats allowed to be used by the target client. The random selection may be, but is not limited to, randomly selecting one of the plurality of data formats allowed for the target client as the target format. If the data format with the best display effect of the target client is selected as the target format, the data format with the best display effect of the target client can be, but is not limited to, the format with the fastest conversion speed, such as: the service data returned by the target service server in response to the first Network request is picture data, a data Format allowed to be used by the target client may include, but is not limited to, JPG (Joint Photographic Experts Group, JEPG Format), TIFF (Tag Image File Format), PNG (Portable Network Graphics), and the like, and if the speed of converting the service data into the JPG Format is fastest, the target Format of the service data may be the JPG Format. For another example: the service data returned by the target service server in response to the first network request is Video data, the data format allowed to be used by the target client may include, but is not limited to, MPEG (Moving Picture Experts Group), AVI (Audio Video Interleaved), MP4(Moving Picture Experts Group 4), and the target format of the service data may be AVI format if the speed of converting the service data into AVI format is fastest.
In an optional implementation manner, a processing procedure of a network request is provided, fig. 3 is a schematic diagram of a processing procedure of a network request according to an embodiment of the present invention, as shown in fig. 3, when a network request initiated by a client is obtained, a specific processing procedure of the network request is shown in steps S301 to S309:
step S301: the APP initiates a first network request.
Step S302: the network adaptation module implements a domain name caching strategy, and specifically, the network adaptation module searches whether a currently requested service server exists in a current server parameter list according to a server domain name and a port of a first network request initiated by a client. If the requested service server is not found, a service server cache object is created for the APP and the service server, and if the requested service server is found, the service server cache object corresponding to the service server (namely, the interactive connection object) is directly returned.
Step S303: the network adaptation module implements a network request Header strategy, and the service server cache object stores Header information required by network request transmission, and the method comprises the following steps: and identity ID information such as AppId, ClientId, Token and the like is used for the service server to carry out identity verification. The network adaptation module carries out unified configuration and assembly on the relevant Header information of each service server and the request message in the first network request, and Header processing of the first network request message is completed.
Step S304: the network adaptation module implements a network signature strategy, extracts a request message from the first network request as an initial request message, and encrypts the obtained initial request message by an encryption algorithm, such as: encrypting the initial request message by using a sha-256 encryption algorithm; the network adaptation module uniformly encrypts the request message of each service server according to a corresponding encryption algorithm to complete the preparation processing work of the request message authentication.
Step S305: the network adaptation module calls a network interface to initiate a first network request, and specifically, the network adaptation module calls a corresponding network interface to initiate the first network request to the service server.
Step S306: and the network adaptation module receives the service data returned by the service server.
Step S307: and the network adaptation module converts the format of the returned service data.
Step S308: and the network adaptation module returns the service data after format conversion to the APP for presentation.
In order to better understand the process of the network request processing method, the following describes an implementation method flow of the network request processing with reference to an optional embodiment, but the invention is not limited to the technical solution of the embodiment of the present invention.
In this embodiment, a method for processing a network request is provided, and fig. 4 is a schematic diagram of a method for processing a network request according to an embodiment of the present invention, as shown in fig. 4, the method may include, but is not limited to, the following steps:
step S401: the method comprises the steps of obtaining a first network request initiated by a target client, wherein the first network request is used for requesting service interaction with a target service server.
Step S402: and searching a target parameter carried by the first network request from a server parameter list corresponding to the target client. If the target parameter is found, step S403 is executed, and if the target parameter is not found, steps S404-S406 are executed.
Step S403: and under the condition that the target parameter is found, acquiring the interactive connection object corresponding to the target parameter from the server parameter and the interactive connection object with the corresponding relation as the target interactive connection object, and executing the step S407.
Step S404: and sending an interactive connection request to the target service server under the condition that the target parameter is not found, wherein the interactive connection request is used for requesting to establish interactive connection between the target client and the target service server.
Step S405: and acquiring response information returned by the target service server in response to the interactive connection request, wherein the response information is used for indicating that the interactive connection between the target client and the target service server is successfully established.
Step S406: and establishing request configuration information carried in the initial interactive connection object storage response information to obtain the target interactive connection object.
Step S407: and forwarding the first network request to the target service server through the target interactive connection object.
Step S408: and receiving the service data returned by the target service server in response to the first network request.
Step S409: and converting the data format of the service data into a target format to obtain target data, wherein the target format is a data format allowed to be used by the target client.
Step S410: and sending the target data to the target client.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Fig. 5 is a block diagram of a device for processing a network request according to an embodiment of the present invention, as shown in fig. 5, including:
a first obtaining module 52, configured to obtain a first network request initiated by a target client, where the first network request is used to request service interaction with a target service server;
a second obtaining module 54, configured to obtain a target interactive connection object corresponding to the target client and the target service server from a client server group and an interactive connection object having a corresponding relationship, where the target interactive connection object is used to indicate connection information of an established interactive connection between the target client and the target service server;
a forwarding module 56, configured to forward the first network request to the target service server through the target interconnection object.
Through the above embodiment, if the first network request initiated by the target client is obtained, the target interactive connection object indicating the connection information of the established interactive connection between the target client and the target service server is obtained from the client server group and the interactive connection object having the corresponding relationship, if the target interactive connection object is obtained, the first network request can be directly forwarded to the target service server through the target interactive connection object, that is, the established interactive connection between the client and the service server is not destroyed after the interaction between the client and the service server, but the connection information of the interactive connection is stored, therefore, when the client and the service server need to interact again, the client does not need to establish the interactive connection with the service server again, the time of the connection establishing process is saved, and the interaction efficiency of the application program and the service server is improved. By adopting the technical scheme, the problems of low interaction efficiency of the application program and the service server and the like in the related technology are solved, and the technical effect of improving the interaction efficiency of the application program and the service server is realized.
In an exemplary embodiment, the second obtaining module includes:
a searching unit, configured to search a server parameter list corresponding to the target client for a target parameter carried by the first network request, where the target parameter is a server parameter of the target service server, and the server parameter list records a server parameter of a server that has established a connection with the target client;
and the obtaining unit is used for obtaining the interactive connection object corresponding to the target parameter from the server parameter and the interactive connection object which have the corresponding relation as the target interactive connection object under the condition that the target parameter is found.
In an exemplary embodiment, the lookup unit is configured to:
acquiring a server domain name and a connection port from the first network request;
and searching the server domain name and the connection port from a server parameter list corresponding to the target client, wherein the target parameter carried by the first network request is determined to be searched under the condition that the server domain name and the connection port are searched.
In an exemplary embodiment, the forwarding module includes:
an extracting unit, configured to extract a request packet from the first network request to obtain a target request packet;
a splicing unit, configured to splice the target request packet and request configuration information included in the target interconnection object to obtain a second network request, where the request configuration information is used to indicate a configuration parameter of the network request between the target client and the target service server;
a sending unit, configured to send the second network request to the target service server.
In an exemplary embodiment, the extracting unit is configured to:
extracting a request message from the first network request as an initial request message;
and encrypting the initial request message to obtain an encrypted message as the target request message.
In one exemplary embodiment, the apparatus further comprises:
the first sending module is used for sending an interactive connection request to the target service server under the condition that the target interactive connection object is not obtained from a client server group and the interactive connection object which have corresponding relations, wherein the interactive connection request is used for requesting to establish interactive connection between the target client and the target service server;
a third obtaining module, configured to obtain response information returned by the target service server in response to the interactive connection request, where the response information is used to indicate that establishment of an interactive connection between the target client and the target service server is successful;
and the storage module is used for establishing an initial interactive connection object to store the request configuration information carried in the response information so as to obtain the target interactive connection object.
In one exemplary embodiment, the apparatus further comprises:
a receiving module, configured to receive service data returned by the target service server in response to the first network request;
the conversion module is used for converting the data format of the service data into a target format to obtain target data, wherein the target format is a data format allowed to be used by the target client;
and the second sending module is used for sending the target data to the target client.
An embodiment of the present invention further provides a storage medium including a stored program, wherein the program executes any one of the methods described above.
Alternatively, in the present embodiment, the storage medium may be configured to store program codes for performing the following steps:
acquiring a first network request initiated by a target client, wherein the first network request is used for requesting service interaction with a target service server;
acquiring a target interactive connection object corresponding to the target client and the target service server from a client server group and an interactive connection object which have a corresponding relation, wherein the target interactive connection object is used for indicating connection information of an established interactive connection between the target client and the target service server;
and forwarding the first network request to the target service server through the target interactive connection object.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
acquiring a first network request initiated by a target client, wherein the first network request is used for requesting service interaction with a target service server;
acquiring a target interactive connection object corresponding to the target client and the target service server from a client server group and an interactive connection object which have a corresponding relation, wherein the target interactive connection object is used for indicating connection information of an established interactive connection between the target client and the target service server;
and forwarding the first network request to the target service server through the target interactive connection object.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for processing a network request, comprising:
acquiring a first network request initiated by a target client, wherein the first network request is used for requesting service interaction with a target service server;
acquiring a target interactive connection object corresponding to the target client and the target service server from a client server group and an interactive connection object which have a corresponding relation, wherein the target interactive connection object is used for indicating connection information of an established interactive connection between the target client and the target service server;
and forwarding the first network request to the target service server through the target interactive connection object.
2. The method of claim 1, wherein obtaining the target interactive connection object corresponding to the target client and the target service server from the client server group and the interactive connection object having the corresponding relationship comprises:
searching a target parameter carried by the first network request from a server parameter list corresponding to the target client, wherein the target parameter is a server parameter of the target service server, and the server parameter list records a server parameter of a server which is connected with the target client;
and under the condition that the target parameter is found, acquiring an interactive connection object corresponding to the target parameter from the server parameter and the interactive connection object with the corresponding relation as the target interactive connection object.
3. The method of claim 2, wherein searching for the target parameter carried by the first network request from a server parameter list corresponding to the target client comprises:
acquiring a server domain name and a connection port from the first network request;
and searching the server domain name and the connection port from a server parameter list corresponding to the target client, wherein the target parameter carried by the first network request is determined to be searched under the condition that the server domain name and the connection port are searched.
4. The method of claim 1, wherein forwarding the first network request to the target business server through the target interworking connection object comprises:
extracting a request message from the first network request to obtain a target request message;
splicing the target request message with request configuration information included in the target interactive connection object to obtain a second network request, wherein the request configuration information is used for indicating configuration parameters of the network request between the target client and the target service server;
and sending the second network request to the target service server.
5. The method of claim 4, wherein extracting a request message from the first network request to obtain a target request message comprises:
extracting a request message from the first network request as an initial request message;
and encrypting the initial request message to obtain an encrypted message as the target request message.
6. The method according to claim 1, wherein after obtaining the target interactive connection object corresponding to the target client and the target service server from the client server group and the interactive connection object having the corresponding relationship, the method further comprises:
sending an interactive connection request to the target service server under the condition that the target interactive connection object is not obtained from a client server group and an interactive connection object which have corresponding relations, wherein the interactive connection request is used for requesting to establish interactive connection between the target client and the target service server;
acquiring response information returned by the target service server in response to the interactive connection request, wherein the response information is used for indicating that the interactive connection between the target client and the target service server is successfully established;
and establishing an initial interactive connection object to store the request configuration information carried in the response information to obtain the target interactive connection object.
7. The method of claim 1, wherein after forwarding the first network request to the target traffic server through the target interworking connection object, the method further comprises:
receiving service data returned by the target service server in response to the first network request;
converting the data format of the service data into a target format to obtain target data, wherein the target format is a data format allowed to be used by the target client;
and sending the target data to the target client.
8. An apparatus for processing a network request, comprising:
the system comprises a first acquisition module, a first service server and a first service module, wherein the first acquisition module is used for acquiring a first network request initiated by a target client, and the first network request is used for requesting service interaction with the target service server;
a second obtaining module, configured to obtain a target interactive connection object corresponding to the target client and the target service server from a client server group and an interactive connection object that have a corresponding relationship, where the target interactive connection object is used to indicate connection information of an established interactive connection between the target client and the target service server;
and the forwarding module is used for forwarding the first network request to the target service server through the target interactive connection object.
9. A computer-readable storage medium, comprising a stored program, wherein the program is operable to perform the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202111243773.9A 2021-10-25 2021-10-25 Processing method and device of network request, storage medium and electronic device Active CN114124891B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111243773.9A CN114124891B (en) 2021-10-25 2021-10-25 Processing method and device of network request, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111243773.9A CN114124891B (en) 2021-10-25 2021-10-25 Processing method and device of network request, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN114124891A true CN114124891A (en) 2022-03-01
CN114124891B CN114124891B (en) 2023-12-19

Family

ID=80376903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111243773.9A Active CN114124891B (en) 2021-10-25 2021-10-25 Processing method and device of network request, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN114124891B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115829702A (en) * 2022-09-28 2023-03-21 睿智合创(北京)科技有限公司 User message transmission method for cloud credit service

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109657128A (en) * 2018-12-20 2019-04-19 北京小米移动软件有限公司 Data query method, apparatus and storage medium
CN111414208A (en) * 2020-03-13 2020-07-14 百度在线网络技术(北京)有限公司 Application program starting method, device and equipment
CN112068818A (en) * 2020-09-04 2020-12-11 中国平安财产保险股份有限公司 Service interaction method and device, computer equipment and storage medium
CN112383632A (en) * 2020-11-17 2021-02-19 珠海大横琴科技发展有限公司 Load balancing method and device
CN112600926A (en) * 2020-12-16 2021-04-02 平安消费金融有限公司 Message pushing method and device and computer readable storage medium
CN113238756A (en) * 2021-07-08 2021-08-10 北京达佳互联信息技术有限公司 Live broadcast service processing method and device, electronic equipment and storage medium
CN113285979A (en) * 2021-04-15 2021-08-20 北京奇艺世纪科技有限公司 Network request processing method, device, terminal and storage medium
CN113285920A (en) * 2021-04-20 2021-08-20 北京奇艺世纪科技有限公司 Service access method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109657128A (en) * 2018-12-20 2019-04-19 北京小米移动软件有限公司 Data query method, apparatus and storage medium
CN111414208A (en) * 2020-03-13 2020-07-14 百度在线网络技术(北京)有限公司 Application program starting method, device and equipment
CN112068818A (en) * 2020-09-04 2020-12-11 中国平安财产保险股份有限公司 Service interaction method and device, computer equipment and storage medium
CN112383632A (en) * 2020-11-17 2021-02-19 珠海大横琴科技发展有限公司 Load balancing method and device
CN112600926A (en) * 2020-12-16 2021-04-02 平安消费金融有限公司 Message pushing method and device and computer readable storage medium
CN113285979A (en) * 2021-04-15 2021-08-20 北京奇艺世纪科技有限公司 Network request processing method, device, terminal and storage medium
CN113285920A (en) * 2021-04-20 2021-08-20 北京奇艺世纪科技有限公司 Service access method, device, equipment and storage medium
CN113238756A (en) * 2021-07-08 2021-08-10 北京达佳互联信息技术有限公司 Live broadcast service processing method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115829702A (en) * 2022-09-28 2023-03-21 睿智合创(北京)科技有限公司 User message transmission method for cloud credit service

Also Published As

Publication number Publication date
CN114124891B (en) 2023-12-19

Similar Documents

Publication Publication Date Title
CN108989848B (en) Video resource file acquisition method and management system
US11303431B2 (en) Method and system for performing SSL handshake
CN108600376B (en) Data transmission method and device based on LoRa, LoRa gateway, system and storage medium
CN107483383B (en) Data processing method, terminal, background server and storage medium
CN111787517A (en) Method and device for binding activation of intelligent equipment
CN102833253A (en) Method and server for establishing safe connection between client and server
EP4210297A1 (en) Edge application discovery method and apparatus, and edge application service support method and apparatus
CN109067739B (en) Communication data encryption method and device
CN113596191A (en) Data processing method, network element equipment and readable storage medium
CN105959281B (en) File encryption transmission method and device
EP2521311A1 (en) Resource control method, apparatus and system in peer-to-peer network
US11323527B2 (en) Data distribution system, method and computer-readable storage medium
EP2701447A1 (en) A method for establishing a wireless network by means of a content identifier
WO2021227254A1 (en) Routing access method and apparatus, electronic device, and storage medium
CN110290192B (en) Block chain-based data distributed storage and data acquisition method and device
CN114124891B (en) Processing method and device of network request, storage medium and electronic device
CN116471586A (en) Data processing method, device and readable storage medium
CN114430496B (en) Cross-equipment video searching method and related equipment
CN116830525A (en) Data transmission method, device, system, electronic equipment and readable medium
CN111797417A (en) File uploading method and device, storage medium and electronic device
CN111200492A (en) Quantum encryption method, device and equipment
CN111163466A (en) Method for 5G user terminal to access block chain, user terminal equipment and medium
JP6369094B2 (en) Information sharing system
US7814168B2 (en) Unit-to-unit data exchange system, and unit, exchange completion data keeping device and program for use in the same
CN116827619A (en) Method, apparatus and computer readable medium for preventing HTTP amplification attacks

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