Webpage access request control method and device, storage medium and computer device
Patent Information
- Application Number
- CN202211083533.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-06
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-09-06
AI Technical Summary
然而,这种方式若后台接收器的各种业务功能未准备好,则该请求会报错,需要开发人员去排查报错原因,耗费开发人员的时间,同时降低了网页访问的效率,与此同时,也会降低前端用户的请求访问体验感
[0024]若所述预设网址数据库中存在与所述网页地址及其对应的目标请求环境和目标资源服务器均相匹配的预设网页地址及其对应的预设环境和预设资源服务器,则发布网页访问请求。
Smart Images

Figure CN115437885B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information technology, and in particular to a method, apparatus, storage medium, and computer device for controlling web page access requests. Background Technology
[0002] Web page access, as the name suggests, involves sending user requests, such as those in the medical field, to different receivers. The receivers then process the requests and return the results to the user.
[0003] Currently, user requests are typically published directly to the backend receiver to obtain the response. However, if the backend receiver's various business functions are not ready, the request will result in an error, requiring developers to troubleshoot the cause, wasting their time, reducing webpage access efficiency, and ultimately degrading the user experience. Summary of the Invention
[0004] This invention provides a method, apparatus, storage medium, and computer device for controlling web page access requests, which mainly improves the efficiency of web page access and enhances the user's access experience.
[0005] According to a first aspect of the present invention, a method for controlling webpage access requests is provided, comprising:
[0006] Receive an access request instruction sent by the client corresponding to the webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed;
[0007] Determine the target request environment and target resource server corresponding to the webpage address;
[0008] Determine whether a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database that match the webpage address and its corresponding target request environment and target resource server;
[0009] If the preset URL database contains a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server, then a webpage access request is issued.
[0010] According to a second aspect of the present invention, a control device for webpage access requests is provided, comprising:
[0011] The receiving unit is used to receive an access request instruction sent by the client corresponding to the webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed.
[0012] The determining unit is used to determine the target request environment and target resource server corresponding to the webpage address;
[0013] The judgment unit is used to determine whether there exists a preset webpage address and its corresponding preset environment and preset resource server in the preset URL database that match the webpage address and its corresponding target request environment and target resource server.
[0014] The publishing unit is used to publish a webpage access request if the preset URL database contains a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server.
[0015] According to a third aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0016] Receive an access request instruction sent by the client corresponding to the webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed;
[0017] Determine the target request environment and target resource server corresponding to the webpage address;
[0018] Determine whether a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database that match the webpage address and its corresponding target request environment and target resource server;
[0019] If the preset URL database contains a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server, then a webpage access request is issued.
[0020] According to a fourth aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to perform the following steps:
[0021] Receive an access request instruction sent by the client corresponding to the webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed;
[0022] Determine the target request environment and target resource server corresponding to the webpage address;
[0023] Determine whether a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database that match the webpage address and its corresponding target request environment and target resource server;
[0024] If the preset URL database contains a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server, then a webpage access request is issued.
[0025] According to the present invention, a method, apparatus, storage medium, and computer device for controlling webpage access requests, compared with the current method of directly publishing user requests to obtain the response result from a backend receiver, the present invention receives an access request instruction corresponding to a webpage to be accessed sent by a client, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed; and determines the target request environment and target resource server corresponding to the webpage address; simultaneously, it determines whether there exists a preset webpage address and its corresponding preset environment and preset resource server in a preset URL database that match the webpage address and its corresponding target request environment and target resource server; finally, if there exists a webpage address and its corresponding target request environment and target resource server in the preset URL database, the method, apparatus, storage medium, and computer device for controlling webpage access requests according to the present invention, are different. If a pre-defined webpage address, its corresponding pre-defined environment, and pre-defined resource server are matched with all resource servers, a webpage access request is issued. This is achieved by determining whether a pre-defined webpage address, its corresponding target request environment, and target resource server exist in the pre-defined URL database. If such a pre-defined webpage address, its corresponding pre-defined environment, and pre-defined resource server exist in the database, a webpage access request is issued. This limits the issuance of access requests, preventing errors that may occur when the backend server is not ready to receive requests. It also saves developers time spent troubleshooting, thereby improving webpage access efficiency and enhancing the user experience. Attached Figure Description
[0026] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0027] Figure 1 A flowchart of a webpage access request control method provided by an embodiment of the present invention is shown;
[0028] Figure 2 This invention provides a flowchart of another method for controlling web page access requests according to an embodiment of the invention.
[0029] Figure 3 This diagram illustrates the structure of a webpage access request control device according to an embodiment of the present invention.
[0030] Figure 4 A schematic diagram of the physical structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation
[0031] The present invention will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the present application can be combined with each other.
[0032] Currently, the method of directly publishing user requests to obtain response results from the backend receiver reduces the efficiency of web page access and degrades the user experience for front-end users because there are no restrictions on request publishing.
[0033] To address the aforementioned problems, embodiments of the present invention provide a method for controlling webpage access requests, such as... Figure 1 As shown, the method includes:
[0034] 101. Receive an access request instruction sent by the client corresponding to the webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed.
[0035] In this embodiment of the invention, to overcome the problems of low efficiency and poor user experience in webpage access in the prior art, this embodiment determines whether a preset webpage address and its corresponding preset environment and preset resource server exist in a preset URL database that match the stated webpage address, its corresponding target request environment, and its target resource server. If a matching preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database, a webpage access request is issued. This limits the issuance of access requests, thereby preventing errors that may occur when the backend server is not ready to receive requests. It also saves developers time spent troubleshooting, thus improving webpage access efficiency and enhancing the user experience. This embodiment of the invention is mainly applied to scenarios where webpage access requests are controlled. The executing entity of this embodiment is a device or equipment capable of controlling webpage access requests, which can be located on the client or server side.
[0036] Specifically, in this embodiment of the invention, a url-onoff.jar plugin is installed in the gateway system. The gateway system also includes a URL registry. When a user enters webpage access request information in the input box of a client browser or other software, the client sends an access request instruction. When the access request instruction sent by the client is received, the url-onoff.jar plugin can parse the webpage address in the webpage access request, i.e., the URL address. Then, based on the webpage address, the url-onoff.jar plugin determines whether to register the URL request in the URL registry of the gateway system. If the URL request is registered in the URL registry of the gateway system, the URL request is published.
[0037] 102. Determine the target request environment and target resource server corresponding to the webpage address.
[0038] In this embodiment, the target request environment refers to the production environment where the target user initiating the request resides, and the target resource server is the request resource storage server corresponding to the webpage access request. For this embodiment, after obtaining the URL address in the URL request, it is also necessary to determine the target request environment corresponding to the URL address and the target resource server pointed to by the URL address. Finally, based on the URL address, its corresponding target request environment, and the target resource server, it is determined whether to register the URL request in the URL registry of the gateway system. If the URL request is registered, it is determined that the URL request will be published; if the URL request is not registered, its publication is prohibited. Therefore, by controlling the publication of URLs, it is possible to avoid backend server errors that consume maintenance time, thereby improving the efficiency of webpage access.
[0039] 103. Determine whether there exists a preset webpage address and its corresponding preset environment and preset resource server in the preset URL database that match the webpage address and its corresponding target request environment and target resource server.
[0040] The preset URL database stores multiple preset web page addresses that can be published, along with their corresponding preset environments and identifiers for preset resource servers. The preset resource server refers to a server whose functions and configurations are ready and operational. The preset web page address and its corresponding preset environment are the URLs and environments that the preset resource server can respond to requests after it is started. When a preset web page address, its corresponding preset environment, and the preset resource server are stored in the preset URL database, it indicates that the preset resource server has been started and can receive requests corresponding to the preset URL.
[0041] In this embodiment of the invention, after determining the target request environment and the target resource server corresponding to the webpage address, in order to determine whether the target resource server is ready, it is first necessary to determine whether there is a preset webpage address and its corresponding preset environment and preset resource server in the preset URL database that match the webpage address and its corresponding target request environment and target resource server. If there is, it is determined that the target resource server is ready, and the URL request is registered in the URL registrar of the gateway system, and then the URL request is published. This allows for control over the publication of URL requests. The URL request is only published when the backend target resource server is ready, avoiding errors caused by publishing URL requests when the backend target resource server is not ready. This improves the user's request access experience and increases the request efficiency of webpage access.
[0042] 104. If the preset URL database contains a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server, then a webpage access request is issued.
[0043] The preset URL database can be a MySQL database or an Oracle database. In this embodiment of the invention, the url-onoff.jar plugin installed in the gateway system is used to receive URL requests and obtain the URL address in the URL request. Then, the url-onoff.jar plugin is used to read various information stored in the preset URL database. Based on the read information, it is determined whether there is a preset webpage address and its corresponding preset environment and preset resource server that match the URL address and its corresponding target request environment and target resource server in the preset URL database. If there is a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server in the preset URL database, it is determined that the target resource server pointed to by the URL request is ready, that is, it has been started and can receive the URL request. At this time, the URL request is registered in the URL registrar of the gateway system. Then, the controller receives the URL request and transmits the URL request to the corresponding resource server. The resource server responds to the URL request and finally returns the response result to the client interface to be displayed to the user.
[0044] According to the present invention, a method for controlling webpage access requests, compared with the current method of directly publishing user requests to obtain response results from a backend receiver, the present invention receives an access request instruction corresponding to a webpage to be accessed sent by a client, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed; determines the target request environment and target resource server corresponding to the webpage address; simultaneously, determines whether there exists a preset webpage address and its corresponding preset environment and target resource server in a preset URL database that match the webpage address and its corresponding target request environment and target resource server; and finally, if there exists a preset webpage address and its corresponding target request environment and target resource server in the preset URL database that match the webpage address and its corresponding target request environment and target resource server... If a matching preset webpage address, its corresponding preset environment, and preset resource server are found, a webpage access request is issued. This is achieved by determining whether a preset webpage address, its corresponding target request environment, and target resource server exist in the preset URL database. If such a matching preset webpage address and its corresponding preset environment and preset resource server exist in the database, a webpage access request is issued. This limits the issuance of access requests, preventing errors that may occur when the backend server is not ready to receive requests. It also saves developers time spent troubleshooting, thereby improving webpage access efficiency and enhancing the user experience.
[0045] Furthermore, to better illustrate the above process of controlling webpage access requests, as a refinement and extension of the above embodiments, this invention provides another method for controlling webpage access requests, such as... Figure 2 As shown, the method includes:
[0046] 201. Receive an access request instruction sent by the client corresponding to the webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed.
[0047] Specifically, when a user enters request information in an input box in the browser or other interface of the client, an access request instruction corresponding to the webpage to be accessed is received. The webpage address carried in the access request instruction is obtained, and it is determined whether the webpage address and its corresponding target request environment and the target resource server are stored in the preset URL database. If they are, the webpage access request is issued.
[0048] 202. Determine the target request environment and target resource server corresponding to the webpage address.
[0049] In this embodiment of the invention, to determine whether the webpage access request can be published, it is first necessary to determine the target request environment and target resource server corresponding to the webpage address in the access request. Based on this, step 202 specifically includes: obtaining the target user identifier corresponding to the target user logging into the client; obtaining the target request environment corresponding to the webpage address from a preset environment database based on the target user identifier, wherein the preset environment database records a first correspondence between the user identifier and the request environment; and obtaining the target resource server corresponding to the webpage address from a preset resource server database based on the target resource address carried in the webpage address, wherein the preset resource server database records a second correspondence between the resource address and the resource server.
[0050] The target user identifier can be a username, mobile phone number, or email address that the target user has registered with the target resource server corresponding to the client, which can uniquely identify the target user. Alternatively, the target user identifier can be a string that the target resource server assigns to the target user to uniquely identify the target user. The target resource address can be the address of the resource server where the resource is located, such as the domain name or Internet protocol of the target resource server.
[0051] Specifically, firstly, the target user who logs into the client and initiates the access request is identified, and the target user identifier corresponding to the target user is determined. When the client sends a webpage access request, the target user identifier and the target resource address can be directly obtained from the webpage access request. Then, the target request environment corresponding to the target user identifier is determined from a preset environment database, that is, the target request environment corresponding to the webpage address is obtained. Specifically, the target request environment can be determined from the preset environment database based on a character matching algorithm. At the same time, the method of obtaining the target request environment corresponding to the webpage address based on the target user identifier also includes: obtaining the development environment information, gray-scale environment information, or online environment information corresponding to the webpage address from the preset environment database based on the target user identifier.
[0052] Specifically, based on the target user identifier, it can be determined in the preset environment database whether the target request environment corresponding to the access request is a development environment (UAT environment), a grayscale environment (i.e., HD environment), or a production environment (PRD environment).
[0053] 203. Receive the startup command from the preset resource server, wherein the startup command carries a preset webpage address to which the preset resource server can respond and its corresponding preset environment.
[0054] Specifically, the preset resource server may include multiple servers storing resources.
[0055] Specifically, upon receiving the startup command of the preset resource server, it means that the preset resource server has deployed the preset environment and is ready to respond to the preset web page address. Therefore, upon receiving the startup command of the preset resource server, the preset web page address and its corresponding preset environment carried in the startup command are obtained, and the server identification information corresponding to the preset resource server is determined.
[0056] 204. Store the preset webpage address, the preset environment, and the identifier information of the preset resource server in the preset URL database.
[0057] Specifically, if a preset resource server is in the startup state, the preset webpage address and the preset environment carried in the startup instruction are obtained, and the server identification information corresponding to the preset resource server is also obtained. The preset webpage address, the preset environment and the server identification information are stored in the preset URL database. If multiple preset resource servers are in the startup state at the same time, the preset URL database will store multiple preset webpage addresses and their corresponding preset environments and server identification information. At this time, the operation state corresponding to the preset webpage address can be set to the new state.
[0058] Furthermore, the preset resource server corresponding to the preset webpage address stored in the preset URL database may also be shut down due to system maintenance or other reasons after startup. In this case, it is necessary to delete the preset webpage address and its corresponding preset environment and server identification information stored in the preset URL database, or set the status type corresponding to the preset webpage address to the canceled state. Based on this, after storing the preset webpage address, the preset environment, and the identification information of the preset resource server in the preset URL database, the method further includes: monitoring the status information of the preset resource server; if the status information of the preset resource server changes to the closed state, then setting the operation type of the preset webpage address corresponding to the preset resource server stored in the preset URL database to the canceled type.
[0059] Specifically, after storing the preset URLs that the preset resource server can respond to and their corresponding preset environments into the preset URL database, it is also necessary to monitor the status information of the preset resource server in real time. If the status information is in the off state, the preset web page address stored in the preset URL database needs to be set to the cancel type.
[0060] 205. Determine whether there exists a preset webpage address and its corresponding preset environment and preset resource server in the preset URL database that match the webpage address and its corresponding target request environment and target resource server.
[0061] Specifically, after storing the preset URL, preset environment, and server identification information corresponding to the preset resource server after startup into the preset URL database, when the webpage address corresponding to the access request sent by the client, as well as the target request environment and target resource server corresponding to the webpage address, it is necessary to determine whether there is a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server in the preset URL database. If there is, it is determined that the target resource server has been deployed and is in the startup state, and the access request can be published.
[0062] 206. If the preset URL database contains a preset webpage address and its corresponding preset environment information and preset resource server that match the webpage address and its corresponding request environment information and resource server, then a webpage access request is issued.
[0063] In this embodiment of the invention, after determining whether a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database that match the webpage address, its corresponding target request environment, and its corresponding target resource server, if the preset URL database contains a preset webpage address and its corresponding preset environment information and preset resource server that match the webpage address, it is also necessary to determine the operation type corresponding to the matching preset URL. Based on this, step 206 specifically includes: if the preset URL database contains a preset webpage address and its corresponding preset environment and preset resource server that are identical to the webpage address, its corresponding target request environment, and its corresponding target resource server, then it is determined whether the operation type corresponding to the preset webpage address is a cancellation type; if the operation type corresponding to the preset webpage address is a cancellation type, then the publication of the webpage access request is intercepted; if the operation type corresponding to the preset webpage address is a non-cancellation type, then the webpage access request is published.
[0064] Specifically, if the preset URL database contains a preset webpage address and its corresponding preset environment and preset resource server that are identical to the webpage address, the database determines whether the operation type corresponding to the preset webpage address is a cancellation type. If it is a cancellation type, the database determines that the target resource server is currently in a closed state, and therefore prohibits the issuance of the access request. If the operation type corresponding to the preset webpage address is a add type, the database determines that the target resource server is currently in a running state, and then the access request is issued.
[0065] Furthermore, after determining whether there exists a preset webpage address and its corresponding preset environment and preset resource server in the preset URL database that match the webpage address and its corresponding target request environment and target resource server, the method further includes: if there is no preset webpage address and its corresponding preset environment and preset resource server in the preset URL database that match the webpage address and its corresponding target request environment and target resource server, then the publication of the webpage access request is intercepted.
[0066] Specifically, if there is no preset webpage address in the preset URL database that is the same as the webpage address, the access request is prohibited. If there is a preset webpage address in the preset URL database that is the same as the webpage address, but the target request environment corresponding to the webpage address is different from the preset request environment corresponding to the preset webpage address, the access request is prohibited. If there is a preset webpage address and its corresponding preset request environment in the preset URL database that are the same as the webpage address and its corresponding target request environment, but the target resource server corresponding to the webpage address is different from the preset resource server corresponding to the preset webpage address, the access request is prohibited.
[0067] According to another webpage access request control method provided by the present invention, compared with the current method of directly publishing user requests to obtain the response results from the backend receiver, the present invention receives an access request instruction corresponding to the webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed; and determines the request environment information and resource server corresponding to the webpage address; simultaneously, it determines whether there exists a preset webpage address and its corresponding preset environment information and preset resource server in the preset URL database that match the webpage address and its corresponding request environment information and resource server; finally, if there exists a preset webpage address and its corresponding request environment information and resource server in the preset URL database that match the webpage address and its corresponding request environment information and resource server... If a webpage access request is issued based on the page address, its corresponding preset environment information, and preset resource server, then a webpage access request is issued. This is achieved by determining whether a preset webpage address, its corresponding preset environment information, and preset resource server exist in the preset URL database. If such a matching preset webpage address, its corresponding preset environment information, and preset resource server exist in the database, then a webpage access request is issued. This system limits the issuance of access requests, preventing errors that may occur when the backend server is not ready to receive requests. It also saves developers time spent troubleshooting, thereby improving webpage access efficiency and enhancing the user experience.
[0068] Furthermore, as Figure 1In specific implementation, embodiments of the present invention provide a control device for webpage access requests, such as... Figure 3 As shown, the device includes: a receiving unit 31, a determining unit 32, a judging unit 33, and a publishing unit 34.
[0069] The receiving unit 31 can be used to receive an access request instruction corresponding to a webpage to be accessed sent by a client, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed.
[0070] The determining unit 32 can be used to determine the target request environment and target resource server corresponding to the webpage address.
[0071] The judgment unit 33 can be used to determine whether there exists a preset webpage address and its corresponding preset environment and preset resource server in the preset URL database that match the webpage address and its corresponding target request environment and target resource server.
[0072] The publishing unit 34 can be used to publish a webpage access request if there is a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server in the preset URL database.
[0073] In specific application scenarios, in order to construct a preset web page database, the device further includes a storage unit 35.
[0074] The receiving unit 31 can also be used to receive the startup command of the preset resource server, wherein the startup command carries a preset webpage address that the preset resource server can respond to and its corresponding preset environment.
[0075] The storage unit 35 can be used to store the preset webpage address, the preset environment, and the identifier information of the preset resource server into the preset URL database.
[0076] In specific application scenarios, in order to determine the operation type corresponding to the preset webpage address, the device further includes: a listening unit 36 and a setting unit 37.
[0077] The monitoring unit 36 can be used to monitor the status information of the preset resource server.
[0078] The setting unit 37 can be used to set the operation type of the preset webpage address corresponding to the preset resource server stored in the preset URL database to the cancel type if the status information of the preset resource server becomes closed.
[0079] In a specific application scenario, in order to publish a webpage access request, the publishing unit 34 includes a judgment module 341, an interception module 342, and a publishing module 343.
[0080] The judgment module 341 can be used to determine whether the operation type corresponding to the preset webpage address is a cancellation type if there is a preset webpage address and its corresponding preset environment and preset resource server that are the same as the webpage address and its corresponding target request environment and target resource server in the preset URL database.
[0081] The interception module 342 can be used to intercept the publication of the webpage access request if the operation type corresponding to the preset webpage address is a cancellation type.
[0082] The publishing module 343 can be used to publish the webpage access request if the operation type corresponding to the preset webpage address is a non-cancellation type.
[0083] In specific application scenarios, in order to intercept the publication of the webpage access request, the device further includes an interception unit 38.
[0084] The interception unit 38 can be used to intercept the publication of the webpage access request if there is no preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server in the preset URL database.
[0085] In a specific application scenario, in order to determine the target request environment and target resource server corresponding to the webpage address, the determining unit 32 can be specifically used to obtain the target user identifier corresponding to the target user logging into the client; based on the target user identifier, obtain the target request environment corresponding to the webpage address from a preset environment database, wherein the preset environment database records a first correspondence between the user identifier and the request environment; based on the target resource address carried in the webpage address, obtain the target resource server corresponding to the webpage address from a preset resource server database, wherein the preset resource server database records a second correspondence between the resource address and the resource server.
[0086] In specific application scenarios, in order to obtain the target request environment corresponding to the webpage address, the determining unit 32 can be used to obtain the development environment information, grayscale environment information, or online environment information corresponding to the webpage address from a preset environment database based on the target user identifier.
[0087] It should be noted that other corresponding descriptions of the functional modules involved in the webpage access request control device provided in this embodiment of the invention can be found in [reference]. Figure 1 The corresponding description of the method shown will not be repeated here.
[0088] Based on the above, Figure 1 Accordingly, this embodiment of the invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the following steps: receiving an access request instruction corresponding to a webpage to be accessed sent by a client, wherein the access request instruction carries a webpage address corresponding to the webpage to be accessed; determining the target request environment and target resource server corresponding to the webpage address; determining whether a preset webpage address and its corresponding preset environment and preset resource server exist in a preset URL database that match the webpage address and its corresponding target request environment and target resource server; and if a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database that match the webpage address and its corresponding target request environment and target resource server, then issuing a webpage access request.
[0089] Based on the above, Figure 1 The method shown and as Figure 3 The embodiment of the device shown in the invention also provides a physical structure diagram of a computer device, such as... Figure 4 As shown, the computer device includes: a processor 41, a memory 42, and a computer program stored in the memory 42 and executable on the processor. Both the memory 42 and the processor 41 are mounted on a bus 43. When the processor 41 executes the program, it performs the following steps: receiving an access request instruction from a client corresponding to a webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed; determining the target request environment and target resource server corresponding to the webpage address; determining whether a preset webpage address and its corresponding preset environment and preset resource server exist in a preset URL database that match both the webpage address and its corresponding target request environment and target resource server; and if a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database that match both the webpage address and its corresponding target request environment and target resource server, then issuing a webpage access request.
[0090] The present invention, through its technical solution, receives an access request instruction from a client corresponding to a webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed; determines the target request environment and target resource server corresponding to the webpage address; simultaneously, it determines whether a preset webpage address and its corresponding preset environment and preset resource server exist in a preset URL database; and finally, if a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database, a webpage access request is issued. Therefore, by determining whether a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database, and issuing a webpage access request, the issuance of access requests can be limited, thereby avoiding errors that may occur when the backend server is not ready to receive requests. This also saves developers time spent troubleshooting, thus improving the efficiency of webpage access and enhancing the user experience.
[0091] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0092] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for controlling webpage access requests, characterized in that, include: Receive an access request instruction sent by the client corresponding to the webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed; Determine the target request environment and target resource server corresponding to the webpage address; Multiple preset resource servers that are in the startup state are identified. The multiple preset resource servers and their corresponding preset web page addresses and preset environments that can respond are stored in the preset URL database. The startup state of each preset resource server in the preset URL database is monitored in real time to see if it changes to the shutdown state. If there is a target preset resource server whose startup state changes to the shutdown state, the target preset resource server and its corresponding preset web page address and preset environment are deleted from the preset URL database. Determine whether a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database that match the webpage address and its corresponding target request environment and target resource server; If the preset URL database contains a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server, then a webpage access request is issued. The method further includes: Install the url-onoff.jar plugin in the gateway system. Use the url-onoff.jar plugin to parse the web page address in the access request command. Based on the web page address, use the url-onoff.jar plugin to determine whether to register the web page access request in the URL registry of the gateway system. If so, publish the web page access request.
2. The method according to claim 1, characterized in that, Before determining whether a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database that match the webpage address, its corresponding target request environment, and its corresponding target resource server, the method further includes: Receive the startup command of the preset resource server, wherein the startup command carries a preset webpage address that the preset resource server can respond to and its corresponding preset environment; The preset webpage address, the preset environment, and the identifier information of the preset resource server are stored in the preset URL database.
3. The method according to claim 2, characterized in that, After storing the preset webpage address, the preset environment, and the identifier information of the preset resource server into the preset URL database, the method further includes: Monitor the status information of the preset resource server; If the status information of the preset resource server changes to the closed state, then the operation type of the preset webpage address corresponding to the preset resource server stored in the preset URL database is set to the cancel type.
4. The method according to claim 3, characterized in that, If the preset URL database contains a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address, its corresponding target request environment, and its corresponding target resource server, then a webpage access request is issued, including: If the preset URL database contains a preset webpage address and its corresponding preset environment and preset resource server that are identical to the webpage address and its corresponding target request environment and target resource server, then determine whether the operation type corresponding to the preset webpage address is a cancellation type; If the operation type corresponding to the preset webpage address is cancel, then the publication of the webpage access request is blocked; If the operation type corresponding to the preset webpage address is a non-cancel type, then the webpage access request is issued.
5. The method according to claim 1, characterized in that, After determining whether a preset webpage address and its corresponding preset environment and preset resource server exist in the preset URL database that match the webpage address, its corresponding target request environment, and its corresponding target resource server, the method further includes: If the preset URL database does not contain a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server, then the publication of the webpage access request will be blocked.
6. The method according to claim 1, characterized in that, Determining the target request environment and target resource server corresponding to the webpage address includes: Obtain the target user identifier corresponding to the target user who logged into the client; Based on the target user identifier, the target request environment corresponding to the webpage address is obtained from the preset environment database, wherein the preset environment database records a first correspondence between the user identifier and the request environment; Based on the target resource address carried in the webpage address, the target resource server corresponding to the webpage address is obtained from the preset resource server database, wherein the preset resource server database records a second correspondence between resource addresses and resource servers.
7. The method according to claim 6, characterized in that, The step of obtaining the target request environment corresponding to the webpage address from a preset environment database based on the target user identifier includes: Based on the target user identifier, obtain the development environment information, gray-scale environment information, or online environment information corresponding to the webpage address from the preset environment database.
8. A control device for webpage access requests, characterized in that, include: The receiving unit is used to receive an access request instruction sent by the client corresponding to the webpage to be accessed, wherein the access request instruction carries the webpage address corresponding to the webpage to be accessed. The determining unit is used to determine the target request environment and target resource server corresponding to the webpage address; The judgment unit is used to determine multiple preset resource servers in the startup state, store the multiple preset resource servers and their corresponding preset web page addresses and preset environments that can respond in a preset URL database, monitor in real time whether the startup state of each preset resource server in the preset URL database changes to the shutdown state, if there is a target preset resource server whose startup state changes to the shutdown state, then delete the target preset resource server and its corresponding preset web page address and preset environment in the preset URL database; and determine whether there is a preset web page address and its corresponding preset environment and preset resource server that match the web page address and its corresponding target request environment and target resource server in the preset URL database. The publishing unit is used to publish a webpage access request if there is a preset webpage address and its corresponding preset environment and preset resource server that match the webpage address and its corresponding target request environment and target resource server in the preset URL database. The publishing unit is used to install the url-onoff.jar plugin in the gateway system, use the url-onoff.jar plugin to parse the web page address in the access request instruction, and use the url-onoff.jar plugin to determine whether to register the web page access request in the URL registry of the gateway system. If so, the web page access request is published.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Routing method and device in grayscale publishing scenario
CN108881030A