CN114124891B - Processing method and device of network request, storage medium and electronic device - Google Patents

Processing method and device of network request, storage medium and electronic device Download PDF

Info

Publication number
CN114124891B
CN114124891B CN202111243773.9A CN202111243773A CN114124891B CN 114124891 B CN114124891 B CN 114124891B CN 202111243773 A CN202111243773 A CN 202111243773A CN 114124891 B CN114124891 B CN 114124891B
Authority
CN
China
Prior art keywords
target
server
service server
client
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.)
Active
Application number
CN202111243773.9A
Other languages
Chinese (zh)
Other versions
CN114124891A (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

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

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 with corresponding relations, wherein the target interactive connection object is used for indicating connection information of established interactive connection between the target client and the target service server; 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

Processing method and device of network request, storage medium and electronic device
Technical Field
The present invention relates to the field of communications, and in particular, to a method and apparatus for processing a network request, a storage medium, and an electronic device.
Background
With the development of the internet, APP (Application) has become one of important terminal operation means, and interaction with a service server is also becoming more and more intimate. On the one hand, the number of service servers interacting with APP increases significantly; on the other hand, the interaction frequency of APP with service servers is also increasing. In the prior art, under the condition that the 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, it needs to reestablish the network connection with the service server. The interaction efficiency of the APP and the service server is greatly reduced, and the high-frequency network request scene of the user is difficult to meet.
Aiming at the problems of low interaction efficiency of application programs and service servers and the like in the related technology, no effective solution is proposed yet.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing a network request, a storage medium and an electronic device, which are used for at least solving the problems of low interaction efficiency between an application program and a service server and the like in the related technology.
According to an embodiment of the present invention, there is provided a method for processing a network request, 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 with corresponding relations, wherein the target interactive connection object is used for indicating connection information of established interactive connection between the target client and the target service server;
forwarding the first network request to the target service server through the target interactive connection object.
Optionally, the obtaining, from a client server group and an interactive connection object having a corresponding relationship, a target interactive connection object corresponding to the target client and the target service server 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 server parameters 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 the target parameter carried by the first network request from the server parameter list corresponding to the target client includes:
obtaining 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 both searched.
Optionally, forwarding, by the target interactive connection object, the first network request to the target service server 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 message from the first network request to obtain a target request message includes:
extracting a request message from the first network request as an initial request message;
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 with 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 acquired from the client server group and the interactive connection object which have the corresponding relation, wherein the interactive connection request is used for requesting to establish interactive connection between the target client and the target service server;
obtaining 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, and storing 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 interactive connection 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 which allows the target client to use;
and sending the target data to the target client.
According to another embodiment of the present invention, there is also provided a processing apparatus for a network request, including: the first acquisition module is used for acquiring a first network request initiated by the target client, wherein the first network request is used for requesting service interaction with the target service server;
the second acquisition module is used for acquiring target interactive connection objects corresponding to the target client and the target service server from a client server group and the interactive connection objects which have corresponding relations, wherein the target interactive connection objects are used for indicating connection information of 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 yet another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-described network request processing method when run.
According to still another aspect of the embodiments of the present invention, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the method for processing a network request according to the above-mentioned computer program.
In the embodiment of the invention, a first network request initiated by a target client is acquired, wherein the first network request is used for requesting service interaction with a target service server; acquiring target interactive connection objects corresponding to a target client and a target service server from a client server group and the interactive connection objects with corresponding relations, wherein the target interactive connection objects are used for indicating connection information of 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, namely, if the first network request initiated by the target client is acquired, acquiring the target interactive connection object indicating the connection information of the established interactive connection between the target client and the target service server from the client server group and the interactive connection object with corresponding relations, and if the target interactive connection object is acquired, forwarding the first network request to the target service server directly through the target interactive connection object, namely, the established interactive connection between the client and the service server is not destroyed after the interaction of the client and the service server, and the connection information of the interactive connection is stored, so that the client does not need to re-establish the interactive connection with the service server when the client and the service server need to interact again, the time of a connection establishment process is saved, and the interaction efficiency of an 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 do not constitute a limitation on the invention. In the drawings:
fig. 1 is a hardware block diagram of a computer terminal of a processing method of a network request 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 process for processing a network request 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 that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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 embodiments provided by the embodiments of the present invention may be performed in a computer terminal, or a similar computing device. Taking the example of running on a computer terminal, fig. 1 is a block diagram of a hardware structure of a computer terminal of a method for processing a network request according to an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and in one exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, a computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than the equivalent functions shown in FIG. 1 or more than the functions shown in FIG. 1.
The memory 104 may be used to store computer programs, such as software programs of application software and modules, such as computer programs corresponding to the method for processing network requests in the embodiment of the present invention, and the processor 102 executes the computer programs stored in the memory 104 to perform various functional applications and data processing, that is, implement the method described above. 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 remotely located relative to the processor 102, which may be connected to the computer terminal via 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 means 106 is arranged to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In this embodiment, a method for processing a network request is provided and 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, where 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 with a corresponding relation, wherein the target interactive connection object is used for indicating connection information of 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 acquired, the target interactive connection object indicating the connection information of the established interactive connection between the target client and the target service server is acquired from the client server group and the interactive connection object with the corresponding relation, if the target interactive connection object is acquired, 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 of the client and the service server, but the connection information of the interactive connection is stored, so that the client does not need to re-establish the interactive connection with the service server when the client and the service server need to interact again, the time of a connection establishment process is saved, and the interaction efficiency of an 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.
Alternatively, in this embodiment, the method for processing a network request may be applied to the target client, or may be applied to a functional module or a device disposed between the target client and the target service server, for example: a network adaptation module may be disposed between the target client and the target service server, where the network adaptation module is at least configured to implement the method for processing a network request.
In the technical solution provided in step S202, the step of obtaining the first network request initiated by the target client may be, but not limited to, implemented in different manners during the process of executing the processing method of the network request by different execution subjects. Such as: in the case where the execution subject is a target client, the first network request acquired by the target client may be, but is not limited to, 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, but is not limited to, obtain the first network request by receiving the first network request sent by the target client.
Optionally, in this embodiment, the service interaction may, but is not limited to, data interaction or instruction interaction between the client and the service server, and the like, where the data interaction may, but is not limited to, include: uploading or downloading of picture data, uploading or downloading of video data, uploading or downloading of text data, and the like.
Alternatively, in the present embodiment, the target client may include, but is not limited to, a package installed on the user device by an application, which may include, but is not limited to, a game application, an instant messaging application, a multimedia application, a live application, and the like.
Alternatively, in this embodiment, the target service server may, but is not limited to, include a server device deployed in the background by an application, which may provide service for a package in which the application is installed on a user device, and the service provided by the target service server may, but is not limited to, include transaction service, search service, and so on.
In the solution provided in step S204, the corresponding relationship between the client server group and the interactive connection object may determine the target interactive connection object corresponding to the target client and the target service server, where the interactive connection object may be, but is not limited to, connection information for storing the established interactive connection, the connection information may be, but is not limited to, connection configuration information and request configuration information required for establishing the interactive connection between the target client and the target service server, the request configuration information may be, but is not limited to, network requests for establishing the connection to allow transmission (e.g., identity information of each of the client and the server, format requirements of the network requests, etc.), and the connection configuration information may be, but is not limited to, network information required for establishing the connection (e.g., network bandwidth, transmission protocol, network resources, etc.).
Such as: the request configuration information may, but is not limited to, include identity information of the client, and the connection configuration information may, but is not limited to, include: 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 so on.
Alternatively, in the present embodiment, each of the interactive connection objects may be implemented, but is not limited to, by a service server cache object built on a service server. Such as: and constructing a service server cache object serving as an interactive connection object on the service server, constructing the service server object in the service server cache object, and storing connection information of the established interactive connection between the client and the service server into the service server object, so that the interactive connection object stores the connection information of the established interactive connection.
Such as: and if the client A and the service server B have service interaction, constructing a service server cache object B for a client server group formed by the client A and the service server B to serve as an interactive connection object B, constructing a service server object B in the service server cache object B, and storing connection information of the established interactive connection between the client A and the service server B into the service server object B so as to obtain the client A with a corresponding relation, wherein the service server B and the interactive connection object B.
Alternatively, 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 a service interaction, such as: and when 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, there is a correspondence between the client server group and the interactive connection object, 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, connection information of 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 the interactive connection object corresponding to the client server group 1 can be uniquely determined through identification information of the client A and the service server B under the condition that the client A and the service server B perform service interaction again.
In one 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: 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 server parameters 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, server parameters of a service server having a service interaction with the target client are recorded in the server parameter list. Such as: if the target client A requests to perform service interaction with the target service server B, firstly, searching the server parameters of the target service server B requested by the target client A in the existing server parameter list, and if the server parameters of the target service server B are not found, determining that the target client A does not perform service interaction before the target client A and the target service server B, and determining that the server parameters with corresponding relations and the interactive connection objects of the interactive connection objects do not store the interactive connection objects of the target service server B.
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 fact that the target client A performs service interaction with the target service server C before the target client A is determined, and therefore the server parameter with a corresponding relation and the interactive connection object in which the target service server C is stored in the interactive connection object can be determined.
Alternatively, in the present embodiment, the target parameters obtained from the first network request may include, but are not limited to, parameters including 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 stated that the target client may be the first request to perform service interaction with the service server, so that an interaction connection may be established between the target client and the service server, for example: and the target client A requests to perform service interaction with the target service server B, and 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 is described as performing service interaction with the target service server B for the first time, and the interactive connection of the target client A and the target service server B can be established by creating interactive connection objects corresponding to the target client A and the target service server B.
In one exemplary embodiment, the target parameter carried by the first network request may be, but is not limited to, searched from the server parameter list corresponding to the target client in the following manner: obtaining 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 both searched.
Alternatively, in this embodiment, the target service server requested by the target client for service interaction may be determined by, but not limited to, a domain name and a connection port of the service server, and thus, the service server may be identified in the server parameter list by storing the server domain name and the connection port of the service server.
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 searched in the server parameter list corresponding to the target client, and if the server domain name of the requested target service server is found, the connection port of the requested target service server is found in the ports corresponding to the found server domain name. Or, but not limited to, searching for the connection port of the requested target service server in the server parameter list corresponding to the target client, and searching for the server domain name of the requested target service server in the server domain name corresponding to the searched connection port when the connection port of the requested target service server is searched for.
Optionally, in this embodiment, if the target client requests to perform service interaction with the target service server, and if both the server domain name and the connection port are found in the server parameter list corresponding to the target client, the found server domain name and the service server identified by the connection port may be determined as the target service server requested by the first network request.
In one exemplary embodiment, after step S204 described above, if the target interactive connection object is not acquired, the target interactive connection object may be created for the target client by, but is not limited to: sending an interactive connection request to the target service server under the condition that the target interactive connection object is not acquired from the client server group and the interactive connection object which have the corresponding relation, wherein the interactive connection request is used for requesting to establish interactive connection between the target client and the target service server; obtaining 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, and storing request configuration information carried in the response information to obtain the target interactive connection object.
Alternatively, in the present embodiment, if the server domain name is not found in the server parameter list and/or the connection port is determined that the target interactive connection object is not stored in the client server group and the interactive connection object having the correspondence, the target interactive connection object may be acquired by way of creation.
Alternatively, in the present embodiment, the interactive connection request may be, but not limited to, for requesting establishment of an interactive connection between the target client and the target service server.
Alternatively, in the present embodiment, the response information may include, but is not limited to, information that successfully establishes an interactive connection between the target client and the target service server, 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, but is not limited to, carry connection configuration information of an interactive connection between the target client and the target service server, where the connection configuration information may also be stored in the initial interactive connection object, so that connection information of an established interactive connection between the target client and the target service server indicated by the obtained target interactive connection object includes the above-mentioned request configuration information and connection configuration information.
Optionally, in this embodiment, the initial interactive connection object corresponding to the target client and the target service server may be, but not limited to, established by first sending an interactive connection request for requesting to establish 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 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, the request configuration information carried in the 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, the target interactive connection object corresponding to the established target client and the target service server may be, but not limited to, stored in a client server group and an interactive connection object having a 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 a corresponding relationship, so that the time of re-creating the interactive connection is omitted, and the 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 does not need to establish the interactive connection object with the target service server again, and the obtained target interactive connection object is directly used to forward the first network request to the target service server, thereby improving the interaction efficiency of the client and the service server.
Optionally, in this embodiment, if the target interactive connection object corresponding to the target client and the target service server is acquired, the established interactive connection information corresponding to the client server group may be acquired, where the interactive connection information may include, but is not limited to, connection configuration information and request configuration information, and the connection configuration information may include, but is not limited to, network information required for establishing 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: in a first mode, directly using established interactive connection information stored in a target interactive connection object, 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 then sending the second network request to the target service server through the target interactive connection object.
In one 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.
Alternatively, in the present embodiment, the request configuration information may include, but is not limited to, header information stored in the target interactive connection object, such as: appId (Application Identity document, application identifier), clientId (Client Identity document, client identifier), token, etc.
Alternatively, in this embodiment, header information of the target request packet and Header information included in the request configuration information may be spliced, but not limited to. The splice order may be, but is not limited to, header information preceding and Header information following. Alternatively, header information may precede and Header information may follow. Alternatively, header information and Header information may be assembled according to a certain rule.
Optionally, in this embodiment, the request packet is extracted from the first network request, then the extracted request packet is spliced with the request configuration information, and the first network request is forwarded in a manner that the spliced network request is sent to the target service server.
Alternatively, in this embodiment, the first network request may be, but not limited to, a network request singleton object sharing a network adaptation module, and may be, but not limited to, sharing a thread pool and a connection pool. Such as: the first network request initiated by the client a may be, but is not limited to, an http object 1, an http object 2 and an http object 3, the shared thread pool may be, but is not limited to, include two threads a and b, the shared connection pool may be, but is not limited to, include three connections c, e and f, when the http object 1 may be, but is not limited to, acquired by the thread a and the connection c, and after the acquisition of the http object 1 is completed, the rest of the incompletely acquired http objects may be, but is not limited to, completed by the thread a and the connection c used for acquiring the http object 1, which not only can improve the network performance and the multiplexing rate of the network link, but also can reduce the memory consumption.
In an exemplary embodiment, the request message may be extracted from the first network request by, but not limited to, the following way to obtain the target request message: extracting a request message from the first network request as an initial request message; encrypting the initial request message to obtain an encrypted message as the target request message.
Alternatively, in this embodiment, the initial request message may be encrypted by any type of algorithm for encrypting data, to obtain the target request message. Such as: symmetric encryption algorithms, asymmetric encryption algorithms, and hash algorithms, etc., which may include, but are not limited to, DES (Data Encryption Standard ), 3DES (Triple DES, triple data encryption Algorithm), AES (Advanced Encryption Standard, block encryption standard), etc., asymmetric encryption algorithms may include, but are not limited to, RSA (RSA Algorithm, RSA encryption Algorithm), DSA (Digital Signature Algorithm, DSA encryption Algorithm), etc., hash algorithms may include, but are not limited to, sha-256 encryption algorithms (Secure Hash Algorithm ), MD5 encryption algorithms (MD 5 Message-Digest algorism), etc.
Optionally, in this embodiment, by encrypting the initial request packet, secure encrypted transmission of the first network request is achieved, and security of service interaction between the target client and the target service server is improved.
In an exemplary embodiment, after step S206 described above, the data returned by the server may be processed, but is not limited to, by: 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 which allows the target client to use; 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 request packet may be decrypted by a decryption algorithm corresponding to the encryption algorithm of the initial request packet, for example: the initial request message is encrypted through a sha-256 encryption algorithm to obtain a target request message, and after the target service server obtains the first network request, the target request message is decrypted according to a decryption algorithm matched with the sha-256 encryption algorithm to obtain 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, etc., 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, etc.
Alternatively, in the present embodiment, the data format that the target client is allowed to use may include, but is not limited to, a data format that one or more target clients can recognize or parse. If the data format that the target client is allowed to use is one, then that format is directly used as the target format. If the data format that the target client is allowed to use is multiple, the data format that the target client has the best display effect may be selected or selected as the target format at random from the above multiple data formats that the target client is allowed to use. The random selection may be, but is not limited to, randomly selecting a data format from among the plurality of data formats allowed to be used by the target client as the target format. If the data format with the best target client display effect is selected as the target format, the data format with the best target client display effect may 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, and the data format that the target client is allowed to use may include, but is not limited to, JPG (Joint Photographic Experts Group, JEPG format), TIFF (Tag Image File Format ), PNG (Portable Network Graphics, portable network picture), etc., and if the speed of converting the service data into the JPG format is the fastest, the target format of the service data may be the JPG format. And, for example: the service data returned by the target service server in response to the first network request is video data, which allows the target client to use a data format that may include, but is not limited to, MPEG (Moving Picture Experts Group ), AVI (Audio Video Interleaved, audio video interleave), MP4 (Moving Picture Experts Group 4, moving picture experts group), etc., and may be an AVI format if the speed of converting the service data into the AVI format is the fastest.
In an alternative 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, where, as shown in fig. 3, in a case where a network request initiated by a client is acquired, specific processing procedures of the network request are 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 policy, 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 (i.e. the interactive connection object) corresponding to the service server is directly returned.
Step S303: the network adaptation module implements a network request Header policy, and the service server cache object stores Header information required for transmitting the network request, including: and (3) identity ID information such as AppId, clientId, token and the like is used for the identity verification of the service server. And the network adaptation module performs unified configuration and assembly on the relevant Header information of each service server and the request message in the first network request to complete the Header processing of the first network request message.
Step S304: the network adaptation module implements a network signature strategy, extracts a request message from a first network request as an initial request message, and encrypts the obtained initial request message through an encryption algorithm, for example: 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 finish the preparation processing work of the authentication of the request message.
Step S305: the network adaptation module invokes a network interface to initiate a first network request, and specifically, the network adaptation module invokes 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: the network adaptation module converts the format of the returned service data.
Step S308: and the network adaptation module returns the business data after the format conversion to the APP for presentation.
In order to better understand the process of the network request processing method, the following describes the implementation method flow of the network request processing in combination with the alternative embodiment, but 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: and acquiring a first network request initiated by the target client, wherein the first network request is used for requesting service interaction with the target service server.
Step S402: and searching the target parameters carried by the first network request from the server parameter list corresponding to the target client. If the target parameter is found, step S403 is performed, and if the target parameter is not found, steps S404 to S406 are performed.
Step S403: if the target parameter is found, the interactive connection object corresponding to the target parameter is obtained from the server parameter and the interactive connection object having the corresponding relationship as the target interactive connection object, and step S407 is performed.
Step S404: and sending an interactive connection request to the target service server under the condition that the target parameters are 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 obtaining 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 a 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 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 which is allowed to be used by a target client.
Step S410: and sending the target data to the target client.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present invention.
Fig. 5 is a block diagram of a network request processing apparatus 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 a service interaction with a target service server;
a second obtaining module 54, configured to obtain, from a client server group and an interactive connection object that have a corresponding relationship, a target interactive connection object corresponding to the target client and the target service server, 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 interactive connection 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 forwarded to the target service server directly 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, so that when the client and the service server need to interact again, the client does not need to re-create the interactive connection between the service server, the time of the connection creation 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 acquisition module includes:
the searching unit is used for searching the 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 the server parameter of a server which is connected with the target client;
and the acquisition unit is used for 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 under the condition that the target parameter is found.
In an exemplary embodiment, the search unit is configured to:
obtaining 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 both searched.
In an exemplary embodiment, the forwarding module includes:
The extraction unit is used for extracting a request message from the first network request to obtain a target request message;
a splicing unit, configured to splice the target request packet with request configuration information included in the target interactive connection object to obtain a second network request, where the request configuration information is used to indicate configuration parameters of a network request between the target client and the target service server;
and the sending unit is used for sending 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;
encrypting the initial request message to obtain an encrypted message as the target request message.
In an 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 acquired from the client server group and the interactive connection object which have the corresponding relation, wherein the interactive connection request is used for requesting to establish interactive connection between the target client and the target service server;
The third acquisition module is used for 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 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 an exemplary embodiment, the apparatus further comprises:
the receiving module is used for receiving 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 which allows the target client to use;
and the second sending module is used for sending the target data to the target client.
An embodiment of the present invention also provides a storage medium including a stored program, wherein the program executes the method of any one of the above.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
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 with corresponding relations, wherein the target interactive connection object is used for indicating connection information of established interactive connection between the target client and the target service server;
forwarding the first network request to the target service server through the target interactive connection object.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described 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 with corresponding relations, wherein the target interactive connection object is used for indicating connection information of established interactive connection between the target client and the target service server;
forwarding the first network request to the target service server through the target interactive connection object.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

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;
the method comprises the steps of obtaining target interactive connection objects corresponding to a target client and the target service server from a client server group and interactive connection objects with corresponding relations, wherein the target interactive connection objects are used for indicating connection information of established interactive connection between the target client and the target service server, and obtaining target interactive connection objects corresponding to the target client and the target service server from the client server group and interactive connection objects with corresponding relations, and the method comprises the following steps: 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, the server parameter list records server parameters of a server which is connected with the target client, and the target parameter comprises a domain name and a connection port of the requested target service server; under the condition that the target parameter is found, acquiring an interactive connection object corresponding to the target parameter from a server parameter and an interactive connection object which have corresponding relations as the target interactive connection object;
Forwarding the first network request to the target service server through the target interactive connection object, wherein forwarding the first network request to the target service server through the target interactive connection 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.
2. The method of claim 1, wherein searching for the target parameter carried by the first network request from the server parameter list corresponding to the target client comprises:
obtaining 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 both searched.
3. The method of claim 1, wherein extracting the request message from the first network request to obtain the target request message comprises:
extracting a request message from the first network request as an initial request message;
encrypting the initial request message to obtain an encrypted message as the target request message.
4. The method of 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 correspondence, 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 acquired from the client server group and the interactive connection object which have the corresponding relation, wherein the interactive connection request is used for requesting to establish interactive connection between the target client and the target service server;
obtaining 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, and storing request configuration information carried in the response information to obtain the target interactive connection object.
5. The method of claim 1, wherein after forwarding the first network request to the target traffic server through the target interactive 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 which allows the target client to use;
and sending the target data to the target client.
6. A processing apparatus for processing a network request, comprising:
the first acquisition module is used for acquiring a first network request initiated by the target client, wherein the first network request is used for requesting service interaction with the target service server;
the second acquisition module is used for acquiring target interactive connection objects corresponding to the target client and the target service server from a client server group and the interactive connection objects which have corresponding relations, wherein the target interactive connection objects are used for indicating connection information of established interactive connection between the target client and the target service server;
The second obtaining module is further 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, a server parameter of a server that has established a connection with the target client is recorded in the server parameter list, and the target parameter includes a domain name and a connection port of the requested target service server; under the condition that the target parameter is found, acquiring an interactive connection object corresponding to the target parameter from a server parameter and an interactive connection object which have corresponding relations as the target interactive connection object;
the forwarding module is used for forwarding the first network request to the target service server through the target interactive connection object;
the forwarding module is further configured to extract a request packet from the first network request, to obtain a target request packet; 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.
7. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any of the preceding claims 1 to 5.
8. 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 according to any of the claims 1 to 5 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 CN114124891A (en) 2022-03-01
CN114124891B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115829702B (en) * 2022-09-28 2023-07-25 睿智合创(北京)科技有限公司 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

Also Published As

Publication number Publication date
CN114124891A (en) 2022-03-01

Similar Documents

Publication Publication Date Title
EP3550892B1 (en) Method for network slice selection, user equipment, and network device
US11303431B2 (en) Method and system for performing SSL handshake
CN107483383B (en) Data processing method, terminal, background server and storage medium
CN108737476B (en) Cloud storage system, media data storage method and system
EP2521311A1 (en) Resource control method, apparatus and system in peer-to-peer network
CN111786867B (en) Data transmission method and server
CN105959281B (en) File encryption transmission method and device
EP3849200A1 (en) Data distribution system and method, and computer readable storage medium
CN110417632B (en) Network communication method, system and server
CN114124891B (en) Processing method and device of network request, storage medium and electronic device
CN114157607A (en) Media stream transmission method and system
CN110290192B (en) Block chain-based data distributed storage and data acquisition method and device
CN110909030B (en) Information processing method and server cluster
CN112838925A (en) Data transmission method, device and system, electronic equipment and storage medium
CN107135190B (en) Data flow attribution identification method and device based on transport layer secure connection
WO2021227254A1 (en) Routing access method and apparatus, electronic device, and storage medium
JP7209593B2 (en) Relay method, relay system, and relay program
CN111786870B (en) Data transmission method and strongswan server
CN111030914A (en) Data transmission method and data transmission system
CN112153001B (en) WAF-based network communication method, WAF-based network communication system, electronic device and storage medium
CN112822241A (en) Method and device for realizing APP dynamic cache based on HTTPS protocol
CN111163466A (en) Method for 5G user terminal to access block chain, user terminal equipment and medium
CN112333540B (en) Method and device for determining video encryption length
CN116827619A (en) Method, apparatus and computer readable medium for preventing HTTP amplification attacks
CN114745372A (en) File sending method and related equipment

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