A URL-based access permission control method and device

By decoupling URL access control with an independent URL control system and control logic plugin, the problem of tight coupling between URL access permissions and the system in single-page application systems is solved, achieving flexible access control and efficient page rendering.

CN114444094BActive Publication Date: 2026-02-10CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111630655.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2026-02-10
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

In single-page application systems, URL access control rules are tightly coupled with the system, making it impossible to flexibly handle business changes and page switching, and thus impossible to achieve fine-grained access control.

Method used

By using an independent URL control system and control logic plugin, URL access control rules are decoupled from single-page application systems. Access control is performed using a set of URL control rules, including permission levels and matching information. This supports the decoupling of front-end and back-end synchronous control logic, simplifying processes and improving flexibility.

Benefits of technology

It enables flexibility and security in URL access permissions for single-page application systems, simplifies the page rendering process, improves page rendering efficiency and SEO friendliness, and supports flexible modification and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114444094B_ABST
    Figure CN114444094B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer networks, in particular to a URL-based access permission control method and device. The method is used for solving the problem that a single-page application system cannot flexibly handle various businesses under the prior art, and the method comprises the following steps: a single-page application system receives an access request sent by a browser associated with the single-page application system through a control logic plug-in, and displays a to-be-displayed HTML page contained in the access request based on a search result of a URL searched from a URL control rule set; wherein the URL control rule set is generated by a URL control system based on configuration information associated with the control logic plug-in; the configuration information comprises a permission level and matching information of each URL; each matching information comprises at least one of a UI interactive page, a server HTML resource acquisition address and a server data resource acquisition address; in this way, the security and flexibility of URL hash access permission control in the single-page application system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer network technology, and in particular to a URL-based access control method and apparatus. Background Technology

[0002] A single-page application system consists of an external framework and individual components. Switching between different interfaces is accomplished by removing the aforementioned components and adding new ones.

[0003] In existing technologies, in single-page application systems, the routing control of the Uniform Resource Locator (URL) is controlled by the front-end system in conjunction with their respective business systems through the URL hash pattern, thereby enabling page switching in the single-page application system.

[0004] See Figure 1A As shown, when a route switch occurs, the single-page application system obtains and loads the front-end routing component from the front-end system. Then, it initializes the front-end component and obtains business data from the back-end server based on the URL access request. After receiving the business data sent by the back-end server, the browser processes the obtained data using JavaScript to generate a new Hyper Text Markup Language (HTML) code snippet, which is then inserted into the original components of the single-page application system and rendered and displayed by the browser.

[0005] This results in the single-page application system (SPA) being unable to flexibly handle subsequent business scenarios where the SPA needs to frequently change pages, but the page content does not require processing by the SPA. At the same time, the SPA development model makes the URL access permission control rules too tightly coupled with the SPA, preventing the business backend from more granularly perceiving page switching changes in the SPA and causing the business backend to lose flexible control over page switching scenarios and permissions.

[0006] In summary, a new method is needed to solve the above problems. Summary of the Invention

[0007] This application provides a URL-based access control method and apparatus to address the problem that existing single-page application systems cannot flexibly handle various business processes.

[0008] The specific technical solutions provided in this application are as follows:

[0009] In a first aspect, this application provides an access control method based on a Uniform Resource Locator (URL), applied to a single-page application system, the method comprising:

[0010] The control logic plugin receives access requests sent by the browser associated with the single-page application system, the access requests including the URL of the Hypertext Markup Language (HTML) page to be displayed;

[0011] The control logic plugin searches for the URL from the URL control rule set and displays the HTML page to be displayed based on the search results.

[0012] The URL control rule set is obtained from the URL control system after it is generated by the URL control system based on the configuration information associated with the control logic plugin. The configuration information includes the permission level of each URL and the corresponding matching information. Each matching information includes part or all of the user interface (UI) interaction page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address.

[0013] The above method decouples URL access control rules from the development of single-page application systems, reduces logical intrusion, and makes the modification and configuration of URL access control rules in single-page application systems more flexible. It improves the security and flexibility of URL hash access control in single-page application systems, enabling single-page application systems to flexibly respond to business needs such as sudden access control security issues and frequent changes in URL access control rules.

[0014] Meanwhile, the control mechanism for the front-end routing scheme has been reduced from seven steps in the existing process to five, greatly simplifying the process and enabling the business backend to automatically perceive and control the performance of the HTML pages to be displayed in the single-page application system. The adoption of an independent URL control system makes it easier to modify the UI interaction pages, server-side HTML resources, and server-side data resources corresponding to the URLs, providing a sinking server-side rendering capability for the page rendering of the single-page application system. This enriches the UI interaction of the single-page application system, is more conducive to SEO, and makes the page rendering and display more efficient and faster.

[0015] Optionally, before receiving the access request sent by the browser associated with the single-page application system through the control logic plugin, the method further includes:

[0016] After confirming that the control logic plugin is configured, when the access request sent by the browser is received for the first time, a first acquisition request is sent to the URL control system. The control logic plugin is configured in the single-page application system by the administrator of the single-page application system. The first acquisition request is used to acquire the set of URL control rules generated by the URL control system based on the configuration information. The configuration information is set by the administrator in the URL control system.

[0017] The system receives the set of URL control rules sent by the URL control system and loads the set of URL control rules into the single-page application system.

[0018] The above method, through an independent URL control system, allows administrators of single-page application systems to flexibly modify URL control rules anytime and anywhere, thereby facilitating the subsequent maintenance of single-page application systems and improving their flexibility.

[0019] Optionally, displaying the HTML page to be displayed based on the search results includes:

[0020] If the search result indicates that the URL does not meet the preset conditions, then based on the URL control rules contained in the URL control rule set that match the URL, the corresponding UI interaction interface is displayed, and after receiving user authorization through the UI interaction interface, the HTML page to be displayed is displayed.

[0021] or,

[0022] If the search result indicates that the URL meets the preset condition, then the HTML page to be displayed is displayed based on the URL control rules contained in the URL control rule set that match the URL;

[0023] The preset conditions include some or all of the following conditions:

[0024] The URLs control the URLs within the system;

[0025] The URL is the URL authenticated by the URL control system.

[0026] The above method, by searching the set of URL control rules for the URL contained in the access request, determines whether the URL meets the preset conditions, and performs corresponding processing based on the control rules that match the URL according to different search results, can better, more flexibly and securely deal with some sudden access control issues.

[0027] Optionally, if the search result indicates that the URL meets a preset condition, then based on the URL control rules included in the URL control rule set that match the URL, the HTML page to be displayed is shown, including:

[0028] If the search result indicates that the URL meets the preset condition, then based on the URL control rules contained in the URL control rule set that match the URL, it is determined whether the HTML page to be displayed needs to be rendered by the server where the URL is located;

[0029] When it is determined that the HTML page to be displayed needs to be rendered by the server where the URL is located, an HTML resource retrieval request is sent to the server where the URL is located based on the server HTML resource retrieval address contained in the URL control rule that matches the URL. After receiving the HTML resource returned by the server where the URL is located, the HTML resource is loaded into the specified area of ​​the single-page application system through the control logic plugin to obtain and display the HTML page to be displayed.

[0030] When it is determined that the HTML page to be displayed does not need to be rendered by the server containing the URL, a data resource retrieval request is sent to the server containing the URL based on the server data resource retrieval address contained in the URL control rule that matches the URL. After receiving the data resource returned by the server containing the URL, the data resource is processed according to the preset processing method of the single-page application system to obtain and display the HTML page to be displayed.

[0031] The above method, through a control logic plugin, further judges the URL contained in the access request. When it is determined that server-side rendering is required, the rendering work of the HTML page to be displayed corresponding to that URL is offloaded to the server. This is more conducive to SEO and makes page rendering and display more efficient and faster.

[0032] Optionally, the method further includes:

[0033] If an update instruction is received, a second acquisition request is sent to the URL control information, wherein the update instruction is triggered after the URL control system generates an updated set of URL control rules based on the modified configuration information, and the second acquisition request is used to acquire the updated set of URL control rules in the URL control system.

[0034] Receive the updated set of URL control rules sent by the URL control system, and replace the updated set of URL control rules with the updated set of URL control rules.

[0035] The above method, through an independent URL control system, allows for flexible modification of URL control rules anytime and anywhere, and also facilitates subsequent maintenance.

[0036] Secondly, this application provides an access control method based on a Uniform Resource Locator (URL), applied to a URL control system, the method comprising:

[0037] Receive configuration information associated with the control logic plugin in a single-page application system;

[0038] Based on the configuration information, a set of URL control rules is generated so that the single-page application system can receive access requests sent by the browser associated with the single-page application system through the control logic plugin, and display the HTML page to be displayed contained in the access request based on the search results of the URL found in the set of URL control rules.

[0039] The access request includes the URL of the HTML page to be displayed, and the configuration information includes the permission level of each URL and the corresponding matching information. Each matching information includes part or all of the user interface (UI) interactive page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address.

[0040] Optionally, after generating the URL control rule set based on the configuration information, the method further includes:

[0041] Receive a first acquisition request sent by the single-page application system, and based on the first acquisition request, send the set of URL control rules to the single-page application system;

[0042] The first acquisition request is used to acquire the set of URL control rules generated by the URL control system based on the configuration information when the single-page application system first receives the access request sent by the browser.

[0043] Optionally, after generating the URL control rule set based on the configuration information, the method further includes:

[0044] An updated set of URL control rules is generated based on the modified configuration information, and after receiving a second acquisition request from the single-page application system, the updated set of URL control rules is sent to the single-page application system based on the second acquisition request.

[0045] The second acquisition request is sent by the single-page application system to the URL control system after receiving the update instruction, and is used to acquire the updated set of URL control rules in the URL control system. The update instruction is triggered after modifying the corresponding configuration information in the URL control system.

[0046] Thirdly, this application provides an access control device based on a Uniform Resource Locator (URL) for use in a single-page application system. The device includes:

[0047] The receiving module is used to receive access requests sent by the browser associated with the single-page application system through the control logic plugin. The access requests include the URL of the Hypertext Markup Language (HTML) page to be displayed.

[0048] The search module is used to search for the URL from the URL control rule set through the control logic plugin, and display the HTML page to be displayed based on the search results;

[0049] The URL control rule set is obtained from the URL control system after it is generated by the URL control system based on the configuration information associated with the control logic plugin. The configuration information includes the permission level of each URL and the corresponding matching information. Each matching information includes part or all of the user interface (UI) interaction page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address.

[0050] Optionally, before receiving the access request sent by the browser associated with the single-page application system through the control logic plugin, the receiving module is further configured to:

[0051] After confirming that the control logic plugin is configured, when the access request sent by the browser is received for the first time, a first acquisition request is sent to the URL control system. The control logic plugin is configured in the single-page application system by the administrator of the single-page application system. The first acquisition request is used to acquire the set of URL control rules generated by the URL control system based on the configuration information. The configuration information is set by the administrator in the URL control system.

[0052] The system receives the set of URL control rules sent by the URL control system and loads the set of URL control rules into the single-page application system.

[0053] Optionally, the step of displaying the HTML page to be displayed based on the search results, wherein the search module is used for:

[0054] If the search result indicates that the URL does not meet the preset conditions, then based on the URL control rules contained in the URL control rule set that match the URL, the corresponding UI interaction interface is displayed, and after receiving user authorization through the UI interaction interface, the HTML page to be displayed is displayed.

[0055] or,

[0056] If the search result indicates that the URL meets the preset condition, then the HTML page to be displayed is displayed based on the URL control rules contained in the URL control rule set that match the URL;

[0057] The preset conditions include some or all of the following conditions:

[0058] The URLs control the URLs within the system;

[0059] The URL is the URL authenticated by the URL control system.

[0060] Optionally, if the search result indicates that the URL meets preset conditions, then based on the URL control rules included in the URL control rule set that match the URL, the HTML page to be displayed is displayed. The search module is used for:

[0061] If the search result indicates that the URL meets the preset condition, then based on the URL control rules contained in the URL control rule set that match the URL, it is determined whether the HTML page to be displayed needs to be rendered by the server where the URL is located;

[0062] When it is determined that the HTML page to be displayed needs to be rendered by the server where the URL is located, an HTML resource retrieval request is sent to the server where the URL is located based on the server HTML resource retrieval address contained in the URL control rule that matches the URL. After receiving the HTML resource returned by the server where the URL is located, the HTML resource is loaded into the specified area of ​​the single-page application system through the control logic plugin to obtain and display the HTML page to be displayed.

[0063] When it is determined that the HTML page to be displayed does not need to be rendered by the server containing the URL, a data resource retrieval request is sent to the server containing the URL based on the server data resource retrieval address contained in the URL control rule that matches the URL. After receiving the data resource returned by the server containing the URL, the data resource is processed according to the preset processing method of the single-page application system to obtain and display the HTML page to be displayed.

[0064] Optionally, the receiving module is further configured to:

[0065] If an update instruction is received, a second acquisition request is sent to the URL control information, wherein the update instruction is triggered after the URL control system generates an updated set of URL control rules based on the modified configuration information, and the second acquisition request is used to acquire the updated set of URL control rules in the URL control system.

[0066] Receive the updated set of URL control rules sent by the URL control system, and replace the updated set of URL control rules with the updated set of URL control rules.

[0067] Fourthly, this application provides an access control device based on a Uniform Resource Locator (URL), applied to a URL control system, the device comprising:

[0068] The receiving module is used to receive configuration information associated with the control logic plugins in the single-page application system;

[0069] The generation module is used to generate a set of URL control rules based on the configuration information, so that the single-page application system can receive the access request sent by the browser associated with the single-page application system through the control logic plugin, and display the HTML page to be displayed contained in the access request based on the search results of the URL found in the set of URL control rules.

[0070] The access request includes the URL of the HTML page to be displayed, and the configuration information includes the permission level of each URL and the corresponding matching information. Each matching information includes part or all of the user interface (UI) interactive page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address.

[0071] Optionally, after generating the URL control rule set based on the configuration information, the generation module is further configured to:

[0072] Receive a first acquisition request sent by the single-page application system, and based on the first acquisition request, send the set of URL control rules to the single-page application system;

[0073] The first acquisition request is used to acquire the set of URL control rules generated by the URL control system based on the configuration information when the single-page application system first receives the access request sent by the browser.

[0074] Optionally, after generating the URL control rule set based on the configuration information, the generation module is further configured to:

[0075] An updated set of URL control rules is generated based on the modified configuration information, and after receiving a second acquisition request from the single-page application system, the updated set of URL control rules is sent to the single-page application system based on the second acquisition request.

[0076] The second acquisition request is sent by the single-page application system to the URL control system after receiving the update instruction, and is used to acquire the updated set of URL control rules in the URL control system. The update instruction is triggered after modifying the corresponding configuration information in the URL control system.

[0077] Fifthly, this application provides an electronic device, which includes a processor and a memory.

[0078] The memory is used to store computer programs or instructions;

[0079] The processor is configured to execute a computer program or instructions in memory, such that the method as described in any one of the first and second aspects above is performed.

[0080] In a sixth aspect, embodiments of this application provide a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the method as described in any one of the first and second aspects above.

[0081] Furthermore, the technical effects of any of the implementation methods in aspects two through six can be found in the technical effects of different implementation methods in aspect one, and will not be repeated here. Attached Figure Description

[0082] Figure 1A This is a schematic diagram illustrating the asynchronous loading and rendering process of URL routes in a traditional single-page application system using existing technologies.

[0083] Figure 1B This is a flowchart illustrating the process of changing URL access permission control in a traditional single-page application system using existing technology.

[0084] Figure 2 This application provides a schematic diagram of the system architecture for a URL-based access control system.

[0085] Figure 3 This is a schematic diagram illustrating the process of configuring and loading a set of URL control rules in an embodiment of this application;

[0086] Figure 4This is a schematic diagram of the process for obtaining the URL control rule set in an embodiment of this application;

[0087] Figure 5 This is a flowchart illustrating a URL-based access control method in an embodiment of this application.

[0088] Figure 6 This is a schematic diagram of a logical processing procedure based on a set of URL control rules in an embodiment of this application;

[0089] Figure 7 This is a schematic diagram of a process for updating a set of URL control rules in an embodiment of this application;

[0090] Figure 8 This is a schematic diagram of a URL route loading and rendering process in an embodiment of this application;

[0091] Figure 9 This is a flowchart illustrating a URL-based access control method in an embodiment of this application.

[0092] Figure 10 This is a schematic diagram of the logical architecture of a URL-based access control device in an embodiment of this application;

[0093] Figure 11 This is a schematic diagram of the logical architecture of a URL-based access control device in an embodiment of this application;

[0094] Figure 12 This is a schematic diagram of the physical architecture of the electronic device in the embodiments of this application;

[0095] Figure 13 This is a schematic diagram of the physical architecture of the electronic device in the embodiments of this application. Detailed Implementation

[0096] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0097] It should be noted that the terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein.

[0098] Under existing technology, see Figure 1B As shown, URL access control rules in a single-page application (SPA) system are pre-configured logic in the front-end system during development. If these pre-configured rules need modification, developers must change them and then load the modified rules into the SPA system to enable smooth URL access for specific or modified business functions. It is evident that this tight coupling between URL access control rules and the SPA system hinders flexible modification of these rules, restricts the handling of various business functions, and limits the flexibility of changing the UI framework of the corresponding page. Furthermore, the need for developers to perform maintenance further complicates the subsequent maintenance of the SPA system.

