WO2021258575A1 - Request processing system, method and apparatus, and electronic device and computer-readable medium - Google Patents

Request processing system, method and apparatus, and electronic device and computer-readable medium Download PDF

Info

Publication number
WO2021258575A1
WO2021258575A1 PCT/CN2020/118867 CN2020118867W WO2021258575A1 WO 2021258575 A1 WO2021258575 A1 WO 2021258575A1 CN 2020118867 W CN2020118867 W CN 2020118867W WO 2021258575 A1 WO2021258575 A1 WO 2021258575A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
address
target resource
target
parameter information
Prior art date
Application number
PCT/CN2020/118867
Other languages
French (fr)
Chinese (zh)
Inventor
李小强
张亮
任彦达
Original Assignee
北京旷视科技有限公司
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 北京旷视科技有限公司 filed Critical 北京旷视科技有限公司
Publication of WO2021258575A1 publication Critical patent/WO2021258575A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links

Definitions

  • the embodiments of the present application relate to the field of computer technology, and specifically relate to request processing systems, methods, devices, electronic equipment, and computer-readable media.
  • the front-end device can usually send a request to the back-end server through a browser to obtain the required resources.
  • a proxy server such as Nginx, etc.
  • Nginx such as Nginx, etc.
  • the resources returned by the back-end server Such as pictures, videos, texts, etc.
  • the address is forwarded to the front-end equipment. Therefore, when users view or download resources on the front-end page, they can request corresponding resources according to the resource address returned by the proxy server.
  • this request processing method requires frequent modification of the data in the back-end server, resulting in a large workload.
  • the back-end server needs to be restarted, resulting in poor system security and stability.
  • the embodiment of the application proposes a request processing system, method, device, electronic device, and computer readable medium to reduce the workload when the resource address is frequently changed, and improve the security and stability of the system when the resource address is frequently changed .
  • an embodiment of the present application provides a request processing system, including: a front-end device, a proxy server, a resource conversion server, and a back-end server; the proxy server is used to forward the resource address acquisition request sent by the front-end device to the back-end Server, and receive the original resource address returned by the back-end server, where the original resource address includes the original IP address of the device where the target resource is located and the parameter information of the target resource; the original IP address is replaced with the IP address of the resource conversion server to get the modification The resource address after the modification; the modified resource address is returned to the front-end device; the front-end device is used to send a target resource acquisition request containing parameter information to the resource conversion server based on the IP address in the modified resource address; the resource conversion server uses To determine the current resource address of the target resource based on the parameter information, obtain the target resource from the current resource address, and return the target resource to the front-end device.
  • the embodiments of the present application provide a request processing method, which is applied to a resource conversion server.
  • the resource conversion server communicates with a front-end device, and the front-end device communicates with the back-end server through a proxy server.
  • the method includes: receiving the front-end device The sent target resource acquisition request, where the target resource acquisition request includes parameter information of the target resource, the parameter information is obtained by the front-end device from the resource address, and the resource address is obtained by the proxy server by modifying the IP address in the original resource address, The original resource address is returned by the back-end server after receiving the resource address acquisition request forwarded by the front-end device via the proxy server; based on the parameter information, the current resource address of the target resource is determined; the target resource is obtained from the current resource address, and the target resource is returned To the front-end equipment.
  • an embodiment of the present application provides a request processing device.
  • the device includes: applied to a resource conversion server, the resource conversion server communicates with a front-end device, and the front-end device communicates with the back-end server through a proxy server.
  • the device includes : The receiving unit is configured to receive the target resource acquisition request sent by the front-end device.
  • the target resource acquisition request includes parameter information of the target resource.
  • the original IP address in the resource address is obtained by replacing the IP address of the resource conversion server.
  • the original resource address is returned by the back-end server after receiving the resource address acquisition request forwarded by the front-end device via the proxy server; the determining unit is configured to be based on parameters The information determines the current resource address of the target resource; the returning unit is configured to obtain the target resource from the current resource address and return the target resource to the front-end device.
  • an embodiment of the present application provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when one or more programs are used by one or more processors Execution causes one or more processors to implement the method as described in the second aspect.
  • an embodiment of the present application provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method as described in the second aspect is implemented.
  • the request processing system, method, device, electronic device, and computer-readable medium provided by the embodiments of the present application forward the resource address acquisition request sent by the front-end device to the back-end server through the proxy server, thereby receiving the original resource address returned by the back-end server , Where the original resource address includes the original IP address of the device where the target resource is located and the parameter information of the target resource. Then, the original IP address is replaced with the IP address of the resource conversion server through the proxy server, and the modified resource address is obtained, so that the modified resource address is returned to the front-end device. Afterwards, the front-end device sends a target resource acquisition request containing parameter information to the resource conversion server based on the IP address in the modified resource address.
  • the resource conversion server determines the current resource address of the target resource based on the parameter information, obtains the target resource from the current resource address, and returns the target resource to the front-end device.
  • a resource conversion server independent of the back-end server is introduced into the system.
  • the resource conversion server determines the current resource address of the target resource.
  • Fig. 1 is a schematic diagram of the interaction process between devices of the request processing system according to the present application
  • Fig. 2 is a schematic diagram of an application scenario of the request processing system according to the present application.
  • Fig. 3 is a schematic diagram of an application scenario of the request processing system according to the present application.
  • Fig. 4 is a schematic diagram of an application scenario of the request processing system according to the present application.
  • Fig. 5 is a schematic diagram of an application scenario of the request processing system according to the present application.
  • Fig. 6 is a schematic diagram of an application scenario of the request processing system according to the present application.
  • Fig. 7 is a flowchart of an embodiment of a request processing method according to the present application.
  • Fig. 8 is a schematic structural diagram of an embodiment of a request processing apparatus according to the present application.
  • Fig. 9 is a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application.
  • the request processing system includes front-end equipment, proxy server, resource conversion server and back-end server.
  • the front-end equipment can be hardware or software.
  • the front-end device When the front-end device is hardware, it can be various electronic devices that support network information transmission, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and wearable devices.
  • the front-end device can send the request through an application (such as a browser) installed on it.
  • the front-end device When the front-end device is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. There is no specific limitation here.
  • the proxy server may be a proxy web (network) server such as Nginx (engine x).
  • the request of the front-end device (such as a resource address acquisition request) can be forwarded to the back-end server, and the address of the resource (such as pictures, videos, text, etc.) returned by the back-end server can be forwarded to the front-end device.
  • the front-end equipment and the back-end server are isolated.
  • the resource conversion server may be a device that provides resource conversion services, and the device may be hardware or software.
  • the device When the device is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server.
  • the device When the device is software, it can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. There is no specific limitation here.
  • the back-end server may be a server that provides data support for the front-end device.
  • the back-end server can interact with the front-end device through the proxy server to process resource address acquisition requests and so on.
  • the resource conversion server can be hardware or software.
  • the device When the device is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server.
  • the device When the device is software, it can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. There is no specific limitation here.
  • the interaction process of each device of the request processing system may include the following steps:
  • Step 101 The front-end device sends a resource address acquisition request to the proxy server.
  • the front-end device can send a resource address acquisition request to the proxy server through a browser application installed on it.
  • the resource address acquisition request can be used to request the resource address.
  • the resource address may refer to the access address of the resource, and specifically may refer to the URL (Uniform Resource Locator, Uniform Resource Locator) of the resource.
  • the resources here can be various network data, such as pictures, videos, texts, etc.
  • the user can trigger the sending of the resource address acquisition request in various ways. For example, if a user clicks on a certain link on a certain page through a browser, he can send a resource address acquisition request through the browser to request the URL of the resource corresponding to the link. For another example, if a user enters a search term in a search engine and clicks a search button, he can send a resource address acquisition request through the browser to request the URL of the search result corresponding to the search term.
  • Step 102 The proxy server forwards the resource address acquisition request to the back-end server.
  • the proxy server may forward the resource address acquisition request to the back-end server.
  • Step 103 The back-end server returns the original resource address to the proxy server.
  • the back-end server after receiving the resource address acquisition request, the back-end server can query and return the original resource address of the target resource requested by the resource address acquisition request. It should be noted that, in addition to the original resource address, the data returned by the back-end server to the proxy server may also include other data for supporting network communication, which is not limited in this embodiment.
  • the original resource address may be the original URL of the target resource. It is understandable that the URL of the resource may be changed according to business needs, so the original URL may be the URL before the change of the target resource, that is, the URL to be changed.
  • the original resource address may include the original IP (Internet Protocol, Internet Protocol) address of the device where the target resource is located and parameter information of the target resource.
  • the device where the target resource is located here is the device storing the target resource. Since the URL of the resource may be changed according to business needs and the changed content may be the IP address of the device where the target resource is located, the IP address in the original resource address may be called the original IP address.
  • the URL usually contains various information such as IP address, port, URL parameters, path, transmission protocol, etc. Therefore, the parameter information here may refer to information other than the IP address in the original URL of the target resource. Such as port, URL parameter, path, transmission protocol information, etc.
  • Step 104 The proxy server replaces the original IP address with the IP address of the resource conversion server to obtain the modified resource address.
  • the proxy server can replace the original IP address in the original resource address with the IP address of the resource conversion server to obtain the modified resource address.
  • the sub_filter module of Nginx can be used to replace the original IP address with the IP address of the resource conversion server.
  • IP1 is used to represent the original IP address
  • IPs is used to represent the IP address of the resource conversion server
  • the original IP address (ie IP1) in the original resource address can be replaced with the resource by adding the code sub_filter'IP1''IPs' Convert the IP address (ie IPs) of the server so that the modified resource address points to the resource conversion server.
  • Step 105 The proxy server returns the modified resource address to the front-end device.
  • Step 106 The front-end device sends a target resource acquisition request including parameter information to the resource conversion server based on the IP address in the modified resource address.
  • the IP address in the modified resource address (that is, the modified URL) obtained by the front-end device is the IP address of the resource conversion server. Therefore, the modified resource address points to the resource conversion server. With this, a target resource acquisition request can be sent to the resource conversion server to acquire the target resource.
  • the target resource acquisition request here may include parameter information in the modified resource address, and the parameter information is the same as the parameter information in the original resource address.
  • Step 107 The resource conversion server determines the current resource address of the target resource based on the parameter information.
  • the resource conversion server may determine the current resource address of the target resource based on the parameter information in the received target resource acquisition request.
  • different resource address conversion rules can be preset for different resource address change scenarios, and the current resource address of the target resource can be generated based on the resource address conversion rule.
  • the new IP address can be stored in the resource conversion server in advance.
  • the resource conversion server After the resource conversion server receives the target resource acquisition request, it combines the new IP address with the parameter information in the target resource acquisition request to obtain a new URL, that is, the current resource address.
  • the new URL is the URL obtained by replacing the IP address in the original URL with the new IP address.
  • the corresponding relationship between the original path and the new path can be set in advance, and the corresponding relationship can be stored In the resource conversion server.
  • the resource conversion server After the resource conversion server receives the target resource acquisition request, it may replace the original path in the parameter information carried in the target resource acquisition request with a new path corresponding to the original path.
  • the proxy server will replace the original IP address with the IP address of the resource server.
  • the resource conversion server can pre-store the original IP address (that is, the above-mentioned designated IP address), so that after replacing the original path in the parameter information with the new path, the original IP address and the updated path The parameter information is combined to obtain a new URL, that is, the current resource address.
  • the original IP address may not be restricted. For example, every time the proxy server receives the original resource address returned by the back-end server, it can replace the original IP address in the original resource address with the IP address of the resource server .
  • the resource conversion server may also pre-store the correspondence between the resource ID and the IP address of the device where the resource is located.
  • the original path in the parameter information carried in the target resource acquisition request may include a resource ID, and based on the resource ID and the foregoing corresponding relationship, the IP address of the device where the target resource is located can be determined. Therefore, after replacing the original path in the parameter information with the new path, the IP address of the device where the target resource is located can be combined with the updated path parameter information to obtain a new URL, that is, the current resource address.
  • the IP address recorded in the correspondence is the original IP address.
  • the IP address recorded in the correspondence is the latest IP address, and the resource conversion server can maintain the correspondence to update the correspondence in real time. Therefore, when the IP address of the device where the target resource is located and the path of the resource change at the same time, the resource conversion server can also determine the current resource address.
  • the resource address change scenario and the resource address conversion rule can also be set as needed, and are not limited to the above examples.
  • Step 108 The resource conversion server obtains the target resource from the current resource address.
  • the resource conversion server can obtain the target resource from the current resource address.
  • Step 109 The resource conversion server returns the target resource to the front-end device.
  • FIG. 2 shows a schematic diagram of an application scenario of the request processing system.
  • the browser that is, the front-end device
  • Nginx which can be regarded as a proxy server
  • the back-end service cluster can return the original resource address based on the request.
  • the original resource address contains the original IP address of the device where the target resource is located.
  • Nginx can modify the IP address in the original resource address to the IP address of the resource conversion server through the sub_filter module, so that the modified resource address points to the resource conversion server.
  • Nginx can return the modified resource address to the browser.
  • the browser can request the resource from the resource conversion server.
  • the resource conversion server can determine the new resource address (that is, the current resource address), and obtain the resource from the new resource address, thereby forwarding the obtained resource to the browser.
  • the acquired resources may be resources in the new IP address, resources under the new rule path, third-party resources, and so on.
  • the resource conversion server can also be used to determine the current resource address based on other rules, thereby improving the scalability of the resource address change scenario.
  • the resource conversion server may first determine the resource address change type of the target resource.
  • the resource address change type may include but is not limited to at least one of the following: the IP address of the device where the target resource is located is changed, the path of the target resource is changed, and the transmission protocol is changed. Then, the resource conversion server can determine the current resource address of the target resource based on the parameter information and the resource address change type.
  • the resource address change type is that the IP address of the device where the target resource is located changes.
  • the resource conversion server can obtain the current IP address of the device where the target resource is located. Then, based on the current IP address and parameter information, the current resource address of the target resource is determined. For example, by combining the current IP address and parameter information, the current resource address is obtained.
  • FIG. 3 shows a schematic diagram of the application scenario of the request processing system.
  • the browser that is, the front-end device
  • Nginx which can be regarded as a proxy server
  • the back-end service cluster can return the original resource address based on the request.
  • the original resource address contains the original IP address of the device where the target resource is located.
  • Nginx can use the sub_filter module to modify the original IP address in the original resource address (IP1 in Figure 3) to the IP address of the resource conversion server (IPs in Figure 3), so that the modified resource address points to the resource conversion server.
  • Nginx can return the modified resource address to the browser.
  • the browser can request the resource from the resource conversion server.
  • the IP address of the device where the target resource is located IP1 in FIG. 3 can be changed to IP2, IP3, or IP4 in FIG. 3, etc.
  • the resource conversion server can determine a new resource address based on the new IP address (such as IP2, IP3, or IP4, etc.) and the parameter information carried in the request.
  • the resource can be obtained from the new resource address, so that the obtained resource is forwarded to the browser.
  • the resource conversion server independent of the back-end server points to the changed IP address to obtain resources, without modifying the data in the back-end server or restarting the back-end server. This reduces the workload and improves the safety and stability of the system.
  • the parameter information may include the original path of the target resource.
  • the resource address change type is that the path of the target resource changes.
  • the resource conversion server may replace the original path in the parameter information with the current path of the target resource.
  • the current resource address of the target resource can be determined based on the original IP address of the storage device of the target resource and the parameter information after the replacement path. For example, by combining the original IP address and the parameter information after the replacement path, the current resource address is obtained.
  • Fig. 4 shows a schematic diagram of the application scenario of the request processing system.
  • the browser that is, the front-end device
  • Nginx which can be regarded as a proxy server
  • the back-end service cluster can return the original resource address based on the request.
  • the original resource address contains the original IP address of the device where the target resource is located.
  • Nginx can use the sub_filter module to modify the original IP address in the original resource address (IP in Figure 4) to the IP address of the resource conversion server (IPs in Figure 4), so that the modified resource address points to the resource conversion server.
  • Nginx can return the modified resource address to the browser.
  • the browser can request the resource from the resource conversion server.
  • the original path is path1
  • the new path (path) can be path2, path3, or path4. Therefore, the resource conversion server can replace the original path path1 in the parameter information with a new path (path2, path3, or path4, etc.). Then, the resource conversion server can obtain the required resources from the device pointed to by the original IP address according to the parameter information replaced with the new path, and thus forward the obtained resources to the browser.
  • the resource conversion server independent of the back-end server points to the resource address after the changed path to obtain resources, without modifying the data in the back-end server or restarting the back-end server. This reduces the workload and improves the safety and stability of the system.
  • the IP address of the device where the target resource is located and the path in the resource address can be changed at the same time.
  • the operations involved in FIG. 3 and FIG. 4 can be combined at the same time, in the device pointed to by the changed IP address, the target resource can be obtained according to the changed path.
  • the parameter information may include the identification (such as ID) of the target resource.
  • the resource conversion server can be connected to or deployed with a database. The latest resource address corresponding to each resource identifier can be stored in the database. At this time, after receiving the target resource acquisition request, the resource conversion server may query the database for the resource address associated with the identifier of the target resource. Thus, the resource address that is queried can be determined as the current resource address of the target resource.
  • FIG. 5 shows a schematic diagram of the application scenario of the request processing system.
  • the browser that is, the front-end device
  • Nginx which can be regarded as a proxy server
  • the back-end service cluster can return the original resource address based on the request.
  • the original resource address contains the original IP address of the device where the target resource is located.
  • Nginx can use the sub_filter module to modify the original IP address in the original resource address (IP in Figure 5) to the IP address of the resource conversion server (IPs in Figure 5), so that the modified resource address points to the resource conversion server.
  • Nginx can return the modified resource address to the browser.
  • the browser can request the resource from the resource conversion server.
  • the resource conversion server can query the database based on the ID of the resource in the parameter information in the request, so as to obtain the new URL (that is, the new resource address) of the required resource.
  • the database may include the new URL corresponding to each resource. Different resources have different IDs, such as ID1, ID2, and so on. After obtaining the new URL of the required resource, the resource conversion server can obtain the resource according to the new URL, thereby forwarding the obtained resource to the browser.
  • the resource conversion server independent of the back-end server can query the current resource address of the target resource from the database based on the identification of the target resource, without modifying the data in the back-end server, and there is no need to restart the back-end server.
  • the workload has improved the safety and stability of the system.
  • the type of resource address change is a change in the transfer protocol, such as converting HTTP (Hyper Text Transfer Protocol) to FTP (File Transfer Protocol).
  • the resource conversion server can obtain the IP address of the device where the target resource that complies with the current transmission protocol is located. Then, the transmission protocol information in the parameter information is replaced with the changed target transmission protocol information (that is, the new transmission protocol information).
  • the current resource address of the target resource can be determined based on the acquired IP address and the parameter information after replacing the transmission protocol. For example, by combining the IP address and the parameter information after replacing the transmission protocol, the current resource address is obtained.
  • FIG. 6 shows a schematic diagram of the application scenario of the request processing system.
  • the browser that is, the front-end device
  • Nginx which can be regarded as a proxy server
  • the back-end service cluster can return the original resource address based on the request.
  • the original resource address contains the original IP address of the device where the target resource is located.
  • Nginx can use the sub_filter module to modify the original IP address in the original resource address (IP in Figure 6) to the IP address of the resource conversion server (IPs in Figure 6), so that the modified resource address points to the resource conversion server.
  • Nginx can return the modified resource address to the browser.
  • the browser can request the resource from the resource conversion server.
  • the transfer protocol is changed from HTTP to FTP.
  • the resource conversion server can be pre-configured with the IP address of the device (such as the FTP server) where the target resource that follows the current transfer protocol is located. At this time, the resource conversion server can directly obtain the IP address locally, thereby obtaining the required resource from the FTP server pointed to by the IP address according to the parameter information, and forwarding the obtained resource to the browser.
  • the resource conversion server independent of the back-end server obtains resources from the devices that comply with the changed transmission protocol, without modifying the data in the back-end server, and without restarting the back-end server. Less workload and improved system safety and stability.
  • the request processing system forwards the resource address acquisition request sent by the front-end device to the back-end server through the proxy server, thereby receiving the original resource address returned by the back-end server, where the original resource address includes the device where the target resource is located The original IP address and the parameter information of the target resource. Then, the original IP address is replaced with the IP address of the resource conversion server through the proxy server, and the modified resource address is obtained, so that the modified resource address is returned to the front-end device. Afterwards, the front-end device sends a target resource acquisition request containing parameter information to the resource conversion server based on the IP address in the modified resource address.
  • the resource conversion server determines the current resource address of the target resource based on the parameter information, obtains the target resource from the current resource address, and returns the target resource to the front-end device.
  • a resource conversion server independent of the back-end server is introduced into the system.
  • the resource conversion server determines the current resource address of the target resource.
  • FIG. 7 shows a flow 700 of an embodiment of a request processing method according to the present application.
  • the request processing method is applied to a resource conversion server, the above-mentioned resource conversion server is in communication connection with a front-end device, and the above-mentioned front-end device is in communication connection with the back-end server through a proxy server.
  • the request processing method includes the following steps:
  • Step 701 Receive a target resource acquisition request sent by a front-end device.
  • the execution subject of the request processing method can receive the target resource acquisition request sent by the front-end device.
  • the target resource acquisition request may include parameter information of the target resource.
  • the above-mentioned parameter information can be obtained by the front-end device from the resource address.
  • the above resource address can be obtained by the proxy server by modifying the IP address in the original resource address (for example, the original IP address of the device where the target resource is located is modified to the IP address of the resource conversion server, so that the modified resource address can point to the resource conversion server).
  • the foregoing original resource address may be returned by the back-end server after receiving the resource address acquisition request forwarded by the front-end device via the proxy server.
  • Step 702 Determine the current resource address of the target resource based on the parameter information.
  • the above-mentioned execution subject may determine the current resource address of the target resource based on the parameter information.
  • the above-mentioned execution subject may determine the resource address change type of the above-mentioned target resource.
  • the aforementioned resource address change type includes one or more of the change of the IP address of the device where the target resource is located, the change of the path of the target resource, and the change of the transmission protocol. Then, the current resource address of the target resource can be determined based on the parameter information and the resource address change type.
  • the execution subject in response to the resource address change type being the IP address of the device where the target resource is changed, may obtain the current IP address of the device where the target resource is located. Then, the current resource address of the target resource can be determined based on the current IP address and the parameter information.
  • the foregoing parameter information includes the original path of the foregoing target resource.
  • the execution subject may replace the original path in the parameter information with the current path of the target resource. Then, the current resource address of the target resource can be determined based on the original IP address of the storage device of the target resource and the parameter information after the replacement path.
  • the above-mentioned parameter information includes the identifier of the above-mentioned target resource.
  • the above-mentioned execution subject can query the resource address associated with the above-mentioned identifier from the database. Then, the resource address found can be determined as the current resource address of the aforementioned target resource.
  • the above-mentioned executive body may obtain the IP address of the device where the target resource that complies with the current transmission protocol is located. Then, the current resource address of the target resource can be determined based on the obtained IP address and the parameter information.
  • Step 703 Obtain the target resource from the current resource address, and return the target resource to the front-end device.
  • steps 701 to 703 can refer to the corresponding steps in the embodiment corresponding to FIG. 1, which will not be repeated here.
  • the resource conversion server receives the target resource acquisition request containing parameter information sent by the front-end device, and then determines the current resource address of the target resource based on the parameter information, and finally acquires the target resource from the current resource address. And return the target resource to the front-end equipment.
  • the current resource address of the target resource can be determined by the resource conversion server independent of the back-end server.
  • this application provides an embodiment of a request processing apparatus.
  • the apparatus embodiment corresponds to the method embodiment shown in FIG.
  • the above-mentioned resource conversion server is in communication connection with a front-end device
  • the above-mentioned front-end device is in a communication connection with the back-end server through a proxy server.
  • the request processing apparatus 800 in this embodiment includes: a receiving unit 801 configured to receive a target resource acquisition request sent by a front-end device, wherein the target resource acquisition request includes parameter information of the target resource,
  • the above-mentioned parameter information is obtained by the above-mentioned front-end device from the resource address
  • the above-mentioned resource address is obtained by the above-mentioned proxy server by replacing the original IP address in the original resource address with the IP address of the above-mentioned resource conversion server, and the above-mentioned original resource address is obtained by the above-mentioned back-end
  • the server returns after receiving the resource address acquisition request forwarded by the front-end device via the above-mentioned proxy server
  • the determining unit 802 is configured to determine the current resource address of the above-mentioned target resource based on the above-mentioned parameter information
  • the returning unit 803 is configured to obtain the current resource address from the above-mentioned current Obtain the target resource from the resource address,
  • the determining unit 802 is further configured to determine the resource address change type of the target resource, where the resource address change type includes a change in the IP address of the device where the target resource is located. One or more of a change in the path of the target resource and a change in the transmission protocol; based on the above parameter information and the above resource address change type, the current resource address of the above target resource is determined.
  • the determining unit 802 is further configured to: in response to the resource address change type being the IP address of the device where the target resource is changed, obtain the current IP of the device where the target resource is located. Address: Based on the current IP address and the parameter information, the current resource address of the target resource is determined.
  • the aforementioned parameter information includes the original path of the aforementioned target resource; and, the aforementioned determining unit 802 is further configured to respond to the occurrence of the aforementioned resource address change type being the path of the aforementioned target resource. Change, replace the original path in the parameter information with the current path of the target resource; determine the current resource address of the target resource based on the original IP address of the storage device of the target resource and the parameter information after the replacement path.
  • the above-mentioned parameter information includes the identifier of the above-mentioned target resource; and, the above-mentioned determining unit 802 is further configured to query the resource address associated with the above-mentioned identifier from the database; The resource address of is determined as the current resource address of the aforementioned target resource.
  • the above determining unit 802 is further configured to: in response to the above resource address change type being a transmission protocol change, obtain the IP address of the device where the target resource that complies with the current transmission protocol is located; Replace the transmission protocol information in the above parameter information with the changed target transmission protocol information; determine the current resource address of the above target resource based on the acquired IP address and the parameter information after replacing the transmission information.
  • the device provided by the foregoing embodiment of the present application receives a target resource acquisition request containing parameter information sent by a front-end device through a resource conversion server, and then determines the current resource address of the target resource based on the parameter information, and finally acquires the target resource from the current resource address, And return the target resource to the front-end equipment.
  • the current resource address of the target resource can be determined by the resource conversion server independent of the back-end server.
  • FIG. 9 shows a schematic structural diagram of a computer system 900 suitable for implementing an electronic device according to an embodiment of the present application.
  • the electronic device shown in FIG. 9 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present application.
  • the computer system 900 includes a central processing unit (CPU) 901, which can be based on a program stored in a read-only memory (ROM) 902 or a program loaded from a storage portion 908 into a random access memory (RAM) 903 And perform various appropriate actions and processing.
  • ROM read-only memory
  • RAM random access memory
  • various programs and data required for the operation of the system 900 are also stored.
  • the CPU 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904.
  • An input/output (I/O) interface 905 is also connected to the bus 904.
  • the following components are connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a liquid crystal display (LCD), etc., and speakers, etc.; a storage section 908 including a hard disk, etc.;
  • the communication section 909 performs communication processing via a network such as the Internet.
  • the drive 910 is also connected to the I/O interface 905 as needed.
  • a removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that the computer program read from it is installed into the storage portion 908 as needed.
  • the process described above with reference to the flowchart can be implemented as a computer software program.
  • the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication part 909, and/or installed from the removable medium 911.
  • the central processing unit (CPU) 901 the above-mentioned functions defined in the method of the present application are executed.
  • the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein.
  • This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
  • each block in the flowchart or block diagram can represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logic function.
  • Executable instructions can also occur in a different order from the order marked in the drawings. For example, two blocks shown one after the other can actually be executed substantially in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in this application can be implemented in software or hardware.
  • the described units can also be arranged in the processor, where the names of these units do not constitute a limitation on the unit itself under certain circumstances.
  • the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist alone without being assembled into the device.
  • the above-mentioned computer-readable medium carries one or more programs.
  • the apparatus is caused to receive a target resource acquisition request sent by the front-end equipment, wherein the target resource acquisition request
  • the parameter information of the target resource, the parameter information is obtained by the front-end device from the resource address, the resource address is obtained by the proxy server by modifying the IP address in the original resource address, and the original resource address is obtained by the source
  • the back-end server returns after receiving the resource address acquisition request forwarded by the front-end device via the proxy server; determines the current resource address of the target resource based on the parameter information; acquires the target from the current resource address Resource, and return the target resource to the front-end device.

