A method, device, equipment and medium for simulating a login state based on a browser plug-in

CN116069620BActive Publication Date: 2026-10-16SHANGHAI YUER NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211554134.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2026-10-16
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

[0002]目前,大多数计算机业务都需要账号处于已登录的状态才可以正常运行,前端开发人员以谷歌(chrome)浏览器作为开发调试和效果预览工具时,为了模拟不同项目、不同环境,需要模拟大量账号登录态,而传统的模拟账号登录态的方式有两个:一个是直接登录账号,该方案需要获取大量账号和密码信息,不便用于开发调试中;另一个是通过多个系统组合获取账号登录态,但该方案具有以下缺陷:

Benefits of technology

[0041]This application provides a method, apparatus, device, and medium for simulating login state based on a browser plugin. The method involves logging into a target website and intercepting page request attributes through a browser plugin. If the target list contains the domain name corresponding to the target website, the method intercepts the target webpage and data interaction request corresponding to the target website and adds the target login state information to the user agent information corresponding to the data interaction request, thus obtaining the target request for transmission. If the target login state information exists in the login state information list, the method determines whether the validity period of the target login state information has expired. If expired, a one-click refresh obtains a valid target login state information; if not expired, a valid target login state information can be directly obtained. If the target login state information does not exist in the login state information list, a one-click creation of the target login state information is achieved using the account information corresponding to the target login state information, based on a create login state command. This technical solution reduces the cost of creating login states, improves the creation experience, allows for quick application of login states, and enables dynamic expansion. Login states can be quickly regenerated after expiration, which is beneficial for improving the development experience and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116069620B_ABST
    Figure CN116069620B_ABST
Patent Text Reader

Abstract

The application provides a method, device and equipment for simulating a login state based on a browser plug-in and a medium. The method comprises the following steps: obtaining a target website; intercepting a target webpage and a data interaction request corresponding to the target website in the case that a target list contains a domain name corresponding to the target website; the target list is a list generated based on customization; obtaining user agent information and target login state information corresponding to the data interaction request; adding the target login state information to the user agent information corresponding to the data interaction request to obtain a target request; and sending the target request. The technical solution can reduce the creation cost of the login state, improve the creation experience, quickly apply the login state, and can be dynamically expanded. After the login state is invalid, the login state can be quickly regenerated, which is beneficial to improving the development experience and development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of browser login state simulation technology, and in particular to a method, apparatus, device and medium for simulating login state based on browser plugins. Background Technology

[0002] Currently, most computer applications require an account to be logged in to function properly. When front-end developers use Google Chrome as a development, debugging, and preview tool, they need to simulate numerous account login states to simulate different projects and environments. Traditional methods for simulating account login states are twofold: one is to directly log in to an account, which requires obtaining a large amount of username and password information, making it inconvenient for development and debugging; the other is to obtain account login states through a combination of multiple systems, but this method has the following drawbacks:

[0003] 1. Creating an account login state is costly: it requires multiple steps and involves multiple systems (e.g., obtaining the account login state flag, opening the device simulation settings page, pasting the account identity flag, closing the device simulation page, refreshing the current page, etc.).

[0004] 2. Poor user experience when creating an account login: Users need to leave the current HTML5 page, go to another platform to create a user agent, and then return to the current HTML5 page;

[0005] 3. High cost of account login-based consumption: Simulation can only be completed through a custom user agent process in the Chrome browser;

[0006] 4. Limited functionality and lack of scalability: It cannot manage multiple accounts for a single project or shared accounts across multiple projects;

[0007] 5. Low efficiency: After the account login status expires, it must be recreated through multiple steps and across multiple systems, which is inefficient.

[0008] Furthermore, neither of the above two methods of simulating account login states allows for quick account switching, resulting in a poor development experience and low development efficiency. Summary of the Invention

[0009] This application provides a method, apparatus, device, and medium for simulating login state based on browser plugins to overcome the defects of the prior art. It can reduce the cost of creating login state, improve the creation experience, quickly apply login state, and can be dynamically expanded. After the login state expires, it can be quickly regenerated, which is beneficial to improving the development experience and development efficiency.

[0010] To solve the above-mentioned technical problems, this application provides the following technical solution:

[0011] According to a first aspect of the embodiments of this application, a method for simulating login state based on a browser plugin is provided, comprising:

[0012] Obtain the target URL;

[0013] If the target list contains the domain name corresponding to the target URL, the target webpage and data interaction request corresponding to the target URL are intercepted; the target list is a custom-generated list.

[0014] Obtain the user agent information and target login status information corresponding to the data interaction request;

[0015] Add the target login status information to the user agent information corresponding to the data interaction request to obtain the target request;

[0016] Send the target request.

[0017] In one exemplary implementation, when the target list does not contain the domain name corresponding to the target URL, the following is included:

[0018] Do not intercept the target webpage and data interaction requests corresponding to the target URL.

[0019] In one exemplary implementation, obtaining the target login status information includes:

[0020] Retrieve the list of login status information;

[0021] If the target login status information exists in the login status information list, obtain the timeliness information of the target login status information;

[0022] If the timeliness information has expired, a refresh command is received;

[0023] Based on the refresh command, the interface for obtaining the target login status information through the account information corresponding to the target login status information is invoked, so that the interface returns the target login status information;

[0024] Receive the target login status information returned by the interface;

[0025] The target login status information is persistently stored on the target device;

[0026] Obtain the target login status information from the target device.

[0027] In one exemplary implementation, when the target login status information does not exist in the login status information list, the following steps are included:

[0028] Receive the account information corresponding to the target login state information and the command to create a login state;

[0029] Based on the command to create a login state, the interface for obtaining the target login state information through the account information is called, so that the interface returns the target login state information.

[0030] In one exemplary implementation, if the timeliness information display is not expired, the following is included:

[0031] Obtain the target login status information.

[0032] According to a second aspect of the embodiments of this application, an apparatus for simulating a login state based on a browser plugin is provided, the apparatus comprising:

[0033] The URL acquisition module is used to obtain the target URL;

[0034] The interception module is used to intercept the target webpage and data interaction request corresponding to the target URL when the target list contains the domain name corresponding to the target URL; the target list is a custom-generated list;

[0035] The information acquisition module is used to acquire the user agent information and target login status information corresponding to the data interaction request;

[0036] The target request acquisition module is used to add target login status information to the user agent information corresponding to the data interaction request to obtain the target request;

[0037] The target request sending module is used to send the target request.

[0038] According to a third aspect of the embodiments of this application, an electronic device is provided, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement any of the above-described methods for simulating login state based on browser plugins.

[0039] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, the storage medium storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement any of the above-described methods for simulating login state based on browser plugins.

[0040] By adopting the above technical solution, this application has the following beneficial effects:

[0041] This application provides a method, apparatus, device, and medium for simulating login state based on a browser plugin. The method involves logging into a target website and intercepting page request attributes through a browser plugin. If the target list contains the domain name corresponding to the target website, the method intercepts the target webpage and data interaction request corresponding to the target website and adds the target login state information to the user agent information corresponding to the data interaction request, thus obtaining the target request for transmission. If the target login state information exists in the login state information list, the method determines whether the validity period of the target login state information has expired. If expired, a one-click refresh obtains a valid target login state information; if not expired, a valid target login state information can be directly obtained. If the target login state information does not exist in the login state information list, a one-click creation of the target login state information is achieved using the account information corresponding to the target login state information, based on a create login state command. This technical solution reduces the cost of creating login states, improves the creation experience, allows for quick application of login states, and enables dynamic expansion. Login states can be quickly regenerated after expiration, which is beneficial for improving the development experience and efficiency. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 A flowchart illustrating a method for simulating login state based on a browser plugin, provided as an embodiment of this application;

[0044] Figure 2 This application provides a schematic diagram of a process for obtaining target login status information in an embodiment of the present application.

[0045] Figure 3 An application block diagram of a method for simulating login state based on a browser plugin, provided in an embodiment of this application;

[0046] Figure 4 This application provides a schematic diagram of an application process for creating a login state, as illustrated in an embodiment of this application.

[0047] Figure 5 This application provides a schematic diagram of an application process for a consumer login state.

[0048] Figure 6 A structural block diagram of a device for simulating login state based on a browser plugin, provided in an embodiment of this application;

[0049] Figure 7This is a hardware structure block diagram of an electronic device that runs a method for simulating login state based on a browser plugin, as provided in an embodiment of this application. Detailed Implementation