[0099] To address the issue of existing single-page application systems' inability to flexibly handle various business processes, this embodiment of the application describes a single-page application system that receives access requests from a browser associated with the single-page application system via a control logic plugin. The system then displays the HTML page to be displayed, contained within the access request, based on the URL lookup results from a URL control rule set. The URL control rule set is obtained from the URL control system after being generated by the URL control system based on configuration information associated with the control logic plugin. The configuration information includes the permission level of each URL and its corresponding matching information. Each matching information includes part or all of the user interface (UI) interactive page, the server-side HTML resource retrieval address, and the server-side data resource retrieval address. This decouples the development of front-end and back-end synchronous control logic from the development of business logic, reduces logical intrusion, improves the security and flexibility of URL hash access control in the single-page application system, and enables flexible modification of URL access control rules and flexible transformation of the page frame content corresponding to the URL at any time.

[0100] The preferred embodiments of this application will be further described in detail below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only for illustration and explanation of this application and are not intended to limit this application. Furthermore, the embodiments of this application and the features in the embodiments can be combined with each other without conflict.

[0101] Figure 2 A schematic diagram of the system architecture of an access control system according to an embodiment of this application is shown. (See also...) Figure 2 As shown, the system includes a single-page application system 100 and a URL control system 200; wherein,

[0102] A single-page application system 100 includes a control logic plugin 101, which is used to receive access requests sent by a browser associated with the single-page application system 100, the access requests including the URL of an HTML page to be displayed; and to search for the URL from a set of URL control rules through the control logic plugin 101, and display the HTML page to be displayed based on the search results. The set of URL control rules is obtained from the URL control system 200 after being generated by the URL control system 200 based on configuration information associated with the control logic plugin 101. The configuration information includes the permission level of each URL and the corresponding matching information. Each matching information includes part or all of the user interface (UI) interactive page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address.

[0103] The URL control system 200 is used to receive configuration information associated with the control logic plugin 101 in the single-page application system 100, and generate a set of URL control rules based on the configuration information, so that the single-page application system 100 can receive access requests sent by the browser associated with the single-page application system 100 through the control logic plugin 101, and display the HTML page to be displayed contained in the access request based on the search results of the URL found in the set of URL control rules.

[0104] In this embodiment of the application, the URL control rule set is used to control the URL access rules in the single-page application system 100. When the single-page application system 100 receives a URL access (i.e., an access request), it sends a first acquisition request to the URL control system 200 to obtain the URL control rule set and installs the URL control rule set into the single-page application system 100.

[0105] It should be noted that the aforementioned control logic plugin is installed into the single-page application system 100 of the front-end system as a separate installation package during the deployment of the front-end system. It is mainly used to process access requests in the single-page application system 100 based on the set of URL control rules.

[0106] For specific implementation details, please refer to... Figure 3 As shown, firstly, the administrator of the single-page application system uploads the control logic plugin 101 to the npm repository through the URL control system 200.

[0107] Secondly, single-page application system developers pull and configure control logic plugin 101 from the npm repository into single-page application system 100.

[0108] Then, the administrator of the single-page application system (SPA) sets the URL access permissions of the SPA 100 through the URL control system 200, that is, sets the configuration information associated with the control logic plugins. After setting the configuration information, the URL control system 200 generates a set of URL control rules based on the configuration information. The URL control system 200 provides an access interface for the SPA 100 so that the SPA 100 can obtain the set of URL control rules through this access interface.

[0109] After the single-page application system 100 determines that the control logic plugin 101 has been configured, when it receives the first access request from the browser, it sends a first retrieval request to the URL control system 200. Correspondingly, after receiving the first retrieval request, the URL control system 200 sends the generated set of URL control rules to the single-page application system 100 so that the single-page application system 100 loads the set of URL control rules into the single-page application system 100.

[0110] The single-page application system 100 uses the control logic plugin 101 to perform corresponding access control processing on different URL access requests based on the control rules contained in the URL control rule set.

[0111] The following describes a specific implementation of a URL-based access control method provided in this application.

[0112] In this embodiment of the application, before introducing the URL-based access control method, please refer to... Figure 4 As shown, the URL control rule set needs to be obtained by performing the following operations:

[0113] Step 400: After confirming that the control logic plugin is configured, when the browser sends an access request for the first time, a first retrieval request is sent to the URL control system. The control logic plugin is configured in the single-page application system by the administrator of the single-page application system. The first retrieval request is used to obtain the set of URL control rules generated by the URL control system based on the configuration information. The configuration information is set by the administrator in the URL control system.

[0114] In this embodiment of the application, the URL control system is configured with an access interface for the single-page application system. After the single-page application system determines that the local control logic plugin is configured, it receives the first access request sent by the browser and sends a first acquisition request to the URL control system to obtain the set of URL control rules generated by the URL control system based on the configuration information associated with the control logic plugin. The control logic plugin is configured in the single-page application system by the administrator of the single-page application system, and the configuration information is set by the administrator in the URL control system.

[0115] Step 410: Receive the set of URL control rules sent by the URL control system and load the set of URL control rules into the single-page application system.

[0116] In this embodiment of the application, when performing step 410, a set of URL control rules sent by the URL control system is received, and the set of URL control rules is loaded into the single-page application system, so that the single-page application system receives the above-mentioned access request through the control logic plugin, and performs access control on the URL contained in the access request based on the control rules contained in the set of URL control rules that match the URL contained in the access request, thereby displaying the corresponding HTML page to be displayed.

[0117] Then, refer to Figure 5 As shown in the embodiments of this application, a URL-based access control method is provided, applied to a single-page application system. The specific process of this method is as follows:

[0118] Step 500: Receive an access request sent by the browser associated with the single-page application system through the control logic plugin. The access request includes the URL of the HTML page to be displayed.

[0119] In this embodiment, the administrator of the single-page application system (SPA) deploys a control logic plugin in the SPA. Specifically, the administrator downloads the control logic plugin from the npm repository, deploys it in the SPA, and then deploys the URL control rule set received from the URL control system in the SPA. After the SPA receives the access request sent by the browser associated with the SPA through the deployed control logic plugin, the access request includes the URL of the HTML page to be displayed.

[0120] Step 510: Using the control logic plugin, search for the URL contained in the above access request from the URL control rule set, and display the HTML page to be displayed based on the search results; wherein, the URL control rule set is obtained from the URL control system after being generated by the URL control system based on the configuration information associated with the control logic plugin; the configuration information includes the permission level of each URL and the corresponding matching information, and each matching information includes part or all of the user interface (UI) interactive page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address.

[0121] In this embodiment of the application, when performing step 510, firstly, the URL contained in the above access request is searched from the configured set of URL control rules through the control logic plugin, and then the HTML page to be displayed is displayed based on the search results.

[0122] In practice, the above-mentioned HTML page to be displayed based on the search results includes, but is not limited to, the following two situations:

[0123] Scenario 1: If the URL represented by the above search result does not meet the preset conditions, then based on the URL control rules contained in the URL control rule set that match the URL, the corresponding UI interaction interface will be displayed. After receiving user authorization through the UI interaction interface, the HTML page to be displayed will be displayed. The preset conditions include some or all of the URLs inside the URL control system and the URLs authenticated by the URL control system.

[0124] In this embodiment of the application, when it is determined that the URL contained in the access request is not a URL within the URL control system and / or a URL authenticated by the URL control system, it is determined that the access request needs to be redirected to a URL outside the URL control system. Then, based on the URL control rules contained in the URL control rule set that match the URL, the corresponding UI interaction interface is displayed to give the user a specific prompt, such as "This URL needs to be redirected to an external network or an unauthenticated network. Confirm redirection?"

[0125] In this embodiment of the application, if user authorization is received through the UI interface, the single-page application system will redirect to the URL contained in the access request and display the HTML page to be displayed; otherwise, if user authorization is not received through the UI interface, the single-page application system will stop redirecting and end the UI interaction.

[0126] For example, if the user selects to confirm the redirection under this prompt, it indicates that the user's authorization has been received; conversely, if the user selects to abort the redirection under this prompt, it indicates that the user's authorization has not been received.

[0127] Scenario 2: If the above search results indicate that the URL meets the preset conditions, then the HTML page to be displayed is displayed based on the URL control rules that match the URL contained in the URL control rule set; wherein, the preset conditions include some or all of the URLs inside the URL control system and the URLs authenticated by the URL control system.

[0128] In this embodiment of the application, when the search result indicates that the URL meets the preset conditions, firstly, based on the URL control rules matching the URL contained in the URL control rule set, it is determined whether the HTML page to be displayed needs to be rendered by the server where the URL is located. Then, based on the determination result, the corresponding HTML page to be displayed is displayed.

[0129] In this embodiment of the application, when it is determined that the HTML page to be displayed needs to be rendered by the server where the URL is located, an HTML resource retrieval request is sent to the server where the URL is located based on the server HTML resource retrieval address contained in the URL control rules that match the URL. After receiving the HTML resource returned by the server where the URL is located, the HTML resource is loaded into the specified area of ​​the single-page application system through the control logic plugin, and the HTML page to be displayed is obtained and displayed.

[0130] In practice, after loading the HTML resources into a designated area of ​​the single-page application system, the browser renders the page to obtain the HTML page to be displayed.

[0131] Accordingly, in this embodiment of the application, when it is determined that the HTML page to be displayed does not need to be rendered by the server where the URL is located, a data resource acquisition request is sent to the server where the URL is located based on the server data resource acquisition address contained in the URL control rule that matches the URL. After receiving the data resource returned by the server where the URL is located, the data resource is processed according to the preset processing method of the single-page application system to obtain and display the HTML page to be displayed.

[0132] In practice, after receiving the data resources returned by the server where the URL is located, the data resources are processed by JavaScript to generate new HTML resource fragments, and these new HTML resource fragments are inserted into the infrastructure of the single-page application system. The browser then renders the page to obtain the HTML page to be displayed.

[0133] For example, see Figure 6 As shown, this example illustrates a user accessing a URL through a browser.

[0134] Suppose a user sends an access request to a single-page application system through a browser associated with the single-page application system, where the access request includes the URL of the HTML page to be displayed.

[0135] Therefore, in this embodiment, the single-page application system implements the above-mentioned processing flow for the HTML page to be displayed based on the set of URL control rules by executing the following steps:

[0136] Step 600: Receive the access request for the access URL sent by the browser through the control logic plugin.

[0137] In this embodiment of the application, the control logic plugin receives the aforementioned access request and executes subsequent steps based on the URL contained in the access request.

[0138] Step 610: Using the control logic plugin, search for the URL in the URL control rule set, and determine whether the URL meets the preset conditions based on the URL control rules that match the above URL contained in the URL control rule set. If yes, proceed to step 620; otherwise, proceed to step 650.

[0139] In this embodiment of the application, the preset conditions include some or all of the following conditions: URLs inside the URL control system; URLs authenticated by the URL control system.

[0140] For ease of explanation, this application embodiment only uses URLs within the URL control system or URLs authenticated by the URL control system as examples, with preset conditions included.

[0141] Step 620: Determine whether the HTML page to be displayed needs to be rendered by the server where the URL is located. If yes, proceed to step 630; otherwise, proceed to step 640.

