Application resource proxy method, device and electronic device

By binding multiple application environments with the same proxy domain name, determining the target application environment and updating the URL, the problem of frequent switching of URLs in the application environment is solved, and more efficient resource access and computing resource conservation is achieved.

CN115080883BActive Publication Date: 2025-08-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110266892.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-11
Publication Date
2025-08-29
Estimated Expiration
2041-03-11

AI Technical Summary

Technical Problem

In the prior art, the application environment switches URL frequently and has poor flexibility, resulting in waste of computing resources.

Method used

Bind multiple application environments with the same proxy domain name, and determine the target application environment through the proxy domain name, and update the URL to respond to access requests.

Benefits of technology

Improves the flexibility and convenience of accessing application resources and reduces the waste of computing resources for electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115080883B_ABST
    Figure CN115080883B_ABST
Patent Text Reader

Abstract

The present application provides a proxy method, device, electronic device and computer-readable storage medium for application resources; it relates to network technology in the field of cloud technology; the method includes: binding multiple application environments with the same proxy domain name; receiving an access request whose uniform resource locator (URL) includes a proxy domain name; determining the target application environment requested by the access request in multiple application environments that have a binding relationship with the proxy domain name; updating the URL of the application resource in the target application environment according to the proxy domain name, and responding to the access request according to the application resource including the updated URL. Through the present application, multiple application environments can be proxied through a unified proxy domain name, and the flexibility and convenience of accessing application resources in different application environments can be improved based on domain name resolution, while also reducing the waste of computing resources of electronic devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to network technology, and in particular to a proxy method, device, electronic device, and computer-readable storage medium for application resources. Background Art

[0002] An application is an application written in a programming language to implement specific functions. For example, applications can include system applications for electronic devices as well as user applications designed for individuals. Applications often involve multiple stages, including development, testing, and product experience. Therefore, multiple application environments are often configured to support these development, testing, and experience operations.

[0003] In the solutions provided by related technologies, different Uniform Resource Locators (URLs) are usually configured for different application environments, resulting in the need to frequently switch URLs when accessing application resources in different application environments. This has poor flexibility and is likely to waste computing resources of electronic devices. Summary of the Invention

[0004] The embodiments of the present application provide a proxy method, device, electronic device and computer-readable storage medium for application resources, which can improve the flexibility and convenience of accessing application resources, and also reduce the waste of computing resources of electronic devices.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The present invention provides a proxy method for application resources, including:

[0007] Bind multiple application environments to the same proxy domain name;

[0008] Receiving an access request including a uniform resource locator (URL) and the proxy domain name;

[0009] Determining a target application environment requested by the access request among the multiple application environments that have a binding relationship with the proxy domain name;

[0010] The URL of the application resource in the target application environment is updated according to the proxy domain name, and the access request is responded to according to the application resource including the updated URL.

[0011] In the above solution, determining the target application environment requested by the access request among the multiple application environments that are bound to the proxy domain name includes:

[0012] Obtaining access identity information in the access request, and verifying the access identity information to obtain an identity information verification result;

[0013] When the identity information verification result is successful, determining an application environment accessible according to the access identity information from among the multiple application environments that are bound to the proxy domain name;

[0014] Wherein, each of the application environments corresponds to at least one accessible identity information;

[0015] In at least one of the accessible application environments, a target application environment requested by the access request is determined.

[0016] In the above solution, responding to the access request according to the application resource including the updated URL includes:

[0017] The access request is responded to according to the application resources in the target application environment that include the updated URL and the application resources that do not include the URL.

[0018] The present invention provides an application resource proxy device, including:

[0019] Binding module, used to bind multiple application environments to the same proxy domain name;

[0020] A receiving module, configured to receive an access request including a uniform resource locator (URL) and the proxy domain name;

[0021] An environment determination module, configured to determine a target application environment requested by the access request among the multiple application environments that are bound to the proxy domain name;

[0022] An updating module is configured to update the URL of the application resource in the target application environment according to the proxy domain name, and respond to the access request according to the application resource including the updated URL.

[0023] In the above solution, the environment determination module is further used to:

[0024] Obtaining access identity information in the access request, and verifying the access identity information to obtain an identity information verification result;

[0025] When the identity information verification result is successful, determining an application environment accessible according to the access identity information from among the multiple application environments that are bound to the proxy domain name;

[0026] Wherein, each of the application environments corresponds to at least one accessible identity information;

[0027] In at least one of the accessible application environments, a target application environment requested by the access request is determined.

[0028] In the above solution, the update module is further used to:

[0029] The access request is responded to according to the application resources in the target application environment that include the updated URL and the application resources that do not include the URL.

[0030] An embodiment of the present application provides an electronic device, including:

[0031] a memory for storing executable instructions;

[0032] The processor is used to implement the application resource proxy method provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0033] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute and implement the application resource proxy method provided in the embodiment of the present application.

[0034] The embodiments of the present application have the following beneficial effects:

[0035] Bind multiple application environments to the same proxy domain name. When receiving an access request whose URL includes the proxy domain name, determine the target application environment requested by the access request from the multiple bound application environments. In this way, access to multiple application environments can be achieved based on a unified proxy domain name without the need to frequently switch URLs. In addition, the URLs of application resources in the target application environment are updated based on the proxy domain name to respond to the access request, thereby achieving effective proxying of application resources. In summary, the embodiments of the present application can improve the flexibility and convenience of accessing application resources in different application environments based on the proxy domain name, while also reducing the waste of computing resources of electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a schematic diagram of the architecture of the proxy system for application resources provided in an embodiment of the present application;

[0037] Figure 2 This is a schematic diagram of the architecture of a terminal device provided in an embodiment of the present application;

[0038] Figures 3A to 3E This is a flow chart of the proxy method for application resources provided in an embodiment of the present application;

[0039] Figure 4 This is a schematic diagram of the user interface of the client provided in an embodiment of the present application;

[0040] Figure 5 This is a schematic diagram of the domain name application interface provided in the embodiment of the present application;

[0041] Figure 6 This is a schematic diagram of the space application interface provided in the embodiment of the present application;

[0042] Figure 7 This is a schematic diagram of a domain name binding interface provided by an embodiment of the present application;

[0043] Figure 8 This is a schematic diagram of an environment creation interface provided by an embodiment of the present application;

[0044] Figure 9 is a schematic diagram of the environment management interface provided by an embodiment of the present application;

[0045] Figure 10 This is a schematic diagram of the proxy rule management interface provided by an embodiment of the present application;

[0046] Figure 11 This is a schematic diagram of a browser interface of a client provided in an embodiment of the present application;

[0047] Figure 12 This is a flow chart of the proxy method for application resources provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0049] In the following description, references to "some embodiments" describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. In the following description, the term "plurality" refers to at least two.

[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0051] Before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0052] 1) Application: refers to an application program written in a programming language to implement specific functions. For example, an application can include system applications of an electronic device (such as applications used to implement the underlying functions of an electronic device) and user applications designed for individuals (such as web applications).

[0053] 2) Application resources: These refer to static resources in an application. The present application embodiment does not limit the types of application resources. Taking Web applications as an example, application resource types may include Hypertext Markup Language (HTML) resources, Cascading Style Sheets (CSS) resources, and JavaScript resources.

[0054] 3) Application environment: This refers to the computer hardware, software, network equipment, and data deployed for an application. The application environment supports specific operations on the application. For example, an application environment may include a development environment (used to support developers developing the application), a testing environment (used to support testers to verify application stability and bugs), and a production environment (used to support users' daily use of the application).

[0055] 4) Uniform Resource Locator (URL): A way of indicating the location of information (such as application resources) on a network. A URL mainly consists of two parts: a domain name and a resource path. The domain name is the name of a computer (i.e., an electronic device) or a group of computers on a network, consisting of a string of characters separated by dots. It is used to identify the electronic location of the computer during data transmission. The resource path refers to the path of the application resource on the computer or group of computers represented by the domain name. For example, the URL can be now.xx.com / demo.html, where now.xx.com is the domain name and demo.html is the resource path.

[0056] It is worth noting that the URL may also include other content, which is not limited thereto. For example, the URL may also include a specified transmission protocol, such as HyperText Transfer Protocol (HTTP).