[0050] 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 them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0051] The term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of this application. In the description of the embodiments of this application, it should be understood that the terms "upper," "lower," "top," "bottom," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" and "second" may explicitly or implicitly include one or more of that feature. Moreover, the terms "first," "second," etc., 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 orders other than those illustrated or described herein.

[0052] Please see Figure 1 The diagram shown is a flowchart illustrating a method for simulating login state based on a browser plugin, as provided in an embodiment of this application. The method includes:

[0053] Step S101: Obtain the target URL;

[0054] Step S102: Determine whether the target list contains the domain name corresponding to the target URL; the target list is a list generated based on custom settings; if yes, proceed to step S1031; if no, proceed to step S1032.

[0055] Step S1031: Intercept the target webpage and data interaction request corresponding to the target URL;

[0056] Step S1032: Do not intercept the target webpage and data interaction request corresponding to the target URL;

[0057] Step S104: Obtain the user agent information and target login status information corresponding to the data interaction request;

[0058] Step S105: Add target login status information to the user agent information corresponding to the data interaction request to obtain the target request;

[0059] Step S106: Send the target request.

[0060] In a specific embodiment, step S101 obtains the target URL; optionally, the target URL is obtained by input from the execution entity; step S102 determines whether the target list contains the domain name corresponding to the target URL; the target list is a custom-generated list, the customization is based on preset rules, and the preset rules match the research and development content; if yes, that is, if the target list contains the domain name corresponding to the target URL, then step S1031 is executed; if no, that is, if the target list does not contain the domain name corresponding to the target URL, then step S1032 is executed; through step S1031, based on the attribute that browser plugins can intercept page requests, if the target list contains the domain name corresponding to the target URL, the target webpage and data interaction request corresponding to the target URL are intercepted; optionally, The browser can be Google Chrome. In step S1032, based on the browser plugin's ability to intercept page request attributes, if the domain name corresponding to the target URL is not in the target list, the target webpage and data interaction request corresponding to the target URL are not intercepted. In step S104, if the target webpage and data interaction request corresponding to the target URL are intercepted, the user agent information and target login state information corresponding to the data interaction request are obtained. In step S105, if the user agent information and target login state information corresponding to the data interaction request are obtained, the target login state information is added to the user agent information corresponding to the data interaction request to obtain the target request. In step S106, if the target request is obtained, the target request is sent. This achieves efficient and fast simulation of account login state. This technical solution allows for convenient management of multiple target login state information, enabling one-click account switching. It is suitable for test environments and online environments with multiple accounts in a single project or shared accounts across multiple projects, helping to improve testing and online environment testing efficiency. It facilitates the interception of multi-domain webpages and can be dynamically expanded according to actual R&D needs, which is beneficial for improving the development experience and efficiency.

[0061] Please see Figure 2 The diagram illustrates a process for obtaining target login status information according to an embodiment of this application. In step S104, obtaining the target login status information may include:

[0062] Step S201: Obtain the login status information list;

[0063] Step S202: Determine whether the target login status information exists in the login status information list; if yes, proceed to step S2031; if no, proceed to step S2032.

[0064] Step S2031: Obtain the timeliness information of the target login status information;

[0065] Step S2032: Receive the account information and login state creation command corresponding to the target login state information;

[0066] Step S2033: Based on the command to create login state, call the interface for obtaining the target login state information through the account information, so that the interface returns the target login state information;

[0067] Step S204: Determine whether the timeliness information has expired; if yes, proceed to step S2051; if no, proceed to step S2052.

[0068] Step S2051: Receive refresh command;

[0069] Step S2052: Obtain the target login status information;

[0070] Step S206: Based on the refresh command, call the interface for obtaining the target login status information through the account information corresponding to the target login status information, so that the interface returns the target login status information;

[0071] Step S207: Receive the target login status information returned by the interface;

[0072] Step S208: Persistently store the target login status information in the target device;

[0073] Step S209: Obtain the target login status information from the target device.