[0142] In this embodiment of the application, when performing step 610, if it is determined that the preset conditions are met, that is, the URL that the user wants to access is a URL inside the URL control system or a URL authenticated by the URL control system, then step 620 is performed to further determine whether the HTML page to be displayed needs to be rendered by the server where the URL is located.

[0143] Step 630: Based on the server-side HTML resource retrieval address contained in the URL control rules that match the URL, send an HTML resource retrieval request to the server where the URL is located. After receiving the HTML resource returned by the server where the URL is located, load the HTML resource into the specified area of ​​the single-page application system through the control logic plugin, and obtain and display the HTML page to be displayed.

[0144] Step 640: Based on the server-side data resource retrieval address contained in the URL control rules that match the URL, send a data resource retrieval request to the server where the URL is located, and after receiving the data resource returned by the server where the URL is located, process the data resource according to the preset processing method of the single-page application system to obtain and display the HTML page to be displayed.

[0145] Step 650: Based on the URL control rules contained in the URL control rule set that match the URL, display the corresponding UI interaction interface, which is used to give the user specific prompts.

[0146] In this embodiment of the application, when executing step 610, if it is determined that the preset conditions are not met, that is, the URL that the user wants to access is not a URL inside the URL control system and is not a URL authenticated by the URL control system, then step 650 is executed, displaying the UI interaction interface corresponding to the URL control rule that matches the URL, and giving the user a specific prompt in the UI interaction interface, such as the above prompt being "This URL needs to be redirected to an external network or an unauthenticated network. Confirm redirection?"

[0147] Step 660: Determine whether user authorization has been received through the UI interaction interface. If yes, proceed to step 670; otherwise, proceed to step 680.

[0148] Step 670: Based on the user's authorization, redirect to the HTML page to be displayed corresponding to the URL.

[0149] In this embodiment of the application, if the user authorization indicates that the user has selected to confirm the jump in the above prompt in the UI interaction interface, then based on the user authorization, the user is redirected to the HTML page to be displayed corresponding to the URL.

[0150] Step 680: Abort the jump and end the process.

[0151] In this embodiment of the application, if no user authorization is received indicating that the user has selected to abort the redirection in the above-mentioned prompt in the UI interaction interface, the single-page application system will abort the redirection and end the process.

[0152] This application also provides a convenient method for updating a set of URL control rules, see below. Figure 7 As shown, the specific process for updating the URL control rule set is as follows:

[0153] Step 700: If an update instruction is received, a second retrieval request is sent to the URL control system. The update instruction is triggered after the URL control system generates an updated set of URL control rules based on the modified configuration information. The second retrieval request is used to retrieve the updated set of URL control rules from the URL control system.

[0154] In this embodiment of the application, when it is necessary to change the URL control rules, the administrator of the single-page application system only needs to modify the URL control rules through the URL control system.

[0155] In practice, when the administrator of the single-page application system updates the URL control rule set through the URL control system, he sends an update instruction to the single-page application system. When executing step 700, after receiving the update instruction, the single-page application system sends a second retrieval request to the URL control system, so that after receiving the second retrieval request, the URL control system sends the updated URL control rule set to the single-page application system.

[0156] Step 710: Receive the updated set of URL control rules sent by the URL control system, and replace the original set of URL control rules with the updated set of URL control rules.

[0157] In this embodiment of the application, when performing step 710, the updated URL control rule set sent by the URL control system is received, and the previously loaded URL control rule set is replaced with the updated URL control rule set, thereby realizing convenient and flexible modification of the URL control rule set.

[0158] See Figure 8 As shown in the embodiments of this application, the process of loading and rendering business is simplified in the rendering and display scenario triggered by route switching. When route switching is required, the backend server can automatically sense the business scenario switch and return business HTML data. After receiving the HTML resource, the single-page application system inserts the HTML resource into the specified area of ​​the single-page application system, and then the browser renders it. This greatly simplifies the process of loading and displaying business, making page rendering and display more efficient and faster.

[0159] See Figure 9 As shown in the embodiments of this application, a URL-based access control method is provided, applied to a URL control system. The specific process of this method is as follows:

[0160] Step 900: Receive configuration information associated with the control logic plugin in the single-page application system. The configuration information includes the permission level of each URL and the corresponding matching information. Each matching information includes part or all of the user interface (UI) interaction page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address.

[0161] Step 910: Generate a set of URL control rules based on the configuration information, so that the single-page application system can receive access requests sent by the browser associated with the single-page application system through the control logic plugin, and display the HTML page to be displayed contained in the access request based on the lookup results of the URL in the set of URL control rules. The access request includes the URL of the HTML page to be displayed.

[0162] In this embodiment of the application, after executing step 910, the generated set of URL control rules is sent to the single-page application system by performing the following operations:

[0163] Operation 1: Receive a first acquisition request sent by a single-page application system, and based on the first acquisition request, send the set of URL control rules to the single-page application system; wherein, the first acquisition request is used to acquire the set of URL control rules generated by the URL control system based on configuration information when the single-page application system first receives an access request sent by a browser.

[0164] In this embodiment of the application, a convenient method for updating the URL control rule set is also provided. After the administrator of the single-page application system updates the above configuration information in the URL control system, the URL control system generates an updated URL control rule set based on the modified configuration information. Then, after receiving a second acquisition request sent by the single-page application system, the updated URL control rule set is sent to the single-page application system based on the second acquisition request. The second acquisition request is sent by the single-page application system to the URL control system after receiving the update instruction, and is used to acquire the updated URL control rule set in the URL control system. The update instruction is triggered after modifying the corresponding configuration information in the URL control system.

[0165] Based on the same inventive concept, see [reference] Figure 10 As shown, this application provides an access control device based on a Uniform Resource Locator (URL) for use in a single-page application system. The device includes:

[0166] The receiving module 1010 is used to receive an access request sent by the browser associated with the single-page application system through a control logic plug-in. The access request includes the URL of the Hypertext Markup Language (HTML) page to be displayed.