[0057] 5) Domain name separator: A separator used in a URL to separate contents with different meanings (levels). The default domain name separator in a URL is a slash “ / ”. In an embodiment of the present application, it can also be a special domain name separator, such as “_tde_”.

[0058] The embodiments of the present application provide a proxy method, device, electronic device, and computer-readable storage medium for application resources, which can improve the flexibility and convenience of accessing application resources while also reducing the waste of computing resources of the electronic device. The following describes exemplary applications of the electronic device provided by the embodiments of the present application. The electronic device provided by the embodiments of the present application can be implemented as various types of terminal devices or as a server.

[0059] See also Figure 1 , Figure 1 This is a schematic diagram of the architecture of the application resource proxy system 100 provided in the embodiment of the present application. The terminal device 400 is connected to the server 200 via the network 300-1, and the server 200 is connected to the server 500-1 and the server 500-2 via the network 300-2. Among them, the server 500-1 and the server 500-2 respectively provide an application environment. Figure 1 Application environment A and application environment B are distinguished in the present application, but this does not constitute a limitation on the embodiments of the present application. For example, a server can provide multiple application environments, and for example, multiple servers (such as a server cluster) can provide one application environment. In addition, network 300-1 can be a wide area network or a local area network, or a combination of the two. The same applies to network 300-2.

[0060] In some embodiments, taking the electronic device as a terminal device as an example, the proxy method for application resources provided in the embodiments of the present application can be implemented by the terminal device. For example, the terminal device 400 runs the client 410 and the proxy client, wherein the client 410 corresponds to the application to be proxied, such as a Web application; and the proxy client is used to implement the proxy function. The proxy client binds multiple application environments of the application to be proxied to the same proxy domain name, wherein the relevant information of the application environment and the proxy domain name can be obtained by the proxy client from the outside world. For example, the proxy client can present a user interface and receive the relevant information of the application environment and the proxy domain name entered by the user in the user interface.

[0061] After completing the binding process, the proxy client intercepts the access request including the proxy domain name in the URL sent by the client 410. When the access request is intercepted, the target application environment requested by the access request is determined among the multiple application environments that have a binding relationship with the proxy domain name. Then, the proxy client obtains the application resources in the target application environment, and updates the URL in the obtained application resources according to the proxy domain name to obtain an updated URL. Taking the target application environment as application environment A provided by server 500-1 as an example, the proxy client can obtain application resources from server 500-1, wherein there can be a direct or indirect connection between the proxy client and server 500-1. Finally, the proxy client sends the application resources including the updated URL to the client 410 as a response to the access request. As an example, Figure 1 FIG4 shows a user interface provided by the client 410, that is, a user interface of the xx application program, which presents the application resources obtained after the client 410 sends an access request. Figure 1 Taking the image resource as an example, the image resource includes the updated URL ( Figure 1 not shown).

[0062] In some embodiments, taking the electronic device as an example, the proxy method for application resources provided in the embodiment of the present application can also be implemented by the server. For example, the server 200 can be a server for implementing the proxy function. In the process of implementing the proxy function, the server 200 first binds multiple application environments with the same proxy domain name. After completing the binding process, the server 200 can intercept the access request of the URL sent by the client 410 including the proxy domain name. When the access request is intercepted, the server 200 determines the target application environment requested by the access request in the multiple application environments that have a binding relationship with the proxy domain name. Figure 1 In the example above, the target application environment is application environment A provided by server 500-1. Server 200 then obtains application resources from the target application environment, updates the URL of the obtained application resources based on the proxy domain name, and sends the application resources including the updated URL to client 410 as a response to the intercepted access request.

[0063] It is worth mentioning that Figure 1 The server 200 shown is only an example. In practice, the proxy function may also be implemented by a terminal device different from the terminal device 400 .

[0064] In some embodiments, the terminal device 400 or the server 200 can implement the proxy method for application resources provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run; it can also be a small program, that is, a program that can be run by simply downloading it into a browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be an application, module or plug-in in any form.

[0065] In some embodiments, the servers shown above (such as server 200, server 500-1 and server 500-2) can be independent physical servers, or they can be server clusters or distributed systems composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms. Among them, cloud services can be cloud proxy services for terminal devices 400 to call. It is worth noting that cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data calculation, storage, processing, and sharing. In addition, the terminal device 400 can be a smart phone, tablet computer, laptop computer, desktop computer, smart TV, smart watch, etc., but is not limited to this. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0066] Taking the electronic device provided in the embodiment of the present application as an example, it can be understood that in the case where the electronic device is a server, Figure 2 Some of the structures shown in FIG (such as the user interface, presentation module, and input processing module) may be omitted. Figure 2 , Figure 2 is a schematic diagram of the structure of a terminal device 400 provided in an embodiment of the present application. Figure 2 The terminal device 400 shown includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal device 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not shown in FIG. Figure 2Various buses are labeled as bus system 440 .

[0067] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0068] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0069] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0070] The memory 450 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0071] In some embodiments, the memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0072] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and process hardware-based tasks;

[0073] A network communication module 452 for reaching other computing devices via one or more (wired or wireless) network interfaces 420 , exemplary network interfaces 420 including Bluetooth, WiFi, and USB;

[0074] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripheral devices and displaying content and information);

[0075] The input processing module 454 is configured to detect one or more user inputs or interactions from one of the one or more input devices 432 and to translate the detected inputs or interactions.

[0076] In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software. Figure 2 Proxy device 455 for application resources stored in memory 450 is shown. This proxy device can be software in the form of a program or plug-in, and includes the following software modules: a binding module 4551, a receiving module 4552, an environment determination module 4553, and an update module 4554. These modules are logical and can be arbitrarily combined or further separated according to the functions they implement. The functions of each module will be described below.

[0077] The proxy method for application resources provided by the embodiment of the present application will be described in conjunction with the exemplary application and implementation of the electronic device provided by the embodiment of the present application. For ease of understanding, the electronic device used to implement the proxy function is named as a proxy device.

[0078] See also Figure 3A , Figure 3A This is a flow chart of the proxy method for application resources provided by the embodiment of the present application, which will be combined with Figure 3A The steps shown are explained.

[0079] In step 101, multiple application environments are bound to the same proxy domain name.

[0080] For an application, it often involves multiple links such as development, testing, and product experience. Therefore, multiple application environments are often configured to support corresponding development, testing, and experience operations. In order to facilitate access to these application environments, in the embodiment of the present application, the proxy device can bind multiple application environments to the same proxy domain name. The embodiment of the present application does not limit the type of application environment. For example, the application environment can be any of the test environment, development environment, and production environment; the form of the proxy domain name is also not limited and can be set according to the actual application scenario.

[0081] In step 102, an access request including a uniform resource locator (URL) and a proxy domain name is received.

[0082] The binding process performed in step 101 establishes binding relationships between multiple application environments and the proxy domain name. Based on this binding relationship, the proxy device can intercept access requests sent by clients in a network whose URL includes the proxy domain name. The network can be a wide area network (WAN), a local area network (LAN), or a combination of the two. This embodiment of the application does not limit the type of access request, which depends on the protocol in the URL included in the access request, for example, an HTTP request.

[0083] In step 103, the target application environment requested by the access request is determined among multiple application environments that have a binding relationship with the proxy domain name.

[0084] When the proxy device intercepts (receives) an access request, it determines the target application environment requested by the access request from multiple application environments that are bound to the proxy domain name, where the number of target application environments is one. The present embodiment of the application does not limit the method for determining the target application environment. For example, a random selection can be made from multiple application environments that are bound to the proxy domain name, and the selected application environment can be used as the target application environment. Of course, the target application environment can also be specified by the access request.

[0085] In some embodiments, the above-mentioned determination of the target application environment requested by the access request in multiple application environments that are bound to the proxy domain name can be achieved in the following manner: obtaining the access identity information in the access request, and verifying the access identity information to obtain an identity information verification result; when the identity information verification result is successful, determining the application environment that is accessible according to the access identity information in the multiple application environments that are bound to the proxy domain name; wherein each application environment corresponds to at least one accessible identity information; and determining the target application environment requested by the access request in the at least one accessible application environment.