Abstract

Disclosed are a request processing system, method and apparatus, and an electronic device and a computer-readable medium. The system comprises a front-end device, a proxy server, a resource transformation server and a back-end server, wherein the proxy server is used for forwarding, to the back-end server, a resource address acquisition request sent by the front-end device, so as to receive an original resource address returned by the back-end server, replacing an original IP address in the original resource address with an IP address of the resource transformation server, and returning a modified resource address to the front-end device; the front-end device is used for sending, to the resource transformation server and on the basis of the IP address in the modified resource address, a target resource acquisition request that includes parameter information; and the resource transformation server is used for determining the current resource address of a target resource on the basis of the parameter information, acquiring the target resource from the current resource address, and returning the target resource to the front-end device. By means of the embodiments, the security and stability of a system are improved when frequent changes occur in terms of a resource address.

Description

请求处理系统、方法、装置、电子设备和计算机可读介质Request processing system, method, device, electronic equipment and computer readable medium
本申请要求在2020年6月22日提交中国专利局、申请号为202010576545.2、发明名称为“请求处理系统、方法、装置、电子设备和计算机可读介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on June 22, 2020, the application number is 202010576545. 2, and the invention title is "request processing system, method, device, electronic equipment and computer readable medium", all of which The content is incorporated in this application by reference.
技术领域Technical field
本申请实施例涉及计算机技术领域,具体涉及请求处理系统、方法、装置、电子设备和计算机可读介质。The embodiments of the present application relate to the field of computer technology, and specifically relate to request processing systems, methods, devices, electronic equipment, and computer-readable media.
背景技术Background technique
随着互联网技术的发展,各平台的资源访问量越来越大。前端设备通常可浏览器向后端服务器发送请求,以获取所需资源。With the development of Internet technology, the amount of resource visits on various platforms is increasing. The front-end device can usually send a request to the back-end server through a browser to obtain the required resources.
现有技术中,在前端设备与后端服务器进行交互时,通常通过一个代理服务器(如Nginx等)将前端设备的请求转发给后端服务器,并通过该代理服务器将后端服务器返回的资源(如图片、视频、文本等)地址转发给前端设备。由此,用户在前端页面中查看或者下载资源时,可根据代理服务器返回的资源地址请求相应资源。然而,当资源地址发生频繁变更时,这种请求处理方式需要频繁修改后端服务器中的数据,导致工作量较大。同时,每进行一次修改,需要重启一次后端服务器,导致系统的安全性和稳定性较差。In the prior art, when a front-end device interacts with a back-end server, a proxy server (such as Nginx, etc.) is usually used to forward the request of the front-end device to the back-end server, and the resources returned by the back-end server ( Such as pictures, videos, texts, etc.) The address is forwarded to the front-end equipment. Therefore, when users view or download resources on the front-end page, they can request corresponding resources according to the resource address returned by the proxy server. However, when the resource address is frequently changed, this request processing method requires frequent modification of the data in the back-end server, resulting in a large workload. At the same time, every time a modification is made, the back-end server needs to be restarted, resulting in poor system security and stability.
发明内容Summary of the invention
本申请实施例提出了请求处理系统、方法、装置、电子设备和计算机可读介质,以降低在资源地址发生频繁变更时的工作量,提高系统在资源地址发生频繁变更时的安全性和稳定性。The embodiment of the application proposes a request processing system, method, device, electronic device, and computer readable medium to reduce the workload when the resource address is frequently changed, and improve the security and stability of the system when the resource address is frequently changed .
第一方面,本申请实施例提供了一种请求处理系统,包括:前端设备、代理服务器、资源转换服务器和后端服务器;代理服务器,用于将前端设备发送的资源地址获取请求转发至后端服务器,并接收后端服务 器返回的原始资源地址,其中,原始资源地址中包括目标资源所在设备的原始IP地址和目标资源的参数信息;将原始IP地址替换为资源转换服务器的IP地址,得到修改后的资源地址;向前端设备返回修改后的资源地址;前端设备,用于基于修改后的资源地址中的IP地址,向资源转换服务器发送包含参数信息的目标资源获取请求;资源转换服务器,用于基于参数信息确定目标资源的当前资源地址,从当前资源地址中获取目标资源,并将目标资源返回至前端设备。In the first aspect, an embodiment of the present application provides a request processing system, including: a front-end device, a proxy server, a resource conversion server, and a back-end server; the proxy server is used to forward the resource address acquisition request sent by the front-end device to the back-end Server, and receive the original resource address returned by the back-end server, where the original resource address includes the original IP address of the device where the target resource is located and the parameter information of the target resource; the original IP address is replaced with the IP address of the resource conversion server to get the modification The resource address after the modification; the modified resource address is returned to the front-end device; the front-end device is used to send a target resource acquisition request containing parameter information to the resource conversion server based on the IP address in the modified resource address; the resource conversion server uses To determine the current resource address of the target resource based on the parameter information, obtain the target resource from the current resource address, and return the target resource to the front-end device.
第二方面,本申请实施例提供了一种请求处理方法,应用于资源转换服务器,资源转换服务器与前端设备通信连接,前端设备通过代理服务器与后端服务器通信连接,该方法包括:接收前端设备发送的目标资源获取请求,其中,目标资源获取请求中包括目标资源的参数信息,参数信息由前端设备从资源地址中获取,资源地址由代理服务器通过对原始资源地址中的IP地址修改后得到,原始资源地址由后端服务器在接收到前端设备经由代理服务器转发的资源地址获取请求后返回;基于参数信息,确定目标资源的当前资源地址;从当前资源地址中获取目标资源,并将目标资源返回至前端设备。In the second aspect, the embodiments of the present application provide a request processing method, which is applied to a resource conversion server. The resource conversion server communicates with a front-end device, and the front-end device communicates with the back-end server through a proxy server. The method includes: receiving the front-end device The sent target resource acquisition request, where the target resource acquisition request includes parameter information of the target resource, the parameter information is obtained by the front-end device from the resource address, and the resource address is obtained by the proxy server by modifying the IP address in the original resource address, The original resource address is returned by the back-end server after receiving the resource address acquisition request forwarded by the front-end device via the proxy server; based on the parameter information, the current resource address of the target resource is determined; the target resource is obtained from the current resource address, and the target resource is returned To the front-end equipment.
第三方面,本申请实施例提供了一种请求处理装置,该装置包括:应用于资源转换服务器,资源转换服务器与前端设备通信连接,前端设备通过代理服务器与后端服务器通信连接,该装置包括:接收单元,被配置成接收前端设备发送的目标资源获取请求,其中,目标资源获取请求中包括目标资源的参数信息,参数信息由前端设备从资源地址中获取,资源地址由代理服务器通过将原始资源地址中的原始IP地址替换为资源转换服务器的IP地址后得到,原始资源地址由后端服务器在接收到前端设备经由代理服务器转发的资源地址获取请求后返回;确定单元,被配置成基于参数信息,确定目标资源的当前资源地址;返回单元,被配置成从当前资源地址中获取目标资源,并将目标资源返回至前端设备。In a third aspect, an embodiment of the present application provides a request processing device. The device includes: applied to a resource conversion server, the resource conversion server communicates with a front-end device, and the front-end device communicates with the back-end server through a proxy server. The device includes : The receiving unit is configured to receive the target resource acquisition request sent by the front-end device. The target resource acquisition request includes parameter information of the target resource. The original IP address in the resource address is obtained by replacing the IP address of the resource conversion server. The original resource address is returned by the back-end server after receiving the resource address acquisition request forwarded by the front-end device via the proxy server; the determining unit is configured to be based on parameters The information determines the current resource address of the target resource; the returning unit is configured to obtain the target resource from the current resource address and return the target resource to the front-end device.
第四方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第二方面中所描述的方法。In a fourth aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when one or more programs are used by one or more processors Execution causes one or more processors to implement the method as described in the second aspect.
第五方面,本申请实施例提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现如第二方面中所描述的方法。In the fifth aspect, an embodiment of the present application provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method as described in the second aspect is implemented.
本申请实施例提供的请求处理系统、方法、装置、电子设备和计算机可读介质,通过代理服务器将前端设备发送的资源地址获取请求转发至后端服务器,从而接收后端服务器返回的原始资源地址,其中,原始资源地址中包括目标资源所在设备的原始IP地址和目标资源的参数信息。而后通过代理服务器将原始IP地址替换为资源转换服务器的IP地址,得到修改后的资源地址,从而向前端设备返回修改后的资源地址。之后通过前端设备基于修改后的资源地址中的IP地址,向资源转换服务器发送包含参数信息的目标资源获取请求。最后通过资源转换服务器基于参数信息确定目标资源的当前资源地址,从当前资源地址中获取目标资源,并将目标资源返回至前端设备。由此,在系统中引入了独立于后端服务器的资源转换服务器,通过该资源转换服务器确定目标资源的当前资源地址,在资源地址发生频繁变更时,无需频繁修改后端服务器中的数据,也无需频繁重启后端服务器,从而较少了工作量,提高了系统的安全性和稳定性。The request processing system, method, device, electronic device, and computer-readable medium provided by the embodiments of the present application forward the resource address acquisition request sent by the front-end device to the back-end server through the proxy server, thereby receiving the original resource address returned by the back-end server , Where the original resource address includes the original IP address of the device where the target resource is located and the parameter information of the target resource. Then, the original IP address is replaced with the IP address of the resource conversion server through the proxy server, and the modified resource address is obtained, so that the modified resource address is returned to the front-end device. Afterwards, the front-end device sends a target resource acquisition request containing parameter information to the resource conversion server based on the IP address in the modified resource address. Finally, the resource conversion server determines the current resource address of the target resource based on the parameter information, obtains the target resource from the current resource address, and returns the target resource to the front-end device. As a result, a resource conversion server independent of the back-end server is introduced into the system. The resource conversion server determines the current resource address of the target resource. When the resource address changes frequently, there is no need to frequently modify the data in the back-end server. There is no need to restart the back-end server frequently, which reduces the workload and improves the security and stability of the system.
附图说明Description of the drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, purposes, and advantages of the present application will become more apparent:
图1是根据本申请的请求处理系统的各装置间的交互过程示意图;Fig. 1 is a schematic diagram of the interaction process between devices of the request processing system according to the present application;
图2是根据本申请的请求处理系统的应用场景的示意图;Fig. 2 is a schematic diagram of an application scenario of the request processing system according to the present application;
图3是根据本申请的请求处理系统的应用场景的示意图;Fig. 3 is a schematic diagram of an application scenario of the request processing system according to the present application;
图4是根据本申请的请求处理系统的应用场景的示意图;Fig. 4 is a schematic diagram of an application scenario of the request processing system according to the present application;
图5是根据本申请的请求处理系统的应用场景的示意图;Fig. 5 is a schematic diagram of an application scenario of the request processing system according to the present application;
图6是根据本申请的请求处理系统的应用场景的示意图;Fig. 6 is a schematic diagram of an application scenario of the request processing system according to the present application;
图7是根据本申请的请求处理方法的一个实施例的流程图;Fig. 7 is a flowchart of an embodiment of a request processing method according to the present application;
图8是根据本申请的请求处理装置的一个实施例的结构示意图;Fig. 8 is a schematic structural diagram of an embodiment of a request processing apparatus according to the present application;
图9是适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。Fig. 9 is a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application.
具体实施例Specific embodiment
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described here are only used to explain the related invention, but not to limit the invention. In addition, it should be noted that, for ease of description, only the parts related to the relevant invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other if there is no conflict. Hereinafter, the present application will be described in detail with reference to the drawings and in conjunction with the embodiments.
进一步参考图1,其示出了请求处理系统的各装置交互过程的示意图。请求处理系统包括前端设备、代理服务器、资源转换服务器和后端服务器。With further reference to FIG. 1, it shows a schematic diagram of the interaction process of each device of the request processing system. The request processing system includes front-end equipment, proxy server, resource conversion server and back-end server.
此处,前端设备可以是硬件,也可以是软件。当前端设备为硬件时,可以是支持网络信息传输的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、膝上型便携计算机、台式计算机和可穿戴设备等。此时,前端设备可通过安装于其上的应用程序(如浏览器)进行请求的发送。当前端设备为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块。在此不做具体限定。Here, the front-end equipment can be hardware or software. When the front-end device is hardware, it can be various electronic devices that support network information transmission, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and wearable devices. At this time, the front-end device can send the request through an application (such as a browser) installed on it. When the front-end device is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. There is no specific limitation here.
此处,代理服务器可以是诸如Nginx(engine x)等的代理web(网络)服务器。可以将前端设备的请求(如资源地址获取请求)转发给后端服务器,并通将后端服务器返回的资源(如图片、视频、文本等)地址转发给前端设备。由此,实现前端设备与后端服务器的隔离。Here, the proxy server may be a proxy web (network) server such as Nginx (engine x). The request of the front-end device (such as a resource address acquisition request) can be forwarded to the back-end server, and the address of the resource (such as pictures, videos, text, etc.) returned by the back-end server can be forwarded to the front-end device. In this way, the front-end equipment and the back-end server are isolated.
此处,资源转换服务器可以是提供资源转换服务的装置,该装置可以是硬件,也可以是软件。当该装置为硬件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器。当该装置为软件时,可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块。在此不做具体限定。Here, the resource conversion server may be a device that provides resource conversion services, and the device may be hardware or software. When the device is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the device is software, it can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. There is no specific limitation here.
此处,后端服务器可以是为前端设备提供数据支持的服务器。后端服务器可以通过代理服务器与前端设备交互,以处理资源地址获取请求等。同理,资源转换服务器可以是硬件,也可以是软件。当该设备为硬 件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器。当该设备为软件时,可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块。在此不做具体限定。Here, the back-end server may be a server that provides data support for the front-end device. The back-end server can interact with the front-end device through the proxy server to process resource address acquisition requests and so on. Similarly, the resource conversion server can be hardware or software. When the device is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the device is software, it can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. There is no specific limitation here.
请求处理系统的各装置交互过程可以包括如下步骤:The interaction process of each device of the request processing system may include the following steps:
步骤101,前端设备向代理服务器发送资源地址获取请求。Step 101: The front-end device sends a resource address acquisition request to the proxy server.
在本实施例中,前端设备可通过其所安装的浏览器应用,向代理服务器发送资源地址获取请求。此处,资源地址获取请求可用于请求资源地址。资源地址可以指资源的访问地址,具体可以指资源的URL(Uniform Resource Locator,统一资源定位符)。此处的资源可以是各种网络数据,如图片、视频、文本等。In this embodiment, the front-end device can send a resource address acquisition request to the proxy server through a browser application installed on it. Here, the resource address acquisition request can be used to request the resource address. The resource address may refer to the access address of the resource, and specifically may refer to the URL (Uniform Resource Locator, Uniform Resource Locator) of the resource. The resources here can be various network data, such as pictures, videos, texts, etc.
实践中,用户可通过各种方式触发资源地址获取请求的发送。例如,用户通过浏览器在某页面中点击了某一链接,则可以通过浏览器发送资源地址获取请求,以请求该链接对应的资源的URL。再例如,用户在搜索引擎中输入了某一搜索词,并点击了搜索按键,则可以通过浏览器发送资源地址获取请求,以请求该搜索词对应的搜索结果的URL。In practice, the user can trigger the sending of the resource address acquisition request in various ways. For example, if a user clicks on a certain link on a certain page through a browser, he can send a resource address acquisition request through the browser to request the URL of the resource corresponding to the link. For another example, if a user enters a search term in a search engine and clicks a search button, he can send a resource address acquisition request through the browser to request the URL of the search result corresponding to the search term.
步骤102,代理服务器向后端服务器转发资源地址获取请求。Step 102: The proxy server forwards the resource address acquisition request to the back-end server.
在本实施例中,代理服务器在接收到前端设备发送的资源地址获取请求后,可以向后端服务器转发资源地址获取请求。In this embodiment, after receiving the resource address acquisition request sent by the front-end device, the proxy server may forward the resource address acquisition request to the back-end server.
步骤103,后端服务器向代理服务器返回原始资源地址。Step 103: The back-end server returns the original resource address to the proxy server.
在本实施例中,后端服务器在接收到该资源地址获取请求后,即可查询并返回该资源地址获取请求所请求的目标资源的原始资源地址。需要说明的是,后端服务器向代理服务器返回的数据除原始资源地址外,还可以包含其他数据以用于支持网络通信,本实施例对此不作限定。In this embodiment, after receiving the resource address acquisition request, the back-end server can query and return the original resource address of the target resource requested by the resource address acquisition request. It should be noted that, in addition to the original resource address, the data returned by the back-end server to the proxy server may also include other data for supporting network communication, which is not limited in this embodiment.
在本实施例中,原始资源地址可以是目标资源的原始URL。可以理解的是,资源的URL可能根据业务需要进行变更,因而原始URL可以是在目标资源的变更之前的URL,即待进行变更的URL。In this embodiment, the original resource address may be the original URL of the target resource. It is understandable that the URL of the resource may be changed according to business needs, so the original URL may be the URL before the change of the target resource, that is, the URL to be changed.
在本实施例中,原始资源地址中可以包括目标资源所在设备的原始IP(Internet Protocol,互联网协议)地址和目标资源的参数信息。此处的目标资源所在设备即为存储有目标资源的设备。由于资源的URL可能根 据业务需要进行变更且所变更的内容可以是目标资源所在设备的IP地址,因而原始资源地址中的IP地址可称为原始IP地址。In this embodiment, the original resource address may include the original IP (Internet Protocol, Internet Protocol) address of the device where the target resource is located and parameter information of the target resource. The device where the target resource is located here is the device storing the target resource. Since the URL of the resource may be changed according to business needs and the changed content may be the IP address of the device where the target resource is located, the IP address in the original resource address may be called the original IP address.
需要说明的是,URL通常包含IP地址、端口、URL参数、路径、传输协议等各种信息,因而,此处的参数信息可以指目标资源的原始URL中除IP地址之外的信息。如端口、URL参数、路径、传输协议信息等。It should be noted that the URL usually contains various information such as IP address, port, URL parameters, path, transmission protocol, etc. Therefore, the parameter information here may refer to information other than the IP address in the original URL of the target resource. Such as port, URL parameter, path, transmission protocol information, etc.
步骤104,代理服务器将原始IP地址替换为资源转换服务器的IP地址,得到修改后的资源地址。Step 104: The proxy server replaces the original IP address with the IP address of the resource conversion server to obtain the modified resource address.
在本实施例中,代理服务器可以将原始资源地址中的原始IP地址替换为资源转换服务器的IP地址,从而得到修改后的资源地址。In this embodiment, the proxy server can replace the original IP address in the original resource address with the IP address of the resource conversion server to obtain the modified resource address.
作为示例,代理服务器为Nginx,则可以通过的Nginx的sub_filter模块,将原始IP地址替换为资源转换服务器的IP地址。具体地,若以IP1表示原始IP地址,以IPs表示资源转换服务器的IP地址,则可通过添加代码sub_filter'IP1′′IPs',将原始资源地址中的原始IP地址(即IP1)替换为资源转换服务器的IP地址(即IPs),从而使修改后的资源地址指向资源转换服务器。As an example, if the proxy server is Nginx, the sub_filter module of Nginx can be used to replace the original IP address with the IP address of the resource conversion server. Specifically, if IP1 is used to represent the original IP address and IPs is used to represent the IP address of the resource conversion server, the original IP address (ie IP1) in the original resource address can be replaced with the resource by adding the code sub_filter'IP1''IPs' Convert the IP address (ie IPs) of the server so that the modified resource address points to the resource conversion server.
步骤105,代理服务器向前端设备返回修改后的资源地址。Step 105: The proxy server returns the modified resource address to the front-end device.
步骤106,前端设备基于修改后的资源地址中的IP地址,向资源转换服务器发送包含参数信息的目标资源获取请求。Step 106: The front-end device sends a target resource acquisition request including parameter information to the resource conversion server based on the IP address in the modified resource address.
在本实施例中,前端设备所得到的修改后的资源地址(即修改后的URL)中的IP地址为资源转换服务器的IP地址,因而,修改后的资源地址指向资源转换服务器。有此,可向资源转换服务器发送目标资源获取请求,以获取目标资源。此处的目标资源获取请求可包含修改后的资源地址中的参数信息,该参数信息与原始资源地址中的参数信息相同。In this embodiment, the IP address in the modified resource address (that is, the modified URL) obtained by the front-end device is the IP address of the resource conversion server. Therefore, the modified resource address points to the resource conversion server. With this, a target resource acquisition request can be sent to the resource conversion server to acquire the target resource. The target resource acquisition request here may include parameter information in the modified resource address, and the parameter information is the same as the parameter information in the original resource address.
步骤107,资源转换服务器基于参数信息确定目标资源的当前资源地址。Step 107: The resource conversion server determines the current resource address of the target resource based on the parameter information.
在本实施例中,资源转换服务器可以基于所接收到的目标资源获取请求中的参数信息,确定目标资源的当前资源地址。此处,可以针对资源地址的不同变更场景预先设定不同的资源地址变换规则,并基于资源地址变换规则来生成目标资源的当前资源地址。In this embodiment, the resource conversion server may determine the current resource address of the target resource based on the parameter information in the received target resource acquisition request. Here, different resource address conversion rules can be preset for different resource address change scenarios, and the current resource address of the target resource can be generated based on the resource address conversion rule.
作为示例,若当前的资源地址的变更场景为将对原始资源地址(即 原始URL)中的IP地址进行变更,则可以预先在资源转换服务器中存储新的IP地址。在资源转换服务器接收到目标资源获取请求后,将新的IP地址与目标资源获取请求中的参数信息进行组合,得到新的URL,即当前资源地址。此处,新的URL即为将原始URL中的IP地址替换为新的IP地址后所得到的URL。As an example, if the current resource address change scenario is to change the IP address in the original resource address (that is, the original URL), the new IP address can be stored in the resource conversion server in advance. After the resource conversion server receives the target resource acquisition request, it combines the new IP address with the parameter information in the target resource acquisition request to obtain a new URL, that is, the current resource address. Here, the new URL is the URL obtained by replacing the IP address in the original URL with the new IP address.
作为又一示例,若当前的资源地址的变更场景为对原始资源地址(即原始URL)中的路径规则进行变更,则可以预先设置原始路径与新的路径的对应关系,并将该对应关系存储于资源转换服务器中。在资源转换服务器接收到目标资源获取请求后,可以将目标资源获取请求所携带的参数信息中的原始路径替换为该原始路径所对应的新的路径。As another example, if the current resource address change scenario is to change the path rule in the original resource address (or original URL), the corresponding relationship between the original path and the new path can be set in advance, and the corresponding relationship can be stored In the resource conversion server. After the resource conversion server receives the target resource acquisition request, it may replace the original path in the parameter information carried in the target resource acquisition request with a new path corresponding to the original path.
在一些场景中,当且仅当原始资源地址中的原始IP地址为某一指定IP地址时,代理服务器才会将该原始IP地址替替换为资源服务器的IP地址。在这种场景下,资源转换服务器可以预先存储该原始IP地址(即上述指定IP地址),从而在将参数信息中的原始路径替换为新的路径后,将该原始IP地址与更新路径后的参数信息进行组合,得到新的URL,即当前资源地址。In some scenarios, if and only if the original IP address in the original resource address is a specified IP address, the proxy server will replace the original IP address with the IP address of the resource server. In this scenario, the resource conversion server can pre-store the original IP address (that is, the above-mentioned designated IP address), so that after replacing the original path in the parameter information with the new path, the original IP address and the updated path The parameter information is combined to obtain a new URL, that is, the current resource address.
在另一些场景中,可以不对原始IP地址进行限制,例如,代理服务器每接收到一次后端服务器返回的原始资源地址,均可将该原始资源地址中的原始IP地址替换为资源服务器的IP地址。在这种场景下,资源转换服务器中还可以预先存储资源ID与资源所在设备的IP地址的对应关系。目标资源获取请求所携带的参数信息中的原始路径中可以包含资源ID,基于该资源ID和上述对应关系,即可确定出目标资源所在设备的IP地址。由此,在将参数信息中的原始路径替换为新的路径后,可将目标资源所在设备的IP地址与更新路径后的参数信息进行组合,得到新的URL,即当前资源地址。In other scenarios, the original IP address may not be restricted. For example, every time the proxy server receives the original resource address returned by the back-end server, it can replace the original IP address in the original resource address with the IP address of the resource server . In this scenario, the resource conversion server may also pre-store the correspondence between the resource ID and the IP address of the device where the resource is located. The original path in the parameter information carried in the target resource acquisition request may include a resource ID, and based on the resource ID and the foregoing corresponding relationship, the IP address of the device where the target resource is located can be determined. Therefore, after replacing the original path in the parameter information with the new path, the IP address of the device where the target resource is located can be combined with the updated path parameter information to obtain a new URL, that is, the current resource address.
需要说明的是,在第二种场景中,当目标资源所在设备的IP地址未发生变化时,对应关系中记录的IP地址即为原始IP地址。当目标资源所在设备的IP地址发生变化时,对应关系中记录IP地址的即为最新的IP地址,资源转换服务器可以对该对应关系进行维护,以使该对应关系实时更新。由此,当目标资源所在设备的IP地址以及资源的路径同时发生 变更时,资源转换服务器也可确定出当前资源地址。It should be noted that, in the second scenario, when the IP address of the device where the target resource is located has not changed, the IP address recorded in the correspondence is the original IP address. When the IP address of the device where the target resource is located changes, the IP address recorded in the correspondence is the latest IP address, and the resource conversion server can maintain the correspondence to update the correspondence in real time. Therefore, when the IP address of the device where the target resource is located and the path of the resource change at the same time, the resource conversion server can also determine the current resource address.
此处,资源地址的变更场景以及资源地址变换规则还可以根据需要进行其他设定,不限于上述示例。Here, the resource address change scenario and the resource address conversion rule can also be set as needed, and are not limited to the above examples.
步骤108,资源转换服务器从当前资源地址中获取目标资源。Step 108: The resource conversion server obtains the target resource from the current resource address.
在本实施例中,资源转换服务器在确定出目标资源的当前资源地址后,可以从当前资源地址中获取目标资源。In this embodiment, after determining the current resource address of the target resource, the resource conversion server can obtain the target resource from the current resource address.
步骤109,资源转换服务器将目标资源返回至前端设备。Step 109: The resource conversion server returns the target resource to the front-end device.
作为示例,图2示出了请求处理系统的应用场景的一个示意图。如图2所示,浏览器(即前端设备)首先向Nginx(可视为代理服务器)发起请求(如资源地址获取请求)后,即可通过代理服务器跳转到后端。后端服务集群可基于该请求,返回原始资源地址。该原始资源地址中包含目标资源所在设备的原始IP地址。而后,Nginx可通过sub_filter模块修改原始资源地址中的IP地址为资源转换服务器的IP地址,从而使修改后的资源地址指向资源转换服务器。之后,Nginx可以向浏览器返回修改后的资源地址。浏览器接收到修改后的资源地址,即可向资源转换服务器请求资源。资源转换服务器在接收到浏览器的请求后,即可确定新的资源地址(即当前资源地址),并从该新的资源地址中获取资源,从而将所获取的资源转发给浏览器。此处,所获取的资源可以是新IP地址中的资源、新规则路径下的资源、第三方资源等。As an example, FIG. 2 shows a schematic diagram of an application scenario of the request processing system. As shown in Figure 2, the browser (that is, the front-end device) first initiates a request (such as a resource address acquisition request) to Nginx (which can be regarded as a proxy server), and then jumps to the back-end through the proxy server. The back-end service cluster can return the original resource address based on the request. The original resource address contains the original IP address of the device where the target resource is located. Then, Nginx can modify the IP address in the original resource address to the IP address of the resource conversion server through the sub_filter module, so that the modified resource address points to the resource conversion server. After that, Nginx can return the modified resource address to the browser. After receiving the modified resource address, the browser can request the resource from the resource conversion server. After receiving the request from the browser, the resource conversion server can determine the new resource address (that is, the current resource address), and obtain the resource from the new resource address, thereby forwarding the obtained resource to the browser. Here, the acquired resources may be resources in the new IP address, resources under the new rule path, third-party resources, and so on.
由此,可在IP地址发生变化、路径规则变化、存储位置变化等情况下,通过独立于后端服务器的资源转换服务器获取到所需资源。从而在资源地址发生频繁变更时,无需频繁修改后端服务器中的数据,也无需频繁重启后端服务器,从而较少了工作量,提高了系统的安全性和稳定性。此外,在其他变更场景下,还可使资源转换服务器基于其他规则来确定当前资源地址,由此,提高了在资源地址更改场景的可扩展性。As a result, when the IP address changes, path rules change, storage location changes, etc., the required resources can be obtained through the resource conversion server independent of the back-end server. Therefore, when the resource address is frequently changed, there is no need to frequently modify the data in the back-end server, and there is no need to frequently restart the back-end server, thereby reducing the workload and improving the security and stability of the system. In addition, in other change scenarios, the resource conversion server can also be used to determine the current resource address based on other rules, thereby improving the scalability of the resource address change scenario.
在本实施例的一些可选的实现方式中,资源转换服务器在确定目标资源的当前资源地址时,可以首先确定目标资源的资源地址变更类型。其中,资源地址变更类型可以包括但不限于以下至少一项:目标资源所在设备的IP地址发生变更、目标资源的路径发生变更和传输协议发生变更。而后,资源转换服务器可以基于参数信息和资源地址变更类型,确 定目标资源的当前资源地址。In some optional implementation manners of this embodiment, when determining the current resource address of the target resource, the resource conversion server may first determine the resource address change type of the target resource. The resource address change type may include but is not limited to at least one of the following: the IP address of the device where the target resource is located is changed, the path of the target resource is changed, and the transmission protocol is changed. Then, the resource conversion server can determine the current resource address of the target resource based on the parameter information and the resource address change type.
在一种场景中,资源地址变更类型为目标资源所在设备的IP地址发生变更。此时,资源转换服务器可以获取目标资源所在设备的当前IP地址。而后,基于当前IP地址和参数信息,确定目标资源的当前资源地址。如通过将当前IP地址和参数信息进行组合等方式,得到当前资源地址。In one scenario, the resource address change type is that the IP address of the device where the target resource is located changes. At this time, the resource conversion server can obtain the current IP address of the device where the target resource is located. Then, based on the current IP address and parameter information, the current resource address of the target resource is determined. For example, by combining the current IP address and parameter information, the current resource address is obtained.
作为示例,图3示出了请求处理系统在此应用场景的示意图。如图3所示,浏览器(即前端设备)首先向Nginx(可视为代理服务器)发起请求(如资源地址获取请求)后,即可通过代理服务器跳转到后端。后端服务集群可基于该请求,返回原始资源地址。该原始资源地址中包含目标资源所在设备的原始IP地址。而后,Nginx可通过sub_filter模块修改原始资源地址中的原始IP地址(如图3中的IP1)为资源转换服务器的IP地址(如图3中的IPs),从而使修改后的资源地址指向资源转换服务器。之后,Nginx可以向浏览器返回修改后的资源地址。浏览器接收到修改后的资源地址,即可向资源转换服务器请求资源。此处,目标资源所在设备的IP地址(如图3中的IP1)可变更为如图3中的IP2、IP3、或IP4等。资源转换服务器在接收到浏览器的请求后,即可基于新的IP地址(如IP2、IP3、或IP4等)和请求中所携带的参数信息,确定出新的资源地址。最后,可从新的资源地址中获取资源,从而将所获取的资源转发给浏览器。As an example, FIG. 3 shows a schematic diagram of the application scenario of the request processing system. As shown in Figure 3, the browser (that is, the front-end device) first initiates a request (such as a resource address acquisition request) to Nginx (which can be regarded as a proxy server), and then jumps to the back-end through the proxy server. The back-end service cluster can return the original resource address based on the request. The original resource address contains the original IP address of the device where the target resource is located. Then, Nginx can use the sub_filter module to modify the original IP address in the original resource address (IP1 in Figure 3) to the IP address of the resource conversion server (IPs in Figure 3), so that the modified resource address points to the resource conversion server. After that, Nginx can return the modified resource address to the browser. After receiving the modified resource address, the browser can request the resource from the resource conversion server. Here, the IP address of the device where the target resource is located (IP1 in FIG. 3) can be changed to IP2, IP3, or IP4 in FIG. 3, etc. After receiving the request from the browser, the resource conversion server can determine a new resource address based on the new IP address (such as IP2, IP3, or IP4, etc.) and the parameter information carried in the request. Finally, the resource can be obtained from the new resource address, so that the obtained resource is forwarded to the browser.
由此,在资源地址中的IP地址发生变更时,通过独立于后端服务器的资源转换服务器指向变更后的IP地址来获取资源,无需修改后端服务器中的数据,也无需重启后端服务器,从而较少了工作量,提高了系统的安全性和稳定性。As a result, when the IP address in the resource address changes, the resource conversion server independent of the back-end server points to the changed IP address to obtain resources, without modifying the data in the back-end server or restarting the back-end server. This reduces the workload and improves the safety and stability of the system.
在另一种场景中,参数信息中可以包括目标资源的原始路径。资源地址变更类型为目标资源的路径发生变更。此时,资源转换服务器可以将参数信息中的原始路径替换为目标资源的当前路径。而后,可以基于目标资源的存储设备的原始IP地址和替换路径后的参数信息,确定目标资源的当前资源地址。如通过将原始IP地址和替换路径后的参数信息进行组合等方式,得到当前资源地址。In another scenario, the parameter information may include the original path of the target resource. The resource address change type is that the path of the target resource changes. At this time, the resource conversion server may replace the original path in the parameter information with the current path of the target resource. Then, the current resource address of the target resource can be determined based on the original IP address of the storage device of the target resource and the parameter information after the replacement path. For example, by combining the original IP address and the parameter information after the replacement path, the current resource address is obtained.
作为示例,图4示出了请求处理系统在此应用场景的示意图。如图4 所示,浏览器(即前端设备)首先向Nginx(可视为代理服务器)发起请求(如资源地址获取请求)后,即可通过代理服务器跳转到后端。后端服务集群可基于该请求,返回原始资源地址。该原始资源地址中包含目标资源所在设备的原始IP地址。而后,Nginx可通过sub_filter模块修改原始资源地址中的原始IP地址(如图4中的IP)为资源转换服务器的IP地址(如图4中的IPs),从而使修改后的资源地址指向资源转换服务器。之后,Nginx可以向浏览器返回修改后的资源地址。浏览器接收到修改后的资源地址,即可向资源转换服务器请求资源。此处,原始的路径为path1,新的路径(path)可以是path2、path3或path4等。从而,资源转换服务器可以将参数信息中的原始路径path1替换为新的路径(path2、path3或path4等)。而后,资源转换服务器可以从原始IP地址指向的设备中,按照替换为新的路径的参数信息获取到所需资源,从而将所获取的资源转发给浏览器。As an example, Fig. 4 shows a schematic diagram of the application scenario of the request processing system. As shown in Figure 4, the browser (that is, the front-end device) first initiates a request (such as a resource address acquisition request) to Nginx (which can be regarded as a proxy server), and then it can jump to the back-end through the proxy server. The back-end service cluster can return the original resource address based on the request. The original resource address contains the original IP address of the device where the target resource is located. Then, Nginx can use the sub_filter module to modify the original IP address in the original resource address (IP in Figure 4) to the IP address of the resource conversion server (IPs in Figure 4), so that the modified resource address points to the resource conversion server. After that, Nginx can return the modified resource address to the browser. After receiving the modified resource address, the browser can request the resource from the resource conversion server. Here, the original path is path1, and the new path (path) can be path2, path3, or path4. Therefore, the resource conversion server can replace the original path path1 in the parameter information with a new path (path2, path3, or path4, etc.). Then, the resource conversion server can obtain the required resources from the device pointed to by the original IP address according to the parameter information replaced with the new path, and thus forward the obtained resources to the browser.
由此,在资源地址中的路径发生变更时,通过独立于后端服务器的资源转换服务器指向变更路径后的资源地址来获取资源,无需修改后端服务器中的数据,也无需重启后端服务器,从而较少了工作量,提高了系统的安全性和稳定性。Therefore, when the path in the resource address changes, the resource conversion server independent of the back-end server points to the resource address after the changed path to obtain resources, without modifying the data in the back-end server or restarting the back-end server. This reduces the workload and improves the safety and stability of the system.
需要说明的是,目标资源所在设备的IP地址以及资源地址中的路径可以同时发生变更。此时,可同时结合图3和图4涉及的操作,在变更后的IP地址指向的设备中,按照变更后的路径获取目标资源。It should be noted that the IP address of the device where the target resource is located and the path in the resource address can be changed at the same time. At this time, the operations involved in FIG. 3 and FIG. 4 can be combined at the same time, in the device pointed to by the changed IP address, the target resource can be obtained according to the changed path.
在另一种场景中,参数信息可以包括目标资源的标识(如ID)。资源转换服务器可以连接或部署有数据库。数据库中可以存储有各个资源标识对应的最新的资源地址。此时,资源转换服务器在接收到目标资源获取请求后,可以从数据库中查询与目标资源的标识关联的资源地址。从而,可以将所查询到的资源地址确定为目标资源的当前资源地址。In another scenario, the parameter information may include the identification (such as ID) of the target resource. The resource conversion server can be connected to or deployed with a database. The latest resource address corresponding to each resource identifier can be stored in the database. At this time, after receiving the target resource acquisition request, the resource conversion server may query the database for the resource address associated with the identifier of the target resource. Thus, the resource address that is queried can be determined as the current resource address of the target resource.
作为示例,图5示出了请求处理系统在此应用场景的示意图。如图5所示,浏览器(即前端设备)首先向Nginx(可视为代理服务器)发起请求(如资源地址获取请求)后,即可通过代理服务器跳转到后端。后端服务集群可基于该请求,返回原始资源地址。该原始资源地址中包含目标资源所在设备的原始IP地址。而后,Nginx可通过sub_filter模块修改 原始资源地址中的原始IP地址(如图5中的IP)为资源转换服务器的IP地址(如图5中的IPs),从而使修改后的资源地址指向资源转换服务器。之后,Nginx可以向浏览器返回修改后的资源地址。浏览器接收到修改后的资源地址,即可向资源转换服务器请求资源。此时,资源转换服务器可以基于请求中的参数信息中的资源的ID查询数据库,从而获取所需资源的新的URL(即新资源地址)。数据库中可以包括各个资源对应的新的URL。不同的资源具有不同的ID,如分别为ID1、ID2等。资源转换服务器可以在得到所需资源的新的URL后,即可根据新的URL获取该资源,从而将所获取的资源转发给浏览器。As an example, FIG. 5 shows a schematic diagram of the application scenario of the request processing system. As shown in Figure 5, the browser (that is, the front-end device) first initiates a request (such as a resource address acquisition request) to Nginx (which can be regarded as a proxy server), and then jumps to the back-end through the proxy server. The back-end service cluster can return the original resource address based on the request. The original resource address contains the original IP address of the device where the target resource is located. Then, Nginx can use the sub_filter module to modify the original IP address in the original resource address (IP in Figure 5) to the IP address of the resource conversion server (IPs in Figure 5), so that the modified resource address points to the resource conversion server. After that, Nginx can return the modified resource address to the browser. After receiving the modified resource address, the browser can request the resource from the resource conversion server. At this time, the resource conversion server can query the database based on the ID of the resource in the parameter information in the request, so as to obtain the new URL (that is, the new resource address) of the required resource. The database may include the new URL corresponding to each resource. Different resources have different IDs, such as ID1, ID2, and so on. After obtaining the new URL of the required resource, the resource conversion server can obtain the resource according to the new URL, thereby forwarding the obtained resource to the browser.
由此,通过独立于后端服务器的资源转换服务器基于目标资源的标识,从数据库中查询目标资源的当前资源地址,无需修改后端服务器中的数据,也无需重启后端服务器,从而较少了工作量,提高了系统的安全性和稳定性。Therefore, the resource conversion server independent of the back-end server can query the current resource address of the target resource from the database based on the identification of the target resource, without modifying the data in the back-end server, and there is no need to restart the back-end server. The workload has improved the safety and stability of the system.
在另一种场景中,资源地址变更类型为传输协议发生变更,如将HTTP(Hyper Text Transfer Protocol,超文本传输协议)转换为FTP(File Transfer Protocol,文件传输协议)。此时,资源转换服务器可以获取遵循当前传输协议的目标资源所在设备的IP地址。而后,将参数信息中的传输协议信息替换为变更后的目标传输协议信息(即新的传输协议信息)。最后,可以基于所获取的IP地址和替换传输协议后的参数信息,确定目标资源的当前资源地址。如通过将该IP地址和替换传输协议后的参数信息进行组合等方式,得到当前资源地址。In another scenario, the type of resource address change is a change in the transfer protocol, such as converting HTTP (Hyper Text Transfer Protocol) to FTP (File Transfer Protocol). At this time, the resource conversion server can obtain the IP address of the device where the target resource that complies with the current transmission protocol is located. Then, the transmission protocol information in the parameter information is replaced with the changed target transmission protocol information (that is, the new transmission protocol information). Finally, the current resource address of the target resource can be determined based on the acquired IP address and the parameter information after replacing the transmission protocol. For example, by combining the IP address and the parameter information after replacing the transmission protocol, the current resource address is obtained.
作为示例,图6示出了请求处理系统在此应用场景的示意图。如图6所示,浏览器(即前端设备)首先向Nginx(可视为代理服务器)发起请求(如资源地址获取请求)后,即可通过代理服务器跳转到后端。后端服务集群可基于该请求,返回原始资源地址。该原始资源地址中包含目标资源所在设备的原始IP地址。而后,Nginx可通过sub_filter模块修改原始资源地址中的原始IP地址(如图6中的IP)为资源转换服务器的IP地址(如图6中的IPs),从而使修改后的资源地址指向资源转换服务器。之后,Nginx可以向浏览器返回修改后的资源地址。浏览器接收到修改后的资源地址,即可向资源转换服务器请求资源。此处,传输协议由HTTP 变更为了FTP。资源转换服务器中可以预先配置遵循当前传输协议的目标资源所在设备(如FTP服务器)的IP地址。此时,资源转换服务器可从本地直接获取该IP地址,从而从该IP地址指向的FTP服务器中,按照参数信息获取到所需资源,从而将所获取的资源转发给浏览器。As an example, FIG. 6 shows a schematic diagram of the application scenario of the request processing system. As shown in Figure 6, the browser (that is, the front-end device) first initiates a request (such as a resource address acquisition request) to Nginx (which can be regarded as a proxy server), and then it can jump to the back-end through the proxy server. The back-end service cluster can return the original resource address based on the request. The original resource address contains the original IP address of the device where the target resource is located. Then, Nginx can use the sub_filter module to modify the original IP address in the original resource address (IP in Figure 6) to the IP address of the resource conversion server (IPs in Figure 6), so that the modified resource address points to the resource conversion server. After that, Nginx can return the modified resource address to the browser. After receiving the modified resource address, the browser can request the resource from the resource conversion server. Here, the transfer protocol is changed from HTTP to FTP. The resource conversion server can be pre-configured with the IP address of the device (such as the FTP server) where the target resource that follows the current transfer protocol is located. At this time, the resource conversion server can directly obtain the IP address locally, thereby obtaining the required resource from the FTP server pointed to by the IP address according to the parameter information, and forwarding the obtained resource to the browser.
由此,在传输协议发生变更时,通过独立于后端服务器的资源转换服务器从遵循变更后的传输协议的设备中获取资源,无需修改后端服务器中的数据,也无需重启后端服务器,从而较少了工作量,提高了系统的安全性和稳定性。Therefore, when the transmission protocol is changed, the resource conversion server independent of the back-end server obtains resources from the devices that comply with the changed transmission protocol, without modifying the data in the back-end server, and without restarting the back-end server. Less workload and improved system safety and stability.
本申请实施例提供的请求处理系统,通过代理服务器将前端设备发送的资源地址获取请求转发至后端服务器,从而接收后端服务器返回的原始资源地址,其中,原始资源地址中包括目标资源所在设备的原始IP地址和目标资源的参数信息。而后通过代理服务器将原始IP地址替换为资源转换服务器的IP地址,得到修改后的资源地址,从而向前端设备返回修改后的资源地址。之后通过前端设备基于修改后的资源地址中的IP地址,向资源转换服务器发送包含参数信息的目标资源获取请求。最后通过资源转换服务器基于参数信息确定目标资源的当前资源地址,从当前资源地址中获取目标资源,并将目标资源返回至前端设备。由此,在系统中引入了独立于后端服务器的资源转换服务器,通过该资源转换服务器确定目标资源的当前资源地址,在资源地址发生频繁变更时,无需频繁修改后端服务器中的数据,也无需频繁重启后端服务器,从而较少了工作量,提高了系统的安全性和稳定性。The request processing system provided by the embodiment of the present application forwards the resource address acquisition request sent by the front-end device to the back-end server through the proxy server, thereby receiving the original resource address returned by the back-end server, where the original resource address includes the device where the target resource is located The original IP address and the parameter information of the target resource. Then, the original IP address is replaced with the IP address of the resource conversion server through the proxy server, and the modified resource address is obtained, so that the modified resource address is returned to the front-end device. Afterwards, the front-end device sends a target resource acquisition request containing parameter information to the resource conversion server based on the IP address in the modified resource address. Finally, the resource conversion server determines the current resource address of the target resource based on the parameter information, obtains the target resource from the current resource address, and returns the target resource to the front-end device. As a result, a resource conversion server independent of the back-end server is introduced into the system. The resource conversion server determines the current resource address of the target resource. When the resource address changes frequently, there is no need to frequently modify the data in the back-end server. There is no need to restart the back-end server frequently, which reduces the workload and improves the security and stability of the system.
请参考图7,其示出了根据本申请的请求处理方法的一个实施例的流程700。该请求处理方法应用于资源转换服务器,上述资源转换服务器与前端设备通信连接,上述前端设备通过代理服务器与后端服务器通信连接。该请求处理方法,包括以下步骤:Please refer to FIG. 7, which shows a flow 700 of an embodiment of a request processing method according to the present application. The request processing method is applied to a resource conversion server, the above-mentioned resource conversion server is in communication connection with a front-end device, and the above-mentioned front-end device is in communication connection with the back-end server through a proxy server. The request processing method includes the following steps:
步骤701,接收前端设备发送的目标资源获取请求。Step 701: Receive a target resource acquisition request sent by a front-end device.
在本实施例中,请求处理方法的执行主体(如上述资源转换服务器)可以接收前端设备发送的目标资源获取请求。其中,目标资源获取请求中可以包括目标资源的参数信息。上述参数信息可以由前端设备从资源 地址中获取。上述资源地址可以由代理服务器通过对原始资源地址中的IP地址修改后得到(如将目标资源所在设备的原始IP地址修改为资源转换服务器的IP地址,以便于使修改后的资源地址指向资源转换服务器)。上述原始资源地址可以由后端服务器在接收到前端设备经由代理服务器转发的资源地址获取请求后返回。In this embodiment, the execution subject of the request processing method (such as the aforementioned resource conversion server) can receive the target resource acquisition request sent by the front-end device. Wherein, the target resource acquisition request may include parameter information of the target resource. The above-mentioned parameter information can be obtained by the front-end device from the resource address. The above resource address can be obtained by the proxy server by modifying the IP address in the original resource address (for example, the original IP address of the device where the target resource is located is modified to the IP address of the resource conversion server, so that the modified resource address can point to the resource conversion server). The foregoing original resource address may be returned by the back-end server after receiving the resource address acquisition request forwarded by the front-end device via the proxy server.
步骤702,基于参数信息,确定目标资源的当前资源地址。Step 702: Determine the current resource address of the target resource based on the parameter information.
在本实施例中,上述执行主体可以基于参数信息,确定目标资源的当前资源地址。In this embodiment, the above-mentioned execution subject may determine the current resource address of the target resource based on the parameter information.
在本实施例的一些可选的实现方式中,上述执行主体可以确定上述目标资源的资源地址变更类型。其中,上述资源地址变更类型包括目标资源所在设备的IP地址发生变更、目标资源的路径发生变更和传输协议发生变更中的一种或多种。而后,可以基于上述参数信息和上述资源地址变更类型,确定上述目标资源的当前资源地址。In some optional implementation manners of this embodiment, the above-mentioned execution subject may determine the resource address change type of the above-mentioned target resource. Wherein, the aforementioned resource address change type includes one or more of the change of the IP address of the device where the target resource is located, the change of the path of the target resource, and the change of the transmission protocol. Then, the current resource address of the target resource can be determined based on the parameter information and the resource address change type.
在本实施例的一些可选的实现方式中,响应于上述资源地址变更类型为目标资源所在设备的IP地址发生变更,上述执行主体可以获取上述目标资源所在设备的当前IP地址。而后,可以基于上述当前IP地址和上述参数信息,确定上述目标资源的当前资源地址。In some optional implementation manners of this embodiment, in response to the resource address change type being the IP address of the device where the target resource is changed, the execution subject may obtain the current IP address of the device where the target resource is located. Then, the current resource address of the target resource can be determined based on the current IP address and the parameter information.
在本实施例的一些可选的实现方式中,上述参数信息中包括上述目标资源的原始路径。响应于上述资源地址变更类型为上述目标资源的路径发生变更,上述执行主体可以将上述参数信息中的原始路径替换为上述目标资源的当前路径。而后,可以基于上述目标资源的存储设备的原始IP地址和替换路径后的参数信息,确定上述目标资源的当前资源地址。In some optional implementation manners of this embodiment, the foregoing parameter information includes the original path of the foregoing target resource. In response to the resource address change type being the path of the target resource being changed, the execution subject may replace the original path in the parameter information with the current path of the target resource. Then, the current resource address of the target resource can be determined based on the original IP address of the storage device of the target resource and the parameter information after the replacement path.
在本实施例的一些可选的实现方式中,上述参数信息包括上述目标资源的标识。上述执行主体可以从数据库中查询与上述标识关联的资源地址。而后,可以将所查询到的资源地址确定为上述目标资源的当前资源地址。In some optional implementation manners of this embodiment, the above-mentioned parameter information includes the identifier of the above-mentioned target resource. The above-mentioned execution subject can query the resource address associated with the above-mentioned identifier from the database. Then, the resource address found can be determined as the current resource address of the aforementioned target resource.
在本实施例的一些可选的实现方式中,响应于上述资源地址变更类型为传输协议发生变更,上述执行主体可以获取遵循当前传输协议的目标资源所在设备的IP地址。而后,可以基于所获取的IP地址和上述参数信息,确定上述目标资源的当前资源地址。In some optional implementation manners of this embodiment, in response to the above-mentioned resource address change type being a transmission protocol change, the above-mentioned executive body may obtain the IP address of the device where the target resource that complies with the current transmission protocol is located. Then, the current resource address of the target resource can be determined based on the obtained IP address and the parameter information.
步骤703,从当前资源地址中获取目标资源,并将目标资源返回至前端设备。Step 703: Obtain the target resource from the current resource address, and return the target resource to the front-end device.
需要说明的是,上述步骤701-步骤703可参见图1对应实施例中的相应步骤,此处不再赘述。It should be noted that the foregoing steps 701 to 703 can refer to the corresponding steps in the embodiment corresponding to FIG. 1, which will not be repeated here.
本申请的上述实施例提供的方法,通过资源转换服务器接收前端设备发送的包含参数信息的目标资源获取请求,而后基于参数信息确定目标资源的当前资源地址,最后从当前资源地址中获取目标资源,并将目标资源返回至前端设备。由此,可通过独立于后端服务器的资源转换服务器确定目标资源的当前资源地址。在资源地址发生频繁变更时,无需频繁修改后端服务器中的数据,也无需频繁重启后端服务器,从而较少了工作量,提高了系统的安全性和稳定性。In the method provided by the foregoing embodiment of the present application, the resource conversion server receives the target resource acquisition request containing parameter information sent by the front-end device, and then determines the current resource address of the target resource based on the parameter information, and finally acquires the target resource from the current resource address. And return the target resource to the front-end equipment. Thus, the current resource address of the target resource can be determined by the resource conversion server independent of the back-end server. When the resource address changes frequently, there is no need to frequently modify the data in the back-end server, and there is no need to frequently restart the back-end server, thereby reducing the workload and improving the security and stability of the system.
进一步参考图8,作为对上述各图所示方法的实现,本申请提供了一种请求处理装置的一个实施例,该装置实施例与图1所示的方法实施例相对应,该装置具体可以应用于资源转换服务器,上述资源转换服务器与前端设备通信连接,上述前端设备通过代理服务器与后端服务器通信连接。With further reference to FIG. 8, as an implementation of the methods shown in the above figures, this application provides an embodiment of a request processing apparatus. The apparatus embodiment corresponds to the method embodiment shown in FIG. Applied to a resource conversion server, the above-mentioned resource conversion server is in communication connection with a front-end device, and the above-mentioned front-end device is in a communication connection with the back-end server through a proxy server.
如图8所示,本实施例所述的请求处理装置800包括:接收单元801,被配置成接收前端设备发送的目标资源获取请求,其中,上述目标资源获取请求中包括目标资源的参数信息,上述参数信息由上述前端设备从资源地址中获取,上述资源地址由上述代理服务器通过将原始资源地址中的原始IP地址替换为上述资源转换服务器的IP地址后得到,上述原始资源地址由上述后端服务器在接收到前端设备经由上述代理服务器转发的资源地址获取请求后返回;确定单元802,被配置成基于上述参数信息,确定上述目标资源的当前资源地址;返回单元803,被配置成从上述当前资源地址中获取上述目标资源,并将上述目标资源返回至上述前端设备。As shown in FIG. 8, the request processing apparatus 800 in this embodiment includes: a receiving unit 801 configured to receive a target resource acquisition request sent by a front-end device, wherein the target resource acquisition request includes parameter information of the target resource, The above-mentioned parameter information is obtained by the above-mentioned front-end device from the resource address, the above-mentioned resource address is obtained by the above-mentioned proxy server by replacing the original IP address in the original resource address with the IP address of the above-mentioned resource conversion server, and the above-mentioned original resource address is obtained by the above-mentioned back-end The server returns after receiving the resource address acquisition request forwarded by the front-end device via the above-mentioned proxy server; the determining unit 802 is configured to determine the current resource address of the above-mentioned target resource based on the above-mentioned parameter information; the returning unit 803 is configured to obtain the current resource address from the above-mentioned current Obtain the target resource from the resource address, and return the target resource to the front-end device.
在本实施例的一些可选的实现方式中,上述确定单元802,进一步被配置成:确定上述目标资源的资源地址变更类型,其中,上述资源地址变更类型包括目标资源所在设备的IP地址发生变更、目标资源的路径发生变更和传输协议发生变更中的一种或多种;基于上述参数信息和上述 资源地址变更类型,确定上述目标资源的当前资源地址。In some optional implementation manners of this embodiment, the determining unit 802 is further configured to determine the resource address change type of the target resource, where the resource address change type includes a change in the IP address of the device where the target resource is located. One or more of a change in the path of the target resource and a change in the transmission protocol; based on the above parameter information and the above resource address change type, the current resource address of the above target resource is determined.
在本实施例的一些可选的实现方式中,上述确定单元802,进一步被配置成:响应于上述资源地址变更类型为目标资源所在设备的IP地址发生变更,获取上述目标资源所在设备的当前IP地址;基于上述当前IP地址和上述参数信息,确定上述目标资源的当前资源地址。In some optional implementation manners of this embodiment, the determining unit 802 is further configured to: in response to the resource address change type being the IP address of the device where the target resource is changed, obtain the current IP of the device where the target resource is located. Address: Based on the current IP address and the parameter information, the current resource address of the target resource is determined.
在本实施例的一些可选的实现方式中,上述参数信息中包括上述目标资源的原始路径;以及,上述确定单元802,进一步被配置成响应于上述资源地址变更类型为上述目标资源的路径发生变更,将上述参数信息中的原始路径替换为上述目标资源的当前路径;基于上述目标资源的存储设备的原始IP地址和替换路径后的参数信息,确定上述目标资源的当前资源地址。In some optional implementation manners of this embodiment, the aforementioned parameter information includes the original path of the aforementioned target resource; and, the aforementioned determining unit 802 is further configured to respond to the occurrence of the aforementioned resource address change type being the path of the aforementioned target resource. Change, replace the original path in the parameter information with the current path of the target resource; determine the current resource address of the target resource based on the original IP address of the storage device of the target resource and the parameter information after the replacement path.
在本实施例的一些可选的实现方式中,上述参数信息包括上述目标资源的标识;以及,上述确定单元802,进一步被配置成从数据库中查询与上述标识关联的资源地址;将所查询到的资源地址确定为上述目标资源的当前资源地址。In some optional implementations of this embodiment, the above-mentioned parameter information includes the identifier of the above-mentioned target resource; and, the above-mentioned determining unit 802 is further configured to query the resource address associated with the above-mentioned identifier from the database; The resource address of is determined as the current resource address of the aforementioned target resource.
在本实施例的一些可选的实现方式中,上述确定单元802,进一步被配置成:响应于上述资源地址变更类型为传输协议发生变更,获取遵循当前传输协议的目标资源所在设备的IP地址;将上述参数信息中的传输协议信息替换为变更后的目标传输协议信息;基于所获取的IP地址和替换传输信息后的参数信息,确定上述目标资源的当前资源地址。In some optional implementation manners of this embodiment, the above determining unit 802 is further configured to: in response to the above resource address change type being a transmission protocol change, obtain the IP address of the device where the target resource that complies with the current transmission protocol is located; Replace the transmission protocol information in the above parameter information with the changed target transmission protocol information; determine the current resource address of the above target resource based on the acquired IP address and the parameter information after replacing the transmission information.
本申请的上述实施例提供的装置,通过资源转换服务器接收前端设备发送的包含参数信息的目标资源获取请求,而后基于参数信息确定目标资源的当前资源地址,最后从当前资源地址中获取目标资源,并将目标资源返回至前端设备。由此,可通过独立于后端服务器的资源转换服务器确定目标资源的当前资源地址。在资源地址发生频繁变更时,无需频繁修改后端服务器中的数据,也无需频繁重启后端服务器,从而较少了工作量,提高了系统的安全性和稳定性。The device provided by the foregoing embodiment of the present application receives a target resource acquisition request containing parameter information sent by a front-end device through a resource conversion server, and then determines the current resource address of the target resource based on the parameter information, and finally acquires the target resource from the current resource address, And return the target resource to the front-end equipment. Thus, the current resource address of the target resource can be determined by the resource conversion server independent of the back-end server. When the resource address changes frequently, there is no need to frequently modify the data in the back-end server, and there is no need to frequently restart the back-end server, thereby reducing the workload and improving the security and stability of the system.
下面参考图9,其示出了适于用来实现本申请实施例的电子设备的计算机系统900的结构示意图。图9示出的电子设备仅仅是一个示例,不 应对本申请实施例的功能和使用范围带来任何限制。Next, referring to FIG. 9, it shows a schematic structural diagram of a computer system 900 suitable for implementing an electronic device according to an embodiment of the present application. The electronic device shown in FIG. 9 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present application.
如图9所示,计算机系统900包括中央处理单元(CPU)901,其可以根据存储在只读存储器(ROM)902中的程序或者从存储部分908加载到随机访问存储器(RAM)903中的程序而执行各种适当的动作和处理。在RAM 903中,还存储有系统900操作所需的各种程序和数据。CPU 901、ROM 902以及RAM 903通过总线904彼此相连。输入/输出(I/O)接口905也连接至总线904。As shown in FIG. 9, the computer system 900 includes a central processing unit (CPU) 901, which can be based on a program stored in a read-only memory (ROM) 902 or a program loaded from a storage portion 908 into a random access memory (RAM) 903 And perform various appropriate actions and processing. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
以下部件连接至I/O接口905:包括键盘、鼠标等的输入部分906;包括诸如液晶显示器(LCD)等以及扬声器等的输出部分907;包括硬盘等的存储部分908;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分909。通信部分909经由诸如因特网的网络执行通信处理。驱动器910也根据需要连接至I/O接口905。可拆卸介质911,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器910上,以便于从其上读出的计算机程序根据需要被安装入存储部分908。The following components are connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a liquid crystal display (LCD), etc., and speakers, etc.; a storage section 908 including a hard disk, etc.; The communication part 909 of a network interface card such as a modem. The communication section 909 performs communication processing via a network such as the Internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that the computer program read from it is installed into the storage portion 908 as needed.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分909从网络上被下载和安装,和/或从可拆卸介质911被安装。在该计算机程序被中央处理单元(CPU)901执行时,执行本申请的方法中限定的上述功能。需要说明的是,本申请所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令 执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication part 909, and/or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the method of the present application are executed. It should be noted that the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In this application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium. The computer-readable medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device . The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation of the system architecture, functions, and operations of the system, method, and computer program product according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logic function. Executable instructions. It should also be noted that, in some alternative implementations, the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown one after the other can actually be executed substantially in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments described in this application can be implemented in software or hardware. The described units can also be arranged in the processor, where the names of these units do not constitute a limitation on the unit itself under certain circumstances.
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的装置中所包含的;也可以是单独存在,而未装配入该装置中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该装置执行时,使得该装置:接收前端设备发送的目标资源获取请求,其中,所述目标资源获取请求中包括目标资源的参数信息,所述参数信息由所述前端设备从资源地址中获取,所述资源地址由所述代理服务器通过对原始资源地址中的IP地址修改后得 到,所述原始资源地址由所述后端服务器在接收到前端设备经由所述代理服务器转发的资源地址获取请求后返回;基于所述参数信息,确定所述目标资源的当前资源地址;从所述当前资源地址中获取所述目标资源,并将所述目标资源返回至所述前端设备。As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist alone without being assembled into the device. The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the apparatus, the apparatus is caused to receive a target resource acquisition request sent by the front-end equipment, wherein the target resource acquisition request The parameter information of the target resource, the parameter information is obtained by the front-end device from the resource address, the resource address is obtained by the proxy server by modifying the IP address in the original resource address, and the original resource address is obtained by the source The back-end server returns after receiving the resource address acquisition request forwarded by the front-end device via the proxy server; determines the current resource address of the target resource based on the parameter information; acquires the target from the current resource address Resource, and return the target resource to the front-end device.
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover the above technical features or technical solutions without departing from the above inventive concept. Other technical solutions formed by arbitrarily combining the equivalent features. For example, the above-mentioned features and the technical features disclosed in this application (but not limited to) with similar functions are mutually replaced to form a technical solution.