[0167] The lookup module 1020 is used to look up the URL from the URL control rule set through the control logic plugin, and display the HTML page to be displayed based on the lookup result;

[0168] The URL control rule set is obtained from the URL control system after it is generated by the URL control system based on the configuration information associated with the control logic plugin. The configuration information includes the permission level of each URL and the corresponding matching information. Each matching information includes part or all of the user interface (UI) interaction page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address.

[0169] Optionally, before receiving the access request sent by the browser associated with the single-page application system through the control logic plugin, the receiving module 1010 is further configured to:

[0170] After confirming that the control logic plugin is configured, when the access request sent by the browser is received for the first time, a first acquisition request is sent to the URL control system. The control logic plugin is configured in the single-page application system by the administrator of the single-page application system. The first acquisition request is used to acquire the set of URL control rules generated by the URL control system based on the configuration information. The configuration information is set by the administrator in the URL control system.

[0171] The system receives the set of URL control rules sent by the URL control system and loads the set of URL control rules into the single-page application system.

[0172] Optionally, the search module 1020 is used to display the HTML page to be displayed based on the search results, wherein the search module 1020 is configured to:

[0173] If the search result indicates that the URL does not meet the preset conditions, then based on the URL control rules contained in the URL control rule set that match the URL, the corresponding UI interaction interface is displayed, and after receiving user authorization through the UI interaction interface, the HTML page to be displayed is displayed.

[0174] or,

[0175] If the search result indicates that the URL meets the preset condition, then the HTML page to be displayed is displayed based on the URL control rules contained in the URL control rule set that match the URL;

[0176] The preset conditions include some or all of the following conditions:

[0177] The URLs control the URLs within the system;

[0178] The URL is the URL authenticated by the URL control system.

[0179] Optionally, if the search result indicates that the URL meets preset conditions, then based on the URL control rules included in the URL control rule set that match the URL, the HTML page to be displayed is displayed. The search module 1020 is used for:

[0180] If the search result indicates that the URL meets the preset condition, then based on the URL control rules contained in the URL control rule set that match the URL, it is determined whether the HTML page to be displayed needs to be rendered by the server where the URL is located;

[0181] When it is determined that the HTML page to be displayed needs to be rendered by the server where the URL is located, an HTML resource retrieval request is sent to the server where the URL is located based on the server HTML resource retrieval address contained in the URL control rule that matches the URL. After receiving the HTML resource returned by the server where the URL is located, the HTML resource is loaded into the specified area of ​​the single-page application system through the control logic plugin to obtain and display the HTML page to be displayed.

[0182] When it is determined that the HTML page to be displayed does not need to be rendered by the server containing the URL, a data resource retrieval request is sent to the server containing the URL based on the server data resource retrieval address contained in the URL control rule that matches the URL. After receiving the data resource returned by the server containing the URL, the data resource is processed according to the preset processing method of the single-page application system to obtain and display the HTML page to be displayed.

[0183] Optionally, the receiving module 1010 is further configured to:

[0184] If an update instruction is received, a second acquisition request is sent to the URL control information, wherein the update instruction is triggered after the URL control system generates an updated set of URL control rules based on the modified configuration information, and the second acquisition request is used to acquire the updated set of URL control rules in the URL control system.

[0185] Receive the updated set of URL control rules sent by the URL control system, and replace the updated set of URL control rules with the updated set of URL control rules.

[0186] Based on the same inventive concept, see [reference] Figure 11 As shown in the figure, this application provides an access control device based on a Uniform Resource Locator (URL), applied to a URL control system. The device includes:

[0187] The receiving module 1110 is used to receive configuration information associated with the control logic plugin in the single-page application system;

[0188] The generation module 1120 is used to generate a set of URL control rules based on the configuration information, so that the single-page application system can receive the access request sent by the browser associated with the single-page application system through the control logic plugin, and display the HTML page to be displayed contained in the access request based on the search results of the URL search from the set of URL control rules.

[0189] The access request includes the URL of the HTML page to be displayed, and the configuration information includes the permission level of each URL and the corresponding matching information. Each matching information includes part or all of the user interface (UI) interactive page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address.

[0190] Optionally, after generating the URL control rule set based on the configuration information, the generation module 1120 is further configured to:

[0191] Receive a first acquisition request sent by the single-page application system, and based on the first acquisition request, send the set of URL control rules to the single-page application system;

[0192] The first acquisition request is used to acquire the set of URL control rules generated by the URL control system based on the configuration information when the single-page application system first receives the access request sent by the browser.

[0193] Optionally, after generating the URL control rule set based on the configuration information, the generation module 1120 is further configured to:

[0194] An updated set of URL control rules is generated based on the modified configuration information, and after receiving a second acquisition request from the single-page application system, the updated set of URL control rules is sent to the single-page application system based on the second acquisition request.

[0195] The second acquisition request is sent by the single-page application system to the URL control system after receiving the update instruction, and is used to acquire the updated set of URL control rules in the URL control system. The update instruction is triggered after modifying the corresponding configuration information in the URL control system.

[0196] See Figure 12As shown, this application provides an electronic device, including: a processor 121, a communication interface 122, a memory 123 and a communication bus 124, wherein the processor 121, the communication interface 122 and the memory 123 communicate with each other through the communication bus 124.

[0197] The memory 123 stores a computer program that, when executed by the processor 121, can be executed by any of the methods described in the above embodiments as a URL-based access control device.

[0198] See Figure 13 As shown, this application provides an electronic device, including: a processor 131, a communication interface 132, a memory 133 and a communication bus 134, wherein the processor 131, the communication interface 132 and the memory 133 communicate with each other through the communication bus 134;

[0199] The memory 133 stores a computer program that, when executed by the processor 131, can be executed in any of the ways described in the above embodiments by a URL-based access control device.

