CN116915838B - State maintenance method for virtual private network, terminal equipment and storage medium - Google Patents
State maintenance method for virtual private network, terminal equipment and storage medium Download PDFInfo
- Publication number
- CN116915838B CN116915838B CN202311186557.4A CN202311186557A CN116915838B CN 116915838 B CN116915838 B CN 116915838B CN 202311186557 A CN202311186557 A CN 202311186557A CN 116915838 B CN116915838 B CN 116915838B
- Authority
- CN
- China
- Prior art keywords
- private network
- virtual private
- detected
- page
- login
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 64
- 238000012423 maintenance Methods 0.000 title claims abstract description 21
- 230000004044 response Effects 0.000 claims abstract description 72
- 230000009471 action Effects 0.000 claims abstract description 68
- 238000012544 monitoring process Methods 0.000 claims abstract description 35
- 238000004891 communication Methods 0.000 claims abstract description 23
- 230000008569 process Effects 0.000 claims description 12
- 230000009191 jumping Effects 0.000 claims description 9
- 238000012360 testing method Methods 0.000 claims description 6
- 230000002159 abnormal effect Effects 0.000 abstract description 16
- 238000012545 processing Methods 0.000 abstract description 3
- 230000000875 corresponding effect Effects 0.000 description 80
- 230000001960 triggered effect Effects 0.000 description 12
- 230000001276 controlling effect Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 230000005856 abnormality Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000012550 audit Methods 0.000 description 2
- 230000002596 correlated effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012954 risk control Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
- H04L12/4641—Virtual LANs, VLANs, e.g. virtual private networks [VPN]
-
- 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/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Environmental & Geological Engineering (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a state maintenance method, terminal equipment and storage medium of a virtual private network, belonging to the technical field of data processing, wherein the state maintenance method of the virtual private network comprises the following steps: when triggering a virtual private network state monitoring process, sending a first loading request of a first page based on a virtual private network to be detected, and receiving first response information corresponding to the first loading request; and executing the login action corresponding to the virtual private network to be detected when the first response information does not contain the first expected value. By automatically monitoring the connection state of the virtual private network to be detected in real time, when abnormal connection of the virtual private network to be detected is detected, the login action corresponding to the virtual private network to be detected is automatically executed, so that the quick reconnection of the virtual private network to be detected is realized, and the normal communication between the terminal server and the target server is ensured.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a state maintenance method, a terminal device, and a storage medium for a virtual private network.
Background
Virtual private networks (VPN, virtual Private Network) are an encrypted communication technology that establishes a secure connection between a user and a target network via a public network, such as the internet.
In the related art, projects are generally continuously integrated and deployed in different cloud server environments, for example, project codes are packaged in an a-cloud server and then transmitted to a B-cloud server through a virtual private network connection to deploy the packaged project codes. However, when the connection of the virtual private network is interrupted, the user cannot deploy the project code to the B cloud server, and the user is required to check the reason of the deployment failure one by one at the time, so that the connection interruption of the virtual private network cannot be quickly determined, and reconnection of the virtual private network can be performed.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The embodiment of the invention aims to solve the technical problem that reconnection of a virtual private network cannot be quickly performed by providing a state maintenance method, terminal equipment and a computer readable storage medium of the virtual private network.
To achieve the above object, an embodiment of the present invention provides a method for maintaining a state of a virtual private network, the method for maintaining a state of a virtual private network including:
when triggering a virtual private network state monitoring process, sending a first loading request of a first page based on a virtual private network to be detected, and receiving first response information corresponding to the first loading request;
and executing the login action corresponding to the virtual private network to be detected when the first response information does not contain the first expected value.
Optionally, after the step of sending the first loading request of the first page based on the virtual private network to be detected and receiving the first response information corresponding to the first loading request when the virtual private network state monitoring process is triggered, the method further includes:
when the first response information does not contain a first expected value, sending a second loading request of a second page based on the virtual private network to be detected;
receiving second response information corresponding to the second loading request;
and executing the login action corresponding to the virtual private network to be detected when the second response information does not contain the second expected value.
Optionally, after the step of receiving the second response information corresponding to the second loading request, the method further includes:
when the second response information does not contain the second expected value, performing the steps of:
updating the second page, and jumping to execute the second loading request of the second page sent based on the virtual private network to be detected; or,
and outputting the monitoring result of the virtual private network to be detected.
Optionally, after the step of receiving the second response information corresponding to the second loading request, the method further includes:
when the second response information does not contain the second expected value, determining whether the second page corresponding to the current state is a final page or not;
if yes, executing the step of outputting the monitoring result of the virtual private network to be detected;
and if not, executing the step of updating the second page and jumping to execute the step of sending a second loading request of the second page based on the virtual private network to be detected.
Optionally, the step of executing the login action corresponding to the virtual private network to be detected when the first response information does not include the first expected value includes:
starting a virtual special network connection tool, and positioning and executing a login control corresponding to the login action based on the virtual special network connection tool;
and controlling the login control to execute the login action corresponding to the virtual private network to be detected.
Optionally, the step of starting a virtual private network connection tool and positioning and executing a login control corresponding to the login action based on the virtual private network connection tool includes:
acquiring a main window handle of an application program associated with the login action, wherein the application program is used for logging in the virtual private network to be detected;
acquiring control attribute information corresponding to the application program based on the main window handle;
and matching the control attribute information with preset target control attribute information, and positioning a login control corresponding to the login action executed in the application program.
Optionally, after the step of controlling the login control to execute the login action corresponding to the virtual private network to be detected, the method includes:
if the login operation of the preset times is failed, obtaining the connection information of the standby virtual private network;
updating the connection information to the terminal server and the application program, executing the starting virtual special network connection tool, and positioning and executing a login control corresponding to the login action based on the virtual special network connection tool.
Optionally, before the step of starting the virtual private network connection tool and positioning and executing the login control corresponding to the login action based on the virtual private network connection tool, the method includes:
and closing the working process corresponding to the virtual private network connection tool.
In addition, in order to achieve the above object, the present invention further provides a terminal device, including: the method comprises the steps of a memory, a processor and a state maintenance program of a virtual private network, wherein the state maintenance program of the virtual private network is stored in the memory and can run on the processor, and the state maintenance program of the virtual private network is executed by the processor to realize the state maintenance method of the virtual private network.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a state maintenance program of a virtual private network, which when executed by a processor, implements the steps of the state maintenance method of a virtual private network as described above.
In the state maintenance method of the virtual private network provided by the embodiment of the invention, when the state monitoring process of the virtual private network is triggered, the terminal equipment and the computer readable storage medium send a first loading request of a first page based on the virtual private network to be detected, receive first response information corresponding to the first loading request, and execute the login action corresponding to the virtual private network to be detected when the first response information does not contain a first expected value. According to the method and the device, the connection state of the virtual private network to be detected is automatically monitored in real time, when the abnormal connection of the virtual private network to be detected is detected, the login action corresponding to the virtual private network to be detected is automatically executed, and the quick reconnection of the virtual private network to be detected is realized, so that the normal communication between the terminal server and the target server is ensured.
Drawings
FIG. 1 is a flow chart illustrating an embodiment of a method for maintaining a state of a VPN according to the present invention;
fig. 2 is a schematic diagram of a refinement flow of step S10 in a second embodiment of a state maintenance method of a virtual private network according to the present invention;
fig. 3 is a detailed flowchart of step S20 in a third embodiment of the state maintenance method of the virtual private network according to the present invention;
FIG. 4 is a state maintenance flow diagram of a virtual private network in accordance with the present invention;
FIG. 5 is another detailed flowchart of step S20 in a fourth embodiment of the state maintenance method of the VPN of the present invention;
fig. 6 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Since in the related art, projects are typically continuously integrated and deployed in different cloud server environments, for example, project codes are packaged at an a-cloud server and then transmitted to a B-cloud server through a virtual private network connection to deploy the packaged project codes. However, when the connection of the virtual private network is interrupted, the user cannot deploy the project code to the B cloud server, and the user is required to check the reasons of the deployment failure one by one at the time, so that the technical problem that the connection of the virtual private network cannot be quickly determined as the interruption of the connection of the virtual private network and the reconnection of the virtual private network is performed is caused.
In order to solve the above-mentioned drawbacks of the related art, the present invention provides a method for maintaining a state of a virtual private network, which mainly comprises the following steps:
when the state monitoring process of the virtual private network is triggered, a first loading request of a first page is sent based on the virtual private network to be detected, first response information corresponding to the first loading request is received, and when the first response information does not contain a first expected value, login action corresponding to the virtual private network to be detected is executed. According to the method and the device, the connection state of the virtual private network to be detected is automatically monitored in real time, when the abnormal connection of the virtual private network to be detected is detected, the login action corresponding to the virtual private network to be detected is automatically executed, and the quick reconnection of the virtual private network to be detected is realized, so that the normal communication between the terminal server and the target server is ensured.
In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Referring to fig. 1, in an embodiment of a state maintenance method of a virtual private network according to the present invention, the state maintenance method of a virtual private network includes the steps of:
step S10: when triggering a virtual private network state monitoring process, sending a first loading request of a first page based on a virtual private network to be detected, and receiving first response information corresponding to the first loading request;
in this embodiment, the execution body is a terminal server. The terminal server may be a mobile phone, a computer, a tablet computer, or a server, which is not particularly limited in this embodiment. And the terminal server establishes a secure communication connection with the target server through the virtual private network to be detected. When the terminal server establishes the secure communication connection with the target server, the state monitoring process of the virtual private network is automatically triggered, and the connection state of the virtual private network to be detected is monitored in real time. The first page is preset as a page which is accessible through the virtual private network and is used for detecting the connection state of the virtual private network. When the first page is successfully accessed, the invention returns the first response information containing the first expected value. The first expected value may be a character string with obvious characteristics and unchanged character, or may be other expected values used for representing that the first page is successfully accessed, which is not particularly limited in this embodiment.
It should be noted that the present invention may be specifically developed to monitor the first page of the connection status of the virtual private network to be detected. The first page may be a page that is stable for a long period of time and is used for providing services in daily work, so that the monitoring cost is reduced, and the embodiment is not limited in detail.
For example, take "welcome login-XXX audit and risk control system" or "welcome access XXX work platform" as the first expected value, and then when the first page is successfully accessed, the returned first response information contains the first expected value of "welcome login-XXX audit and risk control system" or "welcome access XXX work platform".
Alternatively, in another alternative embodiment, the virtual private network state monitoring process may be triggered manually by a user or may be triggered automatically. For example, the virtual private network state monitoring process is automatically triggered when the terminal server establishes a secure communication connection with the target server. Or when the terminal server establishes the secure communication connection with the target server, if the monitoring instruction triggered manually by the user or the monitoring instruction is not received within a preset time interval, the monitoring process of the state of the virtual private network is triggered automatically. If the monitoring instruction triggered manually by the user is received or the monitoring instruction is closed within the preset time interval, the virtual private network state monitoring process is started immediately or closed immediately. The user may send the monitoring instruction or close the monitoring instruction by clicking a corresponding button on the terminal device, which is not particularly limited in this embodiment.
Step S20: and executing the login action corresponding to the virtual private network to be detected when the first response information does not contain the first expected value.
In this embodiment, when the first response information does not include the first expected value, it indicates that the virtual private network connection to be detected is abnormal based on the virtual network to be detected failing to normally access the first page. At the moment, the reconnection of the virtual private network to be detected is realized rapidly by re-executing the login action corresponding to the virtual private network to be detected, so that the normal communication between the terminal server and the target server is prevented from being influenced.
It can be appreciated that when the first response information includes the first expected value, it indicates that the connection of the virtual private network to be detected is normal based on the virtual private network to be detected being able to normally access the first page. At this time, the virtual private network to be detected does not need to be logged in again for reconnection.
Alternatively, a Python request library (Python Requests Library, python request library) may be used to send a first load request of the first page, receive first response information returned by the first page, assign the first response information to a corresponding function variable, and check whether the value of the function variable contains the first expected value. And if the value of the function variable contains a first expected value, indicating that the first page access is normal, and judging that the virtual private network connection to be detected is normal. If the first page is not accessed or the returned first response information does not contain the first expected value, for example, the returned first response information is the corresponding response status code 400, so as to determine that the connection of the virtual private network to be detected is abnormal, and execute the login action corresponding to the virtual private network to be detected.
It will be appreciated that the Python requests library is a third party library that simplifies HTTP requests, provides a compact API interface, makes it easier and more convenient to send HTTP requests and process responses, is capable of sending various types of HTTP requests, such as GET, POST, and supports processing response results.
In the technical scheme provided by the embodiment, when the state monitoring process of the virtual private network is triggered, a first loading request of a first page is sent based on the virtual private network to be detected, first response information corresponding to the first loading request is received, and when the first response information does not contain a first expected value, a login action corresponding to the virtual private network to be detected is executed. According to the method and the device, the connection state of the virtual private network to be detected is automatically monitored in real time, when the abnormal connection of the virtual private network to be detected is detected, the login action corresponding to the virtual private network to be detected is automatically executed, and the quick reconnection of the virtual private network to be detected is realized, so that the normal communication between the terminal server and the target server is ensured.
Referring to fig. 2, in the second embodiment, after the step S10, based on the first embodiment, the method further includes:
step S30: when the first response information does not contain a first expected value, sending a second loading request of a second page based on the virtual private network to be detected;
step S40: receiving second response information corresponding to the second loading request;
in this embodiment, the second page is preset as a page that is accessible through the virtual private network, and is used to detect the connection state of the virtual private network. When the second page is successfully accessed, the invention returns the second response information containing the second expected value. The second expected value may be a character string with obvious characteristics and unchanged character string, or may be other expected values used for representing that the second page is successfully accessed, which is not particularly limited in this embodiment.
It is understood that the first response information and the second response information may be the same or different. Similarly, the first expected value and the second expected value may be the same or different, which is not specifically limited in this embodiment.
Step S50: and executing the login action corresponding to the virtual private network to be detected when the second response information does not contain the second expected value.
In this embodiment, when the first response information does not include the first expected value, it is avoided that the received first response information does not include the first expected value due to occurrence of an abnormality in the first page, so that connection abnormality of the virtual private network to be detected is misjudged, a login action corresponding to the virtual private network to be detected is performed, and communication between the terminal server and the target server is intermittent, so that communication efficiency between the terminal server and the target server is affected. The method and the device for detecting the connection state of the virtual private network set up a plurality of pages for detecting the connection state of the virtual private network, further avoid the occurrence of abnormality for the first page when the first response information does not contain a first expected value, continuously send a second loading request of a second page based on the virtual private network to be detected, judge that the connection of the virtual private network to be detected is abnormal when the second response information corresponding to the second loading request does not contain a second expected value, execute the login action corresponding to the virtual private network to be detected, and realize reconnection of the virtual private network to be detected.
It can be understood that when the second response information includes the second expected value, it indicates that the connection of the to-be-detected virtual private network is correct, and it is not necessary to execute the login action corresponding to the to-be-detected virtual private network.
Optionally, after the step of receiving the second response information corresponding to the second loading request, the method further includes: when the second response information does not contain the second expected value, performing the steps of: updating the second page, and jumping to execute the second loading request for sending the second page based on the to-be-detected virtual private network, or outputting the monitoring result of the to-be-detected virtual private network.
In this embodiment, a plurality of pages for monitoring the connection state of the virtual private network to be detected are preset, so that the accuracy of the connection state of the virtual private network to be detected is improved. Therefore, when the second response information does not include the second expected value, the step of sending the second loading request of the second page based on the virtual private network to be detected may be performed by updating the third page to the second page and jumping. Or directly outputting the monitoring result of the virtual private network to be detected. The monitoring result comprises first response information, second response information and the connection state of the virtual private network to be detected, wherein the connection state comprises normal connection and abnormal connection. And the developer further determines whether the page for detecting the connection state of the virtual private network to be detected is abnormal or the virtual private network to be detected is abnormal by analyzing the first response information, the second response information and the connection state of the virtual private network to be detected, so that the abnormal page is repaired when the page for detecting the connection state of the virtual private network to be detected is abnormal.
Optionally, in another optional implementation manner, when the second response information does not include the second expected value, it is determined whether the currently corresponding second page is a final page, if yes, a step of outputting a monitoring result of the virtual private network to be detected is performed, if no, a step of updating the second page is performed, and a step of jumping to perform a second loading request for sending the second page based on the virtual private network to be detected is performed, which is not limited in this embodiment.
In the technical solution provided in this embodiment, when the state monitoring process of the virtual private network is triggered, a first loading request of a first page is sent based on the virtual private network to be detected, and first response information corresponding to the first loading request is received, when the first response information does not include a first expected value, a second loading request of a second page is sent based on the virtual private network to be detected, second response information corresponding to the second loading request is received, and when the second response information does not include a second expected value, a login action corresponding to the virtual private network to be detected is executed. When the first response information does not contain the first expected value, in order to prevent the first page from being abnormal, the monitored connection state of the to-be-detected virtual private network is inaccurate, a second loading request of a second page is continuously sent based on the to-be-detected virtual private network, when the second response information corresponding to the second loading request also does not contain the second expected value, the situation that the first page is abnormal is eliminated, and the connection state of the to-be-detected virtual private network is determined to be abnormal, so that the login action corresponding to the to-be-detected virtual private network is executed, reconnection is performed, and normal communication between a terminal server and a target server due to the abnormal connection state of the to-be-detected virtual private network is avoided.
Referring to fig. 3, in a third embodiment, based on any of the above embodiments, the step S20 includes:
step S21: starting a virtual special network connection tool, and positioning and executing a login control corresponding to the login action based on the virtual special network connection tool;
in this embodiment, by starting the virtual private network connection tool, the login control corresponding to the login action is located and executed, so that the login control is controlled to execute the login action, and the user does not need to wait for manually executing the login action to reconnect the virtual private network to be detected, so that the quick reconnection of the virtual private network to be detected is realized, and the influence on the normal communication between the terminal server and the target server is avoided.
The login of a virtual private network typically requires the use of a specific application or client to establish a connection. These applications or clients are designed to configure and manage virtual private network connections to ensure secure transmission of data. Typically, a virtual private network service provider will provide its own virtual private network application or client that a user can download and install from an official website or application store and then use to effect login to the virtual private network.
Alternatively, pywinuto library of Python automated test modules may be used as a virtual private network connection tool, which is not particularly limited in this embodiment. It will be appreciated that pywinuto is a powerful Python library used to automate the GUI (Graphical User Interface ) interface for testing Windows applications. The method provides rich functions and methods, and can easily interact and control with the application program, thereby achieving the purposes of automatic test and task execution.
Optionally, the step of starting a virtual private network connection tool and positioning and executing a login control corresponding to the login action based on the virtual private network connection tool includes:
step S211: acquiring a main window handle of an application program associated with the login action, wherein the application program is used for logging in the virtual private network to be detected;
in this embodiment, the application is a specific application or a client for logging in a virtual private network to be detected, which is not particularly limited in this embodiment. The invention stores the application program logged in the virtual private network to be detected and the login action in a correlated way in advance, and further can acquire the main window handle of the application program correlated with the login action based on the virtual private network connection tool after the virtual private network connection tool is started.
It will be appreciated that the application's main window handle is a numeric identifier that is used to uniquely identify and reference the application's main window. In the Windows operating system, each application has a master window handle that can be used to operate and interact with the application. By using the master window handle, interactions with the master window of the application may be performed, for example, simulating user operations in an automated test, or window management in the case of cross-application.
Alternatively, a function such as FindWindow, findWindowEx may be used to obtain a handle for a specified window, which is not specifically limited in this embodiment.
Step S212: acquiring control attribute information corresponding to the application program based on the main window handle;
step S213: and matching the control attribute information with preset target control attribute information, and positioning a login control corresponding to the login action executed in the application program.
In this embodiment, after the main window handle of the application program is obtained, the child controls under the main window are traversed according to the main window handle, so that the handle of each child control is obtained, and control information corresponding to the application program is obtained based on the handles of the child controls. Control attribute information includes, but is not limited to, text content of the control, class name, and location information relative to the screen. And setting the preset target control attribute information by the user based on the attribute information of the login control. Therefore, after the control attribute information corresponding to the application program is obtained, in order to locate the position of the login control, the control attribute information is matched with the preset target control attribute information, and part of control attribute information which is the same as the target control attribute information in the control attribute information corresponding to the application program is determined, so that the position information of the part of control attribute information relative to the screen is obtained, and the login control is located.
Step S22: and controlling the login control to execute the login action corresponding to the virtual private network to be detected.
In this embodiment, by using pywinuto library of the Python automatic test module as the virtual private network connection tool, user operation is simulated, and the login control is controlled to execute the login action of the virtual private network to be detected, without waiting for the user to manually execute the login action, so as to realize quick connection of the virtual private network to be detected. It is understood that the login action may be clicking on a login control. In some embodiments, the login action corresponds to a plurality of controls, and the plurality of controls need to be controlled in turn to complete execution of the login action, which is not particularly limited in this embodiment.
Optionally, referring to fig. 4, fig. 4 is a state maintenance flowchart of the virtual private network according to the present invention.
In another optional embodiment, the step of starting the virtual private network connection tool, based on the virtual private network connection tool, before positioning the login control corresponding to the login action includes: and closing the working process corresponding to the virtual private network connection tool.
In this embodiment, before the virtual private network connection tool is started to perform the login action, the working process corresponding to the virtual private network connection tool is closed first, so as to clear the current virtual private network connection state to be detected and the related session information. Closing the working process corresponding to the virtual private network connection tool can release the connection with the virtual private network server, release the resources related to the working process and the occupied system resources, provide a clean environment and a new connection opportunity for re-login, avoid the occurrence of abnormality during re-connection, reduce the connection efficiency of the virtual private network to be detected, and influence the normal communication between the terminal server and the target server.
In the technical scheme provided by the embodiment, by starting the virtual private network connection tool, positioning a login control corresponding to the login action based on the virtual private network connection tool, and then controlling the login control to execute the login action corresponding to the virtual private network to be detected. Through the virtual private network connection tool, user operation is simulated, the login control is automatically controlled to execute login actions, quick connection of the virtual private network to be detected is achieved, the user does not need to wait for manual operation of the login control to reconnect, and connection efficiency of the virtual private network to be detected is improved.
Referring to fig. 5, in a fourth embodiment, after step S20, based on any of the above embodiments, the method includes:
step S60: if the login operation of the preset times is failed, obtaining the connection information of the standby virtual private network;
step S70: updating the connection information to the terminal server and the application program, executing the starting virtual special network connection tool, and positioning and executing a login control corresponding to the login action based on the virtual special network connection tool.
In this embodiment, the connection information includes a connection address, a connection account number, and a connection password of the backup virtual private network. If the login action corresponding to the virtual private network to be detected is executed for a preset number of times, acquiring connection information of the standby virtual private network, updating the connection information into a terminal server and an application program, executing the starting virtual private network connection tool, and positioning and executing the login control corresponding to the login action based on the virtual private network connection tool, so that safe communication connection between the terminal server and a target server is established through the standby virtual private network, and connection interruption between the terminal server and the target server caused by the failure of the server corresponding to the virtual private network to be detected is avoided.
In the technical solution provided in this embodiment, if the login operation corresponding to the virtual private network to be detected for the preset times fails, the connection information of the standby virtual private network is obtained, the connection information is updated to the terminal server and the application program, the starting virtual private network connection tool is executed, and the step of executing the login control corresponding to the login operation is located based on the virtual private network connection tool, so that the secure communication connection between the terminal server and the target server is established through the standby virtual private network, and the connection interruption between the terminal server and the target server caused by the failure of the server corresponding to the virtual private network to be detected is avoided.
Referring to fig. 6, fig. 6 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present invention.
The terminal in the embodiment of the present invention may be a terminal device, and the terminal device may be a computer or a mobile phone, which is not specifically limited in this embodiment.
As shown in fig. 6, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), a mouse, etc., and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the terminal structure shown in fig. 6 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 6, an operating system, a network communication module, a user interface module, and a state maintenance program of a virtual private network may be included in a memory 1005 as one type of computer storage medium.
In the terminal shown in fig. 6, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the processor 1001 may be configured to call a state maintenance program of the virtual private network stored in the memory 1005, and perform the following operations:
when triggering a virtual private network state monitoring process, sending a first loading request of a first page based on a virtual private network to be detected, and receiving first response information corresponding to the first loading request;
and executing the login action corresponding to the virtual private network to be detected when the first response information does not contain the first expected value.
Further, the processor 1001 may call a state maintenance program of the virtual private network stored in the memory 1005, and further perform the following operations:
when the first response information does not contain a first expected value, sending a second loading request of a second page based on the virtual private network to be detected;
receiving second response information corresponding to the second loading request;
and executing the login action corresponding to the virtual private network to be detected when the second response information does not contain the second expected value.
Further, the processor 1001 may call a state maintenance program of the virtual private network stored in the memory 1005, and further perform the following operations:
when the second response information does not contain the second expected value, performing the steps of:
updating the second page, and jumping to execute the second loading request of the second page sent based on the virtual private network to be detected; or,
and outputting the monitoring result of the virtual private network to be detected.
Further, the processor 1001 may call a state maintenance program of the virtual private network stored in the memory 1005, and further perform the following operations:
when the second response information does not contain the second expected value, determining whether the second page corresponding to the current state is a final page or not;
if yes, executing the step of outputting the monitoring result of the virtual private network to be detected;
and if not, executing the step of updating the second page and jumping to execute the step of sending a second loading request of the second page based on the virtual private network to be detected.
Further, the processor 1001 may call a state maintenance program of the virtual private network stored in the memory 1005, and further perform the following operations:
starting a virtual special network connection tool, and positioning and executing a login control corresponding to the login action based on the virtual special network connection tool;
and controlling the login control to execute the login action corresponding to the virtual private network to be detected.
Further, the processor 1001 may call a state maintenance program of the virtual private network stored in the memory 1005, and further perform the following operations:
acquiring a main window handle of an application program associated with the login action, wherein the application program is used for logging in the virtual private network to be detected;
acquiring control attribute information corresponding to the application program based on the main window handle;
and matching the control attribute information with preset target control attribute information, and positioning a login control corresponding to the login action executed in the application program.
Further, the processor 1001 may call a state maintenance program of the virtual private network stored in the memory 1005, and further perform the following operations:
if the login operation of the preset times is failed, obtaining the connection information of the standby virtual private network;
updating the connection information to the terminal server and the application program, executing the starting virtual special network connection tool, and positioning and executing a login control corresponding to the login action based on the virtual special network connection tool.
Further, the processor 1001 may call a state maintenance program of the virtual private network stored in the memory 1005, and further perform the following operations:
and closing the working process corresponding to the virtual private network connection tool.
In addition, in order to achieve the above object, the present invention further provides a terminal device, including: the method comprises the steps of a memory, a processor and a state maintenance program of a virtual private network, wherein the state maintenance program of the virtual private network is stored in the memory and can run on the processor, and the state maintenance program of the virtual private network is executed by the processor to realize the state maintenance method of the virtual private network.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a state maintenance program of a virtual private network, which when executed by a processor, implements the steps of the state maintenance method of a virtual private network as described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of embodiments, it will be clear to a person skilled in the art that the above embodiment method may be implemented by means of software plus a necessary general hardware platform, but may of course also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on this understanding, the technical solution of the present invention 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) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (9)
1. The state maintenance method of the virtual private network is characterized by being applied to a terminal server, and comprises the following steps of:
triggering a virtual private network state monitoring process when a secure communication connection with a target server is established;
when triggering the state monitoring process of the virtual private network, sending a first loading request of a first page based on the virtual private network to be detected, and receiving first response information corresponding to the first loading request, wherein the first page is preset as a page which can be accessed through the virtual private network to be detected and is used for detecting the connection state of the virtual private network to be detected;
when the first response information does not contain a first expected value, a second loading request of a second page is sent based on the virtual private network to be detected, wherein the first expected value is a character string which contains obvious features and is fixed and is used for representing that the first page is successfully accessed, and the second page is preset as a page which can be accessed through the virtual private network to be detected and is used for detecting the connection state of the virtual private network to be detected;
receiving second response information corresponding to the second loading request;
and when the second response information does not contain a second expected value, executing a login action corresponding to the virtual private network to be detected, and reconnecting the virtual private network to be detected, wherein the second expected value is a character string which contains obvious characteristics and is fixed and is used for representing that the second page is successfully accessed.
2. The method for maintaining the state of a virtual private network according to claim 1, wherein after the step of receiving second response information corresponding to the second load request, further comprises:
when the second response information does not contain the second expected value, performing the steps of:
updating the second page, and jumping to execute the second loading request of the second page sent based on the virtual private network to be detected; or,
and outputting the monitoring result of the virtual private network to be detected.
3. The method for maintaining the state of a virtual private network according to claim 2, wherein after the step of receiving second response information corresponding to the second load request, further comprises:
when the second response information does not contain the second expected value, determining whether the second page corresponding to the current state is a final page or not;
if yes, executing the step of outputting the monitoring result of the virtual private network to be detected;
and if not, executing the step of updating the second page and jumping to execute the step of sending a second loading request of the second page based on the virtual private network to be detected.
4. The method for maintaining the state of a virtual private network according to claim 1, wherein the step of performing a login action corresponding to the virtual private network to be detected comprises:
starting a virtual special network connection tool, and positioning and executing a login control corresponding to the login action based on the virtual special network connection tool;
and controlling the login control to execute the login action corresponding to the virtual private network to be detected.
5. The method for maintaining a state of a virtual private network according to claim 4, wherein the step of starting a virtual private network connection tool and positioning a login control corresponding to the login action based on the virtual private network connection tool includes:
acquiring a main window handle of an application program associated with the login action, wherein the application program is used for logging in the virtual private network to be detected, and the virtual private network connection tool is a pywinuto library of a Python automatic test module;
acquiring control attribute information corresponding to the application program based on the main window handle;
and matching the control attribute information with preset target control attribute information, and positioning a login control corresponding to the login action executed in the application program.
6. The method for maintaining the state of a virtual private network according to claim 5, wherein after the step of controlling the login control to perform the login action corresponding to the virtual private network to be detected, the method comprises:
if the login operation of the preset times is failed, obtaining the connection information of the standby virtual private network;
and updating the connection information to the terminal server and the application program, executing the starting virtual private network connection tool, and obtaining a main window handle of the application program associated with the login action corresponding to the virtual private network to be detected.
7. The method for maintaining the state of a virtual private network according to claim 4, wherein before the step of starting a virtual private network connection tool to obtain a master window handle of an application associated with a login action corresponding to the virtual private network to be detected, the method comprises:
and closing the working process corresponding to the virtual private network connection tool.
8. A terminal device, characterized in that the terminal device comprises: memory, a processor and a state maintenance program for a virtual private network of a terminal device stored on the memory and operable on the processor, which when executed by the processor, implements the steps of the state maintenance method for a virtual private network according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a state maintenance program of a virtual private network of a terminal device, which when executed by a processor, implements the steps of the state maintenance method of a virtual private network according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311186557.4A CN116915838B (en) | 2023-09-14 | 2023-09-14 | State maintenance method for virtual private network, terminal equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311186557.4A CN116915838B (en) | 2023-09-14 | 2023-09-14 | State maintenance method for virtual private network, terminal equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116915838A CN116915838A (en) | 2023-10-20 |
CN116915838B true CN116915838B (en) | 2024-01-05 |
Family
ID=88365393
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311186557.4A Active CN116915838B (en) | 2023-09-14 | 2023-09-14 | State maintenance method for virtual private network, terminal equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116915838B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7266715B1 (en) * | 2003-04-29 | 2007-09-04 | Cisco Technology, Inc. | Methods and apparatus for maintaining a virtual private network connection |
CN110875854A (en) * | 2018-08-29 | 2020-03-10 | 阿里巴巴集团控股有限公司 | Method and device for detecting connectivity of virtual machine in virtual private network and storage medium |
CN110912759A (en) * | 2019-12-30 | 2020-03-24 | 山东有人信息技术有限公司 | Automatic connection method and system for VPN network abnormity |
CN112583912A (en) * | 2020-12-03 | 2021-03-30 | 海腾保险代理有限公司 | VPN automatic connection method, device, equipment and storage medium |
CN112910751A (en) * | 2021-03-31 | 2021-06-04 | 郑州信大捷安信息技术股份有限公司 | Method and device for detecting and recovering abnormity of VPN (virtual private network) equipment |
CN113746910A (en) * | 2021-08-25 | 2021-12-03 | 湖北美和易思教育科技有限公司 | H5 page reconnection server method, terminal and readable storage medium |
CN113868021A (en) * | 2021-09-16 | 2021-12-31 | 上海新炬网络信息技术股份有限公司 | A method based on detecting service status and automatically restarting |
US11558469B1 (en) * | 2022-03-04 | 2023-01-17 | Oversec, Uab | Virtual private network connection status detection |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11425018B2 (en) * | 2019-05-28 | 2022-08-23 | Mcafee, Llc | Methods and apparatus to implement a virtual private network with probe for network connectivity |
-
2023
- 2023-09-14 CN CN202311186557.4A patent/CN116915838B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7266715B1 (en) * | 2003-04-29 | 2007-09-04 | Cisco Technology, Inc. | Methods and apparatus for maintaining a virtual private network connection |
CN110875854A (en) * | 2018-08-29 | 2020-03-10 | 阿里巴巴集团控股有限公司 | Method and device for detecting connectivity of virtual machine in virtual private network and storage medium |
CN110912759A (en) * | 2019-12-30 | 2020-03-24 | 山东有人信息技术有限公司 | Automatic connection method and system for VPN network abnormity |
CN112583912A (en) * | 2020-12-03 | 2021-03-30 | 海腾保险代理有限公司 | VPN automatic connection method, device, equipment and storage medium |
CN112910751A (en) * | 2021-03-31 | 2021-06-04 | 郑州信大捷安信息技术股份有限公司 | Method and device for detecting and recovering abnormity of VPN (virtual private network) equipment |
CN113746910A (en) * | 2021-08-25 | 2021-12-03 | 湖北美和易思教育科技有限公司 | H5 page reconnection server method, terminal and readable storage medium |
CN113868021A (en) * | 2021-09-16 | 2021-12-31 | 上海新炬网络信息技术股份有限公司 | A method based on detecting service status and automatically restarting |
US11558469B1 (en) * | 2022-03-04 | 2023-01-17 | Oversec, Uab | Virtual private network connection status detection |
Non-Patent Citations (3)
Title |
---|
刘桂峰 ; 陶漪 ; .网络服务运行状态监控技术研究.计算机与现代化.2011,(02),第2节. * |
网络服务运行状态监控技术研究;刘桂峰;陶漪;;计算机与现代化(02);第2节 * |
通过自动登录交易软件过程详解pywinauto的用法;家有仙妻宝宝;《http://www.360doc.com/content/22/0307/20/39588098_1020516203.shtml》;第1-2页 * |
Also Published As
Publication number | Publication date |
---|---|
CN116915838A (en) | 2023-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108595329B (en) | Application testing method and device and computer storage medium | |
CN111026645B (en) | User interface automatic test method and device, storage medium and electronic equipment | |
CN110908909B (en) | Automatic test method, device, storage medium and equipment | |
CN111090592A (en) | Automatic testing method of buried point, terminal and readable storage medium | |
CN106547687A (en) | Application testing method, device and system | |
JP2019519008A (en) | Method, apparatus, server and computer readable storage medium for information leak inspection | |
CN109684155B (en) | Monitoring configuration method, device, equipment and readable storage medium | |
CN107241229A (en) | A kind of business monitoring method and device based on interface testing instrument | |
CN110011875A (en) | Dial-testing method, apparatus, device and computer-readable storage medium | |
CN115543827B (en) | Buried point data display method and device | |
CN111405006A (en) | Method and device for processing remote login failure and remote login system | |
Pathirathna et al. | Security testing as a service with docker containerization | |
KR20220049334A (en) | Method and system for application test | |
CN111597101B (en) | SDK access state detection method, computer equipment and computer readable storage medium | |
CN111954240A (en) | Network fault processing method and device and electronic equipment | |
CN116915838B (en) | State maintenance method for virtual private network, terminal equipment and storage medium | |
CN108540344B (en) | Router upgrading test method and system | |
CN112073462A (en) | Positioning method and device | |
CN110233760B (en) | System fault monitoring method and device | |
CN113765735B (en) | Application test methods, devices, equipment and storage media | |
CN112650666B (en) | Software testing system, method, device, control equipment and storage medium | |
CN108471635B (en) | Method and apparatus for connecting wireless access points | |
CN112799957A (en) | User behavior-based troubleshooting method, system, device and medium | |
CN113595819A (en) | Website health detection method, device, equipment and computer readable storage medium | |
CN112527606A (en) | Data flow analysis method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |