A geographically divided network proxy system and method
By using a network proxy system that divides servers into VPSs and maps them to region numbers, and by obtaining and storing proxy server IPs, the problems of slow access speed and unstable operation across regions are solved, and stable and efficient cross-region access is achieved.
Patent Information
- Application Number
- CN202311695775.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-12-11
Smart Images

Figure CN117880356B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of network proxy, and more particularly, to a network proxy system and method divided by regions. BACKGROUND
[0002] Many existing service platforms are comprehensive platforms that can support cross-region information query. Generally, different sites are used in different regions, and the cross-region access speed of different sites is slower than the speed of accessing the corresponding site in the same region, and the operation is also less stable. Therefore, there is an urgent need for a technical means that enables a user to access a site using the server in the region where the site is located when accessing the site across regions. SUMMARY
[0003] In order to solve the technical problems of slow access speed and unstable operation of the user's local server when accessing a site across regions in the prior art, the present application provides a network proxy system and method divided by regions.
[0004] According to an aspect of the present application, a network proxy system divided by regions is provided, which comprises:
[0005] A plurality of VPSs are used to obtain proxy server IP and report to the server through a public network interface, wherein the VPS is a virtual space obtained by dividing a server, each VPS has a corresponding VPSid, and each VPSid is mapped to at least one region number;
[0006] A server is used to receive the proxy server IP reported by all VPSs and transmit the proxy server IP to a database;
[0007] The database is used to store the proxy server IP transmitted by the server according to the mapping relationship between the VPSid and the region number;
[0008] An API interface is used to obtain the region number of the calling party accessing the site across regions through a fixed interface parameter when the calling party accesses the site across regions, extract any one of the proxy server IP corresponding to the region number of the calling party accessing the site across regions from the database as a forwarding server IP, and assign the forwarding server to the calling party, so that the calling party forwards the message through the forwarding server IP.
[0009] Further, the API interface is also used to report the forwarding server IP as an invalid IP when the calling party fails to use the obtained forwarding server IP to perform the message forwarding service, or when the connection is timed out, and trigger a dynamic dialing mechanism to obtain a new forwarding server IP from the database for use.
[0010] Further, the database is further used to divide the proxy server IP into active IP and invalid IP, and when the calling party calls the proxy server IP through the API interface, the active IP is preferentially allocated as a forwarding server to the calling party.
[0011] Further, the database is further used to bind the identity information of the calling party and any one of the active IP corresponding to the region number of the region where the calling party is located, as the fixed conversion server IP of the calling party.
[0012] Further, the server is further used to allocate the VPS with failure to the dead letter queue, and set a recovery time, so that the VPS of the dead letter queue is revived in turn according to the recovery time, wherein the failure of the VPS includes that the port cannot be used, the permission error and the ban.
[0013] According to another aspect of the present application, the present application provides a network proxy method divided by region, which comprises:
[0014] A plurality of VPSs obtain proxy server IP and report to the server through a public network interface, wherein the VPS is a virtual space obtained by dividing a server, each VPS has a corresponding VPSid, and each VPSid has a mapping relationship with at least one region number;
[0015] The server receives the proxy server IP reported by all VPSs and transmits the proxy server IP to the database;
[0016] The database stores the proxy server IP transmitted by the server according to the mapping relationship between the VPSid and the region number;
[0017] When the calling party accesses the site across regions, the region number of the calling party accessing the site across regions is obtained through a fixed interface parameter, and any one of the proxy server IP corresponding to the region number of the calling party accessing the site across regions is extracted from the database as a forwarding server IP, and the forwarding server is allocated to the calling party, so that the calling party forwards the message through the forwarding server IP.
[0018] Further, the method further comprises:
[0019] When the calling party fails to use the obtained forwarding server IP to forward the message, or the connection is timed out, the forwarding server IP is reported as invalid IP, and a dynamic dialing mechanism is triggered to obtain a new forwarding server IP from the database for use.
[0020] Further, the method further comprises:
[0021] The proxy server IP is divided into active IP and invalid IP, and when the calling party calls the proxy server IP through the API interface, the active IP is preferentially allocated to the calling party as a forwarding server.
[0022] Further, the method further comprises:
[0023] The proxy server IP is divided into active IP and invalid IP, and when the calling party calls the proxy server IP through the API interface, the active IP is preferentially allocated to the calling party as a forwarding server.
[0024] Further, the method further comprises:
[0025] The identity information of the calling party is bound to any one of the active IP of the region number corresponding to the region where the calling party is located, as the fixed conversion server IP of the calling party.
[0026] Preferably, the method further comprises allocating the failed VPS to a dead letter queue, and setting a recovery time, so that the VPS of the dead letter queue is revived in turn according to the recovery time, wherein the failure of the VPS includes port unavailability, permission error and ban.
[0027] According to another aspect of the present application, the present application provides a computer readable storage medium, the storage medium stores a computer program, the computer program is used for executing the method of any one of the above aspects of the present application.
[0028] According to another aspect of the present application, an electronic device is provided, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to realize the method of any one of the above aspects of the present application.
[0029] The network proxy system and method divided by region of the present application divide the server into multiple VPS to obtain the proxy server IP of different regions and store it in the database. An API interface is also provided, when the calling party accesses the site across the region, through the fixed interface parameter, the region number of the calling party accessing the site across the region is obtained, and any one of the proxy server IP corresponding to the region number of the calling party accessing the site across the region is extracted from the database as a forwarding server IP, and the forwarding server is allocated to the calling party, so that the calling party forwards the message through the forwarding server IP. The system and method have the following beneficial effects:
[0030] Firstly, the VPS of the multi-point deployment of the server obtains and uploads the proxy server IP, and can realize real-time discovery of whether the proxy service is online;
[0031] Second, the IP of the proxy server corresponding to the region can be obtained by using the region code, and the identity information of the calling party is bound to the IP of the proxy server as a fixed forwarding server, so that the calling party can reduce the query to the database when obtaining the IP of the proxy server again, and reduce the occupation of system resources.
[0032] Third, the function of dynamic dialing is supported, the calling party reports the invalid proxy server IP to trigger the dialing mechanism, the new proxy server IP can be obtained, and the operation stability of the calling party is well ensured. BRIEF DESCRIPTION OF DRAWINGS
[0033] The exemplary embodiments of the present application can be more completely understood in reference to the following drawings:
[0034] Figure 1 The structure diagram of the network proxy system divided by region according to the preferred embodiment of the present application;
[0035] Figure 2 The flow chart of the network proxy method divided by region according to the preferred embodiment of the present application;
[0036] Figure 3 The structure diagram of the electronic device according to the preferred embodiment of the present application. DETAILED DESCRIPTION
[0037] The exemplary embodiments of the present application will now be described with reference to the accompanying drawings, however, the present application can be implemented in many different forms and is not limited to the embodiments described herein, and these embodiments are provided to thoroughly and completely disclose the present application and to fully convey the scope of the present application to those skilled in the art. The terms used in the exemplary embodiments shown in the drawings are not limited to the present application. In the drawings, the same elements / units use the same reference numerals.
[0038] Unless otherwise defined, the terms used herein (including technical terms) have the meanings commonly understood by those skilled in the art. In addition, it is to be understood that the terms defined in commonly used dictionaries should be understood to have meanings consistent with their context in the relevant art, and should not be understood as ideally or excessively formal meanings.
[0039] Exemplary system
[0040] Figure 1 The structure diagram of the network proxy system divided by region according to the preferred embodiment of the present application. As shown in Figure 1 The network proxy 100 divided by region according to the preferred embodiment of the present application includes:
[0041] n VPSs 101 are used to acquire proxy server IP and report to the server through a public network interface, wherein the VPS is a virtual space obtained by dividing a server, each VPS has a corresponding VPS id, and each VPS id has a mapping relationship with at least one region number.
[0042] In the preferred embodiment, a server is divided into n virtual spaces, each VPS has its own independent operating system and independent IP. Figure 1 As shown in the figure, each VPS has a corresponding VPS id, such as VPS01, VPS02, …, and VPSn. Through multiple VPSs, the proxy server IP of different regions can be collected. On the basis of establishing the mapping relationship between the VPS id and the region number, the proxy server IP collected by each VPS id can be matched with the region. In addition, since the reported proxy server IP must be through a public network interface, in order to prevent security problems, the application carries out corresponding encryption processing and time verification logic on the parameters.
[0043] The server 102 is used to receive the proxy server IP reported by all VPSs and transmit the proxy server IP to the database.
[0044] Preferably, the server 102 is also used to allocate the VPSs with failures to the dead letter queue and set a recovery time, so that the VPSs in the dead letter queue are revived in turn according to the recovery time, wherein the failures of the VPSs include that the port cannot be used, the permission error and the ban.
[0045] In the preferred embodiment, the server collects the proxy server IP acquired and reported by the VPS, which greatly facilitates the unified call in subsequent cross-region access. The server also monitors the VPS. When the VPS has failures such as 433, 403, ban, etc., the VPS with failures is put into the dead letter queue, and the VPS in the dead letter queue is revived according to the set appropriate recovery time, such as 1 hour, thereby greatly improving the efficiency of collecting the proxy server IP.
[0046] The database 103 is used to store the proxy server IP transmitted by the server according to the mapping relationship between the VPS id and the region number.
[0047] Preferably, the database 103 is also used to divide the proxy server IP into active IP and invalid IP, and when the calling party calls the proxy server IP through the API interface, the active IP is preferentially allocated to the calling party as a forwarding server.
[0048] Preferably, the database 103 is further configured to bind the identity information of the calling party with any one of the proxy server IPs in the active IPs corresponding to the region number of the region where the calling party is located, as the fixed forwarding server IP of the calling party.
[0049] In the preferred embodiment, the database can be of any structure, such as mogoDB, redis, etc., and the present application does not make any limitation. The identity information of the calling party can be any information that can be associated with the calling party, and the present application does not make any limitation. For example, if a taxpaying enterprise needs to access the tax bureau system across provinces, the identity information can be the enterprise tax number of the taxpaying enterprise,
[0050] The API interface 104 is configured to, when the calling party accesses the site across regions, obtain the region number of the site accessed by the calling party across regions through a fixed interface parameter, extract any one of the proxy server IPs corresponding to the region number of the site accessed by the calling party across regions from the database as the forwarding server IP, and assign the forwarding server to the calling party, so that the calling party forwards messages through the forwarding server IP.
[0051] Preferably, the API interface 104 is further configured to, when the calling party fails to use the obtained forwarding server IP to forward messages, or when the connection is timed out, report the forwarding server IP as an invalid IP, and trigger a dynamic dialing mechanism to obtain a new forwarding server IP from the database for use.
[0052] The network proxy system divided by region according to the preferred embodiment of the present application divides the server into multiple VPS to obtain proxy server IPs of different regions and stores them in the database, and provides an API interface. When the calling party accesses the site across regions, the API interface obtains the region number of the site accessed by the calling party across regions through a fixed interface parameter, extracts any one of the proxy server IPs corresponding to the region number of the site accessed by the calling party across regions from the database as the forwarding server IP, and assigns the forwarding server to the calling party, so that the calling party forwards messages through the forwarding server IP, effectively ensuring the stability of the operation of the calling party. At the same time, the region number can be used to obtain the proxy server IP of the corresponding region, and the identity information of the calling party can be bound with the proxy server IP as the fixed forwarding server, so that when the calling party obtains the proxy server IP again, the query to the database can be reduced, and the occupation of system resources can be reduced.
[0053] Exemplary method
[0054] Figure 2 The flowchart of the network proxy method divided by region according to the preferred embodiment of the present application is shown in FIG. 2. As shown in FIG. 2, the network proxy method divided by region according to the preferred embodiment of the present application comprises the following steps. Figure 2As shown, the network proxy method according to the preferred embodiment starts from step 201.
[0055] In step 201, several VPSs acquire proxy server IP and report to the server through a public network interface, wherein the VPS is a virtual space obtained by dividing a server, each VPS has a corresponding VPSid, and each VPSid has a mapping relationship with at least one region number.
[0056] In step 202, the server receives the proxy server IP reported by all VPSs and transmits the proxy server IP to the database.
[0057] In step 203, the database stores the proxy server IP transmitted by the server according to the mapping relationship between the VPSid and the region number; and
[0058] In step 204, when the calling party accesses the site across regions, the region number of the calling party accessing the site across regions is obtained through a fixed interface parameter, and any one of the proxy server IP corresponding to the region number of the calling party accessing the site across regions is extracted from the database as a forwarding server IP, and the forwarding server is assigned to the calling party, so that the calling party forwards the message through the forwarding server IP.
[0059] Preferably, the method further comprises:
[0060] When the calling party fails to use the acquired forwarding server IP to forward the message or the connection times out, the forwarding server IP is reported as a failed IP, and a dynamic dialing mechanism is triggered to obtain a new forwarding server IP from the database for use.
[0061] Preferably, the method further comprises:
[0062] The proxy server IP is divided into active IP and failed IP, and when the calling party calls the proxy server IP through the API interface, the active IP is preferentially assigned to the calling party as the forwarding server.
[0063] Preferably, the method further comprises:
[0064] The identity information of the calling party is bound to any one of the proxy server IP in the active IP corresponding to the region number of the region where the calling party is located, as the fixed conversion server IP of the calling party.
[0065] Preferably, the method further comprises assigning the VPS that fails to a dead letter queue and setting a recovery time, so that the VPSs in the dead letter queue are revived in turn according to the recovery time, wherein the failures of the VPSs include port unavailability, permission error and ban.
[0066] In the preferred embodiment, the method is implemented by an exemplary system, and the same technical effects are achieved, which are not described here again.
[0067] Exemplary electronic device
[0068] Figure 3 A structural schematic diagram of an electronic device according to the preferred embodiment of the present application. The electronic device can be either one or both of the first device and the second device, or a single device independent of them, which can communicate with the first device and the second device to receive the collected input signals therefrom. Figure 3 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. As shown in the figure, Figure 3 The electronic device includes one or more processors 301 and a memory 302.
[0069] The processor 301 can be a central processing unit (CPU) or other form of processing unit having data processing and / or instruction execution capabilities, and can control other components in the electronic device to perform desired functions.
[0070] The memory 302 can include one or more computer program products, which can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM), cache memory, and / or the like. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, and / or the like. One or more computer program instructions can be stored on the computer-readable storage media, and the processor 301 can run the program instructions to implement the enterprise energy-consuming space-based energy anomaly diagnosis method and / or other desired functions of the various embodiments disclosed above. In one example, the electronic device can further include an input device 303 and an output device 304, which are interconnected by a bus system and / or other forms of connection mechanism (not shown).
[0071] In addition, the input device 303 can also include, for example, a keyboard, a mouse, and / or the like.
[0072] The output device 304 can output various information to the outside. The output device 304 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and / or the like.
[0073] Of course, in order to simplify, Figure 3Only some of the components of the electronic device related to the present disclosure are shown, and components such as a bus, an input / output interface, and the like are omitted. In addition, the electronic device can further include any other appropriate components according to a specific application.
[0074] Exemplary computer program product and computer readable storage medium
[0075] In addition to the above-mentioned method and device, an embodiment of the present disclosure can be a computer program product, which includes computer program instructions, and when the computer program instructions are run by a processor, the processor performs the steps of the method of overseas remote tax filing according to various embodiments of the present disclosure described in the above "Exemplary Method" section of the present specification.
[0076] The computer program product can be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, C++, and the like, and conventional procedural programming languages, such as the "C" programming language, or the like. The program code can execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
[0077] In addition, an embodiment of the present disclosure can also be a computer readable storage medium, which stores computer program instructions, and when the computer program instructions are run by a processor, the processor performs the steps of the method of overseas remote tax filing according to various embodiments of the present disclosure described in the above "Exemplary Method" section of the present specification.
[0078] The computer readable storage medium can take any combination of one or more of the following readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium, for example, can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0079] The above describes the basic principles of the present disclosure in conjunction with specific embodiments, but it should be noted that the advantages, benefits, effects and the like mentioned in the present disclosure are merely examples and are not limiting, and these advantages, benefits, effects and the like cannot be considered as necessary for each embodiment of the present disclosure. In addition, the above specific details of the disclosure are only for the purpose of example and for the purpose of understanding, and are not limiting, and the above details do not limit the present disclosure to be necessarily implemented with the above specific details.
[0080] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts between each embodiment can be understood by referring to each other. For system embodiments, since they basically correspond to method embodiments, the description is relatively simple, and the relevant parts can be understood by referring to the part of the method embodiment.
[0081] The block diagrams of the devices, apparatuses, equipment, systems involved in the present disclosure are only exemplary examples and are not intended to require or imply the connection, arrangement, configuration shown in the block diagram. As those skilled in the art will recognize, these devices, apparatuses, equipment, systems can be connected, arranged, configured in any manner. Words such as "include", "contain", "have" and the like are open-ended words, which mean "including but not limited to", and can be used interchangeably. The words "or" and "and" used herein mean the word "and / or", and can be used interchangeably unless the context clearly indicates otherwise. The word "such as" used herein means the phrase "such as but not limited to", and can be used interchangeably.
[0082] The methods and devices of the present disclosure can be implemented in many ways. For example, the methods and devices of the present disclosure can be implemented by software, hardware, firmware, or any combination of software, hardware, firmware. The above order of steps for the method is only for illustration, and the steps of the method of the present disclosure are not limited to the above specific description, unless otherwise specifically described. In addition, in some embodiments, the present disclosure can also be implemented as programs recorded in recording media, which include machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers the recording media storing the programs for executing the method according to the present disclosure.
[0083] It should also be noted that, in the apparatus, equipment and method of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present disclosure. The above description of the disclosed aspects is provided to enable any technician in this field to make or use the present disclosure. Various modifications to these aspects will be very obvious to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown here, but to the widest range consistent with the principles and novel features disclosed herein.
[0084] The above description has been provided for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A geographically divided network proxy system, characterized by, The system comprises: a plurality of VPSs for obtaining proxy server IPs and reporting to a server through a public network interface, wherein the VPS is a virtual space obtained by dividing a server, each VPS has a corresponding VPSid, and each VPSid is mapped with at least one region number; a server for receiving the proxy server IPs reported by all VPSs and transmitting the proxy server IPs to a database; the database for storing the proxy server IPs transmitted by the server according to the mapping relationship between the VPSid and the region number; an API interface for obtaining the region number of a calling party accessing a site across regions through fixed interface parameters when the calling party accesses the site across regions, extracting any one of the proxy server IPs corresponding to the region number of the calling party accessing the site across regions from the database as a forwarding server IP, and assigning the forwarding server to the calling party, so that the calling party forwards messages through the forwarding server IP.
2. The system of claim 1, wherein, The API interface is further used for reporting the forwarding server IP as an invalid IP when the calling party fails to use the forwarding server IP to forward messages or the connection is timed out, and triggering a dynamic dialing mechanism to obtain a new forwarding server IP from the database for use.
3. The system of claim 1, wherein, The database is further used for dividing the proxy server IPs into active IPs and invalid IPs, and preferentially assigning the active IPs as forwarding servers to the calling party when the calling party calls the proxy server IP through the API interface.
4. The system of claim 1, wherein, The database is further used for binding the identity information of the calling party with any one of the proxy server IPs in the active IPs corresponding to the region number of the region where the calling party is located, as the fixed forwarding server IP of the calling party.
5. The system of claim 1, wherein, The server is further used for assigning a VPS with a fault to a dead letter queue, setting a recovery time, and reviving the VPSs in the dead letter queue in turn according to the recovery time, wherein the fault of the VPS includes that a port cannot be used, an authority error, and being banned.
6. A method for geographically divided network proxying, characterized by, The method comprises: a plurality of VPSs for obtaining proxy server IPs and reporting to a server through a public network interface, wherein the VPS is a virtual space obtained by dividing a server, each VPS has a corresponding VPSid, and each VPSid is mapped with at least one region number; a server for receiving the proxy server IPs reported by all VPSs and transmitting the proxy server IPs to a database; the database for storing the proxy server IPs transmitted by the server according to the mapping relationship between the VPSid and the region number; an API interface for obtaining the region number of a calling party accessing a site across regions through fixed interface parameters when the calling party accesses the site across regions, extracting any one of the proxy server IPs corresponding to the region number of the calling party accessing the site across regions from the database as a forwarding server IP, and assigning the forwarding server to the calling party, so that the calling party forwards messages through the forwarding server IP.
7. The method of claim 6, wherein, The method further comprises: When the calling party fails to use the obtained forwarding server IP to perform the message forwarding service, or the connection times out, the forwarding server IP is reported as a failed IP, and a dynamic dialing mechanism is triggered to obtain a new forwarding server IP from a database for use.
8. The method of claim 6, wherein, The method further comprises: The proxy server IP is divided into active IP and failed IP, and when the calling party calls the proxy server IP through an API interface, the active IP is preferentially allocated to the calling party as a forwarding server.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is executed by the processor to implement the method in any one of claims 6 to 8.
10. An electronic device, comprising: The electronic device comprises: a processor; a memory for storing executable instructions of the processor; the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the method in any one of claims 6 to 8.
Citation Information
Patent Citations
Equipment cross-region access method and device, electronic equipment and storage medium
CN114221955A
Device cross-area access method, electronic device, and non-transitory computer-readable storage medium
US20230319157A1