[0074] In a specific embodiment, step S201 involves obtaining a login status information list; this list records created login status information. Step S202 involves determining whether the target login status information exists in the login status information list. If yes, if the target login status information exists in the list, step S2031 is executed; otherwise, if the target login status information does not exist in the list, step S2032 is executed. In step S2031, if the target login status information exists in the list, the timeliness information of the target login status information is obtained. In step S2032, the timeliness information of the login status information is determined in the login status information list. If the target login state information does not exist in the table, the account information corresponding to the target login state information and the command to create a login state are received. Through step S2033, upon receiving the account information corresponding to the target login state information and the command to create a login state, the interface for obtaining the target login state information through the account information is called based on the command to create a login state, so that the interface returns the target login state information. Through steps S2032 and S2033, the account login state creation operation can be completed on the current page without jumping to other pages or systems, which is convenient and efficient, achieving the effect of reducing the cost of account login state creation and improving the creation experience. Through step S204, upon obtaining... If the timeliness information of the target login status information is obtained, it is determined whether the timeliness information has expired; if yes, if the timeliness information shows that it has expired, then step S2051 is executed; if no, if the timeliness information shows that it has not expired, then step S2052 is executed; through step S2051, if the timeliness information shows that it has expired, a refresh command is received; through step S2052, if the timeliness information shows that it has not expired, the target login status information is obtained; through step S206, if the refresh command is received, based on the... The refresh command calls an interface to obtain the target login status information through the account information corresponding to the target login status information, so that the interface returns the target login status information; in step S207, if the interface returns the target login status information, the target login status information returned by the interface is received; in step S208, if the target login status information returned by the interface is received, the target login status information is persistently stored in the target device; through steps S2051, S206, S207 and S208, after the account login status expires or becomes invalid, it can be regenerated with one click through the refresh command, which is convenient and efficient, and helps to improve the R&D experience and R&D efficiency;In step S209, the target login status information is obtained from the target device.

[0075] Please see Figure 3 The diagram shown is an application block diagram of a method for simulating login state based on a browser plugin, provided in an embodiment of this application. The application technical solution of this method for simulating login state based on a browser plugin may include:

[0076] Create login state and consume login state;

[0077] The creation of login status includes creating a login status using a mobile phone number and refreshing an old account with one click; the consumption login status includes selecting any existing record with one click.

[0078] In one specific embodiment, the executing entity obtains the target login state record by creating a new login state record using a mobile phone number or refreshing an old account with one click, completes the creation of the login state, and then completes the consumption of the login state by selecting the target login state record with one click.

[0079] Please see Figure 4 The diagram shown is a schematic representation of an application process for creating a login state, provided in an embodiment of this application. This application process for creating a login state may include:

[0080] The executing entity determines whether a target login status exists;

[0081] If so, i.e., if a target login state exists, determine whether the target login state has expired; if so, i.e., the target login state has expired, click refresh, then call the mobile phone number corresponding to the old account to obtain the interface corresponding to the target login state, and persistently store the target login state flag returned by the interface in the user's local storage, complete the creation of the target login state, and wait for consumption; if not, i.e., the target login state has not expired, then you can directly wait for consumption.

[0082] If not, i.e., if the target login state does not exist, then enter the mobile phone number and click "Create". Then, call the interface corresponding to the target login state obtained through the mobile phone number, and persistently store the target login state flag returned by the interface in the user's local storage, thus completing the creation of the target login state and waiting for consumption.

[0083] Please see Figure 5 The diagram illustrates an application process for a consumer login state according to an embodiment of this application. This consumer login state application process may include:

[0084] Open a webpage in the Chrome browser, such as https: / / example.xxx.com / release-1177 / 1761;

[0085] Determine if the current domain is on the blocking list, such as example.xxx.com;

[0086] If so, i.e. the current domain is on the block list, then the current page and its data interaction (AJAX) requests are blocked. Then, the currently created user agent is obtained, the user agent in the request header is modified, the login state is injected and the request is sent to complete the consumption of the login state.

[0087] If not, the current page and its data interaction (AJAX) requests will not be intercepted.

[0088] As can be seen from the above technical solutions of the embodiments of this application, in this embodiment, when logging into a target website, the browser plugin can intercept the attributes of page requests. If the target list contains the domain name corresponding to the target website, the target webpage and data interaction request corresponding to the target website are intercepted, and the target login state information is added to the user agent information corresponding to the data interaction request to obtain the target request for sending. Specifically, if the target login state information exists in the login state information list, it is determined whether the validity period information of the target login state information has expired. If expired, a one-click refresh is used to obtain a target login state information with valid validity period information. If not expired, a target login state information with valid validity period information can be directly obtained. If the target login state information does not exist in the login state information list, a target login state information is created with one click based on the account information corresponding to the target login state information, using a login state creation command. This technical solution can reduce the cost of creating login states, improve the creation experience, quickly apply login states, and can be dynamically expanded. Login states can be quickly regenerated after they expire, which is beneficial to improving the development experience and development efficiency.

