A website client access method, device and medium
By generating session control identifiers and binding response information, the problem of website clients not supporting anonymous access was solved, thus achieving the security and diversity requirements of anonymous access and avoiding additional development costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2026-03-24
AI Technical Summary
In existing technologies, website clients cannot support anonymous access, which makes it impossible to meet diverse anonymous access needs, and developing a dedicated system is costly.
By receiving access requests from website clients, determining whether they are anonymous requests, and generating session control and session control identifiers if anonymous access is allowed, binding response information to enable anonymous access, building an anonymous request database and a default user information database, and generating anonymous access data.
It achieves the security and diversity requirements of anonymous access, avoids changes to business logic, and ensures the security of the website server.
Smart Images

Figure CN115766194B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet, and particularly relates to a website client access method, device and medium. BACKGROUND
[0002] In a software system, a website server needs to access a user login authorization, and can access corresponding resources for security considerations.
[0003] However, although authorized access can ensure server security, there are some special cases where the user does not have a corresponding account and cannot log in to the website client, but needs to access the resources of the website server. At this time, due to the poor security problem of anonymous access, the developer generally needs to develop a separate system according to the needs, such as company employees who need to log in to the company system every day to report body temperature information, and company customers and visitors also need to report relevant information to the company, but since the visitors do not have a company account, they cannot use the same system as the employees to report. At this time, the company needs to develop a new system to collect visitor information separately, which is costly.
[0004] Therefore, due to the fact that the website client cannot support anonymous access, it cannot meet the diversified needs of anonymous access. SUMMARY
[0005] The embodiments of the present application provide a website client access method, device and medium, which are used to solve the problem that the website client cannot support anonymous access and cannot meet the diversified needs of anonymous access.
[0006] The embodiments of the present application adopt the following technical solutions:
[0007] On the one hand, the embodiments of the present application provide a website client access method, which comprises the following steps: receiving a first access request of a website client; judging whether the first access request is an anonymous request; the anonymous request indicates that the access user has not logged in the website client; if yes, judging whether the website client allows anonymous access; if yes, generating a session control and a session control identifier of the first access request; according to the session control, accessing a website page corresponding to the first access request to determine response information of the first access request; and binding the response information and the session control identifier, so that the website client generates a second access request according to the session control identifier when accessing again.
[0008] In one example, determining whether the website client allows anonymous access specifically includes: matching the access request in a pre-built anonymous request database; the anonymous request database includes anonymous access data corresponding to multiple anonymous requests; determining whether the access request is matched; if yes, then determining that the website client allows anonymous access; if no, then determining that the website client does not allow anonymous access.
[0009] In one example, before receiving the access request from the website client, the method further includes: constructing a preset access request that allows anonymous access; constructing a default user information database; the default user information database includes login information of multiple default users, the login information being used as the default login information for the preset access request; determining the default user identifier of the default user, and associating the default user identifier with the login information; generating a request path, request method, and default user identifier corresponding to the preset access request; and generating anonymous access data for the preset access request based on the preset access request, the request path, the request method, and the default user identifier, to construct the anonymous request database.
[0010] In one example, if the statement "if yes" is true, then generating the session control and session control identifier for the first access request specifically includes: if yes, then determining the designated default user identifier for the first access request based on the anonymous access data matched by the first access request; matching the designated default user identifier in the default user information database to determine the login information of the designated default user identifier; generating the session control and session control identifier for the first access request based on the login information of the designated default user identifier; the designated default user corresponds to a unique session control.
[0011] In one example, a session control identifier for the first access request is generated as the first session control identifier. The step of determining whether the first access request is an anonymous request specifically includes: determining whether the first access request carries a second session control identifier; if not, then the access request is determined to be an anonymous request; if yes, then the access request is determined to be a non-anonymous request; the non-anonymous request indicates that the accessing user has logged into the website client.
[0012] In one example, after generating a second access request based on the session control identifier so that the website client can access the site again, the method further includes: receiving the second access request from the website client; determining whether the second access request carries the first session control identifier; determining that the second access request carries the first session control identifier; and determining that the access request is a non-anonymous request based on the first session control identifier; the non-anonymous request indicating that the default user has logged into the website client.
[0013] In one example, determining whether the second access request carries the first session control identifier specifically includes: determining whether the first session control identifier is within a preset validity period; if yes, then determining that the second access request carries the first session control identifier; if no, then reporting a login failure to the website client.
[0014] In one example, the session control that generated the first access request is used as the first session control. If not, after determining that the first access request is a non-anonymous request, the method further includes: determining the second session control corresponding to the first access request based on the second session control identifier; accessing the website page corresponding to the first access request based on the second session control to determine the response information of the first access request; binding the response information with the second session control identifier so that when the website client accesses the site again, a third access request is generated based on the second session control identifier.
[0015] On the other hand, embodiments of this application provide a website client access device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: receive a first access request from a website client; determine whether the first access request is an anonymous request; the anonymous request indicates that the accessing user is not logged into the website client; if so, determine whether the website client allows anonymous access; if so, generate session control and session control identifier for the first access request; according to the session control, access the website page corresponding to the first access request to determine the response information of the first access request; bind the response information with the session control identifier so that when the website client accesses the website again, a second access request is generated according to the session control identifier.
[0016] On the other hand, embodiments of this application provide a website client accessing a non-volatile computer storage medium storing computer-executable instructions. These computer-executable instructions are configured to: receive a first access request from the website client; determine whether the first access request is an anonymous request; the anonymous request indicates that the user is not logged into the website client; if so, determine whether the website client allows anonymous access; if so, generate session control and a session control identifier for the first access request; according to the session control, access the website page corresponding to the first access request to determine the response information of the first access request; bind the response information to the session control identifier so that when the website client accesses the website again, it generates a second access request based on the session control identifier.
[0017] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:
[0018] By setting up access requests that allow anonymous access and generating session control and session control identifiers for the access requests, access to the website page corresponding to the first access request can be achieved. When returning the access request, the response information is bound to the session control identifier, so that when the website client accesses the website again, the second access request is equivalent to authorized access. This allows the website server to support anonymous access without modifying the business logic, while ensuring the security of the website server and meeting diverse needs for anonymous access. Attached Figure Description
[0019] To more clearly illustrate the technical solution of this application, some embodiments of this application will be described in detail below with reference to the accompanying drawings, in which:
[0020] Figure 1 A flowchart illustrating a website client access method provided in an embodiment of this application;
[0021] Figure 2 This is a schematic diagram of the structure of a website client access device provided in an embodiment of this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] Some embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0024] Figure 1 This is a flowchart illustrating a website client access method provided in an embodiment of this application. This method can be applied to various business sectors, such as internet finance, e-commerce, instant messaging, gaming, and government services. Certain input parameters or intermediate results in this process can be manually adjusted to help improve accuracy.
[0025] The analysis method involved in the embodiments of this application can be implemented by a terminal device or a server, and this application does not impose any special limitations on it. For ease of understanding and description, the following embodiments are all described in detail using a server as an example.
[0026] It should be noted that the server can be a single device or a system composed of multiple devices, i.e., a distributed server. This application does not make any specific limitations on this.
[0027] Anonymous access is less secure because the trustworthiness of the request source cannot be determined, making it more difficult to control resource access. If anonymous access could be made as secure and controllable as authorized access through proper processing, the system would be much easier to implement. Therefore, Figure 1 The process may include the following steps:
[0028] S102: Receive the first access request from the website client.
[0029] For example, a website refers to a collection of web pages created using tools such as HTML (an application of Standard Generalized Markup Language) according to certain rules on the Internet to display specific content. In other words, a website is a communication tool; users can use websites to publish information they want to share or to provide related online services. A client, on the other hand, refers to a program that provides local services to customers, as opposed to a server. Examples of clients include web browsers and instant messaging client software.
[0030] S104: Determine whether the first access request is an anonymous request; the anonymous request indicates that the user accessing the website is not logged in to the website client.
[0031] In some embodiments of this application, the server can only correctly return the resource corresponding to the access request after the user logs in.
[0032] Therefore, after a user logs into the website client, a session control and session control identifier will be automatically generated for the user. The user is considered to be authorized by carrying the session control identifier, and the system can determine whether the user has logged into the website client based on the session control identifier.
[0033] Specifically, it determines whether the first access request carries a second session control identifier. In other words, upon receiving an access request, it first determines whether the access request carries a session control identifier.
[0034] If not, then determine that the access request is an anonymous request and proceed to step S106.
[0035] If so, then the access request is determined to be a non-anonymous request. A non-anonymous request indicates that the user is accessing the website client they logged into.
[0036] S106: If yes, then determine whether the website client allows anonymous access.
[0037] In some embodiments of this application, an anonymous request database will be pre-built. This database is used to set the access parameters required for each anonymous request; that is, the database includes anonymous access data corresponding to multiple anonymous requests. Essentially, there exists a resource that defines how a server should assume a specific anonymous request originates from a predefined specific user when it receives that request.
[0038] Specifically, first, a preset access request that allows anonymous access is constructed. In other words, not all anonymous request types allow anonymous access; that is, anonymous access is only granted to resources on specified website pages.
[0039] Next, a default user information database is constructed. This database includes login information for multiple default users, which are used as the default login information for preset access requests. Essentially, for each anonymous request that allows anonymous access, a default user is set and assigned a user identity.
[0040] Next, the default user identifier is determined, and this identifier is associated with the login information. Through this association, the login information of the default user can be retrieved based on the default user identifier.
[0041] Then, generate the request path, request method, and default user identifier corresponding to the preset access request; where the request path follows the URL, and the request method includes GET, POST, etc.
[0042] Then, based on the preset access request, request path, request method, and default user identifier, anonymous access data for the preset access request is generated to construct an anonymous request database.
[0043] In other words, the anonymous request database is used to define all HTTP / HTTPS request methods in the system that are allowed to access anonymously, as well as the users used by these anonymous methods for background security control. See Table 1 for example.
[0044] Table 1:
[0045] Attribute Attribute description URL HTTP / HTTPS request path Request method Request method of the request path, GET, POST, etc. Default user User to be used to generate the session control when the server receives this request
[0046] Therefore, when determining whether a website client allows anonymous access, the specific steps include:
[0047] First, the access requests are matched against a pre-built anonymous request database. That is, the types of access requests are matched.
[0048] Then, determine whether an access request is matched.
[0049] If so, determine that the website client allows anonymous access and proceed to step S108.
[0050] If not, then it is confirmed that the website client does not allow anonymous access.
[0051] For example, Company A requires its employees to collect customer feedback on products. Currently, Company A's ERP system has a webpage for collecting feedback, but it only supports logged-in users; customers cannot log in and therefore cannot use the system to collect feedback. Company A requires that this webpage be accessible to users who are not logged in. Anonymous access data is shown in Table 2:
[0052] URL Request method Access user identification / api / evaluations GET 000001 / api / evaluations POST 000001
[0053] In Table 2, the two URLs correspond to the request paths for accessing the webpage and submitting the evaluation. The access user identifier represents the user corresponding to this identifier when the server generates session control.
[0054] S108: If so, then generate the session control and session control identifier for the first access request.
[0055] In some embodiments of this application, if so, the designated default user identifier of the first access request is determined based on the anonymous access data matched by the first access request.
[0056] Then, in the default user information database, the specified default user identifier is matched to determine the login information of the specified default user identifier.
[0057] Then, based on the login information of the specified default user, a session control and session control identifier for the first access request are generated. The specified default user corresponds to a unique session control.
[0058] It should be noted that each session control must be unique. In other words, this ensures that different access requests correspond to different session controls.
[0059] Clearly, by generating corresponding session control operations based on the default user's login information, anonymous requests are authorized before business logic is executed, ensuring consistency between the processing of subsequent anonymous and authorized requests.
[0060] S110: According to the session control, access the website page corresponding to the first access request to determine the response information of the first access request.
[0061] The response information refers to the information returned when the access request is received, which includes the information to be displayed to the accessing user on the website client.
[0062] S112: Bind the response information to the session control identifier so that when the website client accesses the site again, it generates a second access request based on the session control identifier.
[0063] In some embodiments of this application, by returning an anonymous request with a session control identifier, the website client can automatically carry the session control identifier when accessing the server again, thus assuming that the second access request has been authorized.
[0064] Specifically, it receives the second access request from the website client.
[0065] Then, determine whether the second access request carries the first session control identifier.
[0066] Then, it is determined that the second access request carries the first session control identifier.
[0067] Finally, based on the first session control identifier, the second access request is determined to be a non-anonymous request. In other words, when the second access request is a non-anonymous request, it means that the user is already logged into the website client by default.
[0068] In some embodiments of this application, once an anonymous request is considered as a default authorized request from the user, it is treated the same as the authorized request from the accessing user, and the business processing between the two is no longer distinguished.
[0069] Specifically, after determining that the first access request is a non-anonymous request, step S106 is no longer executed.
[0070] Specifically, the second session control corresponding to the first access request is determined based on the second session control identifier. That is, the second session control is reconstructed based on the second session control identifier.
[0071] Finally, according to the second session control, the website page corresponding to the first access request is accessed to determine the response information of the first access request. That is, the first access request is processed, and the result is returned.
[0072] Upon return, the response information is bound to the second session control identifier so that when the website client accesses the site again, a third access request is generated based on the second session control identifier.
[0073] In some embodiments of this application, after determining that the second access request is a non-anonymous request, the second session control corresponding to the first access request is determined according to the second session control identifier.
[0074] Then, according to the second session control, the website page corresponding to the first access request is accessed to determine the response information of the first access request;
[0075] Finally, the response information is bound to the second session control identifier so that when the website client accesses the site again, a third access request is generated based on the second session control identifier.
[0076] It should be noted that session control identifiers have an expiration date. This means that once the expiration date has passed, the corresponding resources cannot be accessed based on the session control identifier.
[0077] For example, when determining whether a second access request carries a first session control identifier, it is determined whether the first session control identifier is within a preset validity period.
[0078] If so, then it is determined that the second access request carries the first session control identifier.
[0079] If not, then report the login failure to the website client.
[0080] It should be noted that, although the embodiments in this application are based on... Figure 1 Steps S102 to S112 will be described sequentially, but this does not mean that steps S102 to S112 must be performed in a strict order. The reason this embodiment follows this order is... Figure 1 The order in which steps S102 to S112 are described is provided to facilitate understanding of the technical solutions of the embodiments of this application by those skilled in the art. In other words, in the embodiments of this application, the order of steps S102 to S112 can be appropriately adjusted according to actual needs.
[0081] pass Figure 1This method allows anonymous access requests by setting up access requests that allow anonymous access and generating session control and session control identifiers for the access requests. This enables access to the website page corresponding to the first access request. When returning an access request, the response information is bound to the session control identifier, so that when the website client accesses the website again, the second access request is equivalent to authorized access. This allows the website server to support anonymous access without modifying the business logic, while ensuring the security of the website server and meeting diverse needs for anonymous access.
[0082] Based on the same idea, some embodiments of this application also provide devices and non-volatile computer storage media corresponding to the above methods.
[0083] Figure 2 This application provides a schematic diagram of the structure of a website client access device, which includes:
[0084] At least one processor; and,
[0085] A memory communicatively connected to the at least one processor; wherein,
[0086] The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to:
[0087] Receive the first access request from the website client;
[0088] Determine whether the first access request is an anonymous request; an anonymous request indicates that the user is not logged into the website client.
[0089] If so, determine whether the website client allows anonymous access;
[0090] If so, then generate the session control and session control identifier for the first access request;
[0091] According to the session control, access the website page corresponding to the first access request to determine the response information of the first access request;
[0092] The response information is bound to the session control identifier so that when the website client accesses the site again, a second access request is generated based on the session control identifier.
[0093] Some embodiments of this application provide a non-volatile computer storage medium for a website client access device, which stores computer-executable instructions, wherein the computer-executable instructions are configured as follows:
[0094] Receive the first access request from the website client;
[0095] Determine whether the first access request is an anonymous request; an anonymous request indicates that the user is not logged into the website client.
[0096] If so, determine whether the website client allows anonymous access;
[0097] If so, then generate the session control and session control identifier for the first access request;
[0098] According to the session control, access the website page corresponding to the first access request to determine the response information of the first access request;
[0099] The response information is bound to the session control identifier so that when the website client accesses the site again, a second access request is generated based on the session control identifier.
[0100] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0101] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0102] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention 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.
[0103] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will 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, generate instructions for implementing the flowchart illustrations and / or block diagrams.Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0104] 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, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0105] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0106] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0107] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0108] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0109] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0110] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the technical principles of this application should fall within the protection scope of this application.
Claims
1. A method for accessing a website client, characterized in that, The method includes: Receive the first access request from the website client; Determine whether the first access request is an anonymous request; an anonymous request indicates that the user is not logged into the website client. If so, determine whether the website client allows anonymous access; If so, then generate the session control and session control identifier for the first access request; According to the session control, access the website page corresponding to the first access request to determine the response information of the first access request; The response information is bound to the session control identifier so that when the website client accesses the site again, a second access request is generated based on the session control identifier. The determination of whether the website client allows anonymous access specifically includes: The access requests are matched in a pre-built anonymous request database; the anonymous request database includes anonymous access data corresponding to multiple anonymous requests. Determine whether the access request matches; If so, then it is determined that the website client allows anonymous access; If not, then it is determined that the website client does not allow anonymous access; Before receiving the access request from the website client, the method further includes: Construct a preset access request that allows anonymous access; Construct a default user information database; the default user information database includes login information of multiple default users, and the login information is used as the default login information for the preset access request; Determine the default user identifier of the default user, and associate the default user identifier with the login information; Generate the request path, request method, and default user identifier corresponding to the preset access request; Based on the preset access request, the request path, the request method, and the default user identifier, anonymous access data for the preset access request is generated to construct the anonymous request database; If so, then the session control and session control identifier of the first access request are generated, specifically including: If so, then the specified default user identifier of the first access request is determined based on the anonymous access data matched by the first access request. In the default user information database, the specified default user identifier is matched to determine the login information of the specified default user identifier; Based on the login information of the specified default user identifier, a session control and session control identifier for the first access request are generated; the specified default user corresponds to a unique session control.
2. The method according to claim 1, characterized in that, The first access request session control identifier will be generated and used as the first session control identifier. The step of determining whether the first access request is an anonymous request specifically includes: Determine whether the first access request carries a second session control identifier; If not, then the first access request is determined to be an anonymous request; If so, then the first access request is determined to be a non-anonymous request; the first access request being a non-anonymous request means that the accessing user logs into the website client.
3. The method according to claim 2, characterized in that, After generating a second access request based on the session control identifier so that the website client can access it again, the method further includes: Receive the second access request from the website client; Determine whether the second access request carries the first session control identifier; It is determined that the second access request carries the first session control identifier; Based on the first session control identifier, the second access request is determined to be a non-anonymous request; the second access request being a non-anonymous request means that the user logs in to the website client by default.
4. The method according to claim 3, characterized in that, The determination of whether the second access request carries the first session control identifier specifically includes: Determine whether the first session control identifier is within a preset validity period; If so, then it is determined that the second access request carries the first session control identifier; If not, then report a login failure to the website client.
5. The method according to claim 2, characterized in that, The method further includes, after determining that the first access request is a non-anonymous request, taking the session control that generated the first access request as the first session control, and if not, then: Based on the second session control identifier, determine the second session control corresponding to the first access request; According to the second session control, access the website page corresponding to the first access request to determine the response information of the first access request; The response information is bound to the second session control identifier so that when the website client accesses the site again, a third access request is generated based on the second session control identifier.
6. A website client access device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a website client access method as described in any one of claims 1-5.
7. A website client access non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are configured to execute a website client access method as described in any one of claims 1-5.
Citation Information
Patent Citations
User information acquisition method and device, electronic equipment and storage medium
CN111709055A