CN110650214A - Agent method, device, electronic equipment and storage medium - Google Patents

Agent method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110650214A
CN110650214A CN201911003350.2A CN201911003350A CN110650214A CN 110650214 A CN110650214 A CN 110650214A CN 201911003350 A CN201911003350 A CN 201911003350A CN 110650214 A CN110650214 A CN 110650214A
Authority
CN
China
Prior art keywords
source station
target
delay data
station server
network
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
CN201911003350.2A
Other languages
Chinese (zh)
Other versions
CN110650214B (en
Inventor
肖庆伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Knownsec Information Technology Co Ltd
Original Assignee
Beijing Knownsec Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Knownsec Information Technology Co Ltd filed Critical Beijing Knownsec Information Technology Co Ltd
Priority to CN201911003350.2A priority Critical patent/CN110650214B/en
Publication of CN110650214A publication Critical patent/CN110650214A/en
Application granted granted Critical
Publication of CN110650214B publication Critical patent/CN110650214B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/567Integrating service provisioning from a plurality of service providers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/562Brokering proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a proxy method, a proxy device, an electronic device and a storage medium, wherein the proxy method is applied to a proxy server, and the proxy method comprises the following steps: receiving a resource request sent by terminal equipment; determining one source station server in a plurality of source station servers as a target source station server according to network delay data of the plurality of source station servers for providing resources; sending a resource request to a target source station server so that the target source station server sends a target resource corresponding to the resource request; and if the target resource sent by the target source station server is received, sending the target resource to the terminal equipment. In the implementation process, the target source station server is determined through network delay data in real time, and then the access process from the terminal equipment to the target source station server is proxied, so that the condition that the speed of the terminal equipment for requesting the target resource in the target source station server is unstable is effectively avoided.

Description

Agent method, device, electronic equipment and storage medium
Technical Field
The present application relates to the technical field of computer data interaction, and in particular, to a proxy method, apparatus, electronic device, and storage medium.
Background
The Proxy Server (Proxy Server) functions to Proxy network users to obtain network information. The proxy server is a transfer station of network information, is an intermediate proxy mechanism between a personal network and an Internet service provider, and is responsible for forwarding legal network information, controlling and registering forwarding.
When the proxy server is used for carrying out proxy on the process of accessing the source station server by the terminal equipment, the process of accessing the source station server by the terminal equipment is found out by using a proxy rule which is configured in the proxy server in advance. When the network between the proxy server and the source station server changes (for example, network jitter, which refers to the change of routing information when a certain network unit in the network is blocked or fails), the speed of the terminal device obtaining the target resource of the source station server through the proxy server is unstable.
Disclosure of Invention
An object of the embodiments of the present application is to provide a proxy method, an apparatus, an electronic device, and a storage medium, which are used to solve the problem that the speed of a terminal device obtaining a target resource of a source station server through a proxy server is unstable.
The embodiment of the application provides a proxy method, which is applied to a proxy server and comprises the following steps: receiving a resource request sent by terminal equipment; determining one source station server in a plurality of source station servers as a target source station server according to network delay data of the source station servers for providing resources; sending the resource request to the target source station server so that the target source station server sends a target resource corresponding to the resource request; and if the target resource sent by the target source station server is received, sending the target resource to the terminal equipment. In the implementation process, the target source station server is determined through network delay data in real time, and then the access process from the terminal equipment to the target source station server is proxied, so that the condition that the speed of the terminal equipment for requesting the target resource in the target source station server is unstable is effectively avoided.
Optionally, in this embodiment of the present application, the sending the resource request to the target source station server further includes: and if the target resource sent by the target source station server is not received within a preset time range, returning to execute the step of determining one source station server in the plurality of source station servers as the target source station server according to the network delay data of the plurality of source station servers providing the resource. In the implementation process, the proxy server is enabled to reselect the target source station server under the condition that the target resource sent by the target source station server is not received within the preset time range, so that the condition that the proxy fails due to no response of the target server is avoided.
Optionally, in this embodiment of the present application, the determining, according to network delay data of a plurality of source station servers that provide resources, one source station server in the plurality of source station servers as a target source station server includes: determining a grouping threshold based on network delay data for the plurality of source station servers; dividing the plurality of source station servers into a first source group and a second source group according to the grouping threshold, wherein the first source group comprises at least one first source station server, the second source group comprises at least one second source station server, and the network delay data of the first source station servers are all smaller than the network delay data of the second source station servers; determining the target source station server from the at least one first source station server. In the implementation process, the plurality of source station servers are grouped according to network delay, so that the target source station server is always determined from the at least one first source station server, and the determined target source station server is accessed by the terminal device for acting, so that the speed of determining the target source station server is increased, and the speed of acquiring the target resource by the terminal device is also increased.
Optionally, in this embodiment of the present application, the determining a packet threshold according to the network delay data of the plurality of source station servers includes: determining a maximum value of the network delay data of the plurality of source station servers as maximum delay data; determining a minimum value of the network delay data of the plurality of source station servers as minimum delay data; determining the grouping threshold based on the maximum delay data and the minimum delay data. In the implementation process, the grouping threshold is determined according to the plurality of network delay data, and then the target source station server is determined to perform proxy according to the grouping threshold, so that the condition that the speed of acquiring the target resource by the terminal equipment is unstable due to the change of the network is avoided.
Optionally, in this embodiment of the present application, before determining the packet threshold according to the network delay data of the plurality of source station servers, the method further includes: obtaining a real-time delay data and at least one historical delay data for each source site server of the plurality of source site servers; determining the network delay data of each source station server according to the real-time delay data and the at least one historical delay data, and obtaining the network delay data of the plurality of source station servers. In the implementation process, the network delay data is determined through the historical delay data and the real-time delay data, and then the target source station server is determined according to the network delay data, so that the problem of unstable access caused by network jitter, namely the change of routing information when a certain network unit in a network is blocked or fails, is avoided.
Optionally, in this embodiment of the present application, the obtaining of one real-time delay data of each source station server of the plurality of source station servers includes: sending a network request to each source station server, wherein the network request is used for enabling each source station server to send a network response corresponding to the network request; and determining the real-time delay data of each source station server according to the network requests of the source station servers and the network responses corresponding to the network requests. In the implementation process, the network delay of a plurality of source station servers is obtained in real time, so that the problem of unstable access caused by network jitter, namely the change of routing information when a certain network unit in a network is blocked or fails, is avoided.
Optionally, in this embodiment of the present application, before the sending the resource request to the target source station server, the method further includes: obtaining the network type of the terminal equipment; and if the network type of the terminal equipment is different from that of the target source station server, returning to execute the step of determining one source station server in the plurality of source station servers as the target source station server according to the network delay data of the plurality of source station servers providing resources. In the implementation process, the source station server with the network type different from that of the terminal equipment is eliminated, so that the network type of the source station server and the network type of the terminal server are ensured to be the same network type, and the speed of the terminal equipment for requesting the target resource in the target source station server is effectively improved.
An embodiment of the present application further provides a proxy apparatus, which is applied to a proxy server, and includes: the request receiving module is used for receiving a resource request sent by the terminal equipment; the system comprises a target determining module, a resource determining module and a resource determining module, wherein the target determining module is used for determining one source station server in a plurality of source station servers as a target source station server according to network delay data of the source station servers for providing resources; a request sending module, configured to send the resource request to the target source station server, so that the target source station server sends a target resource corresponding to the resource request; and the resource sending module is used for sending the target resource to the terminal equipment if the target resource sent by the target source station server is received.
Optionally, in an embodiment of the present application, the method further includes: a first executing module, configured to, if the target resource sent by the target source station server is not received within a preset time range, return to the step of executing the step of determining, according to network delay data of multiple source station servers providing resources, one source station server of the multiple source station servers as a target source station server.
Optionally, in an embodiment of the present application, the target determining module includes: a first determining module, configured to determine a packet threshold according to network delay data of the plurality of source station servers; a source group dividing module, configured to divide the plurality of source station servers into a first source group and a second source group according to the grouping threshold, where the first source group includes at least one first source station server, the second source group includes at least one second source station server, and network delay data of the first source station servers are all smaller than network delay data of the second source station servers; a second determining module, configured to determine the target source station server from the at least one first source station server.
Optionally, in an embodiment of the present application, the first determining module includes: a third determining module, configured to determine a maximum value of the network delay data of the plurality of source station servers as maximum delay data; a fourth determining module, configured to determine a minimum value of the network delay data of the plurality of source station servers as minimum delay data; a fifth determining module for determining the grouping threshold according to the maximum delay data and the minimum delay data.
Optionally, in an embodiment of the present application, the method further includes: a data obtaining module, configured to obtain a real-time delay data and at least one historical delay data of each source station server of the plurality of source station servers; a sixth determining module, configured to determine, according to the real-time delay data and the at least one historical delay data, network delay data of each source station server, and obtain the network delay data of the plurality of source station servers.
Optionally, in an embodiment of the present application, the data obtaining module includes: a network request module, configured to send a network request to each source station server, where the network request is used for enabling each source station server to send a network response corresponding to the network request; and the seventh determining module is used for determining the real-time delay data of each source station server according to the network requests of the plurality of source station servers and the network responses corresponding to the network requests.
Optionally, in an embodiment of the present application, the method further includes: the type obtaining module is used for obtaining the network type of the terminal equipment; and a second execution module, configured to, if the network type of the terminal device is different from the network type of the target source station server, return to execute the step of determining, according to the network delay data of the plurality of source station servers providing the resource, one source station server of the plurality of source station servers as the target source station server.
An embodiment of the present application further provides an electronic device, including: a processor and a memory storing machine-readable instructions executable by the processor, the machine-readable instructions when executed by the processor performing the method as described above.
The embodiment of the present application also provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method as described above is executed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
FIG. 1 is a schematic diagram of a brokering system provided in an embodiment of the present application;
FIG. 2 is a schematic flow chart of a proxy method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a proxy device provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Icon: 100-a proxy system; 110-a terminal device; 120-a proxy server; 130-source station server; 300-a proxy device; 310-request receiving module; 320-a target determination module; 330-request sending module; 340-a resource sending module; 400-an electronic device; 410-a processor; 420-a memory; 430-storage medium.
Detailed Description
The technical solution in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Before describing the embodiments of the present application, some concepts related to the embodiments of the present application will be described, and these concepts are as follows:
terminal device refers to a device having a function of executing a computer program, and these devices are, for example: a smart phone, a Personal Computer (PC), a tablet computer, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), a network switch or a network router, and the like.
Proxy Server (Proxy Server) refers to a Server that proxies network users to obtain information on the network. The proxy server is a transfer station of network information, is an intermediate proxy mechanism between a personal network and an Internet service provider, and is responsible for forwarding legal network information, controlling and registering forwarding. Proxy servers are typically used for security protection and cache acceleration reasons, among others, where security protection is for example: the terminal equipment does not know whether the target network is safe or not, and can use the safety protection proxy server to access the target network, wherein the safety protection proxy server is a server which is subjected to safety reinforcement, so that the safety risk cannot exist when the safety protection proxy server is used to access the target network; cache acceleration for example: the resource accessed by the terminal equipment each time is cached in the proxy server for a period of time, when the proxy server receives the request of the terminal equipment for accessing the resource again, if the resource is not overdue, the proxy server can directly send the resource to the terminal equipment, so as to achieve the effect of accelerating the terminal equipment access.
Browser, refers to a software tool for accessing data on a server, where the browser includes: firefox browser, Chrome browser, Safari browser, Internet Explorer (IE) browser, etc., which uses engines such as: a firefxdriver engine, an internet explorer driver engine, a ChromeDriver engine, etc., but in some cases, the browser engine may be used by two or more than two engines, for example: the customized browser uses an internet explorer driver engine and a ChromeDriver engine together. When the browser on the terminal device is used for accessing the network, the network can be the internet or a private network, and the proxy server can be used for accessing resources in the network so as to achieve the effects of access acceleration or security protection.
The Transmission Control Protocol/Internet Protocol (TCP/IP), also known as network communication Protocol, is the most basic Protocol of the Internet and the foundation of the Internet and consists of an IP Protocol of a network layer and a TCP Protocol of a transport layer. The communication may be based on transmission control protocol/internet protocol (TCP/IP) or may be based on hypertext transfer protocol (HTTP). The above-mentioned process of the browser accessing the server may use a TCP Protocol, and certainly, in a specific implementation process, the browser may also use a User Datagram Protocol (UDP) for accessing.
Please refer to fig. 1, which is a schematic diagram of an agent system provided in the embodiment of the present application; before introducing the agent method provided by the embodiment of the present application, an agent system 100 provided by the embodiment of the present application is introduced, where the agent system 100 includes: terminal device 110, proxy server 120, and origin server 130; wherein the terminal device 110 is in communication with a proxy server 120, the proxy server 120 being in communication with a plurality of source station servers 130; there are many specific communication modes between the terminal device 110 and the proxy server 120, and there are also many communication modes between the proxy server 120 and the source station servers 130, specifically, the communication modes may be wireless network communication, wired network communication, or internet communication in which a wired network and a wireless network are mixed.
The proxy server and the source station server mentioned above refer to devices that provide computing services through a network, and these devices may be, for example: x86 server and non-x 86 server, non-x 86 server includes: mainframe, minicomputer, and UNIX server. Certainly, in a specific implementation process, the proxy server and the source station server may specifically select a mainframe or a small-sized machine, where the small-sized machine mainly supports a closed and dedicated device for providing a Computing service of the UNIX operating system by using a special processor such as Reduced Instruction Set Computing (RISC), single-length Instruction Per Second (MIPS), and the like; a mainframe, also known as a mainframe, refers to a device that provides computing services using a dedicated set of processor instructions, an operating system, and application software.
Please refer to fig. 2, which is a schematic flow chart of the proxy method provided in the embodiment of the present application; the method may comprise the steps of:
step S210: the proxy server receives the resource request sent by the terminal equipment.
The resource request refers to a request for accessing a target resource stored in a source station server by a terminal device, and the proxy server proxies the process of accessing the target resource of the source station server by the terminal device, so that the proxy server needs to proxy the process of accessing the target resource of the source station server by the terminal device after receiving the resource request sent by the terminal device. The target resource refers to a target resource required by the terminal device, and the target resource may be, for example, a resource such as character data, a file picture, and a video stream.
The specific way of the proxy Server receiving the resource request sent by the terminal device may be a Browser request of the client and a Server response way, that is, a Browser/Server (B/S) way for communication. Of course, in a specific implementation process, the communication may also be performed in an asynchronous manner, for example: the server uses a front-end and back-end separation architecture case, specifically, the front-end uses a framework of separation of a control layer and a view layer, and the frameworks are as follows: knockout, Angular, React or Vue; the back-end uses a framework that separates the control layer and the data access layer, such as: RESTful interface, etc. Another example is: NET Signal method can be adopted for data interaction, SignalR supports server push function, and client codes in a browser can be called in the server. Of course, in a specific implementation process, if the proxy server stores a target resource corresponding to a resource request sent by the terminal device, the proxy server may directly send the target resource to the terminal device without determining a target source station server and sending the resource request to the determined target source station server.
After step S210, step S220 is performed: the proxy server determines one source station server in the plurality of source station servers as a target source station server according to network delay data of the plurality of source station servers for providing resources.
The network delay data is also called network delay or network delay, or simply network delay, and refers to a time length spent from the time when the proxy server sends a data request to the source station server to the time when the proxy server receives a data response sent by the source station server. The specific calculation manner of the network delay data and the specific calculation manner of the network delay data corresponding to the plurality of source station servers will be described in detail in the following description.
The determination method of the target source station server has various determination modes: a first determination mode, wherein one source station server in a plurality of source station servers is randomly determined as a target source station server; in the second determination mode, the network delay data of a plurality of source station servers are sequenced from small to large, and the source station server with the minimum value of the network delay data is determined as a target source station server; in a third determination mode, the network delay data of a plurality of source station servers are grouped first to obtain a plurality of grouped source station servers, namely, each group comprises at least one source station server, and then a target source station server is determined from the at least one source station server. Here, only the third determination manner of the target source station server is illustrated, then the step S220 may include the following steps:
step S221: the proxy server determines a packet threshold based on network delay data for a plurality of source station servers.
The packet threshold refers to a critical value between two packets of the plurality of packets, i.e., a threshold between the two packets. Specifically, for example, if 3,4, and 7 are divided into two groups, the two groups may be divided according to a threshold of 5, or may be divided according to a threshold of 6, as an example, if the threshold is 5, and if the first value is 3 smaller than 5, 3 is divided into the first group; a second value of 4 less than 5, then 4 is divided into a first group, where members of the first group have 3 and 4; and a third value of 7 greater than 5, then 7 should be classified into the second group, where the members of the second group have only 7, and then 5 here is the grouping threshold.
The specific determination of the grouping threshold can be made in many ways: in the first mode, network delay data of a plurality of source station servers are obtained, namely a plurality of network delay data are obtained, and the median of the plurality of network delay data is determined as a grouping threshold; in a second mode, an average value of a plurality of network delay data is determined as a grouping threshold value; in a third mode, a maximum value and a minimum value in the plurality of network delay data are determined, and an average value of the maximum value and the minimum value is determined as a grouping threshold. A third way of determining the grouping threshold is explained in detail here, and then a specific implementation of step S221 is, for example: the proxy server determines the maximum value in the network delay data of the source station servers as the maximum delay data; the proxy server determines the minimum value in the network delay data of the source station servers as the minimum delay data; the proxy server determines a grouping threshold according to the maximum delay data and the minimum delay data; specific embodiments of determining the grouping threshold according to the maximum delay data and the minimum delay data include: the average of the maximum delay data and the minimum delay data is determined as the grouping threshold. In the implementation process, the grouping threshold is determined according to the plurality of network delay data, and then the target source station server is determined to perform proxy according to the grouping threshold, so that the condition that the speed of acquiring the target resource by the terminal equipment is unstable due to the change of the network is avoided.
The above-mentioned obtaining manner of the multiple network delay data, that is, the obtaining manner of the network delay data of the multiple source station servers, for example: the method comprises the steps that a proxy server obtains real-time delay data and at least one historical delay data of each source station server of a plurality of source station servers; the proxy server determines the network delay data of each source station server according to one real-time delay data and at least one historical delay data, and obtains the network delay data of a plurality of source station servers. Of course, in a specific implementation process, the network delay data of each source station server may be directly determined according to the latest preset number of historical delay data, where the preset number may be 20, 40, or 100, that is, the preset number may be set according to actual requirements, for example: determining the network delay data of each source station server according to the latest N historical delay data, deleting the delay data except the latest N-1 historical delay data, and adding the currently accessed real-time delay data, wherein the description of the process refers to updating the latest N historical delay data, and the latest N historical delay data need to be updated every time a resource request of the terminal equipment is received so as to maintain the real-time network state. In the implementation process, the network delay data is determined through the historical delay data and the real-time delay data, and then the target source station server is determined according to the network delay data, so that the problem of unstable access caused by network jitter, namely the change of routing information when a certain network unit in a network is blocked or fails, is avoided.
There are many ways to obtain real-time delay data, the first way is for example: the proxy server sends a network request to each source station server, wherein the network request is used for enabling each source station server to send a network response corresponding to the network request; the proxy server determines real-time delay data of each source station server according to the network requests of the source station servers and the network responses corresponding to the network requests; the specific implementation method for determining the real-time delay data according to the network request and the network response includes: a time interval between a first time of sending the network request and a second time of receiving the network response is determined as real-time delay data. The second way of the specific obtaining method of the real-time delay data is, for example: the proxy server sends a first handshake message for establishing a Transmission Control Protocol (TCP) connection with the source station server to the source station server; the proxy server receives a second handshake message which is returned by the source station server and used for establishing TCP connection; and the proxy server calculates the time interval between the sending time of the first handshake message and the receiving time of the second handshake message, and determines the time interval as the network delay between the proxy server and the source station server. In the implementation process, the network delay of a plurality of source station servers is obtained in real time, so that the problem of unstable access caused by network jitter, namely the change of routing information when a certain network unit in a network is blocked or fails, is avoided.
The specific method for obtaining the historical delay data includes: storing the real-time delay data into a file system or a database each time when the real-time delay data is obtained, wherein the previously stored delay data is historical delay data when the real-time delay data is obtained later; wherein, the database here includes: a memory database, a relational database and a non-relational database; the Memory database refers to a data set searched based on a Random Access Memory (RAM), and is characterized by fast read-write speed, and common Memory databases are, for example: memcached and Redis, etc.; a relational database refers to a database that organizes data using a relational model, and the relational database stores data in the form of rows and columns for easy understanding by users, and the series of rows and columns of the relational database is called a table, and a common relational database is, for example: mysql, Oracle, SQLSever, etc.; a non-relational database, also called nosql (not Only SQL), means that it is not Only Structured Query Language (SQL), but also mainly includes the following components according to the difference of the Structured method and the application scenario: three non-relational databases of columnar storage, document storage and key-value pair storage are oriented, and a common non-relational database comprises: hadoop subsystems HBase, MongoDB and CouchDB, and the like.
After step S221, step S222 is performed: the proxy server divides the plurality of source station servers into a first source group and a second source group according to a grouping threshold.
The first source group is also called an optimal source group, and comprises at least one first source station server; the second source group is also called an alternative source group, the second source group comprises at least one second source station server, and the network delay data of the first source station server is smaller than that of the second source station server. In a specific implementation process, when all the source station servers in the first source group have no response or network access fails, that is, when the proxy server fails to connect with all the source station servers in the first source group, a target source station server may be determined from the source station servers in the second source group, that is, when the proxy server fails to connect with all the source station servers in the first source group, the proxy server may proxy resource access between the terminal device and the source station servers in the second source group.
The specific implementation manner of dividing the plurality of source station servers into the first source group and the second source group according to the grouping threshold is as follows: here, the grouping threshold is 5, the network delay data of the plurality of source station servers are 3,4 and 7, respectively, and the first value is 3 less than 5, then 3 is divided into the first source group; if the second value is 4 and less than 5, dividing 4 into a first source group, wherein the members of the first source group have a source station server corresponding to 3 and a source station server corresponding to 4; and a third value of 7 is greater than 5, then 7 should be placed into the second source group, where members of the second source group only have source servers to which 7 correspond.
After step S222, step S223 is performed: the proxy server determines a target source station server from the at least one first source station server.
Here, similar to the above description, there are many embodiments of determining the target source station server from the at least one first source station server: a first determination mode, wherein one of at least one first source station server is randomly determined as a target source station server; in a second determination method, the network delay data of at least one first source station server is sorted from small to large, and the source station server with the smallest value of the network delay data is determined as a target source station server.
Here, the second determination method is described in detail only by taking the second determination method as an example, and the second determination method includes: the network delay data of the first source station servers are respectively 3 and 4, and then after the network delay data of the first source station servers are sequenced from small to large, the determined sequence of the first source station servers is [3,4] in sequence; if the source station server with the minimum network delay data value is determined as the target source station server, determining the source station server corresponding to the step 3 as the target source station server; and if the source station server corresponding to the step 3 cannot perform proxy, determining the source station server corresponding to the step 4 as a target source station server next time.
In the implementation process, the plurality of source station servers are grouped according to network delay, so that the target source station server is always determined from the at least one first source station server, and the determined target source station server is accessed by the terminal device for acting, so that the speed of determining the target source station server is increased, and the speed of acquiring the target resource by the terminal device is also increased.
After step S220, step S230 is performed: the proxy server sends a resource request to the target source station server so that the target source station server sends a target resource corresponding to the resource request.
The communication mode between the proxy Server and the target source station Server may be a Browser request and a Server response of the client, that is, a Browser/Server (B/S) mode. Of course, in a specific implementation process, the communication may also be performed in an asynchronous manner, for example: the server uses a front-end and back-end separation architecture case, specifically, the front-end uses a framework of separation of a control layer and a view layer, and the frameworks are as follows: knockout, Angular, React or Vue; the back-end uses a framework that separates the control layer and the data access layer, such as: RESTful interface, etc. Another example is: NET Signal method can be adopted for data interaction, SignalR supports server push function, and client codes in a browser can be called in the server.
Here, the proxy server sends a resource request to the target source station server, for example: the proxy server configures the reverse proxy service, and the reverse proxy service software has many choices, and common reverse proxy service software includes: the present invention relates to a method for implementing a reverse proxy service, and more particularly, to a method for implementing a reverse proxy service in a mobile communication system, and a method for implementing a reverse proxy service in a mobile communication system.
After step S230, step S240 is performed: and if the target resource sent by the target source station server is received, the proxy server sends the target resource to the terminal equipment.
The specific implementation manner of step S240 is, for example: after receiving the target resource sent by the target source station server, the proxy server may store the target resource on the proxy server, and if receiving the same resource request sent by the terminal device next time, may send the stored target resource to the terminal device; certainly, in a specific implementation process, the proxy server may also set the expiration time for the stored target resource, for example, the expiration time is set to one day, and then after one day, the target resource may be deleted if a resource request sent by the terminal device has not been received; the proxy server may also perform security scanning on the target resource, and if a trojan program or a virus program is found, the target resource may be cleaned, that is, the trojan program or the virus program in the target resource is deleted from the target resource.
In the implementation process, the target source station server is determined through network delay data in real time, and then the access process from the terminal equipment to the target source station server is proxied, so that the condition that the speed of the terminal equipment for requesting the target resource in the target source station server is unstable is effectively avoided.
Optionally, in this embodiment of the application, after step S240, the following steps may also be included:
step S250: if the target resource sent by the target source station server is not received within the preset time range, the step S220 is executed again.
The preset time range refers to a preset time length after the proxy server sends the resource request to the target source station server, where the preset time length may be set according to an actual requirement, and the preset time length may be set to, for example, 2 minutes or 3 minutes, so the preset time range refers to a time range from 2 minutes or 3 minutes after the proxy server sends the resource request to the target source station server, that is, from the start of sending the resource request from the proxy server to the target source station server to the end of 2 minutes or 3 minutes.
It can be understood that, after the preset duration after the proxy server sends the resource request to the target source station server, the proxy server still does not receive the target resource sent by the target source station server, and may determine the target source station server from the at least one or more first source station servers again, then send the resource request to the re-determined target source station server, and receive the target resource sent by the target source station server. In a specific implementation process, if the target resource sent by the target source station server is still not received after the preset duration after the resource request is sent to the target source station server, the above steps may still be repeated until the target resource is obtained.
In the implementation process, the proxy server is enabled to reselect the target source station server under the condition that the target resource sent by the target source station server is not received within the preset time range, so that the condition that the proxy fails due to no response of the target server is avoided.
Optionally, in this embodiment of the present application, before sending the resource request to the target source station server, that is, before step S230, the following steps may also be included:
step S201: the proxy server obtains the network type of the terminal device.
The network type refers to a network type accessed by the terminal device, where the network type may be an Internet Service Provider (ISP), that is, a network operator that comprehensively provides Internet access Service, information Service, and value added Service to a large number of users, and the specific network operator type, that is, the ISP type is, for example: telecommunications, connectivity, and mobility. The network type here may be a routing protocol type, and common routing protocol types include: an Interior Gateway Routing Protocol (IGRP) Protocol, an intermediate system to intermediate system (IS-IS) Protocol, and an Open Shortest Path First (OSPF) Protocol, and the like.
The specific implementation of the proxy server obtaining the network type of the terminal device is as follows: acquiring a corresponding network type from a network message corresponding to a resource request sent by terminal equipment, specifically, sending the IP address to other electronic equipment to inquire the ISP type of the IP address, wherein the network message corresponding to the resource request sent by the terminal equipment comprises the Internet interconnection protocol address of an egress router, namely the IP address of the egress router; the type of the routing protocol may be obtained from flag bit data in a network message corresponding to the resource request sent by the terminal device. Certainly, in a specific implementation process, the network packet corresponding to the resource request sent by the terminal device may be obtained by intercepting the network packet by the firewall router or using a port mirror, and therefore, the specific obtaining manner of the network packet corresponding to the resource request sent by the terminal device herein should not be construed as limiting the embodiment of the present application.
Step S202: if the network type of the terminal device is different from that of the target source station server, the step S220 is executed.
It can be understood that, in order to increase the speed of acquiring the target resource by the terminal device, the target source station server with the same network type as the terminal device may be preferentially used for acquisition, so as to increase the speed of acquiring the target resource by the terminal device, and certainly, in a specific implementation process, the network type of the terminal device is different from the network type of the target source station server, and the step S220 may be executed again; the resource request can also be sent directly to a target source station server of a different network type than the terminal device.
In the implementation process, the source station server with the network type different from that of the terminal equipment is eliminated, so that the network type of the source station server and the network type of the terminal server are ensured to be the same network type, and the speed of the terminal equipment for requesting the target resource in the target source station server is effectively improved.
Please refer to fig. 3, which is a schematic structural diagram of the proxy apparatus according to the embodiment of the present application; the proxy device 300 is applied to the proxy server 120, and the proxy device 300 may include the following modules:
a request receiving module 310, configured to receive a resource request sent by a terminal device.
And a target determining module 320, configured to determine one source station server of the plurality of source station servers as a target source station server according to network delay data of the plurality of source station servers providing the resource.
A request sending module 330, configured to send a resource request to the target source station server, so that the target source station server sends a target resource corresponding to the resource request.
The resource sending module 340 is configured to send the target resource to the terminal device if the target resource sent by the target source station server is received.
Optionally, in an embodiment of the present application, the apparatus further includes:
and the first execution module is used for returning to execute the step of determining one source station server in the plurality of source station servers as the target source station server according to the network delay data of the plurality of source station servers if the target resource sent by the target source station server is not received within the preset time range.
Optionally, in an embodiment of the present application, the target determining module includes:
a first determining module for determining a packet threshold based on network delay data of a plurality of source station servers.
And the source group division module is used for dividing the plurality of source station servers into a first source group and a second source group according to the grouping threshold, wherein the first source group comprises at least one first source station server, the second source group comprises at least one second source station server, and the network delay data of the first source station servers are all smaller than the network delay data of the second source station servers.
And the second determining module is used for determining a target source station server from at least one first source station server.
Optionally, in an embodiment of the present application, the first determining module includes:
and the third determining module is used for determining the maximum value in the network delay data of the plurality of source station servers as the maximum delay data.
And the fourth determining module is used for determining the minimum value in the network delay data of the plurality of source station servers as the minimum delay data.
A fifth determining module for determining a grouping threshold based on the maximum delay data and the minimum delay data.
Optionally, in this embodiment of the present application, the apparatus may further include:
and the data obtaining module is used for obtaining real-time delay data and at least one historical delay data of each source station server of the plurality of source station servers.
And the sixth determining module is used for determining the network delay data of each source station server according to the real-time delay data and the at least one historical delay data to obtain the network delay data of the plurality of source station servers.
Optionally, in an embodiment of the present application, the data obtaining module includes:
and the network request module is used for sending a network request to each source station server, and the network request is used for enabling each source station server to send a network response corresponding to the network request.
And the seventh determining module is used for determining the real-time delay data of each source station server according to the network requests of the plurality of source station servers and the network responses corresponding to the network requests.
Optionally, in this embodiment of the present application, the proxy apparatus may further include:
and the type obtaining module is used for obtaining the network type of the terminal equipment.
And the second execution module is used for returning to execute the step of determining one source station server in the plurality of source station servers as the target source station server according to the network delay data of the plurality of source station servers if the network type of the terminal equipment is different from the network type of the target source station server.
It should be understood that the apparatus corresponds to the above method embodiment, and can perform the steps related to the above method embodiment, the specific functions of the apparatus can be referred to the above description, and the detailed description is appropriately omitted here to avoid redundancy. The device includes at least one software function that can be stored in memory in the form of software or firmware (firmware) or solidified in the Operating System (OS) of the device.
Please refer to fig. 4 for a schematic structural diagram of an electronic device according to an embodiment of the present application. An electronic device 400 provided in an embodiment of the present application includes: a processor 410 and a memory 420, the memory 420 storing machine-readable instructions executable by the processor 410, the machine-readable instructions when executed by the processor 410 performing the method of steps S210 to S250 as described above.
The embodiment of the present application further provides a storage medium 430, where the storage medium 430 stores thereon a computer program, and the computer program is executed by the processor 410 to perform the methods of step S210 to step S250 as described above.
The storage medium 430 may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an alternative embodiment of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the embodiments of the present application, and all the changes or substitutions should be covered by the scope of the embodiments of the present application.

Claims (10)

1. A proxy method, applied to a proxy server, the method comprising:
receiving a resource request sent by terminal equipment;
determining one source station server in a plurality of source station servers as a target source station server according to network delay data of the source station servers for providing resources;
sending the resource request to the target source station server so that the target source station server sends a target resource corresponding to the resource request;
and if the target resource sent by the target source station server is received, sending the target resource to the terminal equipment.
2. The method of claim 1, further comprising, after said sending the resource request to the target source station server:
and if the target resource sent by the target source station server is not received within a preset time range, returning to execute the step of determining one source station server in the plurality of source station servers as the target source station server according to the network delay data of the plurality of source station servers providing the resource.
3. The method of claim 1, wherein determining a source station server of a plurality of source station servers providing resources as a target source station server according to network delay data of the source station servers comprises:
determining a grouping threshold based on network delay data for the plurality of source station servers;
dividing the plurality of source station servers into a first source group and a second source group according to the grouping threshold, wherein the first source group comprises at least one first source station server, the second source group comprises at least one second source station server, and the network delay data of the first source station servers are all smaller than the network delay data of the second source station servers;
determining the target source station server from the at least one first source station server.
4. The method of claim 3, wherein determining a packet threshold based on network delay data for the plurality of source station servers comprises:
determining a maximum value of the network delay data of the plurality of source station servers as maximum delay data;
determining a minimum value of the network delay data of the plurality of source station servers as minimum delay data;
determining the grouping threshold based on the maximum delay data and the minimum delay data.
5. The method of claim 3, further comprising, prior to the determining a packet threshold from network delay data for the plurality of source station servers:
obtaining a real-time delay data and at least one historical delay data for each source site server of the plurality of source site servers;
determining the network delay data of each source station server according to the real-time delay data and the at least one historical delay data, and obtaining the network delay data of the plurality of source station servers.
6. The method of claim 5, wherein obtaining a real-time delay data for each of the plurality of source site servers comprises:
sending a network request to each source station server, wherein the network request is used for enabling each source station server to send a network response corresponding to the network request;
and determining the real-time delay data of each source station server according to the network requests of the source station servers and the network responses corresponding to the network requests.
7. The method of any of claims 1-6, further comprising, prior to said sending said resource request to said target source station server:
obtaining the network type of the terminal equipment;
and if the network type of the terminal equipment is different from that of the target source station server, returning to execute the step of determining one source station server in the plurality of source station servers as the target source station server according to the network delay data of the plurality of source station servers providing resources.
8. A proxy device, applied to a proxy server, includes:
the request receiving module is used for receiving a resource request sent by the terminal equipment;
the system comprises a target determining module, a resource determining module and a resource determining module, wherein the target determining module is used for determining one source station server in a plurality of source station servers as a target source station server according to network delay data of the source station servers for providing resources;
a request sending module, configured to send the resource request to the target source station server, so that the target source station server sends a target resource corresponding to the resource request;
and the resource sending module is used for sending the target resource to the terminal equipment if the target resource sent by the target source station server is received.
9. An electronic device, comprising: a processor and a memory, the memory storing machine-readable instructions executable by the processor, the machine-readable instructions, when executed by the processor, performing the method of any of claims 1-7.
10. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN201911003350.2A 2019-10-21 2019-10-21 Agent method, device, electronic equipment and storage medium Active CN110650214B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911003350.2A CN110650214B (en) 2019-10-21 2019-10-21 Agent method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911003350.2A CN110650214B (en) 2019-10-21 2019-10-21 Agent method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110650214A true CN110650214A (en) 2020-01-03
CN110650214B CN110650214B (en) 2022-07-05

Family

ID=68994435

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911003350.2A Active CN110650214B (en) 2019-10-21 2019-10-21 Agent method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110650214B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111741319A (en) * 2020-06-23 2020-10-02 北京金山云网络技术有限公司 Live broadcast data processing method and device and electronic equipment
CN112653736A (en) * 2020-12-10 2021-04-13 北京金山云网络技术有限公司 Parallel source returning method and device and electronic equipment
CN113992997A (en) * 2021-10-27 2022-01-28 北京金山云网络技术有限公司 Source station switching method, device, equipment and computer readable storage medium
CN114006764A (en) * 2021-11-02 2022-02-01 北京天融信网络安全技术有限公司 Deployment method and device of safety network element based on super-fusion system
CN115022278A (en) * 2022-06-02 2022-09-06 上海哔哩哔哩科技有限公司 CDN processing method and system
CN115426404A (en) * 2022-11-03 2022-12-02 深圳市明源云科技有限公司 Intranet resource access method, system, equipment and computer readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217475A (en) * 2008-01-04 2008-07-09 中兴通讯股份有限公司 A route enquire and route failure reelection method
CN101557344A (en) * 2009-05-21 2009-10-14 南昌航空大学 Dynamic load balancing method based on spatial geographical locations
US20120131178A1 (en) * 2010-11-24 2012-05-24 Microsoft Corporation Multimedia Aware Cloud for Mobile Device Computing
CN105847381A (en) * 2016-04-18 2016-08-10 乐视控股(北京)有限公司 Scheduling method and device for content server
CN106059856A (en) * 2016-06-20 2016-10-26 乐视控股(北京)有限公司 File retrieval method, file retrieval apparatus and content delivery network (CDN) system
CN106844111A (en) * 2016-12-26 2017-06-13 创新科存储技术(深圳)有限公司 The access method of cloud storage NFS
CN107566270A (en) * 2017-09-28 2018-01-09 北京奇安信科技有限公司 The processing method and processing device that a kind of resource accesses
CN107920122A (en) * 2017-11-23 2018-04-17 杭州电魂网络科技股份有限公司 Game player's matching process, device, match server and readable storage medium storing program for executing
CN109587270A (en) * 2015-06-30 2019-04-05 北京奇虎科技有限公司 A kind of method and mobile terminal saving stream access network for mobile terminal

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217475A (en) * 2008-01-04 2008-07-09 中兴通讯股份有限公司 A route enquire and route failure reelection method
CN101557344A (en) * 2009-05-21 2009-10-14 南昌航空大学 Dynamic load balancing method based on spatial geographical locations
US20120131178A1 (en) * 2010-11-24 2012-05-24 Microsoft Corporation Multimedia Aware Cloud for Mobile Device Computing
CN109587270A (en) * 2015-06-30 2019-04-05 北京奇虎科技有限公司 A kind of method and mobile terminal saving stream access network for mobile terminal
CN105847381A (en) * 2016-04-18 2016-08-10 乐视控股(北京)有限公司 Scheduling method and device for content server
CN106059856A (en) * 2016-06-20 2016-10-26 乐视控股(北京)有限公司 File retrieval method, file retrieval apparatus and content delivery network (CDN) system
CN106844111A (en) * 2016-12-26 2017-06-13 创新科存储技术(深圳)有限公司 The access method of cloud storage NFS
CN107566270A (en) * 2017-09-28 2018-01-09 北京奇安信科技有限公司 The processing method and processing device that a kind of resource accesses
CN107920122A (en) * 2017-11-23 2018-04-17 杭州电魂网络科技股份有限公司 Game player's matching process, device, match server and readable storage medium storing program for executing

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111741319A (en) * 2020-06-23 2020-10-02 北京金山云网络技术有限公司 Live broadcast data processing method and device and electronic equipment
CN112653736A (en) * 2020-12-10 2021-04-13 北京金山云网络技术有限公司 Parallel source returning method and device and electronic equipment
CN113992997A (en) * 2021-10-27 2022-01-28 北京金山云网络技术有限公司 Source station switching method, device, equipment and computer readable storage medium
CN114006764A (en) * 2021-11-02 2022-02-01 北京天融信网络安全技术有限公司 Deployment method and device of safety network element based on super-fusion system
CN114006764B (en) * 2021-11-02 2023-09-26 北京天融信网络安全技术有限公司 Deployment method and device of safety network element based on super fusion system
CN115022278A (en) * 2022-06-02 2022-09-06 上海哔哩哔哩科技有限公司 CDN processing method and system
CN115022278B (en) * 2022-06-02 2024-04-26 上海哔哩哔哩科技有限公司 CDN processing method and system
CN115426404A (en) * 2022-11-03 2022-12-02 深圳市明源云科技有限公司 Intranet resource access method, system, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN110650214B (en) 2022-07-05