[0086] When the access request includes identity information (named as access identity information for the sake of distinction), the proxy device can verify the access identity information and obtain the identity information verification result. The embodiment of the present application does not limit the form of the access identity information. For example, it can be in the form of a user name + password, or in the form of a cookie, where the cookie is data stored in the client to identify the user's identity. The proxy device can match the access identity information with multiple pre-stored security identity information. When the access identity information successfully matches any one of the security identity information, the identity information verification result is determined to be a successful verification, where a successful match can mean the same; when the access identity information fails to match all the security identity information, the identity information verification result is determined to be a failed verification, where a failed match can mean different.

[0087] When the identity information verification result is successful, the proxy device determines the application environment that is accessible to the access identity information in multiple application environments that are bound to the proxy domain name. For example, multiple application environments can be traversed, and when the whitelist corresponding to the traversed application environment includes the access identity information, the traversed application environment is used as an application environment that is accessible according to the access identity information; when the whitelist corresponding to the traversed application environment does not include the access identity information, the traversed application environment is used as an application environment that is inaccessible according to the access identity information. The whitelist corresponding to each application environment includes at least one accessible identity information. In addition, when the identity information verification result is a verification failure, the proxy device can send a prompt to the client that the identity is not secure, so as to prompt the client to initiate an access request based on the new access identity information.

[0088] When the number of accessible application environments is at least one, the proxy device determines the target application environment for the access request from among all accessible application environments. For example, the target application environment may be randomly selected from among all accessible application environments, or the default application environment from among all accessible application environments may be used as the target application environment. Furthermore, when the number of accessible application environments is zero, the proxy device may send a notification to the client indicating that the access is unauthorized.

[0089] Through the above approach, on the one hand, access identity information is verified, enabling security control over the access identity information itself; on the other hand, accessible application environments are screened based on the access identity information, ensuring the security of application resources within the application environments. It is worth noting that only one of the above operations of verifying the access identity information and determining the accessible application environments can be performed.

[0090] In step 104, the URL of the application resource in the target application environment is updated according to the proxy domain name, and the access request is responded to according to the application resource including the updated URL.

[0091] Here, the proxy device obtains the application resources in the target application environment and updates the URL of the obtained application resources according to the proxy domain name to obtain the updated URL. The obtained application resources can be all or part of the application resources in the target application environment, depending on the URL in the access request.

[0092] It is worth noting that the URL included in the application resource is updated here. For example, when the application resource is an HTML resource, the URL included in the HTML resource can be the URL specified by the href attribute of the HTML resource. In addition, the updated URL obtained after the update process includes at least the proxy domain name.

[0093] The proxy device then responds to the access request based on the application resource containing the updated URL, for example, by sending the application resource containing the updated URL to the client as a response to the access request sent by the client. This allows the client to access application resources in multiple application environments using a unified proxy domain name, without having to modify the proxy domain name included in the URL in the access request for each application environment.

[0094] Upon receiving the application resource, the client can generate and send a new access request based on the updated URL in the application resource, thereby re-accessing the application resource based on the proxy domain name. For example, the client can present the received application resource in a user interface and, upon receiving a triggering operation targeting the application resource, generate a new access request based on the updated URL in the triggered application resource. It is worth noting that when processing the new access request received from the client, the proxy device can directly use the target application environment determined in step 103, i.e., it does not need to redefine the target application environment.

[0095] For ease of understanding, the present application provides the following examples: Figure 4 The client user interface diagram shown in the figure takes the proxied application as an example of a live broadcast application. First, the client generates an access request based on the URL obtained in the address bar 42 of the user interface 41 (such as the browser interface) and sends the access request to the network. The URL here includes at least the proxy domain name, Figure 4 When the client receives the application resource in response to the access request from the proxy device, the client presents the application resource in the user interface 41, such as Figure 4 The text of "Live Broadcast Application", the image of anchor A, the image of anchor B and the image of anchor C, here, the updated URL in the application resource may not be presented.

[0096] When the client receives a trigger operation for any of the presented application resources, it generates a new access request based on the updated URL of the triggered application resource and sends the new access request to the network. Here, the triggered application resource is taken as application resource 43. When the client receives application resource 44 in response to the new access request from the proxy device, it presents application resource 44 in user interface 41. Figure 4 In the example, application resource 44 is used as the live broadcast room data of anchor C.

[0097] In some embodiments, when the URL of the application resource in the target application environment is updated based on the proxy domain name, it also includes: deleting at least one of the following attributes included in the application resource: prohibit update attribute, prohibit identity attribute, prohibit proxy attribute, content encoding attribute and content length attribute.

[0098] Here, the attributes that can be deleted in application resources are described separately.

[0099] 1) The "disable update" attribute is used to prohibit (or block) updates to the content of an application resource. Therefore, you can remove the "disable update" attribute to ensure that updates to the application resource URL are successfully completed. The "disable update" attribute is an example of the "integrity" attribute in the script tag of an HTML resource.

[0100] 2) The prohibited identity attribute is used to prohibit the client from carrying access identity information in access requests initiated based on application resources. Therefore, the prohibited identity attribute can be deleted to improve the security of subsequent access. The prohibited identity attribute is such as the crossorgin attribute in the script tag of HTML resources.

[0101] 3) The "prohibit proxy" attribute is used to restrict the source of application resource loading. This means that the client can only load application resources from the same source and cannot load application resources proxied by a proxy device. Therefore, the "prohibit proxy" attribute can be removed to ensure that the client can successfully load application resources sent by the proxy device. The "prohibit proxy" attribute is similar to the "content-security-policy" attribute.

[0102] 4) The content-encoding attribute indicates the compression encoding of the application resource. When proxying application resources, the proxy device decompresses and recompresses them, causing the actual compression encoding of the application resource to be inconsistent with the compression encoding in the content-encoding attribute, which can further cause the client to fail to load the application resource. Therefore, the content-encoding attribute can be removed to ensure that the client can successfully load the application resource sent by the proxy device. The content-encoding attribute is an example of a content-encoding attribute.

[0103] 5) The Content-Length attribute is used to indicate the content length of the application resource. Because the proxy device updates the application resource URL, the actual content length of the updated application resource may be inconsistent with the content length in the Content-Length attribute, which can cause the client to fail to load the application resource. Therefore, the Content-Length attribute can be removed to ensure that the client can successfully load the application resource sent by the proxy device. The Content-Length attribute is similar to the Content-Length attribute.

[0104] In some embodiments, responding to access requests based on application resources including updated URLs can be achieved by responding to access requests based on application resources in the target application environment including updated URLs and application resources not including URLs.

[0105] For the application resources obtained by the proxy device from the target application environment, some may include URLs and some may not. Therefore, the proxy device can filter out the application resources that include URLs from the obtained application resources and update the URLs of the filtered application resources. In addition, for the application resources that do not include URLs in the obtained application resources, they can be kept as they are. In this way, when responding to an access request, the proxy device mainly feeds back two types of resources. The first type of resource is the application resource obtained from the target application environment and whose URL has been updated. The second type of resource is the application resource obtained from the target application environment and does not include a URL. In this way, the comprehensiveness and accuracy of responding to access requests can be improved.

[0106] In some embodiments, before step 104, the method further includes: acquiring application resources in a stream data format from the target application environment, and converting the format of the application resources from the stream data into character string data.

[0107] In some cases, such as in Node.js scenarios, the proxy device obtains application resources from the target application environment in the form of stream data. Since stream data is not easy to process directly, the format of the application resources can be converted from stream data to string data. Node.js is a JavaScript runtime environment built on the Chrome V8 engine and is a backend technology. For example, the format of the application resources can be first converted from stream data to binary data (such as binary data processed using the Buffer class), and then the format of the application resources can be converted from binary data to string data. String data is easier to process than stream data, so the above method can improve the convenience of URL update processing.

[0108] like Figure 3A As shown, the embodiment of the present application provides a method for accessing multiple application environments based on a unified proxy domain name, which can improve the flexibility and convenience of access and also reduce the waste of computing resources.

[0109] In some embodiments, see Figure 3B , Figure 3B This is a flow chart of the proxy method for application resources provided in the embodiment of the present application. Figure 3A Step 104 shown can be implemented through steps 201 to 204 , which will be described in conjunction with each step.

[0110] In step 201, the content to be proxied including the domain name corresponding to the target application environment is obtained.