[0089] Corresponding to the method for simulating login state based on browser plugins provided in the above embodiments, this application also provides an apparatus for simulating login state based on browser plugins. Since the apparatus for simulating login state based on browser plugins provided in this application corresponds to the method for simulating login state based on browser plugins provided in the above embodiments, the implementation method of the aforementioned method for simulating login state based on browser plugins is also applicable to the apparatus for simulating login state based on browser plugins provided in this embodiment, and will not be described in detail in this embodiment.

[0090] Please see Figure 6 The diagram shown is a structural block diagram of a device for simulating login state based on a browser plugin, according to an embodiment of this application; the device includes:

[0091] 001: URL acquisition module, used to obtain the target URL;

[0092] 002: Interception module, used to intercept the target webpage and data interaction request corresponding to the target URL when the target list contains the domain name corresponding to the target URL; the target list is a custom-generated list;

[0093] 003: Information acquisition module, used to acquire user agent information and target login status information corresponding to the data interaction request;

[0094] 004: Target request acquisition module, used to add target login status information to the user agent information corresponding to the data interaction request to obtain the target request;

[0095] 005: Target request sending module, used to send the target request.

[0096] In one specific embodiment, the above-described apparatus may include:

[0097] The URL acquisition module is used to obtain the target URL;

[0098] The first judgment module is used to determine whether the target list contains the domain name corresponding to the target URL; the target list is a list generated based on a custom function.

[0099] The interception module is used to intercept the target webpage and data interaction request corresponding to the target URL when the target list contains the domain name corresponding to the target URL;

[0100] The non-interception module is used to not intercept the target webpage and data interaction request corresponding to the target URL when the target list does not contain the domain name corresponding to the target URL;

[0101] The information acquisition module is used to acquire the user agent information and target login status information corresponding to the data interaction request;

[0102] The target request acquisition module is used to add target login status information to the user agent information corresponding to the data interaction request to obtain the target request;

[0103] The target request sending module is used to send the target request.

[0104] Specifically, the target URL is obtained through a URL acquisition module; optionally, the target URL is obtained by input from the execution entity; a first judgment module determines whether the target list contains the domain name corresponding to the target URL; the target list is a custom-generated list, the customization is based on preset rules, and the preset rules match the research and development content; if yes, that is, if the target list contains the domain name corresponding to the target URL, then the interception module is executed; if no, that is, if the target list does not contain the domain name corresponding to the target URL, then the non-interception module is executed; through the interception module, based on the browser plugin's ability to intercept page requests, if the target list contains the domain name corresponding to the target URL, the target webpage and data interaction request corresponding to the target URL are intercepted; optionally, the browser can be... Google Chrome browser; Through a non-interception module, based on browser plugins, it can intercept page request attributes. If the domain corresponding to the target URL is not in the target list, it will not intercept the target webpage and data interaction request corresponding to the target URL. Through an information acquisition module, while intercepting the target webpage and data interaction request corresponding to the target URL, it acquires the user agent information and target login state information corresponding to the data interaction request. Through a target request acquisition module, while acquiring the user agent information and target login state information corresponding to the data interaction request, it adds the target login state information to the user agent information corresponding to the data interaction request to obtain the target request. Through a target request sending module, while acquiring the target request, it sends the target request. This achieves efficient and fast simulation of account login state. This technical solution allows for convenient management of multiple target login state information, enabling one-click account switching. It is suitable for test environments with multiple accounts in a single project or shared accounts across multiple projects, helping to improve testing and online environment testing efficiency. It facilitates the interception of multi-domain webpages and can be dynamically expanded according to actual development needs, which is beneficial to improving the development experience and efficiency.

[0105] In an optional embodiment, the above-described apparatus may further include:

[0106] The list retrieval module is used to retrieve a list of login status information.

[0107] The second judgment module is used to determine whether the target login status information exists in the login status information list;

[0108] The timeliness information acquisition module is used to acquire the timeliness information of the target login status information when the target login status information exists in the login status information list;

[0109] A command receiving module is created to receive the account information corresponding to the target login state information and the command to create login state.

[0110] The login state creation module is used to call the interface that obtains the target login state information through the account information based on the login state creation command, so that the interface returns the target login state information;

[0111] The third judgment module is used to determine whether the timeliness information has expired;

[0112] The refresh command receiving module is used to receive a refresh command when the timeliness information display has expired;

[0113] The first login status acquisition module is used to acquire the target login status information when the timeliness information display has not expired;

[0114] The refresh module is used to call the interface for obtaining the target login status information through the account information corresponding to the target login status information based on the refresh command, so that the interface returns the target login status information;

[0115] An interface information receiving module is used to receive the target login status information returned by the interface;

[0116] A storage module is used to persistently store the target login status information in the target device;

[0117] The second login status acquisition module is used to acquire the target login status information from the target device.

[0118] Specifically, the system retrieves a list of login status information via a list retrieval module. This list records previously created login status information. A second judgment module determines whether the target login status information exists in the list. If it does, the system executes a timeliness information retrieval module; otherwise, it executes a creation command receiving module. If the target login status information exists in the list, the system retrieves its timeliness information via the timeliness information retrieval module. If the target login status information does not exist in the list, the system executes a creation command receiving module. If the target login status information exists in the list, the system retrieves its timeliness information via the timeliness information retrieval module. If the target login status information does not exist in the list, the system retrieves its timeliness information via the creation command receiving module. If the target login state information exists, the system receives the account information corresponding to the target login state information and a login state creation command. Through the login state creation module, upon receiving the account information corresponding to the target login state information and the login state creation command, it calls the interface for obtaining the target login state information through the account information based on the login state creation command, so that the interface returns the target login state information. Through the creation command receiving module and the login state creation module, the account login state creation operation can be completed on the current page without jumping to other pages or systems, which is convenient and efficient, achieving the effect of reducing the cost of account login state creation and improving the creation experience. Through the third judgment module, upon obtaining the... In the case of the timeliness information of the target login status information, it is determined whether the timeliness information has expired; if so, if the timeliness information shows that it has expired, the refresh command receiving module is executed; if not, if the timeliness information shows that it has not expired, the first login status acquisition module is executed; through the refresh command receiving module, if the timeliness information shows that it has expired, a refresh command is received; through the first login status acquisition module, if the timeliness information shows that it has not expired, the target login status information is acquired; through the refresh module, upon receiving the refresh command, based on The refresh command calls an interface that retrieves the target login status information using the account information corresponding to the target login status information, so that the interface returns the target login status information; the interface information receiving module receives the target login status information returned by the interface; and the storage module persistently stores the target login status information in the target device upon receiving the target login status information returned by the interface. Through the refresh command receiving module, refresh module, interface information receiving module, and storage module, the account login status can be regenerated with a single click after it expires or becomes invalid, which is convenient, efficient, and helps improve the development experience and efficiency.The target login status information is obtained from the target device through the second login status acquisition module.

[0119] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0120] This application's embodiment describes a device for simulating login states based on browser plugins. It logs into a target website and, through the browser plugin, intercepts page request attributes. If the target list contains the domain name corresponding to the target website, it intercepts the target webpage and data interaction requests for that website and adds the target login state information to the user agent information corresponding to the data interaction request, thus obtaining the target request for transmission. If the target login state information exists in the login state information list, it determines whether the validity period of the target login state information has expired. If expired, a one-click refresh obtains a valid target login state information; if valid, it can be directly obtained. If the target login state information does not exist in the list, it is created with one click using the account information corresponding to the target login state information, based on a login state creation command. This technical solution reduces the cost of creating login states, improves the creation experience, allows for quick application of login states, and can be dynamically expanded. Login states can be quickly regenerated after expiration, which is beneficial for improving the development experience and efficiency.

[0121] This application also provides an electronic device, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the method of simulating login state based on browser plugin as provided in the above method embodiments.

[0122] Memory can be used to store software programs and modules. The processor executes these stored software programs and modules to perform various functional applications and achieve advanced autonomous driving. Memory can primarily include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for functions, etc.; the data storage area can store data created based on device usage, etc. Furthermore, memory can include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory can also include a memory controller to provide the processor with access to the memory.