Claims (15)

  1. 一种请求处理系统,其特征在于,包括:前端设备、代理服务器、资源转换服务器和后端服务器;A request processing system, which is characterized by comprising: a front-end device, a proxy server, a resource conversion server, and a back-end server;
    所述代理服务器,用于将所述前端设备发送的资源地址获取请求转发至所述后端服务器,并接收所述后端服务器返回的原始资源地址,其中,所述原始资源地址中包括目标资源所在设备的原始IP地址和目标资源的参数信息;将所述原始IP地址替换为所述资源转换服务器的IP地址,得到修改后的资源地址;向所述前端设备返回所述修改后的资源地址;The proxy server is configured to forward the resource address acquisition request sent by the front-end device to the back-end server, and receive the original resource address returned by the back-end server, wherein the original resource address includes the target resource The original IP address of the device and the parameter information of the target resource; replace the original IP address with the IP address of the resource conversion server to obtain the modified resource address; return the modified resource address to the front-end device ;
    所述前端设备,用于基于所述修改后的资源地址中的IP地址,向所述资源转换服务器发送包含所述参数信息的目标资源获取请求;The front-end device is configured to send a target resource acquisition request including the parameter information to the resource conversion server based on the IP address in the modified resource address;
    所述资源转换服务器,用于基于所述参数信息确定所述目标资源的当前资源地址,从所述当前资源地址中获取所述目标资源,并将所述目标资源返回至所述前端设备。The resource conversion server is configured to determine the current resource address of the target resource based on the parameter information, obtain the target resource from the current resource address, and return the target resource to the front-end device.
  2. 根据权利要求1所述的请求处理系统,其特征在于,所述资源转换服务器,进一步用于:The request processing system according to claim 1, wherein the resource conversion server is further configured to:
    确定所述目标资源的资源地址变更类型,其中,所述资源地址变更类型包括目标资源所在设备的IP地址发生变更、目标资源的路径发生变更和传输协议发生变更中的一种或多种;Determine the resource address change type of the target resource, where the resource address change type includes one or more of changes in the IP address of the device where the target resource is located, changes in the path of the target resource, and changes in the transmission protocol;
    基于所述参数信息和所述资源地址变更类型,确定所述目标资源的当前资源地址。Determine the current resource address of the target resource based on the parameter information and the resource address change type.
  3. 根据权利要求2所述的请求处理系统,其特征在于,所述资源转换服务器,进一步用于:The request processing system according to claim 2, wherein the resource conversion server is further configured to:
    响应于所述资源地址变更类型为目标资源所在设备的IP地址发生变更,获取所述目标资源所在设备的当前IP地址;In response to the resource address change type being that the IP address of the device where the target resource is located is changed, acquiring the current IP address of the device where the target resource is located;
    基于所述当前IP地址和所述参数信息,确定所述目标资源的当前资源地址。Determine the current resource address of the target resource based on the current IP address and the parameter information.
  4. 根据权利要求2所述的请求处理系统,其特征在于,所述参数信息中包括所述目标资源的原始路径;以及,The request processing system according to claim 2, wherein the parameter information includes the original path of the target resource; and,
    所述资源转换服务器,进一步用于:The resource conversion server is further used for:
    响应于所述资源地址变更类型为所述目标资源的路径发生变更,将所述参数信息中的原始路径替换为所述目标资源的当前路径;In response to the resource address change type being that the path of the target resource is changed, replacing the original path in the parameter information with the current path of the target resource;
    基于所述目标资源的存储设备的原始IP地址和替换路径后的参数信息,确定所述目标资源的当前资源地址。Determine the current resource address of the target resource based on the original IP address of the storage device of the target resource and the parameter information after the replacement path.
  5. 根据权利要求2所述的请求处理系统,其特征在于,所述参数信息包括所述目标资源的标识;以及,The request processing system according to claim 2, wherein the parameter information includes an identifier of the target resource; and,
    所述资源转换服务器,进一步用于:The resource conversion server is further used for:
    从数据库中查询与所述标识关联的资源地址;Query the resource address associated with the identifier from the database;
    将所查询到的资源地址确定为所述目标资源的当前资源地址。The inquired resource address is determined as the current resource address of the target resource.
  6. 根据权利要求2所述的请求处理系统,其特征在于,所述参数信息包括传输协议信息;以及,The request processing system according to claim 2, wherein the parameter information includes transmission protocol information; and,
    所述资源转换服务器,进一步用于:The resource conversion server is further used for:
    响应于所述资源地址变更类型为传输协议发生变更,获取遵循当前传输协议的目标资源所在设备的IP地址;In response to the resource address change type being a transmission protocol change, obtaining the IP address of the device where the target resource that complies with the current transmission protocol is located;
    将所述参数信息中的传输协议信息替换为变更后的目标传输协议信息;Replacing the transmission protocol information in the parameter information with the changed target transmission protocol information;
    基于所获取的IP地址和替换传输信息后的参数信息,确定所述目标资源的当前资源地址。Determine the current resource address of the target resource based on the acquired IP address and the parameter information after replacing the transmission information.
  7. 一种请求处理方法,其特征在于,应用于资源转换服务器,所述资源转换服务器与前端设备通信连接,所述前端设备通过代理服务器与后端服务器通信连接,所述方法包括:A request processing method, characterized in that it is applied to a resource conversion server, the resource conversion server is in communication connection with a front-end device, and the front-end device is in communication connection with a back-end server through a proxy server, and the method includes:
    接收前端设备发送的目标资源获取请求,其中,所述目标资源获取请求中包括目标资源的参数信息,所述参数信息由所述前端设备从资源地址中获取,所述资源地址由所述代理服务器通过将原始资源地址中的 IP地址修改为所述资源转换服务器的IP地址后得到,所述原始资源地址由所述后端服务器在接收到前端设备经由所述代理服务器转发的资源地址获取请求后返回;Receive a target resource acquisition request sent by a front-end device, where the target resource acquisition request includes parameter information of the target resource, the parameter information is acquired by the front-end device from a resource address, and the resource address is acquired by the proxy server Obtained by modifying the IP address in the original resource address to the IP address of the resource conversion server. The original resource address is obtained by the back-end server after receiving the resource address acquisition request forwarded by the front-end device via the proxy server return;
    基于所述参数信息,确定所述目标资源的当前资源地址;Determine the current resource address of the target resource based on the parameter information;
    从所述当前资源地址中获取所述目标资源,并将所述目标资源返回至所述前端设备。Obtain the target resource from the current resource address, and return the target resource to the front-end device.
  8. 根据权利要求7所述的请求处理方法,其特征在于,所述基于所述参数信息,确定所述目标资源的当前资源地址,包括:The request processing method according to claim 7, wherein the determining the current resource address of the target resource based on the parameter information comprises:
    确定所述目标资源的资源地址变更类型,其中,所述资源地址变更类型包括目标资源所在设备的IP地址发生变更、目标资源的路径发生变更和传输协议发生变更中的一种或多种;Determine the resource address change type of the target resource, where the resource address change type includes one or more of changes in the IP address of the device where the target resource is located, changes in the path of the target resource, and changes in the transmission protocol;
    基于所述参数信息和所述资源地址变更类型,确定所述目标资源的当前资源地址。Determine the current resource address of the target resource based on the parameter information and the resource address change type.
  9. 根据权利要求8所述的请求处理方法,其特征在于,所述基于所述参数信息和所述目标资源的资源地址变更类型,确定所述目标资源的当前资源地址,包括:The request processing method according to claim 8, wherein the determining the current resource address of the target resource based on the parameter information and the resource address change type of the target resource comprises:
    响应于所述资源地址变更类型为目标资源所在设备的IP地址发生变更,获取所述目标资源所在设备的当前IP地址;In response to the resource address change type being that the IP address of the device where the target resource is located is changed, acquiring the current IP address of the device where the target resource is located;
    基于所述当前IP地址和所述参数信息,确定所述目标资源的当前资源地址。Determine the current resource address of the target resource based on the current IP address and the parameter information.
  10. 根据权利要求8所述的请求处理方法,其特征在于,所述参数信息中包括所述目标资源的原始路径;以及,The request processing method according to claim 8, wherein the parameter information includes the original path of the target resource; and,
    所述基于所述参数信息和所述目标资源的资源地址变更类型,确定所述目标资源的当前资源地址,包括:The determining the current resource address of the target resource based on the parameter information and the resource address change type of the target resource includes:
    响应于所述资源地址变更类型为所述目标资源的路径发生变更,将所述参数信息中的原始路径替换为所述目标资源的当前路径;In response to the resource address change type being that the path of the target resource is changed, replacing the original path in the parameter information with the current path of the target resource;
    基于所述目标资源的存储设备的原始IP地址和替换路径后的参数信 息,确定所述目标资源的当前资源地址。Based on the original IP address of the storage device of the target resource and the parameter information after the replacement path, the current resource address of the target resource is determined.
  11. 根据权利要求8所述的请求处理方法,其特征在于,所述参数信息包括所述目标资源的标识;以及,The request processing method according to claim 8, wherein the parameter information includes an identifier of the target resource; and,
    所述基于所述参数信息和所述目标资源的资源地址变更类型,确定所述目标资源的当前资源地址,包括:The determining the current resource address of the target resource based on the parameter information and the resource address change type of the target resource includes:
    从数据库中查询与所述标识关联的资源地址;Query the resource address associated with the identifier from the database;
    将所查询到的资源地址确定为所述目标资源的当前资源地址。The inquired resource address is determined as the current resource address of the target resource.
  12. 根据权利要求8所述的请求处理方法,其特征在于,所述基于所述参数信息和所述目标资源的资源地址变更类型,确定所述目标资源的当前资源地址,包括:The request processing method according to claim 8, wherein the determining the current resource address of the target resource based on the parameter information and the resource address change type of the target resource comprises:
    响应于所述资源地址变更类型为传输协议发生变更,获取遵循当前传输协议的目标资源所在设备的IP地址;In response to the resource address change type being a transmission protocol change, obtaining the IP address of the device where the target resource that complies with the current transmission protocol is located;
    基于所获取的IP地址和所述参数信息,确定所述目标资源的当前资源地址。Based on the obtained IP address and the parameter information, the current resource address of the target resource is determined.
  13. 一种请求处理装置,其特征在于,应用于资源转换服务器,所述资源转换服务器与前端设备通信连接,所述前端设备通过代理服务器与后端服务器通信连接,所述装置包括:A request processing device, characterized in that it is applied to a resource conversion server, the resource conversion server is in communication connection with a front-end device, and the front-end device is in communication connection with a back-end server through a proxy server, and the device includes:
    接收单元,被配置成接收前端设备发送的目标资源获取请求,其中,所述目标资源获取请求中包括目标资源的参数信息,所述参数信息由所述前端设备从资源地址中获取,所述资源地址由所述代理服务器通过将原始资源地址中的原始IP地址替换为所述资源转换服务器的IP地址后得到,所述原始资源地址由所述后端服务器在接收到前端设备经由所述代理服务器转发的资源地址获取请求后返回;The receiving unit is configured to receive a target resource acquisition request sent by a front-end device, wherein the target resource acquisition request includes parameter information of the target resource, and the parameter information is acquired by the front-end device from the resource address, and the resource The address is obtained by the proxy server by replacing the original IP address in the original resource address with the IP address of the resource conversion server, and the original resource address is received by the back-end server after the front-end device passes the proxy server The forwarded resource address will be returned after obtaining the request;
    确定单元,被配置成基于所述参数信息,确定所述目标资源的当前资源地址;The determining unit is configured to determine the current resource address of the target resource based on the parameter information;
    返回单元,被配置成从所述当前资源地址中获取所述目标资源,并将所述目标资源返回至所述前端设备。The returning unit is configured to obtain the target resource from the current resource address and return the target resource to the front-end device.
  14. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    一个或多个处理器;One or more processors;
    存储装置,其上存储有一个或多个程序,A storage device on which one or more programs are stored,
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求7-12中任一所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 7-12.
  15. 一种计算机可读介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求7-12中任一所述的方法。A computer-readable medium with a computer program stored thereon, wherein the program is executed by a processor to implement the method according to any one of claims 7-12.