[0111] For multiple application environments bound to a proxy domain name, the proxy device retrieves proxy rules configured for each application environment. For example, the proxy device may present a proxy rule configuration interface and, in response to a configuration operation received within the proxy rule configuration interface, retrieve the proxy rules configured for the application environment. In embodiments of the present application, the proxy rules may be embodied in the form of content to be proxied, which may include at least a domain name and may also include part or all of a resource path.

[0112] In step 202, the URL of the application resource in the target application environment is matched with the content to be proxied to obtain a matching result.

[0113] Here, for each application resource (here referring to the application resource including the URL) obtained by the proxy device from the target application environment, the URL of the application resource is matched with the content to be proxied corresponding to the target application environment. When the URL of the application resource includes the content to be proxied corresponding to the target application environment, the matching result is determined to be a successful match; when the URL of the application resource does not include the content to be proxied corresponding to the target application environment, the matching result is determined to be a failed match.

[0114] In some embodiments, the target application environment includes multiple contents to be proxied, and each content to be proxied corresponds to a priority. The above-mentioned matching of the URL of the application resource in the target application environment with the content to be proxied can be achieved in the following way: according to the order of the priorities corresponding to the multiple contents to be proxied, the multiple contents to be proxied are traversed, and the following processing is performed on the traversed content to be proxied: the URL of the application resource in the target application environment is matched with the traversed content to be proxied.

[0115] Here, when the number of to-be-proxied contents corresponding to the target application environment includes multiple contents, and each to-be-proxied content corresponds to a priority, the multiple to-be-proxied contents corresponding to the target application environment can be sorted according to the priority corresponding to each to-be-proxied content. Here, the sorting is performed in order from high to low priority.

[0116] Then, for each application resource (here referring to the application resource including the URL) obtained by the proxy device from the target application environment, the sorted multiple to-be-proxied contents are traversed, and the URL of the application resource is matched with the traversed to-be-proxied contents. When the matching result obtained is a successful match, step 203 is executed for the application resource; when the matching result obtained is a failed match, the next to-be-proxied content is traversed. Since the higher the priority corresponding to the to-be-proxied content, the higher its importance, the above method can improve the accuracy of the matching process and subsequent update process. It is worth noting that when the URL of a certain application resource fails to match all the to-be-proxied contents corresponding to the target application environment, the application resource can be ignored, that is, the URL of the application resource is not updated.

[0117] In step 203, when the matching result is successful, the proxy domain name is added to the URL of the application resource, and the proxy domain name, the content to be proxied, and the remaining content in the URL of the application resource are separated according to the domain name separator to obtain an updated URL.

[0118] The present application embodiment provides an example of updating the URL of an application resource. When a match is successful, the proxy device may add the proxy domain name to the URL of the application resource, such as by adding it to the URL header. The proxy domain name, the content to be proxied, and the remaining content in the URL of the application resource are then separated according to a domain name separator to obtain an updated URL. The domain name separator may be the default domain name separator " / " in the URL, or a specially configured domain name separator, such as "_tde_".

[0119] In some embodiments, before step 102, it also includes: binding the default domain name with the proxy domain name; when the content to be proxied includes a default domain name that has a binding relationship with the proxy domain name, and the matching result is a successful match, it also includes: deleting the default domain name in the URL of the application resource to update the content to be proxied in the URL of the application resource.

[0120] In an embodiment of the present application, in addition to binding multiple application environments with the proxy domain name, the proxy device can also bind the acquired default domain name with the proxy domain name, where the default domain name is different from the proxy domain name, and the specific form of the default domain name is not limited.

[0121] When the content to be proxied includes a default domain name, and the match between the URL of the application resource and the content to be proxied is successful, there is no need to retain the default domain name (i.e., the original domain name) in the URL of the application resource. Instead, the default domain name in the URL of the application resource can be directly deleted to update the content to be proxied in the URL of the application resource. This can reduce the length of the updated URL and save computing resources. When the URL is subsequently restored, since the updated URL only includes the proxy domain name, the proxy device can directly restore the default domain name with which it is bound.

[0122] For example, if the URL of an application resource is now8.gtimg.com / test.js, the proxy domain name is fastest.now.xx.com, the target application environment's corresponding content to be proxied is now8.gtimg.com, and the default domain name is also now8.gtimg.com, then you can delete the default domain name from the application resource's URL and add the proxy domain name to the URL's header. Then, using the domain name separator ("_tde_" for example), separate the proxy domain name, the updated content to be proxied (which is empty here), and the remaining content in the URL. The resulting updated URL is fastest.now.xx.com / _tde_ / test.js. If the domain name separator is the default " / " in URLs, the resulting updated URL is fastest.now.xx.com / test.js.

[0123] It is worth noting that the embodiment of the present application does not limit the execution timing of the operation of deleting the default domain name. For example, it can be performed after adding the proxy domain name to the URL of the application resource and before the separation processing according to the domain name separator, or it can be performed after the separation processing according to the domain name separator.

[0124] In some embodiments, when the matching result is a successful match, it also includes: for the domain name included in the content to be proxied in the URL of the application resource, converting the domain name from a domain name format to a non-domain name format to update the content to be proxied in the URL of the application resource.

[0125] Here, when the matching result is a successful match, the original domain name in the URL of the application resource (that is, the domain name included in the content to be proxied) can be converted from the domain name format to the non-domain name format to update the content to be proxied in the URL of the application resource. In this way, in the updated URL, there is only one domain name, the proxy domain name, which can better meet the format requirements of the URL itself.

[0126] It is worth noting that the domain name format and non-domain name format can be the format of the separator inside the domain name. For example, in the domain name format, the separator inside the domain name is the default ".", such as the domain name now8.gtimg.com; in the non-domain name format, the separator inside the domain name is a special set internal separator "_", that is, underscore. Of course, this does not constitute a limitation on the non-domain name format.

[0127] For ease of understanding, let's take an example. For example, suppose the URL for an application resource is now8.gtimg.com / test.js, the proxy domain is fastest.now.xx.com, and the content to be proxied is now8.gtimg.com. To do this, convert the original domain name in the URL from domain name format to non-domain name format and add the proxy domain name to the URL header. Finally, use the domain name separator (for example, "_tde_") to separate the proxy domain name, the updated content to be proxied (the updated original domain name), and the remaining content in the URL. The resulting updated URL is fastest.now.xx.com / _tde_ / now8_gtimg_com / _tde_ / test.js. If the domain name separator is the default " / " in URLs, the resulting updated URL is fastest.now.xx.com / now8_gtimg_com / test.js.

[0128] It is worth noting that the embodiment of the present application does not limit the execution timing of the operation of converting the original domain name from the domain name format to the non-domain name format. For example, it can be performed after adding the proxy domain name to the URL of the application resource and before the separation processing according to the domain name separator, or it can be performed after the separation processing according to the domain name separator.

[0129] In step 204, the access request is responded to according to the application resource including the updated URL.

[0130] like Figure 3B As shown, the embodiment of the present application updates the URL of the application resource based on the to-be-proxied content corresponding to the target application environment, which can improve the effectiveness and accuracy of the update process.

[0131] In some embodiments, see Figure 3C , Figure 3C This is a flow chart of the proxy method for application resources provided in the embodiment of the present application. Figure 3A After step 102 shown, in step 301, the URL in the access request may be split according to the domain name separator to obtain the proxy domain name and the restored URL.

[0132] For example, for a URL in an access request, the proxy device can use the content before the first domain name separator in the URL as the proxy domain name, and the content after the first domain name separator in the URL as the restored URL. The domain name separator can be the default domain name separator " / " in the URL, or a specially configured domain name separator, such as "_tde_".

[0133] It is worth noting that step 301 can be executed before or after step 103, or can be executed simultaneously.

[0134] exist Figure 3C middle, Figure 3A Step 104 shown can be implemented through steps 302 to 304 , which will be described in conjunction with each step.

[0135] In step 302, query processing is performed in the target application environment according to the restored URL.

[0136] After determining the target application environment, the proxy device can perform query processing in the target application environment according to the restored URL.

[0137] It is worth noting that different application environments in the embodiments of the present application may have data differences. Therefore, even for the same URL, the application resources obtained by query processing in different application environments may be different.

