WO2013082887A1 - 一种检测客户端异常退出的方法及网站服务器 - Google Patents
一种检测客户端异常退出的方法及网站服务器 Download PDFInfo
- Publication number
- WO2013082887A1 WO2013082887A1 PCT/CN2012/071332 CN2012071332W WO2013082887A1 WO 2013082887 A1 WO2013082887 A1 WO 2013082887A1 CN 2012071332 W CN2012071332 W CN 2012071332W WO 2013082887 A1 WO2013082887 A1 WO 2013082887A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- client
- login
- time
- server
- web server
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
Definitions
- the present invention relates to a web server technology, and more particularly to a method for detecting abnormal exit of a client and a web server.
- Web server technology has been widely used in embedded devices, making it easy for users to modify device configurations through a browser.
- This technology is commonly used in communication devices such as modems and routers.
- the user enters the IP address of the device in the address bar of the browser.
- the Webserver reads the Web configuration page from the Web directory and outputs it to the client through the socket (Socket).
- the user modifies the configuration items of the device according to the prompts of the web configuration page. After clicking the OK button, these configuration parameters are passed to the Webserver, and the Webserver passes these parameters to the Goform function in the background. After the Goform function processes the parameters, the Goform function processes the parameters. , and then write to the hardware configuration item.
- Modifications to device configuration items such as modems and routers are generally only allowed for one user to modify at the same time. If multiple users operate at the same time, the last modified user will overwrite the modified results of other users. This requires a mutually exclusive login function, which requires the device to detect which users are operating as administrators, thereby preventing other users from performing similar operations and preventing the modification results from being overwritten.
- the technical problem to be solved by the present invention is to provide a method for detecting abnormal exit of a client and a website server, which can enable the Web server to know the abnormal exit of the client.
- a method for detecting abnormal exit of a client application
- the web server including:
- the Webserver receives the scheduled registration of the logged-in client. When it is determined that the difference between the current system time and the time of the most recent registration is greater than or equal to the pre-configured lost time (lost_time), it is determined that the client exits abnormally.
- loss_time the pre-configured lost time
- the webserver receives the registered registration of the first client that is logged in.
- the second client initiates the login, it determines whether the difference between the current system time and the last time the registration was received is greater than or equal to the pre-configured lost time (lost_time). ), if yes, verify the second client; otherwise, determine that the client is online and reject the second client.
- loss_time the pre-configured lost time
- the foregoing method further includes:
- the web server sets the login status (Server_login_status) of the server to be successfully registered; and sets a random account (Server_random_id) of the server to initiate the second client.
- a method of logging into a web server including:
- the client initiates a login to the web server to determine whether to log in to the web server. After successfully logging in to the web server, a timer is started, and the web server is periodically registered.
- periodically registering with the web server including:
- the client periodically sends a registration request to the Web server, requesting the Web server to modify the registration time of the user to the current system time after receiving the registration request.
- the client periodically sends a registration request to the Web server, and requests the Web server to modify the registration time of the user to the current system time after receiving the registration request, including:
- the registration request sent by the client to the web server is an Update-time function call request, so that after receiving the registration request, the Web server calls the Update_time function to change the registration time of the user to the current system time. .
- the determining whether to log in to the web server includes: The client obtains a server-side random account (Server_random_id) and a server-side login status (Server_login_status) from the Webserver, and determines a locally stored client's random account (Client_random_id) and The server_random_id is the same, and the server_login_ status indicates that the login is successful, the client determines to successfully log in to the webserver;
- Server_random_id server-side random account
- Server_login_status server-side login status
- the client determines that the server_login_status indicates a password error, it determines that the user is not successfully logged into the Webserver, and prompts the user that the password is incorrect;
- the client determines that the server_login_status indicates that another user is online, the client determines that the user is not successfully logged in to the web server, and prompts the user to be online.
- a client includes: a login initiation unit, a login determination unit, and a timing registration unit, wherein:
- the login initiation unit is configured to initiate a login to a web server (Webserver);
- Webserver web server
- the login determination unit is configured to determine whether to log in to the Web server
- the timing registration unit is configured to start a timer after the login determination unit determines that the login is successfully performed to the Web server, and periodically register with the Web server.
- the timing registration unit is configured to send a registration request to the Web server, and request the web server to modify the registration time of the user to the current system time after receiving the registration request.
- the login determining unit is configured to obtain, from the web server, a random account (Server_random_id) of the server end and a login status (Server_login_status) of the server, and determine a random account of the locally saved client.
- (Client_random_id) is the same as the Server_random_id, and the Server_login_ status indicates that the login is successful, determining to successfully log in to the Webserver; determining that the Server_login_status indicates the password If the error is not successful, it is determined that the user is not successfully logged in to the Webserver, and the user is prompted to have a wrong password.
- the server_login_status indicates that another user is online, it is determined that the user is not successfully logged into the Webserver, and the user is prompted to be online. in.
- a website server comprising: a receiving unit, a determining unit, and a login control unit, wherein: the receiving unit is configured to receive a timed registration of the logged-in first client; The determining unit is configured to determine, when the second client initiates the login, whether the difference between the current system time and the last time the registration was received is greater than or equal to the pre-configured lost time.
- the login control unit is configured to: when the determining unit determines that the difference between the current system time and the last time the registration is received is greater than or equal to the pre-configured lost time, the second client is authenticated; When the judging unit judges that the difference between the current system time and the last time the registration is received is less than the pre-configured lost time, it is determined that the client is online and rejects the second client.
- the login control unit is configured to set a login status (Server_login_status) of the server to be successful after the second client passes the verification; and set a random account of the server (Server_random_id) a random account (Client_random_id) of the client sent when the second client initiates the login; and the registration time of the user is changed to the current system time.
- a login status (Server_login_status) of the server to be successful after the second client passes the verification
- a random account of the server Server_random_id
- Client_random_id a random account of the client sent when the second client initiates the login
- a website server includes: a receiving unit, a determining unit, and a client exit determining unit, wherein:
- the receiving unit is configured to receive a timed registration of the logged in client
- the determining unit is configured to determine whether a difference between a current system time and a time when the registration was last received is greater than or equal to a pre-configured lost time (lost_time);
- the client exit determining unit is configured to determine that the client exits abnormally when the determining unit determines that the difference between the current system time and the last time the registration was received is greater than or equal to the pre-configured lost time.
- the method of generating a timer on the client and registering with the Webserver periodically enables the Web server to detect the login status of the client in real time, thereby providing a good implementation of the exclusive operation.
- FIG. 1 is a flowchart of a method for logging in to a website server according to an embodiment of the present invention
- FIG. 2 is a flowchart of a method for detecting abnormal exit of a client according to an embodiment of the present invention
- FIG. 3 is a flowchart of a method for controlling login of a client according to an embodiment of the present invention
- 4 is a structural diagram of a client according to an embodiment of the present invention
- FIG. 5 is a structural diagram of a Webserver according to an embodiment of the present invention.
- FIG. 6 is a structural diagram of another Webserver according to an embodiment of the present invention. Preferred embodiment of the invention
- the client after logging in to the Webserver, the client generates a timer and periodically registers with the Webserver. If the client exits abnormally, it stops registering with the Webserver. The difference between the current system time and the last time the Webserver received the registration. When the value exceeds the pre-configured lost time, it is determined that the client has logged out.
- the method for the client to log in to the website server in the embodiment includes: Step 101: When the user opens the web GUI page for the first time and enters the login main interface, the client generates a random account for the user (Client — random — id ) , and saved in the client (saved in the cookie), and will set Client_login_status to N, indicating that the user has not been authenticated; this part of the function is mainly implemented by JavaScript combined with cookies, the code
- the general process is as follows
- Client—random— id get the value of Client-random-id in the cookie file
- Client_login_ status Get the value of Client_login_status in the cookie file; if(Client- random-id is empty)
- Client—random— id randomly generate an account for the user
- Step 102 The user inputs an account and a password, and the client initiates login to the Web server.
- the client obtains the server-side random account (Server_random_id) and the server-side login status (Server_login_status) from the Webserver, and determines the locally stored client's random account (Client-random-id) and Server-ran.
- — id is the same, and Server_login_ status indicates that the login is successful, it determines that the login to the Webserver is successful.
- Server_login_status indicates a password error, it determines that the login to the Webserver is not successful, prompting the user for the wrong password;
- login— status Indicates that when other users are online, it is determined that the user has not successfully logged in to the webserver, prompting the user to be online.
- Client—random— id get the value of Client-random-id in the cookie file
- Server— random— id Get Server—random—id from the server;
- Server_login_ status Get Server_login_ status from the server
- Step 104 The client starts a timer and performs a function of registering with the Webserver periodically.
- the function of registering with the Webserver periodically:
- the client starts the timer and periodically sends a registration request to the server, requesting the Webserver to modify the registration time of the user to the current system time after receiving the registration request.
- the registration request can use the update-time function (GoForm class function) to call the request, so that after the Webserver receives the registration request, it calls the Update_time function to change the user's registration time to the current system time.
- GoForm class function update-time function
- This function is executed when the server receives the registration request (update_time function).
- Update_time function The implementation of the Update_time function is as follows:
- the method for controlling client login in this embodiment includes:
- Step 201 The web server receives the login initiated by the client.
- Step 202 The Webserver determines whether the difference between the current system time and the last time the registration is received is greater than or equal to the pre-configured lost time (lost_time). If yes, step 203 is performed; otherwise, the client is determined to be online. , refusing to initiate a login to the client;
- Step 203 Verify the client, and after the verification succeeds, set a random account (Server_random_id) of the server to the client's random account (Client_random_id) sent when the login client initiates the login, and Set the login status of the server ( Server_login_status) to Y, indicating that the login is successful, and change the registration time of the user to the current system time.
- Server_random_id a random account of the server to the client's random account (Client_random_id) sent when the login client initiates the login
- Set the login status of the server Server_login_status
- the above functions are mainly implemented in the Webserver of the embedded device server side (List of Programs. 2): When the user enters the account number, password, and clicks the OK button, the relevant data is sent to the Webserver in the form of an Http packet, and the Webserver parses the Http packet and extracts the information therein.
- Server— random— id Client— random— id;
- Step 204 When a new user B logs in, the Webserver detects that now-update_time ⁇ lost time, indicating that user A is registered in the lost time, and user A is online, and the webserver rejects the login of user B. Request, prompting user B that other users are logged in; The implementation of this part of the function is included in the program list .2 and program list .3. In the program list 2.
- the method for detecting abnormal exit of a client in this embodiment includes: Step 301: When user A exits abnormally (such as disconnected network connection, user shutdown, page after login is closed, etc.), at this time, the client Stop the registration to the Webserver;
- Step 302 When a user initiates a request to detect whether there is a client online, the Webserver determines whether the difference between the current system time and the last time the registration was received is greater than or equal to the pre-configured lost time. If yes, then determine The logged in client quits abnormally, and there is currently no client online.
- Step 303 When a new user C logs in, the Webserver detects the current-update_time> lost-time, and the user A has timed out to register with the Webserver, indicating that the user A has exited abnormally, and the new user C is allowed to log in.
- the client of the embodiment of the present invention includes: a login initiation unit, a login determination unit, and a timing registration unit, where: The login initiation unit is set to initiate login to the web server (Webserver); the login determination unit is configured to determine whether to log in to the web server;
- Webserver web server
- the timer registration unit is configured to start a timer after the login determination unit determines that the login is successfully performed to the Web server, and periodically register with the Web server.
- the timing registration unit is configured to send a registration request to the Webserver, and request the Webserver to modify the registration time of the user to the current system time after receiving the registration request.
- the login judgment unit is configured to obtain a server-side random account (Server_random_id) and a server-side login status (Server_login_status) from the Webserver, and determine a locally stored client's random account (Client_random_id). Same as Server-random-id, and Server_login_ status indicates that the login is successful, and it is determined that the login is successful to the Webserver.
- Server_login_status indicates a password error
- it is determined that the login to the Webserver is not successful, prompting the user for the wrong password.
- Server_login_status indicates that another user is online, it is determined that the user has not successfully logged in to the Webserver, prompting the user to be online.
- the Web server of this embodiment includes: a receiving unit, a determining unit, and a login control unit, where:
- a receiving unit configured to receive a timed registration of the logged in client
- the determining unit is configured to determine, when another client initiates the login, whether the difference between the current system time and the last time the registration was received is greater than or equal to the pre-configured lost time (lost_time);
- the login control unit is configured to: when the determining unit determines that the difference between the current system time and the last time the registration is received is greater than or equal to the pre-configured lost time, verify the client that initiated the login; otherwise, determine the client.
- the terminal is online, and the client that initiated the login is rejected.
- the login control unit is configured to set the login status of the server (Server_login_status) after the client passes the verification, indicating that the login is successful; setting the server-side random account (Server_random-id) to be sent when the client initiates the login.
- the client's random account (Client_random-id); and modify the user's registration time to the current system time.
- another web server of this embodiment includes: a receiving unit, a determining unit, and a client exit determining unit, where:
- a receiving unit configured to receive a timed registration of the logged in client
- a determining unit configured to determine whether a difference between a current system time and a time when the registration was last received is greater than or equal to a pre-configured lost time (lost_time);
- the client exit determining unit is configured to determine that the client exits abnormally when the determining unit determines that the difference between the current system time and the time when the registration was last received is greater than or equal to the pre-configured lost time.
- a general-purpose computing device which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices.
- they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
- the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module.
- the invention is not limited to any particular combination of hardware and software.
- An embodiment of the present invention enables a Webserver to detect a login status of a client in real time by generating a timer on the client and registering it with the Webserver, thereby providing a very good implementation of the exclusive operation.
- a good foundation improves user experience.
Landscapes
- Engineering & Computer Science (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明公开了一种检测客户端异常退出的方法及网站服务器,包括:WebServer接收已登录客户端的定时注册,在判断当前的系统时间与最近一次接收到注册的时间的差值大于或等于预先配置的丢失时间(lost_time)时,确定所述客户端异常退出。本发明在用户登录后,通过在客户端生成定时器,定时向WebServer进行注册的方法,使WebServer能够实时检测到客户端的登录情况,从而为互斥操作的实现提供了很好的基础,提高了用户体验度。
Description
一种检测客户端异常退出的方法及网站服务器
技术领域
本发明涉及网站服务器技术, 尤其涉及一种检测客户端异常退出的方法 及网站服务器。
背景技术
网站服务器( Webserver )技术在嵌入式设备中得到了广泛地应用, 便于 用户通过浏览器, 便捷地对设备配置进行修改。 这一技术在调制解调器、 路 由器等通信设备中得到了普遍使用。 用户在浏览器的地址栏中输入设备的 IP 地址, 这时 Webserver就会从 Web 目录下将 Web配置页面读入, 并通过套 接字 ( Socket )输出到客户端。 用户根据 Web配置页面的提示, 对设备的配 置项进行修改, 点击确定按钮后, 这些配置参数会传递到 Webserver, Webserver再将这些参数传递给后台的 Goform类函数, Goform函数对这些参 数进行处理后, 再写入硬件的配置项中。
对调制解调器、 路由器等设备配置项的修改, 一般同时只允许一个用户 修改, 如果多个用户同时操作, 最后进行修改的用户, 会将其他用户的修改 结果覆盖掉。 这就要求提供互斥登陆功能, 需要设备检测到有哪些用户正在 以管理员身份进行操作, 从而阻止其他用户进行类似的操作, 防止修改结果 被覆盖。
在目前的嵌入式设备中, 用户通过网页登录后, Webserver无法检测用 户的异常退出, 无法实时有效的检测用户的在线情况, 这也就无法真正的实 现互斥操作, 影响了用户体验效果。 发明内容
本发明要解决的技术问题是提供一种检测客户端异常退出的方法及网站 服务器, 能够使 Webserver获知客户端的异常退出。
为解决上述技术问题, 本发明的一种检测客户端异常退出的方法, 应用
于网站服务器 (Webserver)中, 包括:
Webserver接收已登录客户端的定时注册, 在判断当前的系统时间与最 近一次接收到注册的时间的差值大于或等于预先配置的丟失时间 (lost— time) 时, 确定所述客户端异常退出。
一种控制客户端登录的方法, 应用于网站服务器 (Webserver)中, 包括:
Webserver接收已登录的第一客户端的定时注册, 在第二客户端发起登 录时, 判断当前的系统时间与最近一次接收到注册的时间的差值是否大于或 等于预先配置的丟失时间 (lost— time), 如果是, 则对第二客户端进行验证; 否 则, 确定有客户端在线, 拒绝第二客户端。
可选的, 上述方法还包括:
所述 Webserver在所述第二客户端通过验证后, 设置服务器端的登录状 态(Server— login— status)为登录成功 ; 设置服务器端的 随机账号 (Server— random— id)为所述第二客户端发起登录时发送的客户端的随机账号 (Client— random— id); 并将用户的注册时间修改为当前的系统时间。
一种登录网站服务器的方法, 包括:
客户端向网站服务器 (Webserver)发起登录, 判断是否登录到所述 Webserver, 在成功登录到所述 Webserver后, 启动一定时器, 定时向所述 Webserver进行注册。
可选的, 定时向所述 Webserver进行注册, 包括:
所述客户端定时向所述 Webserver发送注册请求, 请求所述 Webserver 在接收到所述注册请求后, 将用户的注册时间修改为当前的系统时间。
可选的, 所述客户端定时向所述 Webserver发送注册请求, 请求所述 Webserver在接收到所述注册请求后, 将用户的注册时间修改为当前的系统 时间, 包括:
所述客户端向所述 Webserver发送的注册请求为 Update— time函数调用请 求,使所述 Webserver接收到注册请求后,调用 Update— time函数将用户的注 册时间 ^ί'爹改为当前的系统时间。
可选的, 所述判断是否登录到所述 Webserver, 包括:
所述客户 端从所述 Webserver 获取服务器端的随机账号 (Server— random— id)和服务器端的登录状态 (Server— login— status) ,在判断本地保 存的客户端的随机账号 (Client— random— id)与所述 Server— random— id相同, 并 且, 所述 Server— login— status表示登录成功时, 所述客户端确定成功登录到所 述 Webserver;
所述客户端在判断所述 Server— login— status表示密码错误时, 则确定未成 功登录到所述 Webserver, 提示用户密码错误;
所述客户端在判断所述 Server— login— status表示已有其他用户在线时, 则 确定未成功登录到所述 Webserver, 提示用户其他用户在线中。
一种客户端, 包括: 登录发起单元、 登录判断单元和定时注册单元, 其 中:
所述登录发起单元设置为向网站服务器 (Webserver)发起登录;
所述登录判断单元设置为判断是否登录到所述 Webserver;
所述定时注册单元设置为在所述登录判断单元判断成功登录到所述 Webserver后, 启动一定时器, 定时向所述 Webserver进行注册。
可选的, , 所述定时注册单元是设置为向所述 Webserver发送注册请求, 请求所述 Webserver在接收到所述注册请求后, 将用户的注册时间修改为当 前的系统时间。
可选的, 所述登录判断单元是设置为从所述 Webserver获取服务器端的 随机账号 (Server— random— id)和服务器端的登录状态 (Server— login— status),在判 断本地保存的客户端的随机账号 (Client— random— id)与所述 Server— random— id 相同, 并且, 所述 Server— login— status表示登录成功时, 确定成功登录到所述 Webserver; 在判断所述 Server— login— status表示密码错误时, 则确定未成功 登录到所述 Webserver, 提示用户密码错误; 在判断所述 Server— login— status 表示已有其他用户在线时, 则确定未成功登录到所述 Webserver, 提示用户 其他用户在线中。
一种网站服务器, 包括: 接收单元、 判断单元和登录控制单元, 其中: 所述接收单元设置为接收已登录的第一客户端的定时注册;
所述判断单元设置为在第二客户端发起登录时, 判断当前的系统时间与 最近一次接收到注册的时间的差值是否大于或等于预先配置的丟失时间
(lost— time);
所述登录控制单元设置为在所述判断单元判断当前的系统时间与最近一 次接收到注册的时间的差值大于或等于预先配置的 lost— time时, 对第二客户 端进行验证; 在所述判断单元判断当前的系统时间与最近一次接收到注册的 时间的差值小于预先配置的丟失时间时, 确定有客户端在线, 拒绝第二客户 端。
可选的, 所述登录控制单元是设置为在所述第二客户端通过验证后, 设 置服务器端的登录状态 (Server— login— status)为登录成功;设置服务器端的随机 账号 (Server— random— id)为所述第二客户端发起登录时发送的客户端的随机账 号 (Client— random— id); 并将用户的注册时间修改为当前的系统时间。
一种网站服务器, 包括: 接收单元、 判断单元和客户端退出确定单元, 其中:
所述接收单元设置为接收已登录客户端的定时注册;
所述判断单元设置为判断当前的系统时间与最近一次接收到注册的时间 的差值是否大于或等于预先配置的丟失时间 (lost— time);
所述客户端退出确定单元设置为在所述判断单元判断当前的系统时间与 最近一次接收到注册的时间的差值大于或等于预先配置的 lost— time时, 确定 所述客户端异常退出。
综上所述, 上述方案在用户登录后, 通过在客户端生成定时器, 定时向 Webserver进行注册的方法, 使 Webserver能够实时检测到客户端的登录情 况, 从而为互斥操作的实现提供了很好的基础, 提高了用户体验度。 附图概述
图 1为本发明实施方式的登录网站服务器的方法的流程图;
图 2为本发明实施方式的检测客户端异常退出的方法的流程图; 图 3为本发明实施方式的控制客户端登录的方法的流程图;
图 4为本发明实施方式的客户端的架构图;
图 5为本发明实施方式的 Webserver的架构图;
图 6为本发明实施方式的另一种 Webserver的架构图。 本发明的较佳实施方式
本实施方式中客户端在登录到 Webserver后, 生成一个定时器, 定时向 Webserver注册,如果客户端异常退出,则停止向 Webserver注册, Webserver 在当前的系统时间与最近一次接收到注册的时间的差值超过预先配置的丟失 时间时, 则确定客户端已经退出。
如图 1所示, 本实施方式中的客户端登录网站服务器的方法, 包括: 步骤 101 : 当用户第一次打开 Web GUI页面, 进入登录主界面时, 客户 端为用户生成一个随机账号 ( Client— random— id ) , 并保存在客户端 (保存于 cookie中) , 同时会将 Client— login— status置为 N, 表示用户尚未经过鉴权; 这部分功能主要由 JavaScript结合 Cookie来实现, 代码的大致流程如下
(程序清单.1):
Client— random— id =获取 cookie文件中 Client— random— id 的值;
Client— login— status =获取 cookie文件中 Client— login— status的值; if(Client— random— id为空)
{//则说明用户尚未登陆, 是第一次打开该页面
Client— random— id = 为用户随机生成一个账号;
将新生成的随机账号- Client— random— id , 保存在 Cookie 文件中的 Client— random— id项中;
设置 Cookie文件中的 Client— login— status项为 N; //表示用户尚未登陆
步骤 102: 用户输入账号和密码, 客户端向 Webserver发起登录;
步骤 103: 客户端判断登录是否成功, 如果登录成功, 则执行步骤 104; 否则, 结束;
客户端通过从 Webserver获取服务器端的随机账号 (Server— random— id)和 服务器端的登录状态 (Server— login— status),在判断本地保存的客户端的随机账 号 (Client— random— id)与 Server— random— id相同, 并且, Server— login— status表 示登录成功时, 确定成功登录到 Webserver; 在判断 Server— login— status表示 密码错误时, 则确定未成功登录到 Webserver, 提示用户密码错误; 在判断 Server— login— status 表示已有其他用户在线时, 则确定未成功登录到 Webserver, 提示用户其他用户在线中。
这部分功能主要在客户端由 JavaScript结合 Cookie来实现如下 (程序清 单.3 ) :
Client— random— id =获取 cookie文件中 Client— random— id 的值;
Server— random— id = 从月良务器端获取 Server— random— id;
Server— login— status = 从月良务器端获取 Server— login— status;
If((Client— random— id = = Server— random— id) && (Server— login— status= =
Y)) 开启定时器, 定时向 Webserver注册;
将 Cookie文件中的 Client— login— status项设为 Y;
打开登陆后的相关功能选项;
Else if(Server— login— status == password— error) 提示用户密码错误;
}
Else if (Server— login— status == some— one— has— been— login) 提示其他用户正在登录中, 请稍后再试;
Else 异常情况, 取消用户的管理员权限;
步骤 104: 客户端开启定时器, 执行定时向 Webserver注册的功能。 定时向 Webserver注册的功能实现:
客户端开启定时器, 定时向服务器发送注册请求, 请求 Webserver在接 收到注册请求后, 将用户的注册时间修改为当前的系统时间。 注册请求可以 釆用 update— time函数 (GoForm类函数)调用请求,使 Webserver接收到注册请 求后, 调用 Update— time函数将用户的注册时间修改为当前的系统时间。
当服务器端收到注册请求( update— time函数)后, 执行该函数。
Update— time函数的实现如下:
Update— time = now。
如图 2所示, 本实施方式的控制客户端登录的方法, 包括:
步骤 201 : Webserver接收客户端发起的登录;
步骤 202: Webserver判断当前的系统时间与最近一次接收到注册的时间 的差值是否大于或等于预先配置的丟失时间(lost— time ) , 如果是, 则执行步 骤 203; 否则, 确定有客户端在线, 拒绝发起登录的客户端;
步骤 203: 对客户端进行验证, 在验证成功后, 设置服务器端的随机账 号 (Server— random— id)为发起登录的客户端发起登录时发送的客户端的随机账 号 (Client— random— id), 并置服务器端的登录状态 ( Server— login— status )为 Y, 表示登录成功, 并将用户的注册时间修改为当前的系统时间;
上述功能主要在嵌入式设备服务器端的 Webserver中实现如下 (程序清 单.2 ) :
当用户输入账号、 密码, 并点击确定按钮后, 相关数据会以 Http包的形 式发送到 Webserver中, Webserver解析 Http包, 将其中的信息提取出来。
Client— Password =提取 htt 包中的密码;
Server— Password =读取嵌入式设备中保存的密码;
Client— random— id =提取 htt 包中的随机账号;
If((now - update time) >= lost_time)〃如果在 lost time时间内没有客户端 向 Webserver注册, 则允许该用户登陆
If(Client— Password == Server— Password)
{
Server— login— status = Y;
Server— random— id = Client— random— id;
Update time = now; Else
Server— login— status = password— error;
Else
Server— login— status = some— one— has— been— login;
步骤 204: 当有新用户 B登录时, Webserver检测到 now - update— time < lost time , 表示用户 A在 lost— time时间内进行了注册, 用户 A为在线状态, 此时 Webserver拒绝用户 B的登录请求, 提示用户 B用户其它用户正在登录 中;
这部分功能的实现包含在程序清单 .2和程序清单.3中。 在程序清单.2中:
If((now - update— time) >= lost— time)〃如果在 lost— time时间内没有用户向 板侧注册, 则允许该用户登陆
{
进行密码险证;
Else//否则禁止新用户登录 {
Server— login— status = some— one— has— been—login;
} 在程序清单.3中:
If((Client— random— id == Server— random— id) && ( Y == Server— login— status)) 开启定时器, 定时向 Webserver注册;
Else if(password_error == Server— login— status)
提示用户密码错误;
Else if (Server— login— status == some— one— has— been— login)
提示其他用户正在登录中, 请稍后再试;
Else
异常情况, 取消用户的管理员权限;
如图 3所示, 本实施方式的检测客户端异常退出的方法, 包括: 步骤 301 : 当用户 A异常退出 (如网络连接断开、 用户关机、 登录后的 页面被关闭等) , 此时客户端停止向 Webserver注册;
Webserver中用户 A的最后注册时间保持在最近一次接收到注册的时间。 步骤 302: 在有用户发起检测是否有客户端在线的请求时, Webserver 判断当前的系统时间与最近一次接收到注册的时间的差值是否大于或等于预 先配置的丟失时间, 如果是, 则确定之前登录的客户端异常退出, 当前无客 户端在线;
步骤 303: 当有新用户 C登录, Webserver检测到 now-update— time > lost— time, 用户 A已经超时未向 Webserver注册, 表示 A用户已经异常退出, 此时允许新用户 C登录。
这部分功能的实现在代码清单.2中:
If((now - update time) >= lost_time)〃如果在 lost time时间内没有用户向 板侧注册, 则允许该用户登陆 进行密码验证;
}
Else//否则禁止新用户登录
Server— login— status = some— one— has— been— login;
如图 4所示, 本发明实施方式的客户端包括: 登录发起单元、 登录判断 单元和定时注册单元, 其中:
登录发起单元, 设置为向网站服务器 (Webserver)发起登录; 登录判断单元, 设置为判断是否登录到 Webserver;
定时注册单元, 设置为在登录判断单元判断成功登录到 Webserver后, 启动一定时器, 定时向 Webserver进行注册。
定时注册单元, 是设置为向 Webserver发送注册请求, 请求 Webserver 在接收到注册请求后, 将用户的注册时间修改为当前的系统时间。
登录判断单元, 是设置为从 Webserver 获取服务器端的随机账号 (Server— random— id)和服务器端的登录状态 (Server— login— status) ,在判断本地保 存的客户端的随机账号 (Client— random— id)与 Server— random— id相同, 并且, Server— login— status 表示登录成功时, 确定成功登录到 Webserver; 在判断 Server— login— status表示密码错误时, 则确定未成功登录到 Webserver, 提示 用户密码错误; 在判断 Server— login— status表示已有其他用户在线时, 则确定 未成功登录到 Webserver, 提示用户其他用户在线中。
如图 5所示, 本实施方式的 Webserver包括: 接收单元、 判断单元和登 录控制单元, 其中:
接收单元, 设置为接收已登录客户端的定时注册;
判断单元, 设置为在有其他客户端发起登录时, 判断当前的系统时间与 最近一次接收到注册的时间的差值是否大于或等于预先配置的丟失时间 (lost— time);
登录控制单元, 设置为在判断单元判断当前的系统时间与最近一次接收 到注册的时间的差值大于或等于预先配置的 lost— time时, 对发起登录的客户 端进行验证; 否则, 确定有客户端在线, 拒绝发起登录的客户端。
登录控制单元, 是设置为在客户端通过验证后, 设置服务器端的登录状 态(Server— login— status)表示登录成功; 设置服务器端的随机账号 (Server— random— id)为客户端发起登录时发送的客户端的随机账号 (Client— random— id); 并将用户的注册时间修改为当前的系统时间。
如图 6所示, 为本实施方式的另一种 Webserver包括: 接收单元、 判断 单元和客户端退出确定单元, 其中:
接收单元, 设置为接收已登录客户端的定时注册;
判断单元, 设置为判断当前的系统时间与最近一次接收到注册的时间的 差值是否大于或等于预先配置的丟失时间 (lost— time);
客户端退出确定单元, 设置为在所述判断单元判断当前的系统时间与最 近一次接收到注册的时间的差值大于或等于预先配置的 lost— time时, 确定所 述客户端异常退出。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可 以用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布 在多个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程 序代码来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 并 且在某些情况下, 可以以不同于此处的顺序执行所示出或描述的步骤, 或者 将它们分别制作成各个集成电路模块, 或者将它们中的多个模块或步骤制作 成单个集成电路模块来实现。 这样, 本发明不限制于任何特定的硬件和软件 结合。
以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本 领域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和 原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护 范围之内。
工业实用性 本发明的实施方式在用户登录后, 通过在客户端生成定时器, 定时向 Webserver进行注册的方法, 使 Webserver能够实时检测到客户端的登录情 况, 从而为互斥操作的实现提供了很好的基础, 提高了用户体验度。
Claims
1、 一种检测客户端异常退出的方法, 其特征在于, 应用于网站服务器 (Webserver)中, 包括:
Webserver接收已登录客户端的定时注册, 在判断当前的系统时间与最 近一次接收到注册的时间的差值大于或等于预先配置的丟失时间时, 确定所 述客户端异常退出。
2、 一种控制客户端登录的方法, 其特征在于, 应用于网站服务器 (Webserver)中, 包括:
Webserver接收已登录的第一客户端的定时注册, 在第二客户端发起登 录时, 判断当前的系统时间与最近一次接收到注册的时间的差值是否大于或 等于预先配置的丟失时间, 如果是, 则对所述第二客户端进行验证; 如果否, 则确定有客户端在线, 拒绝所述第二客户端。
3、 如权利要求 2所述的方法, 其还包括:
所述 Webserver在所述第二客户端通过验证后, 设置服务器端的登录状 态为登录成功; 设置服务器端的随机账号为所述第二客户端发起登录时发送 的客户端的随机账号; 并将用户的注册时间修改为当前的系统时间。
4、 一种登录网站服务器的方法, 其包括:
客户端向网站服务器 (Webserver)发起登录, 判断是否成功登录到所述 Webserver, 在成功登录到所述 Webserver后, 启动一定时器, 定时向所述 Webserver进行注册。
5、 如权利要求 4所述的方法, 其中, 定时向所述 Webserver进行注册的 步骤包括:
所述客户端定时向所述 Webserver发送注册请求, 请求所述 Webserver 在接收到所述注册请求后, 将用户的注册时间修改为当前的系统时间。
6、 如权利要求 5所述的方法, 其中, 所述客户端定时向所述 Webserver 发送注册请求, 请求所述 Webserver在接收到所述注册请求后, 将用户的注
册时间修改为当前的系统时间的步骤包括:
所述客户端向所述 Webserver发送的注册请求为时间更新函数调用请 求, 使所述 Webserver接收到注册请求后, 调用时间更新函数将用户的注册 时间 ^ί'爹改为当前的系统时间。
7、 如权利要求 4 所述的方法, 其中, 所述判断是否成功登录到所述
Webserver的步骤包括:
所述客户端从所述 Webserver获取服务器端的随机账号和服务器端的登 录状态, 在判断本地保存的客户端的随机账号与所述服务器端的随机账号相 同, 并且, 所述服务器端的登录状态表示登录成功时, 所述客户端确定成功 登录到所述 Webserver;
所述客户端在判断所述服务器端的登录状态表示密码错误时, 则确定未 成功登录到所述 Webserver, 提示用户密码错误;
所述客户端在判断所述服务器端的登录状态表示已有其他用户在线时, 则确定未成功登录到所述 Webserver, 提示用户其他用户在线中。
8、一种客户端,其包括: 登录发起单元、登录判断单元和定时注册单元, 其中:
所述登录发起单元设置为: 向网站服务器 (Webserver)发起登录; 所述登录判断单元设置为: 判断是否成功登录到所述 Webserver;
所述定时注册单元设置为: 在所述登录判断单元判断成功登录到所述 Webserver后, 启动一定时器, 定时向所述 Webserver进行注册。
9、 如权利要求 8所述的客户端, 其中:
所述定时注册单元是设置为: 向所述 Webserver发送注册请求, 请求所 述 Webserver在接收到所述注册请求后, 将用户的注册时间修改为当前的系 统时间。
10、 如权利要求 8所述的客户端, 其中:
所述登录判断单元是设置为: 从所述 Webserver获取服务器端的随机账
号和服务器端的登录状态, 在判断本地保存的客户端的随机账号与所述服务 器端的随机账号相同, 并且, 所述服务器端的登录状态表示登录成功时, 确 定成功登录到所述 Webserver; 在判断所述服务器端的登录状态表示密码错 误时, 则确定未成功登录到所述 Webserver, 提示用户密码错误; 在判断所 述服务器端的登录状态表示已有其他用户在线时, 则确定未成功登录到所述 Webserver, 提示用户其他用户在线中。
11、 一种网站服务器, 其包括: 接收单元、 判断单元和登录控制单元, 其中:
所述接收单元设置为: 接收已登录的第一客户端的定时注册;
所述判断单元设置为: 在第二客户端发起登录时, 判断当前的系统时间 与最近一次接收到注册的时间的差值是否大于或等于预先配置的丟失时间; 所述登录控制单元设置为: 在所述判断单元判断当前的系统时间与最近 一次接收到注册的时间的差值大于或等于预先配置的丟失时间时, 对所述第 二客户端进行验证; 在所述判断单元判断当前的系统时间与最近一次接收到 注册的时间的差值小于预先配置的丟失时间时, 确定有客户端在线, 拒绝所 述第二客户端。
12、 如权利要求 11所述的网站服务器, 其中:
所述登录控制单元是设置为: 在所述第二客户端通过验证后, 设置服务 器端的登录状态为登录成功; 设置服务器端的随机账号为所述第二客户端发 起登录时发送的客户端的随机账号; 并将用户的注册时间修改为当前的系统 时间。
13、 一种网站服务器, 其包括: 接收单元、 判断单元和客户端退出确定 单元, 其中:
所述接收单元设置为: 接收已登录客户端的定时注册;
所述判断单元设置为: 判断当前的系统时间与最近一次接收到注册的时 间的差值是否大于或等于预先配置的丟失时间;
所述客户端退出确定单元设置为: 在所述判断单元判断当前的系统时间
与最近一次接收到注册的时间的差值大于或等于预先配置的丟失时间时, 确 定所述客户端异常退出。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110406183.3 | 2011-12-08 | ||
CN2011104061833A CN102523134A (zh) | 2011-12-08 | 2011-12-08 | 一种检测客户端异常退出的方法及网站服务器 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2013082887A1 true WO2013082887A1 (zh) | 2013-06-13 |
Family
ID=46293933
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2012/071332 WO2013082887A1 (zh) | 2011-12-08 | 2012-02-20 | 一种检测客户端异常退出的方法及网站服务器 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN102523134A (zh) |
WO (1) | WO2013082887A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103731413B (zh) * | 2013-11-18 | 2017-08-04 | 广州多益网络科技有限公司 | 一种处理异常登录的方法 |
CN107196949A (zh) * | 2017-06-12 | 2017-09-22 | 环球智达科技(北京)有限公司 | 限制同一用户账号登录终端数量的系统 |
CN114547569A (zh) * | 2022-02-11 | 2022-05-27 | 支付宝(杭州)信息技术有限公司 | 账户登录处理方法及装置 |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1866850A (zh) * | 2005-05-18 | 2006-11-22 | 中兴通讯股份有限公司 | 一种h.323网守实现h.323终端及时注册的方法 |
CN101043388A (zh) * | 2007-03-27 | 2007-09-26 | 杭州华为三康技术有限公司 | 检测Web接入用户终端是否在线的方法、设备和系统 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1764119A (zh) * | 2004-10-21 | 2006-04-26 | 华为技术有限公司 | 无线广播多播业务计时计费的实现方法 |
CN100362808C (zh) * | 2005-07-01 | 2008-01-16 | 华为技术有限公司 | 一种实现lmt系统和omc系统操作互斥的方法 |
CN101119270A (zh) * | 2007-09-14 | 2008-02-06 | 华中科技大学 | 网络边界处理方法 |
CN101267343B (zh) * | 2008-04-25 | 2011-01-05 | 中兴通讯股份有限公司 | 一种多客户端配置服务端网元数据的方法 |
CN102118527A (zh) * | 2009-12-31 | 2011-07-06 | 北京大唐高鸿数据网络技术有限公司 | 一种可穿透私网的VoIP设备管理系统及其方法 |
-
2011
- 2011-12-08 CN CN2011104061833A patent/CN102523134A/zh active Pending
-
2012
- 2012-02-20 WO PCT/CN2012/071332 patent/WO2013082887A1/zh active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1866850A (zh) * | 2005-05-18 | 2006-11-22 | 中兴通讯股份有限公司 | 一种h.323网守实现h.323终端及时注册的方法 |
CN101043388A (zh) * | 2007-03-27 | 2007-09-26 | 杭州华为三康技术有限公司 | 检测Web接入用户终端是否在线的方法、设备和系统 |
Also Published As
Publication number | Publication date |
---|---|
CN102523134A (zh) | 2012-06-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10530763B2 (en) | Late binding authentication | |
EP2078260B1 (en) | Detecting stolen authentication cookie attacks | |
WO2014082555A1 (zh) | 登录方法、装置及开放平台系统 | |
US9118619B2 (en) | Prevention of cross site request forgery attacks by conditional use cookies | |
US9246942B2 (en) | Platform authentication strategy management method and device for trusted connection architecture | |
US9172753B1 (en) | Methods for optimizing HTTP header based authentication and devices thereof | |
WO2006025989B1 (en) | Method and apparatus for automatically re-validating multiple clients of an authentication system | |
JP6663937B2 (ja) | 動的なセキュリティーモジュールサーバー装置及びその駆動方法 | |
US10148636B2 (en) | Authentication methods and apparatus | |
CN108965341A (zh) | 登录认证的方法、装置及系统 | |
CN107888592A (zh) | 一种vpn登录认证方法及装置 | |
JP2008181310A (ja) | 認証サーバおよび認証プログラム | |
WO2014153959A1 (zh) | 用于防止跨站点请求伪造的方法、相关装置及系统 | |
WO2017054570A1 (zh) | Portal认证方法及认证服务器 | |
WO2014206316A1 (zh) | 业务认证方法和系统 | |
EP2702715B1 (en) | Accessing a communication system | |
KR20200003162A (ko) | 신원 인증 방법 및 장치, 전자 기기 | |
WO2013082887A1 (zh) | 一种检测客户端异常退出的方法及网站服务器 | |
CN110011992B (zh) | 系统登录方法及电子设备 | |
CN112929388A (zh) | 网络身份跨设备应用快速认证方法和系统、用户代理设备 | |
CN107835099B (zh) | 一种信息同步方法及装置 | |
EP3313039A1 (en) | Home gateway, communication management method and communication system thereof | |
CN105978774B (zh) | 一种接入认证的方法和装置 | |
CN114079573B (zh) | 一种路由器访问方法以及路由器 | |
CN107733931B (zh) | 入口认证方法、装置及入口服务器 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 12855756 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 12855756 Country of ref document: EP Kind code of ref document: A1 |