[0123] The method embodiments provided in this application can be executed in a computer terminal, server or similar computing device, that is, the above-mentioned electronic device may include a computer terminal, server or similar computing device. Figure 7 This is a hardware structure block diagram of an electronic device that runs a method for simulating login state based on a browser plugin, as provided in the embodiments of this application. Figure 7 As shown, the internal structure of this electronic device may include, but is not limited to, a processor, a network interface, and a memory. The processor, network interface, and memory within the electronic device can be connected via a bus or other means, as illustrated in the embodiments of this specification. Figure 7 Taking the example of a connection between China and Israel via a bus.

[0124] The processor (or CPU, Central Processing Unit) is the computing and control core of the electronic device. The network interface may optionally include a standard wired interface or a wireless interface (such as Wi-Fi, mobile communication interface, etc.). The memory is the storage device in the electronic device used to store programs and data. It is understood that the memory here can be a high-speed RAM storage device, or a non-volatile storage device, such as at least one disk storage device; optionally, it can also be at least one storage device located remotely from the aforementioned processor. The memory provides storage space, which stores the operating system of the electronic device, including but not limited to: Windows (an operating system), Linux (an operating system), Android (a mobile operating system), iOS (a mobile operating system), etc., which are not limited in this application; and the storage space also stores one or more instructions suitable for being loaded and executed by the processor, which can be one or more computer programs (including program code). In the embodiments of this specification, the processor loads and executes one or more instructions stored in the memory to implement the method provided in the above method embodiments based on simulating login state using a browser plugin.

[0125] This application also provides a computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the method provided in the method embodiment for simulating login state based on browser plugin.

[0126] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0127] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than those shown in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multi-sample image classification and parallel processing are also possible or may be advantageous.

[0128] The various embodiments in this specification 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 apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0129] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0130] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for simulating login state based on browser plugins, characterized in that, Suitable for testing and production environments with multiple accounts for a single project or shared accounts across multiple projects, including: Obtain the target URL; If the target list contains the domain name corresponding to the target URL, the target webpage and data interaction request corresponding to the target URL are intercepted; the target list is a custom-generated list. Obtain the user agent information and target login status information corresponding to the data interaction request; Add the target login status information to the user agent information corresponding to the data interaction request to obtain the target request; Send the target request; Obtain target login status information, including: Retrieve the list of login status information; If the target login status information exists in the login status information list, obtain the timeliness information of the target login status information; If the timeliness information has expired, a refresh command is received; Based on the refresh command, the interface for obtaining the target login status information through the account information corresponding to the target login status information is invoked, so that the interface returns the target login status information; Receive the target login status information returned by the interface; The target login status information is persistently stored on the target device; Obtain the target login status information from the target device.

2. The method for simulating login state based on browser plugins according to claim 1, characterized in that, If the target list does not contain the domain name corresponding to the target URL, the following applies: Do not intercept the target webpage and data interaction requests corresponding to the target URL.

3. The method for simulating login state based on browser plugins according to claim 1, characterized in that, If the target login status information does not exist in the login status information list, including: Receive the account information corresponding to the target login state information and the command to create a login state; Based on the command to create a login state, the interface for obtaining the target login state information through the account information is called, so that the interface returns the target login state information.

4. The method for simulating login state based on browser plugins according to claim 1, characterized in that, If the timeliness information display is not expired, including: Obtain the target login status information.

5. A device for simulating login state based on a browser plugin, implemented using the method for simulating login state based on a browser plugin as described in any one of claims 1 to 4, characterized in that, The device includes: The URL acquisition module is used to obtain the target URL; The interception module is used to intercept the target webpage and data interaction request corresponding to the target URL when the target list contains the domain name corresponding to the target URL; the target list is a custom-generated list; The information acquisition module is used to acquire the user agent information and target login status information corresponding to the data interaction request; The target request acquisition module is used to add target login status information to the user agent information corresponding to the data interaction request to obtain the target request; The target request sending module is used to send the target request.

6. An electronic device, characterized in that, The system includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the method for simulating login state based on a browser plugin as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing at least one instruction or at least one program, said at least one instruction or said at least one program being loaded and executed by a processor to implement the method for simulating login state based on a browser plugin as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Website simulation login method and device, server side and readable storage medium

    CN107733969A

  • Website login method and device based on browser plug-in, equipment and storage medium

    CN113709181A