[0138] In some embodiments, the above-mentioned query processing based on the restored URL in the target application environment can be achieved in the following manner: the restored URL is split according to the domain name separator to obtain a candidate domain name and a candidate resource path; when the candidate domain name includes a parameter identifier, the parameter identifier and the parameter identified by the parameter identifier in the candidate domain name are deleted, and the deleted parameter identifier and parameter are added to the candidate resource path; when the candidate domain name successfully matches the non-domain name format, the candidate domain name is converted from the non-domain name format to the domain name format; the candidate domain name is used as the restored domain name, and the candidate resource path is used as the restored resource path, and query processing is performed in the target application environment based on the restored domain name and the restored resource path.

[0139] To ensure the accuracy of query processing, the proxy device can further restore the restored URL to obtain the restored domain name and restored resource path. In this process, the restored URL can first be split according to the domain name separator to obtain candidate domain names and candidate resource paths. For example, the content before the first domain name separator in the restored URL can be used as the candidate domain name, and the content after the first domain name separator in the restored URL can be used as the candidate resource path.

[0140] It is worth noting that if the domain name separator used to split the restored URL is a special domain name separator, the resulting candidate domain name may also include a default domain name separator. In this case, the candidate domain name can be split according to the default domain name separator, that is, the content after the first default domain name separator in the candidate domain name is added to the candidate resource path, such as to the header of the candidate resource path, and the content before the first default domain name separator in the candidate domain name is used as the new candidate domain name.

[0141] If the candidate domain name includes a parameter identifier, it indicates that the parameter identified by the parameter identifier does not belong to the actual domain name. Therefore, the parameter identifier and the parameter identified by the parameter identifier are deleted from the candidate domain name, and the deleted parameter identifier and the deleted parameter are added to the candidate resource path, such as to the header of the candidate resource path. The parameter identifier is, for example, a "?" identifier. For example, if the candidate domain name is now8_gtimg_com?id=123, then ?id=123 is deleted from the candidate domain name and ?id=123 is added to the header of the candidate resource path to update the candidate resource path.

[0142] When a candidate domain successfully matches a non-domain name format, the candidate domain is converted from non-domain name format to domain name format. For example, if the candidate domain is now8_gtimg_com, the default internal delimiter "_" (corresponding to the non-domain name format) in the candidate domain is converted to the default internal delimiter "." (corresponding to the domain name format), which means the candidate domain is updated to now8.gtimg.com.

[0143] Finally, the candidate domain name is used as the restored domain name (i.e., the original domain name), and the candidate resource path is used as the restored resource path (i.e., the original resource path). Query processing is then performed in the target application environment based on the restored domain name and restored resource path. This approach effectively improves the success rate and accuracy of query processing.

[0144] In some embodiments, before step 102, the process also includes: binding the default domain name with the proxy domain name; before using the candidate domain name as the restored domain name, the process also includes: matching the candidate domain name with multiple domain name identifiers; when the candidate domain name fails to match multiple domain name identifiers, adding the candidate domain name to the candidate resource path, and using the default domain name that has a binding relationship with the proxy domain name as a new candidate domain name.

[0145] Here, the proxy device can match the candidate domain name with multiple domain name identifiers that are set. The domain name identifier can be set according to the actual application scenario, for example, it can include "com", "edu", "gov" and "cn", etc. When the candidate domain name successfully matches any domain name identifier (that is, the candidate domain name includes any domain name identifier), the candidate domain name can be used as the restored domain name; when the candidate domain name fails to match all domain name identifiers, it proves that the candidate domain name is not actually a domain name, so the candidate domain name is added to the candidate resource path, such as added to the header of the candidate resource path, and the default domain name that has a binding relationship with the proxy domain name is used as the new candidate domain name. In this way, the accuracy of the restored domain name and the restored resource path can be improved.

[0146] In step 303, the URL of the application resource obtained by the query is updated according to the proxy domain name.

[0147] The application resource obtained by the query processing is the application resource requested by the access request. Here, the proxy device obtains the application resource obtained by the query processing from the target application environment and updates the URL in the obtained application resource.

[0148] In step 304, the access request is responded to according to the application resource including the updated URL.

[0149] like Figure 3C As shown, the embodiment of the present application restores the URL in the access request and performs query processing in the target application environment based on the restored URL, which can improve the accuracy of resource access.

[0150] In some embodiments, see Figure 3D , Figure 3D This is a flow chart of the proxy method for application resources provided in the embodiment of the present application. Figure 3A Step 101 shown can be implemented through steps 401 to 405 , which will be described in conjunction with each step.

[0151] In step 401, the proxy domain name to be bound is obtained.

[0152] For example, the proxy device may present a domain name application interface, and use the proxy domain name received on the domain name application interface as the proxy domain name to be bound.

[0153] In step 402, the existing proxy domain name corresponding to the created management directory is obtained.

[0154] Here, the proxy device obtains the proxy domain name corresponding to the created management directory. For easy identification, the proxy domain name obtained in this step is named the existing proxy domain name. One management directory can correspond to one proxy domain name.

[0155] In step 403, the proxy domain name to be bound is verified based on the existing proxy domain name to obtain a domain name verification result.

[0156] For example, the proxy device can determine the similarity between an existing proxy domain name and the proxy domain name to be bound. If the similarity between the proxy domain name to be bound and all existing proxy domain names is less than a similarity threshold, the domain name verification result is determined to be successful. If the similarity between the proxy domain name to be bound and any existing proxy domain name is greater than or equal to the similarity threshold, the domain name verification result is determined to be a failure. The similarity threshold can be set based on the actual application scenario, such as 100%.

[0157] In step 404, when the domain name verification result is successful, a management directory corresponding to the proxy domain name is created.

[0158] If the domain name verification result is a failure, the proxy device can output a modification prompt (for example, by presenting the modification prompt in the domain name application interface) to prompt the user to modify the proxy domain name to be bound. If the domain name verification result is a success, the proxy device creates a management directory corresponding to the proxy domain name to be bound. In this way, the uniqueness of the proxy domain name to be bound can be guaranteed, and the proxy domain name to be bound can be prevented from being too similar (or identical) to an existing proxy domain name.

[0159] Of course, in the embodiment of the present application, it is also possible to directly create a management directory corresponding to the proxy domain name to be bound without performing verification processing on the proxy domain name to be bound.

[0160] In step 405, in response to the operation of creating multiple application environments in the management directory, binding relationships between the multiple application environments and the proxy domain name are established.

[0161] For example, the proxy device may present an environment creation interface corresponding to the management directory, and in response to the operation of creating multiple application environments in the environment creation interface, establish a binding relationship between the created multiple application environments and the proxy domain name to be bound, thereby implementing binding processing.

[0162] like Figure 3D As shown, the embodiment of the present application implements binding processing by creating a management directory, which can improve the simplicity of binding processing and at the same time improve the stability and traceability of the established binding relationship.

[0163] In some embodiments, see Figure 3E , Figure 3E This is a flow chart of the proxy method for application resources provided in the embodiment of the present application. Figure 3AStep 103 shown can be implemented through step 501 or step 502. In step 501, the default application environment among multiple application environments that have a binding relationship with the proxy domain name is used as the target application environment requested by the access request; wherein the default application environment is any one of the multiple application environments.

[0164] Here, a default application environment among multiple application environments that are bound to the proxy domain name can be pre-set. The default application environment can be any one of the multiple application environments, for example, the application environment created earliest. When the proxy device receives an access request whose URL includes the proxy domain name, it can directly use the default application environment as the target application environment requested by the access request.

[0165] In step 502, the application environment information in the access request is obtained, and the application environment that has a binding relationship with the proxy domain name and successfully matches the application environment information is used as the target application environment requested by the access request.

[0166] Here, when the access request carries application environment information, the proxy device can determine the application environment that successfully matches the application environment information from multiple application environments that are bound to the proxy domain name, and use it as the target application environment requested by the access request, that is, the application environment information of the target application environment successfully matches the application environment information in the access request (if the same). The embodiment of the present application does not limit the form of the application environment information, for example, it may include the application environment name. In this way, the flexibility of determining the target application environment can be improved.

[0167] exist Figure 3E middle, Figure 3A After step 103 shown, in step 503, in response to a switching operation on the target application environment, multiple application environments having a binding relationship with the proxy domain name may be presented.

[0168] For example, the proxy device may present a switching identifier and, upon receiving a trigger operation for the switching identifier, present multiple application environments that are bound to the proxy domain name, wherein the trigger operation for the switching identifier is a switching operation for the target application environment.

[0169] In step 504 , in response to a selection operation on multiple application environments, the selected application environment is used as a new target application environment.