Similar Documents

Publication Publication Date Title
CN110650214B (en) Agent method, device, electronic equipment and storage medium
US11863587B2 (en) Webshell detection method and apparatus
US10791190B2 (en) Systems and methods for avoiding server push of objects already cached at a client
US11902243B2 (en) Resolving domain name system (DNS) requests via proxy mechanisms
EP2985705A2 (en) Webpage access method and apparatus, and router
US10630758B2 (en) Method and system for fulfilling server push directives on an edge proxy
EP3170091B1 (en) Method and server of remote information query
US10120872B2 (en) Data caching based on requestor identity
CN112910793B (en) Method for connection multiplexing in seven-layer load balancing and load balancer
CN108207012B (en) Flow control method, device, terminal and system
US20220248189A1 (en) Cross network rich communications services content
US10075411B2 (en) Method and system for processing a geographical internet protocol (IP) lookup request
CN107872538B (en) Service processing method, reverse proxy and service server for decoupling TCP long connection
GB2514722B (en) Controlling the Download of a File by Obtaining its Reputation Data from a Trusted Source
CN110995763B (en) Data processing method and device, electronic equipment and computer storage medium
CN110198315B (en) Message processing method and device
CN107612831B (en) Transmission method and device for data message of access source station
JP2010079523A (en) Method of sharing session data
CN112866356B (en) CDN cache method and device and electronic equipment
Kanaya et al. Intelligent application switch supporting tcp
CN107517162B (en) CDN cache server determination method and device
CN110324436B (en) Proxy method and device for transport layer proxy
CN113420241A (en) Page access method and device, electronic equipment and storage medium
EP3176986A1 (en) Method, device and system for remote desktop protocol gateway to conduct routing and switching
CN115296900B (en) Network message correction method and device, electronic equipment and storage medium

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