[0200] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing computer program instructions thereon, which, when executed by a processor, implement the steps of any one of the methods executed by the URL-based access control device in the above embodiments.

[0201] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0202] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.

[0203] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more processes in a flowchart and / or one or more blocks in a block diagram.

[0204] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more blocks in the block diagram.

[0205] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. An access control method based on Uniform Resource Locator (URL), characterized in that, Applied to single-page application systems, the method includes: The control logic plugin receives access requests sent by the browser associated with the single-page application system, and the access requests include the URL of the Hypertext Markup Language (HTML) page to be displayed. The control logic plugin searches for the URL from the URL control rule set, which is obtained from the URL control system after being generated by the URL control system based on the configuration information associated with the control logic plugin. The configuration information includes the permission level of each URL and the corresponding matching information. Each matching information includes part or all of the user interface (UI) interaction page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address. If the search result indicates that the URL does not meet the preset conditions, then based on the URL control rules contained in the URL control rule set that match the URL, the corresponding UI interaction interface is displayed, and after receiving user authorization through the UI interaction interface, the HTML page to be displayed is displayed. If the search result indicates that the URL meets the preset condition, then the HTML page to be displayed is displayed based on the URL control rules contained in the URL control rule set that match the URL; The preset conditions include some or all of the following: URLs within the URL control system; URLs authenticated by the URL control system.

2. The method as described in claim 1, characterized in that, Before receiving the access request sent by the browser associated with the single-page application system through the control logic plugin, the method further includes: After confirming that the control logic plugin is configured, when the access request sent by the browser is received for the first time, a first acquisition request is sent to the URL control system. The control logic plugin is configured in the single-page application system by the administrator of the single-page application system. The first acquisition request is used to acquire the set of URL control rules generated by the URL control system based on the configuration information. The configuration information is set by the administrator in the URL control system. The system receives the set of URL control rules sent by the URL control system and loads the set of URL control rules into the single-page application system.

3. The method as described in claim 1, characterized in that, If the search result indicates that the URL meets the preset conditions, then based on the URL control rules contained in the URL control rule set that match the URL, the HTML page to be displayed is shown, including: If the search result indicates that the URL meets the preset condition, then based on the URL control rules contained in the URL control rule set that match the URL, it is determined whether the HTML page to be displayed needs to be rendered by the server where the URL is located; When it is determined that the HTML page to be displayed needs to be rendered by the server where the URL is located, an HTML resource retrieval request is sent to the server where the URL is located based on the server HTML resource retrieval address contained in the URL control rule that matches the URL. After receiving the HTML resource returned by the server where the URL is located, the HTML resource is loaded into the specified area of ​​the single-page application system through the control logic plugin to obtain and display the HTML page to be displayed. When it is determined that the HTML page to be displayed does not need to be rendered by the server containing the URL, a data resource retrieval request is sent to the server containing the URL based on the server data resource retrieval address contained in the URL control rule that matches the URL. After receiving the data resource returned by the server containing the URL, the data resource is processed according to the preset processing method of the single-page application system to obtain and display the HTML page to be displayed.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: If an update instruction is received, a second acquisition request is sent to the URL control information, wherein the update instruction is triggered after the URL control system generates an updated set of URL control rules based on the modified configuration information, and the second acquisition request is used to acquire the updated set of URL control rules in the URL control system. Receive the updated set of URL control rules sent by the URL control system, and replace the updated set of URL control rules with the updated set of URL control rules.

5. An access control method based on Uniform Resource Locator (URL), characterized in that, Applied to a URL control system, the method includes: Receive configuration information associated with the control logic plugin in a single-page application system; Based on the configuration information, a set of URL control rules is generated so that the single-page application system can receive access requests sent by the browser associated with the single-page application system through the control logic plugin, and display the HTML page to be displayed contained in the access request based on the search results of the URL found in the set of URL control rules. The access request includes the URL of the HTML page to be displayed. The configuration information includes the permission level of each URL and the corresponding matching information. Each matching information includes part or all of the user interface (UI) interactive page, the server-side HTML resource acquisition address, and the server-side data resource acquisition address. If the search result indicates that the URL does not meet the preset conditions, the HTML page to be displayed is displayed after receiving user authorization. The user authorization is received through a UI interactive interface displayed based on the URL control rules contained in the URL control rule set that match the URL. If the search result indicates that the URL meets the preset conditions, the HTML page to be displayed is displayed based on the URL control rules contained in the URL control rule set that match the URL. The preset conditions include part or all of the following conditions: URLs within the URL control system; URLs authenticated by the URL control system.

6. The method as described in claim 5, characterized in that, After generating the URL control rule set based on the configuration information, the method further includes: Receive a first acquisition request sent by the single-page application system, and based on the first acquisition request, send the set of URL control rules to the single-page application system; The first acquisition request is used to acquire the set of URL control rules generated by the URL control system based on the configuration information when the single-page application system first receives the access request sent by the browser.

7. The method as described in claim 5, characterized in that, After generating the URL control rule set based on the configuration information, the method further includes: An updated set of URL control rules is generated based on the modified configuration information, and after receiving a second acquisition request from the single-page application system, the updated set of URL control rules is sent to the single-page application system based on the second acquisition request. The second acquisition request is sent by the single-page application system to the URL control system after receiving the update instruction, and is used to acquire the updated set of URL control rules in the URL control system. The update instruction is triggered after modifying the corresponding configuration information in the URL control system.

8. An electronic device, characterized in that, The electronic device includes a processor and a memory. The memory is used to store computer programs or instructions; The processor is configured to execute a computer program or instructions in the memory, such that the method of any one of claims 1-4 and 5-7 is performed.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When executed by a processor, the computer program instructions implement the steps of the method described in any one of claims 1-4 and 5-7.

Citation Information

Patent Citations

  • Network system access method and device

    CN112783548A

  • Page display method and device, electronic equipment and storage medium

    CN113094674A