[0170] Here, upon receiving a selection operation (e.g., a click operation) for the multiple presented application environments, the proxy device uses the selected application environment as the new target application environment. It is worth noting that steps 503 and 504 may also be performed after step 104. It is worth noting that the switching identifier may also be presented by the client. The proxy device may use the trigger operation for the switching identifier received by the client as a switching operation for the target application environment, and send the application environment information of the multiple application environments bound to the proxy domain name to the client, so that the user can perform the selection operation on the client.

[0171] like Figure 3E As shown, the embodiment of the present application provides two methods for determining the target application environment, which improves flexibility; it also provides a method for switching the target application environment, which can switch the target application environment conveniently and quickly.

[0172] Below, we will describe an example application of the present invention in a practical application scenario. For ease of understanding, we will use a web application as an example. This embodiment provides a flexible solution for proxying web resources (i.e., application resources in web applications) based on URL updates. This solution allows for quick and flexible switching between different application environments while maintaining the proxy domain name, greatly improving the efficiency and experience of web application development, testing, and product walkthroughs on PCs and mobile devices.

[0173] Next, we will explain it from the perspective of visualization. Figure 5 The schematic diagram of the domain name application interface shown in FIG. 5 shows a domain name application interface 51, and the management platform can bind the proxy domain name received in the domain name application interface 51 to the default domain name. The management platform can be a platform provided by the proxy device specifically for implementing the proxy function. As an example, in Figure 5 The proxy domain name fastest.now.xx.com is shown in FIG, and the default domain name is now.xx.com. In addition, the application name can also be received in the domain name application interface 51, such as Figure 5 Now application in.

[0174] The present application provides an embodiment of Figure 6 As shown in the schematic diagram of the space application interface, the management platform can create a corresponding management space based on the space name, space logo and space description received in the space application interface 61 by presenting the space application interface 61. The management space is an aggregate class for managing all application environments of the Web application, corresponding to the management directory mentioned above. As an example, Figure 6The image resource pointed to by the space name "now app" and the space logo "https: / / nowpic.gtimg.com / feeds_pic / ..." is shown in the figure. The space description is "now app management space." It is worth noting that the space logo and space description are not necessary information for creating a management space.

[0175] The present application provides an embodiment of Figure 7 As shown in the schematic diagram of the domain name binding interface, after the creation of the management space is completed, the management platform can present the domain name binding interface 71 corresponding to the management space, and in response to the operation of entering the proxy domain name in the domain name binding interface 71, the management space is bound to the entered proxy domain name. As an example, Figure 7 The figure shows that the management space named now application, application name now application, proxy domain name fastest.now.xx.com and default domain name now.xx.com are bound to each other. Figure 7 The whitelist control option is also shown. When a trigger operation for this option is received, a whitelist configuration interface may be presented to facilitate the user to configure the whitelist corresponding to each application environment in the whitelist configuration interface.

[0176] The present application provides an embodiment of Figure 8 As shown in the schematic diagram of the environment creation interface, the management platform can present the environment creation interface 81 corresponding to the management space, and create an application environment for the Web application (ie, the now application) based on the application environment information received in the environment creation interface 81. As an example, Figure 8 It is shown that the application environment information includes the application environment name, application environment type, application environment status, rule editing mode and application environment description, wherein the application environment description is not necessary information for creating an application environment. The application environment type may include Internet Data Center (IDC) application environment and Devnet application environment, etc., depending on the actual network policy adopted; the application environment status may include enabled and disabled; the rule editing mode may include form editing mode and editor editing mode, etc. The form editing mode refers to editing the proxy rules in the form of input text, and the editor editing mode refers to editing the proxy rules by entering code.

[0177] After completing the creation of the application environment, the management platform can present multiple created application environments in the environment management interface, such as Figure 9The environment management interface 91 in the example shows "

[1328] General 201 Environment", where "1328" is the number of the application environment and "General 201 Environment" is the name of the application environment. In the environment management interface 91, there are also options for "Create Environment" and "Create Rules". When a trigger operation (such as a click operation) is received for the "Create Rules" option 92, the proxy rule configuration interface can be presented. Figure 9 , a proxy rule configuration interface 93 is shown as a window. Of course, proxy rule configuration interface 93 can also be presented as a standalone interface. The editing mode used in proxy rule configuration interface 93 is a form editing mode, which supports configuration of proxy rules, their corresponding application environments, rule states, rule nicknames, and weights. The proxy rules correspond to the aforementioned content to be proxied, and the weights correspond to the aforementioned priorities.

[0178] The present application also provides the following examples: Figure 10 The proxy rule management interface 101 shown is used to manage configured (created) proxy rules. Management operations include but are not limited to disabling (i.e., not enabling), editing, and deleting. It is worth noting that the management platform can send the relevant data of the interface shown above to the client for presentation in the client.

[0179] After completing the above steps, the client can access application resources in the web application through the proxy domain name. For example, the client can enter the URL fastest.now.xx.com / demo.html in the browser's address bar to generate an access request including this URL. The management platform intercepts this access request and uses the default application environment among the multiple application environments bound to the proxy domain name fastest.now.xx.com as the target application environment. It then updates the URLs of the application resources in the target application environment based on the proxy domain name and responds to the access request based on the application resources with the updated URLs.

[0180] When the client receives the application resource including the updated URL, it can be presented in the browser interface. Figure 11The browser interface 111 is shown as an example, which includes application resources such as "File 1" and "File 2". A gear-shaped switching mark 112 is also shown in the browser interface 111. When the client receives a trigger operation for the switching mark 112, the application environment information of multiple application environments that are bound to the proxy domain name can be presented in the browser interface 111. Then, in response to the selection operation for multiple application environments, the client will use the selected application environment as the new target application environment. In this way, the switching of the target application environment can be achieved conveniently and quickly. After switching the target application environment, the client can still use the URL of fastest.now.xx.com / demo.html to access it, that is, there is no need to frequently switch URLs, so the development, testing and product experience of Web applications can be conveniently carried out.

[0181] Next, the following is explained from the perspective of the underlying implementation. Figure 12 The flowchart of the proxy method for application resources shown is as follows: first, the client can access the proxy domain name, that is, send an access request with the URL including the proxy domain name. The access request can reach the access layer after load balancing, wherein the load balancing is such as Global Server Load Balance (GSLB). The access layer can deploy a firewall for providing security protection functions. After security protection, the access layer can send the access request to the forwarder, and the forwarder forwards it to the gateway of the management platform, wherein the forwarder is such as the Nginx forwarder. The gateway obtains the application environment that can be accessed according to the access identity information (such as Cookie) in the access request from the data service of the management platform, wherein the data service is used to store the correspondence between each application environment and the identity information that can access the application environment. Before obtaining the accessible application environment, the gateway can also verify the access identity information to determine whether the access identity information is safe.

[0182] When the number of accessible application environments is zero, that is, there are no accessible application environments, the gateway can send a prompt of no permission to access to the client, and the client can present an unauthorized interface including the prompt of no permission to access. When the number of accessible application environments is at least one, the gateway can determine the target application environment from the accessible application environments and obtain the proxy rules corresponding to the target application environment. At the same time, the gateway performs query processing in the target application environment through the application environment management tool to query the application resources requested by the access request, wherein the application environment management tool is such as the Nohost tool.

[0183] For the application resources obtained through query processing, the gateway first determines whether they include a URL. If the application resource does not include a URL, the gateway directly sends the application resource to the client. If the application resource does include a URL (such as HTML, CSS, and JavaScript application resources), the gateway updates the URL in the application resource according to the proxy rules corresponding to the target application environment and sends the application resource including the updated URL to the client. The client can then present the received application resource, completing the application resource access.

[0184] according to Figure 12 It can be determined that the core of the embodiment of the present application lies in two parts: updating the URL and restoring the updated URL, which will be explained separately below.

[0185] 1) Update the URL.

[0186] For the obtained application resources including URLs, the gateway can first convert the format of the application resources from Stream format to Buffer format, and then from Buffer format to String format. The reason for converting to String format is that it is more convenient and faster to use String format for update processing.