PCT/CN2020/118867 2020-06-22 2020-09-29 Request processing system, method and apparatus, and electronic device and computer-readable medium WO2021258575A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010576545.2A CN111931100B (en) 2020-06-22 2020-06-22 Request processing system, method, apparatus, electronic device, and computer readable medium
CN202010576545.2 2020-06-22

Publications (1)

Publication Number Publication Date
WO2021258575A1 true WO2021258575A1 (en) 2021-12-30

Family

ID=73317623

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/118867 WO2021258575A1 (en) 2020-06-22 2020-09-29 Request processing system, method and apparatus, and electronic device and computer-readable medium

Country Status (2)

Country Link
CN (1) CN111931100B (en)
WO (1) WO2021258575A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118624A (en) * 2022-06-28 2022-09-27 平安银行股份有限公司 Production flow shunting method and device, electronic equipment and storage medium
CN115314552A (en) * 2022-06-30 2022-11-08 中汽创智科技有限公司 Data processing method and device, electronic equipment and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468445A (en) * 2021-05-24 2021-10-01 北京旷视科技有限公司 Request processing method and device, electronic equipment and computer readable medium
CN114500505A (en) * 2022-01-19 2022-05-13 北京百度网讯科技有限公司 Text processing method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104105007A (en) * 2013-04-09 2014-10-15 腾讯科技(深圳)有限公司 Video loading method of mobile terminal, devices and system
EP3588875A1 (en) * 2018-06-30 2020-01-01 Hewlett-Packard Enterprise Development LP Web services across virtual routing and forwarding
CN110661826A (en) * 2018-06-28 2020-01-07 北京京东尚科信息技术有限公司 Method for processing network request by proxy server side and proxy server
CN111107134A (en) * 2019-11-29 2020-05-05 北京三快在线科技有限公司 Connection control method and device, electronic equipment and readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7970940B1 (en) * 2009-12-22 2011-06-28 Intel Corporation Domain name system lookup latency reduction
US9363327B2 (en) * 2011-06-15 2016-06-07 Juniper Networks, Inc. Network integrated dynamic resource routing
US10218633B2 (en) * 2014-03-28 2019-02-26 Amazon Technologies, Inc. Implementation of a service that coordinates the placement and execution of containers
CN108696481A (en) * 2017-04-07 2018-10-23 北京京东尚科信息技术有限公司 leak detection method and device
WO2020077497A1 (en) * 2018-10-15 2020-04-23 华为技术有限公司 Method and device for domain name resolution by sending key value to grs server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104105007A (en) * 2013-04-09 2014-10-15 腾讯科技(深圳)有限公司 Video loading method of mobile terminal, devices and system
CN110661826A (en) * 2018-06-28 2020-01-07 北京京东尚科信息技术有限公司 Method for processing network request by proxy server side and proxy server
EP3588875A1 (en) * 2018-06-30 2020-01-01 Hewlett-Packard Enterprise Development LP Web services across virtual routing and forwarding
CN111107134A (en) * 2019-11-29 2020-05-05 北京三快在线科技有限公司 Connection control method and device, electronic equipment and readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118624A (en) * 2022-06-28 2022-09-27 平安银行股份有限公司 Production flow shunting method and device, electronic equipment and storage medium
CN115118624B (en) * 2022-06-28 2024-04-05 平安银行股份有限公司 Method and device for diverting production flow, electronic equipment and storage medium
CN115314552A (en) * 2022-06-30 2022-11-08 中汽创智科技有限公司 Data processing method and device, electronic equipment and storage medium
CN115314552B (en) * 2022-06-30 2023-08-22 中汽创智科技有限公司 Data processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111931100B (en) 2024-04-26
CN111931100A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
WO2021258575A1 (en) Request processing system, method and apparatus, and electronic device and computer-readable medium
US11677857B2 (en) Configurable and dynamic transformation of web content
US20230117702A1 (en) Delivery of instructions in host applications
US11240289B2 (en) Apparatus and method for low-latency message request/response processing
US7499981B2 (en) Methods and apparatus for peer-to-peer services
CN108282529B (en) System, method and device for publishing and subscribing data
US7546363B2 (en) Adaptive route determination for peer-to-peer services
US9871850B1 (en) Enhanced browsing using CDN routing capabilities
CN109218368B (en) Method, device, electronic equipment and readable medium for realizing Http reverse proxy
US10182126B2 (en) Multilevel redirection in a virtual desktop infrastructure environment
US10284671B2 (en) Dynamic bundling of web components for asynchronous delivery
JP2020508505A (en) Custom digital components
US20180131678A1 (en) Managing Idempotent Operations while Interacting with a System of Record
US8352442B2 (en) Determination of an updated data source from disparate data sources
US20190102465A1 (en) Api query extension
KR20110008179A (en) Generating sitemaps
CN112256772A (en) Data service method, device and readable storage medium
CN110267077B (en) Offline caching method, device, terminal and readable storage medium
CN109428872B (en) Data transmission method, equipment, server, starting method and system
US10868881B1 (en) Loading web resources using remote resource pushing
CN113760278A (en) Page management method and device
US11323537B1 (en) Generating early hints informational responses at an intermediary server
US10438169B2 (en) Systems and methods for providing binary data files for real-time collaboration
US20220229858A1 (en) Multi-cloud object store access
US20230093004A1 (en) System and method for asynchronous backend processing of expensive command line interface commands

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20941864

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20941864

Country of ref document: EP

Kind code of ref document: A1