Disclosure of Invention
The embodiment of the application aims to provide a system login method and related equipment thereof, which at least solve the problem that a user needs to repeatedly login a tax system for a plurality of times in the process of using the tax system.
In order to solve the above technical problems, the embodiment of the present application provides a system login method, which adopts the following technical scheme:
The method comprises the steps of obtaining a cookie and an executable login file which are generated after a user logs in a target system, wherein the cookie comprises an account number and a password which are used when the user logs in the target system, starting a robot shell program to call a robot under the condition that a browser which is depended on by the target system is in a pure state, and calling the account number and the password in the cookie to log in the target system through the robot when the timer reaches a timing time and the cookie is valid.
Further, the cookie generated after the user logs in the target system is obtained, and the cookie generated after the user logs in the target system is obtained through the crawling of the web crawler.
Further, the method comprises the steps of writing a login script program, packaging the login script program to obtain an executable login file, and enabling the executable login file to be used for logging in the target system.
Further, the determining that the browser relied on by the target system is in a pure state includes determining that the browser is in a pure state when the driver of the browser is a target driver, and the target driver is used for opening the pure state of the browser.
Further, before the robot shell program is started, the system login method further comprises the step of opening the pure state of the browser under the condition that the browser relied on by the target system is not the pure state.
Further, after the robot is called, the system login method further comprises the step of displaying prompt information when the cookie fails so as to prompt a user to input an account password to login the target system.
Further, the system login method further comprises the steps of obtaining a cookie state corresponding to the cookie in the database, wherein the cookie state is valid or invalid, determining that the cookie is valid when the cookie state is valid, and determining that the cookie is invalid when the cookie state is invalid.
In order to solve the technical problems, the embodiment of the application also provides a system login device, which adopts the following technical scheme:
The system comprises an acquisition module, a starting module and a processing module, wherein the acquisition module is used for acquiring a cookie and an executable login file which are generated after a user logs in a target system, the cookie comprises an account number and a password which are used when the user logs in the target system, the starting module is used for starting a robot shell program and calling a robot under the condition that the browser which is depended on by the target system is in a pure state, and the processing module is used for calling the account number and the password in the cookie to log in the target system through the robot when the timer reaches a timing time and the cookie is effective, so that the login state of the target system is maintained.
Further, the acquisition module comprises an acquisition sub-module, wherein the acquisition sub-module is used for crawling cookies generated after a user logs in a target system through a web crawler.
The acquisition module further comprises a compiling sub-module and a packaging sub-module, wherein the compiling sub-module is used for compiling a login script program, the packaging sub-module is used for packaging the login script program to obtain an executable login file, and the executable login file is used for logging in the target system.
Further, the starting module comprises a determining submodule, wherein the determining submodule is used for determining that the browser is in a pure state when the driver of the browser is a target driver, and the target driver is used for opening the pure state of the browser.
Further, the starting module is further configured to open the pure state of the browser under the condition that it is determined that the browser on which the target system depends is not in the pure state.
The system login device further comprises a prompt module, wherein the prompt module is used for displaying prompt information when the cookie fails so as to prompt a user to input an account password to login the target system.
Further, the system login device further comprises a determining module, the acquiring module is further used for acquiring a cookie state corresponding to the cookie in the database, the cookie state is valid or invalid, the determining module is used for determining that the cookie is valid when the cookie state is valid, and determining that the cookie is invalid when the cookie state is invalid.
In order to solve the above technical problem, the embodiment of the present application further provides a computer device, where the computer device includes a memory and a processor, and the memory stores a computer program, and the processor implements the steps of the system login method when executing the computer program.
In order to solve the above technical problem, an embodiment of the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor implements the steps of the system login method as described above.
Compared with the prior art, the method and the device have the advantages that cookies and executable login files generated after a user logs in a target system are obtained, a robot shell program is started to call a robot under the condition that the browser relied on by the target system is in a pure state, and when the timer reaches timing time and the cookies are effective, the executable login files are executed through the robot to call an account number and a password in the cookies to log in the target system so as to maintain the login state of the target system. Therefore, in the effective time of the cookie, the robot can be mobilized by the timer to automatically log in the target system according to the account number and the password in the cookie, the problem that a user needs to repeatedly log in the tax system for many times in the process of using the tax system or perform secondary password verification is avoided, and the user experience is improved.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs, the terms used in the description herein are used for the purpose of describing particular embodiments only and are not intended to limit the application, and the terms "comprising" and "having" and any variations thereof in the description of the application and the claims and the above description of the drawings are intended to cover non-exclusive inclusions. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to make the person skilled in the art better understand the solution of the present application, the technical solution of the embodiment of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture ExpertsGroup Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving PictureExperts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the system login method provided by the embodiment of the present application is generally executed by the terminal device, and accordingly, the system login device is generally disposed in the terminal device.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow chart of one embodiment of a system login method according to the present application is shown. The system login method comprises the following steps:
Step S21, a cookie and an executable login file generated after the user logs in the target system are obtained.
The cookie comprises an account number and a password which are used when a user logs in a target system. The target system is a system which requires the user to repeat for a plurality of times in the using process or to carry out secondary password verification, such as a tax system.
Specifically, when a user successfully logs in a target system, a corresponding cookie is generated in the terminal equipment, and then the data is crawled in the terminal equipment through a web crawler to obtain the cookie generated after the user logs in the target system.
In the embodiment, the web crawler is used for crawling cookies generated after the user logs in the target system, so that a login account and a password are provided for subsequent maintenance of the login state of the user in the target system, the problem that the user needs to repeatedly login the tax system for many times or perform secondary password verification in the process of using the tax system is avoided, and user experience is improved.
Thereafter, an executable login file is obtained. Wherein the executable login file is used for logging in the target system.
Specifically, writing a login script program, and packaging the login script program to obtain an executable login file. For example, based on Selenium, uipath, etc., a login script program is written and packaged to obtain an executable login file.
In this embodiment, a login script program is written and packaged to obtain an executable login file, so that a subsequent robot can execute the executable login file conveniently to maintain the login state of a user in a target system, the problem that the user needs to repeatedly login the tax system for many times or perform secondary password verification in the process of using the tax system is avoided, and user experience is improved.
Step S22, under the condition that the browser relied on by the target system is in a pure state, starting a robot shell program and calling the robot.
Specifically, under the condition that the driving of the browser is the target driving, the pure state of the browser is determined, and the target driving is used for opening the pure state of the browser. For example, the target drive may be Webdriver.
In this embodiment, when it is determined that the browser is in a pure state, the robot is invoked to maintain the login state of the target system, so that the user can continue to maintain the login state of the target system under the condition that the user account is safe.
In some alternative implementations of the present embodiment, the system login method further includes, prior to launching the robot shell, opening a pure state of the browser if it is determined that the browser on which the target system depends is not in the pure state. Specifically, if the driver of the browser is not the target driver, and if the browser is determined not to be in a pure state, the pure state of the browser is opened.
In this embodiment, when it is determined that the browser on which the target system depends is not in a pure state, the pure state of the browser is opened, so that it can be ensured that the login state of the user in the target system is continuously maintained under the condition that the user account is safe.
Thereafter, a robot shell program is started to invoke the robot. Wherein the robot is a robot capable of automatically executing an executable file, such as an RPA robot.
Specifically, under the condition that the browser on which the target system depends is determined to be in a pure state, a robot shell program is started to call a corresponding script service on a server where the robot is located, so that the robot is called.
Step S23, when the timer reaches the timing time and the cookie is valid, the robot executes the executable login file to call the account number and the password in the cookie to login the target system so as to maintain the login state of the target system.
In some optional implementations of this embodiment, a cookie state corresponding to a cookie in the database is obtained, and when the cookie state is valid, the cookie is determined to be valid, and when the cookie state is invalid, the cookie is determined to be invalid. Wherein the cookie status is valid or invalid.
In this embodiment, the validity of the cookie is determined according to the cookie state corresponding to the cookie in the database, so that the problem that the robot still uses the cookie to maintain the user in the login state of the target system when the cookie fails is avoided.
In some optional implementations of this embodiment, when the cookie fails, a prompt is displayed to prompt the user to enter an account password to log into the target system.
In this embodiment, when the cookie is invalid, the user is reminded to log in the target system again, so that the robot can still use the cookie to maintain the possible error condition of the user in the login state of the target system when the cookie is invalid.
And then, when the timer reaches the timing time and the cookie is effective, executing the executable login file by the robot, and calling an account number and a password in the cookie to log in the target system so as to maintain the login state of the target system.
In the embodiment, a cookie and an executable login file generated after a user logs in a target system are acquired, a robot shell program is started to call a robot under the condition that a browser on which the target system depends is determined to be in a pure state, and when the timer reaches a timing time and the cookie is effective, the executable login file is executed through the robot to call an account number and a password in the cookie to log in the target system so as to maintain the login state of the target system. Therefore, in the effective time of the cookie, the robot can be mobilized by the timer to automatically log in the target system according to the account number and the password in the cookie, the problem that a user needs to repeatedly log in the tax system for many times in the process of using the tax system or perform secondary password verification is avoided, and the user experience is improved.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored in a computer-readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a system login device, where the embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device may be applied to various electronic devices.
As shown in fig. 3, the system login device 30 in this embodiment includes an acquisition module 31, a start module 32, and a processing module 33. Wherein:
the system comprises an acquisition module 31 for acquiring a cookie and an executable login file generated after a user logs in a target system, wherein the cookie comprises an account number and a password used when the user logs in the target system, a starting module 32 for starting a robot shell program and calling a robot under the condition that the browser on which the target system depends is determined to be in a pure state, and a processing module 33 for calling the account number and the password in the cookie to log in the target system through the robot when the timer reaches a timing time and the cookie is valid, so as to maintain the login state of the target system.
In the embodiment, a cookie and an executable login file generated after a user logs in a target system are acquired, a robot shell program is started to call a robot under the condition that a browser on which the target system depends is determined to be in a pure state, and when the timer reaches a timing time and the cookie is effective, the executable login file is executed through the robot to call an account number and a password in the cookie to log in the target system so as to maintain the login state of the target system. Therefore, in the effective time of the cookie, the robot can be mobilized by the timer to automatically log in the target system according to the account number and the password in the cookie, the problem that a user needs to repeatedly log in the tax system for many times in the process of using the tax system or perform secondary password verification is avoided, and the user experience is improved.
In some optional implementations of this embodiment, the obtaining module 31 includes an obtaining sub-module, where the obtaining sub-module is configured to crawl cookies generated after a user logs into the target system by a web crawler.
In the embodiment, the web crawler is used for crawling cookies generated after the user logs in the target system, so that a login account and a password are provided for subsequent maintenance of the login state of the user in the target system, the problem that the user needs to repeatedly login the tax system for many times or perform secondary password verification in the process of using the tax system is avoided, and user experience is improved.
In some optional implementations of this embodiment, the obtaining module 31 further includes a writing sub-module and an encapsulation sub-module, where the writing sub-module is configured to write a login script program, and the encapsulation sub-module is configured to encapsulate the login script program to obtain an executable login file, where the executable login file is configured to log in the target system.
In this embodiment, a login script program is written and packaged to obtain an executable login file, so that a subsequent robot can execute the executable login file conveniently to maintain the login state of a user in a target system, the problem that the user needs to repeatedly login the tax system for many times or perform secondary password verification in the process of using the tax system is avoided, and user experience is improved.
In some optional implementations of this embodiment, the starting module 32 includes a determining submodule, where the determining submodule is configured to determine that the browser is in a pure state if the driver of the browser is a target driver, and where the target driver is configured to open the pure state of the browser.
In this embodiment, when it is determined that the browser is in a pure state, the robot is invoked to maintain the login state of the target system, so that the user can continue to maintain the login state of the target system under the condition that the user account is safe.
In some optional implementations of this embodiment, the starting module 32 is further configured to open the pure state of the browser when it is determined that the browser on which the target system depends is not in the pure state.
In this embodiment, when it is determined that the browser on which the target system depends is not in a pure state, the pure state of the browser is opened, so that it can be ensured that the login state of the user in the target system is continuously maintained under the condition that the user account is safe.
With further reference to fig. 4, in some optional implementations of the present embodiment, the system login device further includes a prompt module 34, where the prompt module 34 is configured to display prompt information to prompt a user to input an account password to login to the target system when the cookie fails.
In this embodiment, when the cookie is invalid, the user is reminded to log in the target system again, so that the robot can still use the cookie to maintain the possible error condition of the user in the login state of the target system when the cookie is invalid.
With further reference to fig. 5, in some optional implementations of the present embodiment, the system login device further includes a determining module 35, where the obtaining module 31 is further configured to obtain a cookie state corresponding to the cookie in the database, where the cookie state is valid or invalid, where the determining module 35 is configured to determine that the cookie is valid when the cookie state is valid, and determine that the cookie is invalid when the cookie state is invalid.
In this embodiment, the validity of the cookie is determined according to the cookie state corresponding to the cookie in the database, so that the problem that the robot still uses the cookie to maintain the user in the login state of the target system when the cookie fails is avoided.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 6, fig. 6 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only computer device 6 having components 61-63 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an Application SPECIFIC INTEGRATED Circuit (ASIC), a Programmable gate array (Field-Programmable GATE ARRAY, FPGA), a digital Processor (DIGITAL SIGNAL Processor, DSP), an embedded device, and the like.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 61 includes at least one type of readable storage media including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal memory unit of the computer device 6 and an external memory device. In this embodiment, the memory 61 is typically used for storing an operating system and various application software installed on the computer device 6, such as program codes of a system login method, and the like. Further, the memory 61 may be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute the program code stored in the memory 61 or process data, such as the program code for executing the system login method.
The network interface 63 may comprise a wireless network interface or a wired network interface, which network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
In the embodiment, a cookie and an executable login file generated after a user logs in a target system are acquired, a robot shell program is started to call a robot under the condition that a browser on which the target system depends is determined to be in a pure state, and when the timer reaches a timing time and the cookie is effective, the executable login file is executed through the robot to call an account number and a password in the cookie to log in the target system so as to maintain the login state of the target system. Therefore, in the effective time of the cookie, the robot can be mobilized by the timer to automatically log in the target system according to the account number and the password in the cookie, the problem that a user needs to repeatedly log in the tax system for many times in the process of using the tax system or perform secondary password verification is avoided, and the user experience is improved.
The present application also provides another embodiment, namely, a computer readable storage medium storing a system login program, where the system login program is executable by at least one processor, so that the at least one processor performs the steps of the system login method as described above.
In the embodiment, a cookie and an executable login file generated after a user logs in a target system are acquired, a robot shell program is started to call a robot under the condition that a browser on which the target system depends is determined to be in a pure state, and when the timer reaches a timing time and the cookie is effective, the executable login file is executed through the robot to call an account number and a password in the cookie to log in the target system so as to maintain the login state of the target system. Therefore, in the effective time of the cookie, the robot can be mobilized by the timer to automatically log in the target system according to the account number and the password in the cookie, the problem that a user needs to repeatedly log in the tax system for many times in the process of using the tax system or perform secondary password verification is avoided, and the user experience is improved.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
It is apparent that the above-described embodiments are only some embodiments of the present application, but not all embodiments, and the preferred embodiments of the present application are shown in the drawings, which do not limit the scope of the patent claims. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.