[0187] For application resources in string format, the gateway updates the URL in the application resource based on the proxy rules. For ease of understanding, the following example uses the proxy domain name fastest.now.xx.com, the default domain name now.xx.com, and the proxy rule now8.gtimg.com. If the URL in the application resource is now8.gtimg.com / test.js, after updating the proxy rules, the updated URL becomes fastest.now.xx.com / _tde_ / now8_gtimg_com / _tde_ / test.js. "_tde_" is a special domain name delimiter, though the default URL delimiter " / " can also be used. Furthermore, during the update process, the default internal delimiter "." in now8.gtimg.com is replaced with the special internal delimiter, underscore "_.", because the domain name in the updated URL is now fastest.now.xx.com, not now8.gtimg.com.

[0188] It's worth noting that now8.gtimg.com isn't the default domain name, so the updated URL still contains now8_gtimg_com. If you're updating the default domain name, for example, if the application resource URL is now.xx.com / cgi-bin / test, the updated URL could be fastest.now.xx.com / _tde_ / cgi-bin / test, meaning the updated URL no longer retains the default domain name.

[0189] If the application resource is an HTML resource, since the content of the application resource has been modified, you can also remove the integrity attribute and crossorigin attribute from the script tag of the application resource to prevent the script tag from failing to load. The integrity attribute is used to prevent the modification of the application resource content; the crossorigin attribute is used to prohibit the carrying of cookies in cross-domain requests.

[0190] In addition, for HTML resources, JavaScript resources, and CSS resources that have been updated, some headers can be deleted to avoid failures in client loading of application resources. The headers that need to be deleted may include content-security-policy, content-encoding, and content-length. Among them, content-security-policy is used to limit the loading source of application resources, that is, only application resources from the same source can be loaded, and loading of proxy application resources is not supported; content-encoding is used to indicate the compression encoding of application resources. Since application resources are decompressed and then compressed again during the update process, the actual compression encoding will be different from the compression encoding in content-encoding, which will cause an error; content-length is used to indicate the content length of application resources. After the update process, the actual content length of application resources will be different from the content length indicated by content-length, which will cause an error.

[0191] 2) Restore the URL.

[0192] Here, the URL sent by the client is restored to ensure that the correct application resource can be queried. For example, if the URL in the access request is fastest.now.xx.com / _tde_ / now8_gtimg_com / _tde_ / index, the restored URL is now8.gtimg.com / index; if the URL in the access request is fastest.now.xx.com / _tde_ / now8_gtimg_com, the restored URL is now8.gtimg.com; if the URL in the access request is fastest.now.xx.com / _tde_ / now8_gtimg_com / _tde_?_tde_id=123, the restored URL is now8.gtimg.com?_tde_id=123.

[0193] Here, the implementation process of the restoration processing is described in a step-by-step manner.

[0194] Step 1: Split the URL in the access request into the portion after the first domain name separator "_tde_" and before the second "_tde_" as candidate domain names. Split the portion after the second "_tde_" into candidate resource paths. The portion before the first "_tde_" in the access request URL is the proxy domain name.

[0195] Step 2: When the candidate domain name includes the default domain name separator " / ", it proves that a part of the candidate domain name actually belongs to the actual resource path, then delete the content after the first " / " in the candidate domain name, and add the deleted content to the header of the candidate resource path to update the candidate resource path.

[0196] Step 3: When the candidate domain name includes a parameter identifier "?", the parameter identifier and the content after the parameter identifier in the candidate domain name are deleted, and the deleted content is added to the header of the candidate resource path to update the candidate resource path.

[0197] Step ④: Update the underscore symbol "_" in the candidate domain name to ".", use the candidate domain name as the restored domain name, and use the candidate resource path as the restored resource path to complete the restoration process.

[0198] After obtaining the restored domain name and restored resource path, query processing can be performed to obtain the application resource requested by the access request.

[0199] Through the embodiments of the present application, at least the following technical effects can be achieved: 1) the client can access application resources in both the intranet (such as a local area network) and the extranet (such as a wide area network) without being affected by the network environment; 2) there is no need to apply for multiple proxy domain names, only one proxy domain name is needed to access multiple different application environments; 3) the operations required to access the application environment (such as deploying complex proxy tools) are greatly reduced, and only the updated URL (or proxy domain name) needs to be provided to the client.

[0200] The following continues to describe the exemplary structure of the application resource agent device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, such as Figure 2 As shown, the software modules in the proxy device 455 of the application resources stored in the memory 450 may include: a binding module 4551, which is used to bind multiple application environments with the same proxy domain name; a receiving module 4552, which is used to receive an access request whose uniform resource locator URL includes the proxy domain name; an environment determination module 4553, which is used to determine the target application environment requested by the access request among multiple application environments that have a binding relationship with the proxy domain name; an update module 4554, which is used to update the URL of the application resource in the target application environment according to the proxy domain name, and respond to the access request according to the application resource including the updated URL.

[0201] In some embodiments, the update module 4554 is also used to: obtain the content to be proxied including the domain name corresponding to the target application environment; match the URL of the application resource in the target application environment with the content to be proxied to obtain a matching result; when the matching result is a successful match, add the proxy domain name to the URL of the application resource, and separate the proxy domain name, content to be proxied and remaining content in the URL of the application resource according to the domain name separator to obtain an updated URL.

[0202] In some embodiments, the number of to-be-proxied contents corresponding to the target application environment includes multiple, and each to-be-proxied content corresponds to a priority; the update module 4554 is also used to: traverse the multiple to-be-proxied contents according to the order of the priorities corresponding to the multiple to-be-proxied contents, and perform the following processing on the traversed to-be-proxied contents: match the URL of the application resource in the target application environment with the traversed to-be-proxied content.

[0203] In some embodiments, the binding module 4551 is further used to: bind the default domain name with the proxy domain name; the update module 4554 is further used to: when the content to be proxied includes a default domain name that has a binding relationship with the proxy domain name, and the matching result is a successful match, delete the default domain name in the URL of the application resource to update the content to be proxied in the URL of the application resource.

[0204] In some embodiments, the update module 4554 is also used to: when the matching result is a successful match, convert the domain name included in the content to be proxied in the URL of the application resource from a domain name format to a non-domain name format to update the content to be proxied in the URL of the application resource.

[0205] In some embodiments, the proxy device 455 of the application resource also includes a restoration module, which is used to split the URL in the access request according to the domain name separator to obtain the proxy domain name and the restored URL; the update module 4554 is also used to: perform query processing in the target application environment according to the restored URL; and update the URL of the application resource obtained by the query processing according to the proxy domain name.

[0206] In some embodiments, the update module 4554 is further used to: split the restored URL according to the domain name separator to obtain a candidate domain name and a candidate resource path; when the candidate domain name includes a parameter identifier, delete the parameter identifier and the parameter identified by the parameter identifier in the candidate domain name, and add the deleted parameter identifier and parameter to the candidate resource path; when the candidate domain name successfully matches the non-domain name format, convert the candidate domain name from the non-domain name format to the domain name format; use the candidate domain name as the restored domain name, use the candidate resource path as the restored resource path, and perform query processing in the target application environment based on the restored domain name and the restored resource path.

[0207] In some embodiments, the binding module 4551 is further used to: bind the default domain name with the proxy domain name; the update module 4554 is further used to: match the candidate domain name with multiple domain name identifiers; when the candidate domain name fails to match multiple domain name identifiers, the candidate domain name is added to the candidate resource path, and the default domain name that has a binding relationship with the proxy domain name is used as the new candidate domain name.

[0208] In some embodiments, the binding module 4551 is further used to: obtain the proxy domain name to be bound; create a management directory corresponding to the proxy domain name; and establish a binding relationship between the multiple application environments and the proxy domain name in response to the operation of creating multiple application environments in the management directory.

[0209] In some embodiments, the binding module 4551 is also used to: obtain an existing proxy domain name corresponding to the created management directory; verify the proxy domain name to be bound based on the existing proxy domain name to obtain a domain name verification result; when the domain name verification result is successful, create a management directory corresponding to the proxy domain name.

[0210] In some embodiments, the environment determination module 4553 is also used to: perform any one of the following processing: obtain application environment information in the access request, and use the application environment that has a binding relationship with the proxy domain name and successfully matches the application environment information as the target application environment requested by the access request; use the default application environment among multiple application environments that have a binding relationship with the proxy domain name as the target application environment requested by the access request; wherein the default application environment is any one of the multiple application environments.

[0211] In some embodiments, the environment determination module 4553 is further used to: in response to a switching operation on a target application environment, present multiple application environments that are bound to the proxy domain name; in response to a selection operation on multiple application environments, use the selected application environment as the new target application environment.

[0212] In some embodiments, the environment determination module 4553 is further used to: obtain access identity information in the access request, and verify the access identity information to obtain an identity information verification result; when the identity information verification result is successful, determine the application environment that is accessible according to the access identity information in multiple application environments that have a binding relationship with the proxy domain name; wherein each application environment corresponds to at least one accessible identity information; and in at least one accessible application environment, determine the target application environment requested by the access request.

[0213] In some embodiments, the update module 4554 is further configured to delete at least one of the following attributes included in the application resource: a prohibit update attribute, a prohibit identity attribute, a prohibit proxy attribute, a content encoding attribute, and a content length attribute.

[0214] In some embodiments, the update module 4554 is further configured to respond to access requests based on application resources in the target application environment that include the updated URL and application resources that do not include the URL.

[0215] The present invention provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the application resource proxy method described above in the present invention.

[0216] The embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the method provided by the embodiment of the present application, for example, Figure 3A 、 Figure 3B 、 Figure 3C 、 Figure 3D and Figure 3E The proxy method of the application resource is shown.

[0217] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.

[0218] In some embodiments, executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0219] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0220] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0221] The above are merely examples of the present application and are not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.

Claims

1. A proxy method for application resources, characterized in that: include: Bind multiple application environments to the same proxy domain name; Receiving an access request including a uniform resource locator (URL) and the proxy domain name; Determining a target application environment requested by the access request among the multiple application environments that have a binding relationship with the proxy domain name; Splitting the URL in the access request according to the domain name separator to obtain the proxy domain name and the restored URL; Splitting the restored URL according to the domain name separator to obtain candidate domain names and candidate resource paths; Using the candidate domain name as the restored domain name, using the candidate resource path as the restored resource path, and performing query processing in the target application environment according to the restored domain name and the restored resource path; The URL of the application resource obtained by the query processing is updated according to the proxy domain name, and the access request is responded to according to the application resource including the updated URL.

2. The method according to claim 1, characterized in that The updating process of the URL of the application resource obtained by the query process according to the proxy domain name includes: Obtaining the content to be proxied including the domain name corresponding to the target application environment; Matching the URL of the application resource obtained by the query processing with the content to be proxied to obtain a matching result; When the matching result is a successful match, the proxy domain name is added to the URL of the application resource, and the proxy domain name, the content to be proxied and the remaining content in the URL of the application resource are separated according to the domain name separator to obtain an updated URL.

3. The method according to claim 2, characterized in that The target application environment includes a plurality of to-be-proxied contents corresponding to the target application environment, and each of the to-be-proxied contents corresponds to a priority level; The matching process of the URL of the application resource obtained by the query process with the content to be proxied includes: According to the order of priorities corresponding to the plurality of to-be-proxied contents, the plurality of to-be-proxied contents are traversed, and the following processing is performed on the traversed to-be-proxied contents: Matching the URL of the application resource with the traversed content to be proxied.

4. The method according to claim 2, characterized in that Before receiving the access request whose uniform resource locator (URL) includes the proxy domain name, the method further includes: Binding the default domain name with the proxy domain name; When the content to be proxied includes a default domain name that is bound to the proxy domain name, and the matching result is a successful match, the method further includes: The default domain name in the URL of the application resource is deleted to update the content to be proxied in the URL of the application resource.

5. The method according to claim 2, characterized in that When the matching result is successful, the method further includes: For the domain name included in the content to be proxied in the URL of the application resource, the domain name is converted from a domain name format to a non-domain name format to update the content to be proxied in the URL of the application resource.

6. The method according to claim 1, characterized in that After splitting the restored URL according to the domain name separator to obtain candidate domain names and candidate resource paths, the method further includes: When the candidate domain name includes a parameter identifier, deleting the parameter identifier and the parameter identified by the parameter identifier in the candidate domain name, and adding the deleted parameter identifier and the parameter to the candidate resource path; When the candidate domain name successfully matches the non-domain name format, the candidate domain name is converted from the non-domain name format to the domain name format.

7. The method according to claim 1, characterized in that Before receiving the access request whose uniform resource locator (URL) includes the proxy domain name, the method further includes: Binding the default domain name with the proxy domain name; Before using the candidate domain name as the restored domain name, the method further includes: Matching the candidate domain name with multiple domain name identifiers; When the candidate domain name fails to match the multiple domain name identifiers, the candidate domain name is added to the candidate resource path, and the default domain name that has a binding relationship with the proxy domain name is used as a new candidate domain name.

8. The method according to any one of claims 1 to 7, characterized in that The binding process of multiple application environments to the same proxy domain name includes: Get the proxy domain name to be bound; Get the existing proxy domain name corresponding to the created management directory; Verify the proxy domain name to be bound according to the existing proxy domain name to obtain a domain name verification result; When the domain name verification result is successful, creating a management directory corresponding to the proxy domain name to be bound; In response to the operation of creating multiple application environments in the management directory, a binding relationship is established between the multiple application environments and the proxy domain name to be bound.

9. The method according to any one of claims 1 to 7, characterized in that The determining, among the multiple application environments that are bound to the proxy domain name, a target application environment requested by the access request, includes: Perform any of the following: Obtaining the application environment information in the access request, and using the application environment that is bound to the proxy domain name and successfully matches the application environment information as the target application environment requested by the access request; using a default application environment among the multiple application environments that are bound to the proxy domain name as the target application environment requested by the access request; The default application environment is any one of the multiple application environments.

10. The method according to any one of claims 1 to 7, characterized in that After determining the target application environment requested by the access request among the multiple application environments that are bound to the proxy domain name, the method further includes: In response to a switching operation on the target application environment, presenting the multiple application environments that have a binding relationship with the proxy domain name; In response to a selection operation on the multiple application environments, the selected application environment is used as a new target application environment.

11. The method according to any one of claims 1 to 7, characterized in that When updating the URL of the application resource in the target application environment according to the proxy domain name, the method further includes: Delete at least one of the following attributes included in the application resource: The prohibited-update attribute, prohibited-identity attribute, prohibited-proxy attribute, content-encoding attribute, and content-length attribute.

12. An agent device for application resources, characterized in that: include: Binding module, used to bind multiple application environments to the same proxy domain name; A receiving module, configured to receive an access request including a uniform resource locator (URL) and the proxy domain name; An environment determination module, configured to determine a target application environment requested by the access request among the multiple application environments that are bound to the proxy domain name; An update module, configured to split the URL in the access request according to the domain name separator to obtain the proxy domain name and the restored URL; Splitting the restored URL according to the domain name separator to obtain candidate domain names and candidate resource paths; using the candidate domain names as the restored domain names and the candidate resource paths as the restored resource paths, and performing query processing in the target application environment based on the restored domain names and the restored resource paths; The URL of the application resource obtained by the query processing is updated according to the proxy domain name, and the access request is responded to according to the application resource including the updated URL.

13. The device according to claim 12, characterized in that The update module is further configured to: When the candidate domain name includes a parameter identifier, deleting the parameter identifier and the parameter identified by the parameter identifier in the candidate domain name, and adding the deleted parameter identifier and the parameter to the candidate resource path; When the candidate domain name successfully matches the non-domain name format, the candidate domain name is converted from the non-domain name format to the domain name format.

14. The device according to claim 12, characterized in that The binding module is also used to: Binding the default domain name with the proxy domain name; The update module is further configured to: Matching the candidate domain name with multiple domain name identifiers; When the candidate domain name fails to match the multiple domain name identifiers, the candidate domain name is added to the candidate resource path, and the default domain name that has a binding relationship with the proxy domain name is used as a new candidate domain name.

15. An electronic device, characterized in that: include: a memory for storing executable instructions; The processor is configured to implement the application resource proxy method according to any one of claims 1 to 11 when executing the executable instructions stored in the memory.

16. A computer-readable storage medium, characterized in that Executable instructions are stored, and when executed by a processor, the agent method for application resources described in any one of claims 1 to 11 is implemented.

17. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the application resource agent method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Domain name processing method and device, readable storage medium and electronic device

    CN110149423A

  • Data proxy method and system, and proxy server

    CN112272158A