Time length management method and device, equipment, readable storage medium and program product

By reconnecting to the target server when the VPN process is closed and combining the screen-on data to calculate usage time, the problems of time recording software being easily killed by false alarms and high power consumption are solved, achieving accurate and energy-saving time management.

CN117014489BActive Publication Date: 2026-03-24GUANGZHOU TENCENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, time recording software is easily killed by mistake or forcibly shut down by the system, resulting in inaccurate timing and increased power consumption of the device due to continuous operation.

Method used

The VPN process is used to record usage time. By reconnecting to the target server when the VPN process is closed, the VPN process is kept running. The usage time is calculated by combining the screen display data.

Benefits of technology

It improves the accuracy of duration recording and reduces power consumption. The resident nature of the VPN process avoids inaccurate timing issues caused by accidental shutdown and high memory usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117014489B_ABST
    Figure CN117014489B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a time length management method, device, equipment, readable storage medium and program product, which can be applied to the fields or scenarios of cloud technology, artificial intelligence, wisdom platform, application software, vehicle-mounted, etc. The method comprises: after a virtual private network (VPN) process is connected to a first target server, starting a timing task by using the VPN process; if the VPN process is closed and the VPN process is disconnected from the first target server, restarting the VPN process and reconnecting the VPN process to the first target server; obtaining a target time length counted by the VPN process and screen-on data of a terminal device recorded; and determining a use time length of the terminal device according to the target time length and the screen-on data. Through the embodiments of the present application, the accuracy of the use time length record can be improved, and the power consumption can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, in particular to a time length management method, a time length management device, a computer device, a computer readable storage medium and a computer program product. BACKGROUND

[0002] The time length recording function can record the use time length of the device, so as to manage the use of the device and achieve the purpose of healthy online. At present, the use time length of the device is recorded by using the time length recording software, that is, the time length recording software is kept running in the background, so that the use time of the device is calculated according to the running time of the time length recording software. However, the time length recording software is easy to be killed by the system, at this time the timing will stop, thus leading to inaccurate timing. In addition, keeping the time length recording software running continuously will greatly increase the power consumption of the device. Therefore, how to improve the accuracy of the use time length recording and reduce the power consumption is a problem to be solved at present. SUMMARY

[0003] The present application provides a time length management method, device, equipment, readable storage medium and program product, which can improve the accuracy of the use time length recording and reduce the power consumption.

[0004] In a first aspect, the present application provides a time length management method, comprising:

[0005] After a virtual private network (VPN) process is connected to a first target server, starting a timing task by using the VPN process;

[0006] If the VPN process is closed and the VPN process is disconnected from the first target server, restarting the VPN process and reconnecting the VPN process to the first target server;

[0007] Obtaining a target time length of the VPN process timing and recorded screen-on data of a terminal device;

[0008] Determining the use time length of the terminal device according to the target time length and the screen-on data.

[0009] In a second aspect, the present application provides a time length management device, comprising:

[0010] The execution module is configured to start a timing task by using the VPN process after a virtual private network (VPN) process is connected to a first target server;

[0011] The execution module is further configured to, if the VPN process is closed and the VPN process is disconnected from the first target server, restart the VPN process and reconnect the VPN process to the first target server.

[0012] The acquisition module is configured to acquire a target duration of the VPN process and recorded screen-on data of the terminal device.

[0013] The calculation module is configured to determine a use duration of the terminal device according to the target duration and the screen-on data.

[0014] In a third aspect, the present application provides a computer device, comprising a processor, a storage device and a communication interface, the processor, the communication interface and the storage device are connected with each other, wherein the storage device stores executable program codes, and the processor is configured to invoke the executable program codes to implement the duration management method.

[0015] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, the computer program comprises program instructions, and the program instructions are executed by a processor to implement the duration management method.

[0016] In a fifth aspect, the present application provides a computer program product, the computer program product comprises a computer program or computer instructions, and the computer program or computer instructions are executed by a processor to implement the duration management method.

[0017] After the VPN process is connected to the first target server, the VPN process starts a timing task, and then the use duration of the terminal device is determined according to the target duration of the VPN process and the recorded screen-on data of the terminal device. Compared with using a use duration recording software to record the use duration of the terminal device, the use duration is recorded by the VPN process in the present application. Since the VPN process can only be manually closed by the user, the possibility of being mistakenly closed by the user, the possibility of being forcibly closed by the system due to high memory occupation is reduced, the continuous recording of the use duration is ensured, and the accuracy of the use duration recording based on the VPN process is improved. Since the VPN process occupies less memory than the use duration recording software, the use duration is recorded by the VPN process, which can reduce the power consumption of the terminal device in recording the use duration. When the VPN process is closed, the terminal device will immediately start the VPN process and reconnect the VPN process to the first target server, so as to ensure the persistence of the VPN process. The above method enables the VPN process to quickly return to the timing task, so as to perform stable and accurate timing operation, and further improve the accuracy of the use duration recording. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced as follows. Obviously, for those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.

[0019] Figure 1 is a schematic diagram of an architecture of a time length management system provided by an exemplary embodiment of the present application;

[0020] Figure 2 is a flowchart of a time length management method provided by an exemplary embodiment of the present application;

[0021] Figure 3 is a flowchart of another time length management method provided by an exemplary embodiment of the present application;

[0022] Figure 4A is an interface diagram of starting a VPN process provided by an exemplary embodiment of the present application;

[0023] Figure 4B is a flowchart of a process of restarting a VPN process provided by an exemplary embodiment of the present application;

[0024] Figure 4C is a flowchart of a process of using time length statistics based on a VPN process provided by an exemplary embodiment of the present application;

[0025] Figure 4D is a flowchart of a process of server switching provided by an exemplary embodiment of the present application;

[0026] Figure 4E is a flowchart of another process of server switching provided by an exemplary embodiment of the present application;

[0027] Figure 4F is an interface diagram of installing a configuration file provided by an exemplary embodiment of the present application;

[0028] Figure 4G is a flowchart of a process of connecting a background server provided by an exemplary embodiment of the present application;

[0029] Figure 4H is a flowchart of another process of server switching provided by an exemplary embodiment of the present application;

[0030] Figure 4I is a flowchart of another process of server switching provided by an exemplary embodiment of the present application;

[0031] Figure 4Jis a time length statistics interface display provided by an exemplary embodiment of the present application;

[0032] Figure 5 is a schematic block diagram of a time length management device provided by an exemplary embodiment of the present application;

[0033] Figure 6 is a schematic block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0034] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0035] It should be noted that the terms "first", "second", and the like described in the embodiments of the present application are only for the purpose of description, and cannot be understood as indicating or implying the relative importance of the technical features or implicitly indicating the number of the technical features. Therefore, the technical features limited by "first" and "second" can explicitly or implicitly include at least one of the features.

[0036] In order to better understand the schemes of the embodiments of the present application, the related terms and concepts that may be involved in the embodiments of the present application will be introduced first.

[0037] Mobile device management (MDM) is a process of managing all contents of a mobile device. Mobile device management includes storing basic information about a mobile device, deciding which applications can exist on the device, locating the device, and protecting the device when the device is lost.

[0038] The embodiments of the present application can be applied to various fields or scenes such as vehicle-mounted scenes, intelligent transportation, auxiliary driving, artificial intelligence, and the like. Several typical fields or scenes will be introduced below.

[0039] Intelligent Traffic System (ITS), also known as Intelligent Transportation System, is to effectively integrate advanced science and technology (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) in transportation, service control and vehicle manufacturing, to strengthen the connection between vehicles, roads and users, so as to form a comprehensive transportation system that ensures safety, improves efficiency, improves environment and saves energy.

[0040] Intelligent Vehicle Infrastructure Cooperative Systems (IVICS), simply referred to as vehicle infrastructure cooperative system, is a development direction of Intelligent Traffic System (ITS). Vehicle infrastructure cooperative system is to use advanced wireless communication and new generation Internet technology to implement dynamic real-time information interaction between vehicles and roads in all directions, and to carry out vehicle active safety control and road cooperative management on the basis of full-time and space dynamic traffic information collection and fusion, to fully realize the effective cooperation of man, vehicle and road, to ensure traffic safety and improve traffic efficiency, so as to form a safe, efficient and environmentally friendly road traffic system. The present application can be applied to the above-mentioned fields, by adding the time length statistical method proposed in the present application to the system related to intelligent traffic, intelligent vehicle infrastructure cooperative system and vehicle-mounted, the use time length of the system is counted, so as to realize the supervision function of the system according to the use time length, and improve the intelligentization of system service.

[0041] Artificial Intelligence (AI) is to use digital computer or digital computer controlled machine to simulate, extend and expand human intelligence, perceive environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which tries to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that the machine has the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, both hardware and software technologies. Artificial intelligence basic technologies generally include technologies such as sensors, cloud computing, distributed storage, big data processing, operation / interaction systems, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, machine learning / deep learning, etc. The present application is based on artificial intelligence technology, and connects the VPN process to different servers according to different business situations to realize use time length recording, maintains the resident of VPN process, and improves the accuracy of use time length recording.

[0042] With the research and progress of artificial intelligence technology, artificial intelligence technology is researched and applied in many fields, such as common smart home, smart wearable device, virtual assistant, smart speaker, smart marketing, unmanned driving, automatic driving, unmanned aerial vehicle, robot, smart medical treatment, smart customer service, Internet of vehicles, automatic driving, 3D game and the like. With the development of technology, artificial intelligence technology will be applied in more fields and play more and more important value.

[0043] The exploration process of the present application will be introduced as follows: the application usage duration has a system function on the iOS device, that is, the screen usage duration function. The screen usage duration function can record the time consumed by using the application, but these data are only allowed to be read by the system of the iOS device, and the application cannot read these data.

[0044] The terminal device can record the usage duration of the device by using the usage duration recording software, that is, by keeping the duration recording software running in the background, so as to calculate the usage time of the device according to the running time of the duration recording software. The core of recording the usage duration of the device by using the usage duration recording software is to require the duration recording software to keep alive, so that the duration recording software can record the usage duration data in the background.

[0045] The above method has several defects:

[0046] 1. In actual use, it cannot be guaranteed that the duration recording software always runs in the background, for example, the duration recording software may be mistakenly killed by the user of the device; it may also be forcibly killed by the system when the system memory resource is insufficient, and the like.

[0047] 2. The duration recording software keeps alive in the background, which greatly increases the power consumption of the device.

[0048] 3. Other software may activate the app feature multiple times by obtaining the geographic location permission, which can activate the background resident function and record the usage duration. However, this way has an audit risk, because the actual purpose of using the permission is different from the expectation of the IOS audit party. On the other hand, giving the geographic location permission has the risk of leaking sensitive information.

[0049] Based on this, the application provides a method for recording the use duration of a terminal device with relatively low power consumption, always running in the background, protecting privacy, and meeting the requirements of an auditing party and related objects. Specifically, the application uses a VPN component (i.e., a VPN process) in an iOS system as a background resident process and uses MDM device management capabilities to restart the VPN process when it is detected to be closed, so that the VPN process remains alive, thereby recording the use duration of the terminal device and improving the accuracy of use duration recording.

[0050] It can be understood that in the specific embodiments of the application, data related to device state information and use duration is involved, and when the above embodiments of the application are applied to specific products or technologies, the collection, use, and processing of related data need to comply with relevant laws, regulations, and standards of relevant countries and regions.

[0051] The application will be specifically described through the following embodiments:

[0052] Referring to FIG. 1, Figure 1 The figure is an architecture schematic diagram of a duration management system provided by an example embodiment of the application. The duration management system specifically can include a terminal device 101 and a background server 102. The terminal device 101 is configured with a local server 103 and a local server 104. The background server 102, the local server 103, and the local server 104 are respectively connected with the terminal device 101 through a network, such as a local area network, a wide area network, a mobile Internet, etc.

[0053] In an embodiment, the terminal device 101 starts a VPN process and acquires device state information at a first time; the terminal device 101 determines a first target server according to the device state information at the first time, and connects the VPN process to the first target server, which is one of a host application local server (such as the local server 103), a background server (such as the background server 102), and a VPN process local server (such as the local server 104). After the VPN process is connected to the first target server, the terminal device 101 starts a timing task by using the VPN process; if the VPN process is closed, the VPN process is disconnected from the first target server, the VPN process is restarted, and the VPN process is reconnected to the first target server; the terminal device 101 acquires a target duration of the VPN process timing and recorded screen-on data of the terminal device 101, and determines the use duration of the terminal device 101 according to the target duration and the screen-on data.

[0054] In an embodiment, after the VPN process is connected to the background server (e.g., the background server 102), the terminal device 101 acquires the device state information at the moment; if the device state information at the moment indicates that the host application on the terminal device 101 is started, the terminal device 101 switches the connection of the VPN process to the host application local server (e.g., the local server 103); if the device state information at the moment indicates that the host application on the terminal device 101 is closed and the network is disconnected, the terminal device 101 switches the connection of the VPN process to the VPN process local server (e.g., the local server 104). It should be noted that the above embodiment is only exemplary, and other possible embodiments in the present application will be described in detail hereinafter, which will not be repeated here.

[0055] The terminal device 101 is also referred to as a terminal, a user equipment (UE), an access terminal, a subscriber unit, a mobile device, a user terminal, a wireless communication device, a user agent, or a user apparatus. The terminal device can be a smart home appliance, a handheld device (e.g., a smartphone, a tablet computer) with a wireless communication function, a computing device (e.g., a personal computer (PC), a vehicle-mounted terminal, a smart voice interaction device, a wearable device, or other smart devices, etc.), but is not limited thereto.

[0056] The background server 102 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data and artificial intelligence platforms. The local server 103 (or the local server 104) is a server configured on the terminal device as a server.

[0057] In an embodiment, the architecture of the time length management system provided in the present application can further include a database for storing screen-on data, device state information and the like, and can also be used to store connection parameters and the like related to each server. These data can be recorded in different database tables in the database. For example, the database can be a database provided in the server, i.e., a built-in or self-provided database of the server; or the database can be an external database connected to the server, such as a cloud database (i.e., a database deployed in the cloud), which can be deployed based on any one of a private cloud, a public cloud, a hybrid cloud, an edge cloud, etc., so that the functions of the cloud database are different. For example, a database deployed in a private cloud is a user's own device, which is more focused on serving a small number of users, while a database deployed in a public cloud is deployed based on a third-party cloud platform, which can enable the data stored in the database to be shared, and any user's data can be stored in the database, and any user can use the data in the database.

[0058] It can be understood that the architecture diagram of the system described in the embodiments of the present application is for more clearly illustrating the technical solutions of the embodiments of the present application, and does not constitute a limitation on the technical solutions provided by the embodiments of the present application. For example, the time length management method provided by the embodiments of the present application can be executed not only by the terminal device 101, but also by other servers or server clusters different from the terminal device 101 and capable of communicating with the terminal device 101 and / or the background server 102. Those skilled in the art can know that the number of terminal devices and servers in Figure 1 is only illustrative. According to the needs of business implementation, any number of terminal devices and servers can be configured. Moreover, as the system architecture evolves and new business scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems. In subsequent embodiments, the terminal device will refer to the terminal device 101 described above, the background server will refer to the background server 102 described above, the host application local server will refer to the local server 103 described above, and the VPN process local server will refer to the local server 104 described above, which will not be described in detail in subsequent embodiments.

[0059] Please refer to Figure 2 , which is a flowchart of a time length management method provided by an exemplary embodiment of the present application. The method is applied to a terminal device (referring to the terminal device 101 in Figure 1 , which will be described by way of example. The method can include the following steps:

[0060] S201, after the virtual private network (VPN) process is connected to the first target server, starting a timing task by using the VPN process.

[0061] In the embodiments of the present application, the VPN is a virtual private network, and a digital connection can be established between a computer and a remote server owned by a VPN provider. After the virtual private network VPN process is connected to the first target server, the present application can start a timing task by using the VPN process, so as to record the use time length of the device. Compared with using use time length recording software to record the use time length of the device, the present application records the use time length by using the VPN process. The VPN process can only be manually closed by the used object, which reduces the possibility of being mistakenly closed by the used object and being forcibly closed by the system due to too high memory occupation, thereby ensuring the persistence of the VPN process and improving the accuracy of use time length recording based on the VPN process. Moreover, the maximum available memory of the VPN process is only 50M, and the memory of an ordinary VPN program is generally less than 10M. Since the software needs to render an interface, the memory occupation of an ordinary software basically exceeds 50M. Less memory occupation means less energy consumption and performance consumption. Compared with the use time length recording software, the VPN process occupies less memory. The present application uses the VPN process to record the use time length, thereby avoiding keeping the time length recording software running in the background, and reducing the power consumption of the terminal device for realizing use time length recording.

[0062] In an embodiment, the first target server connected by the VPN process can be any one of a host application local server, a background server, and a VPN process local server. The host application local server is a local server built in the host application, the VPN process local server is a local server built in the VPN, and the background server is a server outside the terminal device. Each server has different business function attributes. For example, the host application local server can quickly restart the closed VPN process in the case that the host application is opened; the VPN process local server can quickly restart the closed VPN process in the case that the terminal device is in a disconnected state and the host application is closed; and the background server can quickly restart the closed VPN process in the case that the terminal device is in a connected state and the host application is closed. The above method enables the terminal device to flexibly connect the VPN process to a reasonable server according to the actual business situation, ensures the stability and accuracy of timing, and thereby improves the accuracy of use time length recording.

[0063] S202, if the VPN process is closed, the VPN process is disconnected from the first target server, the VPN process is restarted, and the VPN process is reconnected to the first target server.

[0064] In the embodiment of the present application, when the VPN process is closed, the VPN process is disconnected from the first target server, at this time, the terminal device restarts the VPN process and reconnects the VPN process to the first target server, so that the VPN process can quickly return to the timing task, thereby performing stable and accurate timing operation, and further improving the accuracy of the use time record.

[0065] In an embodiment, the first target server can detect the connection state of the VPN process in real time, and when the first target server detects that the VPN process is disconnected therefrom, the first target server informs the terminal device, so that the terminal device reconnects the VPN process to the first target server, thereby realizing the resident of the VPN process.

[0066] S203, acquiring a target duration of the VPN process timing and recorded screen-on data of the terminal device.

[0067] In the embodiment of the present application, the target duration of the VPN process timing refers to the total duration of the VPN process acquired by the terminal device, including the running duration of the terminal device in the screen-on state and the running duration of the terminal device in the screen-off state, and the running duration of the terminal device in the screen-on state can better represent the actual use duration of the terminal device by the user. The recorded screen-on data of the terminal device refers to the screen-on and screen-off state of the terminal device within the target duration. The present application acquires the target duration of the VPN process timing and the recorded screen-on data of the terminal device, so as to determine the use duration of the terminal device.

[0068] S204, determining the use duration of the terminal device according to the target duration and the screen-on data.

[0069] The present application can calculate the running duration of the terminal device in the screen-on state and the running duration of the terminal device in the screen-off state respectively by the target duration and in combination with the screen-on data, and take the running duration of the terminal device in the screen-on state as the use duration of the terminal device, thereby calculating the actual use duration of the terminal device, avoiding the running time in the screen-off state from being counted into the use duration, and improving the accuracy of the use duration record.

[0070] In an embodiment, the VPN process can also acquire the screen-on data of the terminal device, and determine whether the terminal device is screen-on according to the screen-on data, and finally the terminal device acquires the usage duration of the terminal device from the VPN process. Specifically, when the VPN process determines that the terminal device is screen-on, the screen-on time is recorded; when the VPN process determines that the terminal device is screen-off, the screen-on time is not recorded. The VPN process saves the data into a database (or uploads to a management server). When the terminal device (or a host application in the terminal device) needs to perform data display, the screen-on time is acquired from the database (or the management server) as the usage duration of the terminal device for display. The above method improves the flexibility of the terminal device in acquiring the usage duration.

[0071] In an embodiment, the terminal device can collect the target duration and the screen-on data at each moment in real time to generate the usage duration of the terminal device. For example, the terminal device can collect the running duration of the VPN process on the terminal device in real time, and determine the screen-on and screen-off state changes according to the screen-on data, start timing when the screen-on data indicates that the current state is screen-on, and stop timing when the screen-on data indicates that the current state is screen-off, and wait for the screen-on data to indicate that the current state is screen-on again to continue timing. Through the above method, the usage duration of the terminal device is continuously counted.

[0072] Based on the above embodiments, the application has the following beneficial effects: after the VPN process is connected to the first target server, the VPN process can be used to start a timing task, and the usage duration of the terminal device can be determined according to the target duration counted by the VPN process and the recorded screen-on data of the terminal device. Compared with using the usage duration recording software to record the usage duration of the terminal device, the application uses the VPN process to record the usage duration, and the VPN process can only be manually closed by the used object, which reduces the possibility of being mistakenly closed by the used object and the possibility of being forcibly closed by the system due to high memory occupation, and improves the accuracy of recording the usage duration based on the VPN process. Since the VPN process occupies less memory than the usage duration recording software, using the VPN process to count the usage duration can reduce the power consumption of the terminal device in recording the usage duration. When the VPN process is closed, the terminal device will immediately start the VPN process and reconnect the VPN process to the first target server, which ensures the persistence of the VPN process. The above method enables the VPN process to quickly return to the timing task, thereby performing stable and accurate timing operation, and further improves the accuracy of recording the usage duration.

[0073] The first target server to which the VPN process is connected can be any one of a host application local server, a background server, and a VPN process local server. The servers have different service function attributes. The method enables the terminal device to flexibly connect the VPN process to a reasonable server according to actual service conditions, ensures the stability and accuracy of timing, and thus improves the accuracy of the use time record. The target time is combined with screen-on data to calculate the running time of the terminal device in a screen-on state and the running time of the terminal device in an off-screen state, and the running time of the terminal device in the screen-on state is taken as the use time of the terminal device, so as to calculate the actual use time of the terminal device, avoid counting the running time in the off-screen state into the use time, and improve the accuracy of the use time record.

[0074] Referring to Figure 3 , which is a flowchart of a time management method provided by an example embodiment of the present application. The method is applied to a terminal device (denoted as terminal device 101 in Figure 1 . The method can include the following steps:

[0075] S301, in response to a trigger operation on a VPN start control, the terminal device starts a VPN process and displays identification information of the VPN process in a first application interface.

[0076] In the embodiment, the terminal device first needs to start the VPN process, and then connect the VPN process to the first target server, so as to start a timing task by using the VPN process. When the VPN start control is triggered, the terminal device responds to the operation and displays the identification information of the VPN process in the first application interface of the terminal device. By displaying the identification information of the VPN process, the operation object can intuitively and clearly obtain the start state of the VPN process, improving the use experience.

[0077] Referring to Figure 4A , which is a start interface diagram of a VPN process provided by an example embodiment of the present application. The diagram includes various device states, such as a SIM card state (no SIM card in the diagram), a WiFi state (turned on in the diagram), a VPN state (turned on in the diagram), a Bluetooth state (turned on in the diagram), and a power state (power: 90% in the diagram). The operation object can turn on the VPN function in the setting interface of the terminal device (for example, turn on the VPN function in the control center) to complete the start of the VPN process. When the VPN function is turned on, a VPN start mark is displayed at the top of the interface of the terminal device.

[0078] The VPN start control can be a VPN start button, a VPN start icon, or a VPN start link. Figure 4AThe 402 control in the first application interface, when the operation object clicks the 402 control, the terminal device switches the state of the VPN process (for example, switches from an open state to a closed state, or switches from a closed state to an open state). The identification information of the VPN process can be Figure 4A The 401 control in the first application interface, when the state of the VPN process is the open state, the 401 control is displayed in the first application interface; when the state of the VPN process is the closed state, the 401 control is not displayed in the first application interface.

[0079] S302, the terminal device acquires device state information at a first time.

[0080] In an embodiment, the first time is a current time when the terminal device performs a first connection operation on the VPN process. The device state information at the first time can be startup state information (indicating whether a host application on the terminal device is started) of the terminal device at the first time, networking state information (indicating whether the terminal device is connected to the Internet or a mobile network), and the like.

[0081] S303, the terminal device determines a first target server according to the device state information at the first time.

[0082] In the embodiment of the application, the terminal device determines an optimal server as the first target server from a plurality of servers according to the device state information at the first time. After connecting the VPN process to the server, the VPN process can perform a timing task.

[0083] In an embodiment, the first target server can be any one of a host application local server, a background server, and a VPN process local server. The host application local server is a local server built in the host application, the VPN process local server is a local server built in the VPN, and the background server is a server outside the terminal device. Each server has different service function attributes, for example, the host application local server can quickly restart a closed VPN process when the host application is opened; the VPN process local server can quickly restart a closed VPN process when the terminal device is in a network disconnection state and the host application is closed; and the background server can restart a closed VPN process when the terminal device is in a network connection state and the host application is closed. The above method enables the terminal device to flexibly connect the VPN process to a reasonable server according to actual business conditions, ensures the stability and accuracy of timing, and thus improves the accuracy of the use time record.

[0084] S304, the terminal device connects the VPN process to the first target server.

[0085] In the steps S302-S304, the terminal device acquires the device state information (for example, the startup state information and the networking state information) at the first time, so that the terminal device determines the current optimal server according to the device state information at the first time, and connects the VPN process to the first target server determined according to the device state information at the first time to perform the timing task. The implementation method of the terminal device for determining the first target server according to the device state information at the first time is described in the step S303, and the specific implementation method of determining the second target server according to the device state information at the second time is described in the subsequent embodiments, and thus the implementation of the present embodiment is not repeated.

[0086] S305, the terminal device starts the timing task by using the VPN process.

[0087] S306, the first target server detects whether the VPN process is closed in real time.

[0088] In the embodiments of the present application, the first target server can detect whether the VPN process is closed in real time. When the first target server detects that the VPN process is closed, the steps S307-S309 are executed to restart the VPN process and reconnect the VPN process to the first target server, so that the VPN process can quickly return to the timing task, thereby performing stable and accurate timing operation.

[0089] S307, when the VPN process is closed and the VPN process is disconnected from the first target server, the VPN process is restarted.

[0090] S308, the terminal device restarts the VPN process.

[0091] S309, the terminal device reconnects the VPN process to the first target server.

[0092] Please refer to Figure 4B , which is a VPN process restart processing flowchart provided by an exemplary embodiment of the present application. The steps S306-S309 will be described below in combination with the figure: taking the first target server as the host application local server as an example, after the VPN process is connected to the host application local server, the host application local server detects whether the VPN process is closed in real time; if the VPN process is closed, the host application local server will notify the terminal device, and the terminal device restarts the VPN process through the host application and connects the VPN process to the host application local server.

[0093] S310, the terminal device acquires the target duration of the VPN process timing and the recorded screen-on data of the terminal device.

[0094] In the embodiment of the present application, the target duration of the VPN process timing refers to the total duration of the VPN process obtained by the terminal device, including the running duration of the terminal device in the screen-on state and the running duration of the terminal device in the screen-off state, and the running duration of the terminal device in the screen-on state can better represent the actual use duration of the terminal device by the user. The recorded screen-on data of the terminal device refers to the screen-on and screen-off states of the terminal device in the time range of the target duration. The present application obtains the target duration of the VPN process timing and the recorded screen-on data of the terminal device, so as to determine the use duration of the terminal device.

[0095] In S311, the terminal device determines the use duration of the terminal device according to the target duration and the screen-on data.

[0096] The present application can calculate the running duration of the terminal device in the screen-on state and the running duration of the terminal device in the screen-off state respectively by the target duration and in combination with the screen-on data, and take the running duration of the terminal device in the screen-on state as the use duration of the terminal device, so as to calculate the actual use duration of the terminal device, avoid counting the running time in the screen-off state into the use duration, and improve the accuracy of the use duration record.

[0097] In an embodiment, the VPN process can also obtain the screen-on data of the terminal device, and determine whether the terminal device is screen-on according to the screen-on data, and finally the terminal device obtains the use duration of the terminal device from the VPN process. Specifically, when the VPN process determines that the terminal device is screen-on, the screen-on time is recorded; when the VPN process determines that the terminal device is screen-off, the screen-on time is not recorded. The VPN process saves the data into the database (or uploads to the management server). When the terminal device (or the host application in the terminal device) needs to display data, the screen-on time is obtained from the database (or the management server) as the use duration of the terminal device for display. The above method improves the flexibility of the terminal device in obtaining the use duration.

[0098] In an embodiment, the terminal device can collect the target duration and the screen-on data at each moment in real time to generate the use duration of the terminal device. For example, the terminal device can collect the running duration of the VPN process on the terminal device in real time, and determine the screen-on and screen-off state changes according to the screen-on data, start timing when the screen-on data indicates that the current state is screen-on, stop timing when the screen-on data indicates that the current state is screen-off, and continue timing when the screen-on data indicates that the current state is screen-on again. Through the above method of cyclic timing, the continuous statistics of the use duration of the terminal device is realized.

[0099] In an embodiment, the steps S306-S309 described above describe that when the VPN process is disconnected from the first target server, the terminal device re-connects the VPN process to the first target server, thereby ensuring the persistence of the VPN process. Meanwhile, since the servers in the present application have different service function attributes, the effects of connecting the VPN process to the servers are different. Therefore, the terminal device can also acquire the latest device state information in real time, and determine the optimal target server that can be connected to at present according to the latest device state information, so as to efficiently and accurately complete the record of the use duration. Therefore, the method described above can also include the following steps:

[0100] (a1), acquiring device state information of the terminal device at a second time.

[0101] In an embodiment, the second time is an arbitrary time at which the terminal device acquires the latest device state information in real time (which can be understood as each time after the VPN process is connected to an arbitrary server). The device state information at the second time can be startup state information of the terminal device at the second time (indicating whether the host application on the terminal device is started), networking state information (indicating whether the terminal device is connected to the Internet or a mobile network), and the like.

[0102] (a2), determining a second target server according to the device state information at the second time, the second target server being one of the host application local server, the background server, and the VPN process local server.

[0103] In the embodiment of the present application, the terminal device determines the optimal server as the second target server from the plurality of servers through the device state information at the second time. In the case where the second target server is different from the first target server, the second target server has a better effect of performing the use duration recording task than the first target server, which is usually reflected in that the second target server has higher processing efficiency, higher efficiency of restarting the VPN process after disconnection, and the like.

[0104] In an embodiment, the device state information of the terminal device includes startup state information and networking state information. The step (a2) of determining the second target server according to the device state information at the second time can be implemented according to the following steps:

[0105] (a21), acquiring startup state information of the terminal device at the second time.

[0106] In the embodiment of the present application, the startup state information is used to indicate whether the host application on the terminal device is started.

[0107] (a22) If the startup state information at the second time indicates that the host application on the terminal device is started, the second target server is determined as the host application local server.

[0108] In the embodiment of the present application, if the startup state information at the second time indicates that the host application on the terminal device is started, the second target server is the host application local server. The VPN process is connected to the host application local server, and the function of the host application local server is to restart the VPN process when it is monitored that the VPN process is disconnected. The host application local server can also reduce the burden of the background server, because the host application local server has higher authority than the background server and the VPN process local server, and can more quickly and directly pull up the VPN process, and has the highest success rate. Therefore, in the case that the host application is started, the VPN process is connected to the host application local server in priority.

[0109] (a23) If the startup state information at the second time indicates that the host application on the terminal device is closed, the networking state information of the terminal device at the second time is acquired.

[0110] In the embodiment of the present application, the networking state information is used to indicate whether the terminal device accesses the Internet or the mobile network. If the startup state information at the second time indicates that the host application on the terminal device is closed, the terminal device determines to connect the VPN to the background server or the VPN process local server through the networking state information at the second time.

[0111] (a24) If the networking state information at the second time indicates that the terminal device is connected to the network, the second target server is determined as the background server.

[0112] In the embodiment of the present application, if the networking state information at the second time indicates that the terminal device is connected to the network, the second target server is the background server. The VPN process is connected to the background server, and the function of the background server is to restart the VPN process when it is monitored that the VPN process is disconnected. Because it is impossible to connect to the host application local server in this case, the background server has higher authority than the VPN process local server, and can more quickly and directly pull up the VPN process, and has higher success rate. Therefore, in the case that the host application is not started and the terminal device is connected to the network, the VPN process is connected to the background server in priority.

[0113] (a25) If the networking state information at the second time indicates that the terminal device is disconnected from the network, the second target server is determined as the VPN process local server.

[0114] In this embodiment, if the network status information at the second moment indicates that the terminal device is disconnected from the network, then the second target server is the VPN process local server. The VPN process is connected to the VPN process local server, whose function is to restart the VPN process when it detects that the VPN process has lost connection. Since the host application is not running at this time and the terminal device is disconnected from the network, a local server (i.e., the VPN process local server) will be set up inside the VPN, and the VPN process will connect to the VPN process local server.

[0115] This embodiment connects VPN processes to the host application local server, background server, and VPN process local server in descending order of priority, based on the different business function attributes of each server. This improves the effectiveness of the VPN process in recording usage duration. It should be noted that this application can determine the target server based on the method provided in steps (a21-a25) above when using device status information at any given time; these steps will not be repeated here.

[0116] Please see Figure 4C This diagram is a flowchart illustrating a VPN process usage duration statistics process provided in an exemplary embodiment of this application. The following explanation, in conjunction with this diagram, details steps (a21-a25) and S301-S311: The terminal device first starts the VPN process (corresponding to step 1 in the diagram); then, it determines whether the host application is open based on the startup status information (corresponding to step 2 in the diagram). If yes, the VPN process connects to the host application's local server; otherwise, the terminal device determines whether it is connected to the internet based on the network status information (corresponding to step 3 in the diagram). If yes, the VPN process connects to the background server; otherwise, it connects to the VPN process's local server. Once the VPN process connects to any server, it begins recording the duration (corresponding to step 4 in the diagram). Simultaneously, the terminal device determines whether its screen is on based on screen-on data (corresponding to step 5 in the diagram). If the screen is on, the corresponding duration is recorded as the screen-on duration; if the screen is off, the corresponding duration is recorded as the screen-off duration. This process is repeated cyclically, and finally, the screen-on duration is statistically analyzed to obtain the terminal device's usage duration.

[0117] (a3) If the second target server is different from the first target server, disconnect the VPN process from the first target server and connect the VPN process to the second target server.

[0118] In the embodiments of the present application, if the second target server is the same as the first target server, it indicates that the server connected by the VPN process is the current best server, and in this case, the terminal device can maintain the current connection state of the VPN process; if the second target server is different from the first target server, it indicates that the server connected by the VPN process is not the current best server, and the current best server should be the second target server, and in this case, the terminal device can switch the VPN process from the first target server to the second target server. Through the above method, after the VPN process is switched from the first target server to the second target server, the VPN process performs the timing task based on the second target server, so as to achieve better processing effect. Moreover, the above method ensures that the VPN process is always connected to the current best server to perform the timing task, improves the processing efficiency, the accuracy of the use time record, and the efficiency of restarting the VPN process after the VPN is disconnected.

[0119] In an embodiment, when the condition in the above step (a22) is met (i.e., the host application on the terminal device is started), the second target server is the host application local server, and then the VPN process is connected to the host application local server, and the time record is performed through the VPN process. However, the host application startup state and the networking state of the terminal device can change at any time, for example, the operating object closes the host application, the operating system forcibly closes the host application, the operating object closes the mobile network, and the like. Therefore, the terminal device can determine whether the server needs to be converted to connect to the current best server in real time according to the startup state information at the third time. Therefore, the above method can further include the following steps:

[0120] (b1), obtaining the startup state information of the terminal device at the third time.

[0121] (b2), if the startup state information at the third time indicates that the host application on the terminal device is closed, obtaining the networking state information of the terminal device at the third time.

[0122] (b3), if the networking state information at the third time indicates that the terminal device is connected to the network, connecting the VPN process to the background server.

[0123] (b4), if the networking state information at the third time indicates that the terminal device is disconnected from the network, connecting the VPN process to the VPN process local server.

[0124] In the steps (b1-b4), the third time is any time after the VPN process is connected to the host application local server. The start state information at the third time is used to indicate whether the host application on the terminal device is started. After the VPN process is connected to the host application local server, the terminal device acquires the current start state information in real time. If the start state information indicates that the host application is closed, the VPN process will not be able to connect to the host application local server. Therefore, the terminal device acquires the current network state information again, and determines to connect the VPN process to the background server or the VPN process local server according to the network state information.

[0125] Please refer to Figure 4D The figure is a server switching processing flowchart provided by an exemplary embodiment of the present application. The steps (b1-b4) will be described below in combination with the figure. When the terminal device detects that the host application is closed, the terminal device informs the VPN process to reconnect the server. Specifically, the terminal device determines whether the terminal device is connected to the network according to the current network state information. If yes, the VPN process is connected to the background server. If no, the VPN process is connected to the VPN process local server.

[0126] In an embodiment, when the condition in the step (a24) is met (i.e. the host application on the terminal device is closed and the terminal device is connected to the network), the second target server is the background server, and the VPN process is connected to the background server at this time. When the condition in the step (a25) is met (i.e. the host application on the terminal device is closed and the terminal device is disconnected from the network), the second target server is the VPN process local server, and the VPN process is connected to the VPN process local server at this time. In the above two cases, the terminal device can acquire the start state information at the fourth time in real time, determine whether the server conversion is needed, and connect the VPN process to the host application local server to obtain better service when the switching condition is met. Therefore, the above method can further include the following steps:

[0127] (c1), acquiring start state information of the terminal device at a fourth time.

[0128] (c2), if the start state information at the fourth time indicates that the host application on the terminal device is started, switching the server to which the VPN process is connected from the background server or the VPN process local server to the host application local server.

[0129] Please refer to Figure 4EThe figure is another server switching process flowchart provided by an example embodiment of the present application, and the following will describe the steps (c1-c2) in combination with the figure: the terminal device detects the current startup state information in real time, and if the host application is started due to external operation (for example, the operation object manually starts the host application, thereby starting the host application local server), the terminal device notifies the VPN process to switch to connect to the host application local server.

[0130] It should be noted that if the startup state information at the fourth moment indicates that the host application on the terminal device is closed, the terminal device maintains the current connection state of the VPN process, and this embodiment does not repeat the description of this case.

[0131] In an embodiment, when the VPN process is connected to the background server for the first time, the terminal device needs to first establish a long connection with the device management server (MDM server). After the terminal device establishes a long connection with the device management server, if the background server detects that the VPN process is disconnected from it, the device management server will be notified to issue VPN configuration data to the terminal device. After the terminal device receives the VPN configuration data, the VPN process is connected to the background server based on the VPN configuration data. The above method makes it possible to quickly reissue the VPN configuration to the current device by using the device management server when the background server detects that the VPN process of the current device is disconnected from it, thereby realizing the real persistence of the VPN process.

[0132] Based on this, when the first target server is the background server, connecting the VPN process to the first target server (for example, step S304 described above) can be achieved according to the following steps:

[0133] (d1), after the terminal device executes the configuration task corresponding to the connection configuration file, the terminal device sends a first connection request to the device management server, and the first connection request is used to instruct the device management server to send a connection message to the push notification server.

[0134] In the embodiment of the present application, the connection configuration file is obtained by the terminal device from the data node associated with the device management server when receiving the trigger operation of the configuration file installation control in the second application interface. After the terminal device obtains the connection configuration file, the configuration task corresponding to the connection configuration file is executed.

[0135] In the present application, it may be necessary to connect the VPN process to the background server, and connecting the VPN process to the background server requires establishing an MDM channel, that is, establishing a connection between the terminal device and the MDM background server. For the user of the terminal device, before using the method for recording the use duration of the VPN process proposed in the present application, it is necessary to install the MDM configuration file on the terminal device, please refer to Figure 4FFig. 2 is a diagram of an installation interface of a configuration file according to an exemplary embodiment of the present application, which shows pre-configuration in the open juvenile guardian mode (supervision of the time of the juvenile using the mobile device by the device usage time record function). Specifically, it includes downloading a file, installing the file, and scanning the file. When downloading the file, an operation diagram is popped up on the terminal interface, and a prompt message "click the button below to go to the built-in browser of the IOS system, and then a pop-up window will appear, click 'allow', and a 'go to download' control are displayed. When the user clicks the 'go to download' control, the corresponding webpage (for example, www.xxx.com) is jumped to, and the user performs the file downloading according to the operation diagram. After the downloading, installing, and scanning of the file are performed, the MDM background server can be associated with the terminal device, and the MDM background server is prepared for subsequent issuing of the VPN configuration data to the terminal device. The terminal device performs the configuration task corresponding to the configuration file by the above method, and then the connection with the device management server is established.

[0136] From the perspective of the operation object of the terminal device, the operation object only needs to perform the related installation steps of the configuration file according to the operation diagram popped up by the application interface before using the time management method provided by the present application, so as to use the time management method provided by the present application, reduce the operation threshold and difficulty of the operation object, and thus improve the application scope of the present application.

[0137] (d2), receiving the connection parameter returned by the push notification server based on the connection message, and establishing the connection with the device management server based on the connection parameter.

[0138] (d3), sending a second connection request to the device management server.

[0139] (d4), receiving the VPN configuration data returned by the device management server based on the second connection request, and connecting the VPN process to the background server based on the VPN configuration data.

[0140] In the above steps (d1-d4), the terminal device first sends a first connection request to the device management server; the device management server sends a connection message to the push notification server (apns server) after receiving the first connection request; the push notification server returns a connection parameter to the terminal device after receiving the connection message; and the terminal device establishes a long connection with the device management server based on the connection parameter. After the long connection is established, the terminal device sends a second connection request (a connection request for indicating the connection of the VPN process to the background server) to the device management server; the device management server sends the VPN configuration data to the terminal device after receiving the second connection request; and the terminal device connects the VPN process to the background server based on the VPN configuration data.

[0141] After the terminal device and the device management server establish a long connection (i.e., the terminal device and the device management server establish an MDM channel), and when the VPN process is connected to the background server, the background server can detect whether the VPN process is disconnected in real time, and when the VPN process is disconnected, the device management server reissues the VPN configuration data through the MDM channel; when the terminal device receives the VPN configuration data, the VPN process is reconnected to the background server, thereby realizing the real persistence of the VPN process.

[0142] Please refer to Figure 4G The figure is a processing flow chart of connecting a background server provided by an exemplary embodiment of the present application, and the above steps (d1-d4) will be described below in combination with the figure: the terminal device connects the background server (corresponding to step 1 in the figure); specifically, the terminal device first notifies the device management server (corresponding to step 2 in the figure); and the device management server sends connection parameters to the push notification server (corresponding to step 3 in the figure); when the push notification server receives the connection parameters, a long connection is established with the device management server (corresponding to step 5 in the figure); the device management server sends VPN configuration data to the terminal device (corresponding to step 6 in the figure); after the terminal device obtains the VPN configuration data, the VPN process is connected to the background server based on the VPN configuration data, and the execution result is returned (corresponding to step 7 in the figure).

[0143] The present application can be applied to terminal devices of the IOS operating system. In the above method, when the IOS device establishes an MDM channel, the VPN process needs to notify the MDM background server to communicate with the push notification server (APNS server corresponding to the IOS system) after being connected to the device management server (MDM background server), and the APNS server issues a connection push to the IOS device; when the IOS device receives the push notification of the APNS server, a long connection is established with the MDM background server according to the ticket and other information provided in the push. After the long connection is established, the IOS device can connect the VPN process to the background server according to the VPN configuration data sent by the MDM background server, and the VPN process starts to record the usage duration. The background server can detect the connection state of the VPN process in real time, and when the VPN process is disconnected, the background server notifies the MDM background server, and the MDM background server can immediately issue the VPN configuration data to the IOS device to make the VPN process reconnect to the background server.

[0144] It should be noted that the above background server and MDM background server are two different servers, the background server is used to detect the connection state of the VPN process, and informs the MDM background server when the connection is disconnected; and the MDM background server is used to reissue the VPN configuration data to the terminal device when receiving the disconnection notification of the VPN process from the background server, so as to reconnect the VPN process to the background server. Since the application is applied to IOS devices for use time recording, the MDM background server needs to reissue the VPN configuration data after each disconnection of the VPN process, and the IOS device automatically reconnects the VPN process after receiving the VPN configuration data. The above method is realized through the function defined by the IOS system, and the application will not be described again.

[0145] Based on the above embodiment, when the first target server is the background server, when the VPN process is disconnected, the VPN process is reconnected to the first target server (for example, step S309 described above), which can be realized according to the following steps:

[0146] (e1), receiving the VPN configuration data sent by the device management server based on the notification message of the background server, the notification message being sent by the background server to the device management server when determining that the VPN process is disconnected.

[0147] (e2), reconnecting the VPN process to the background server based on the VPN configuration data.

[0148] In the above steps (e1-e2), when the VPN process is disconnected from the background server, the background server sends a notification message to the device management server; the device management server determines that the VPN process is disconnected from the background server when receiving the notification message, and then sends the VPN configuration data to the terminal device; the terminal device reconnects the VPN process to the background server after receiving the VPN configuration data.

[0149] In an embodiment, when the VPN process is connected to the background server, the terminal device can determine whether server conversion is needed according to the networking state information at the current time, to connect to the currently optimal server. Specifically: the terminal device obtains the networking state information at the fifth time; if the networking state information at the fifth time indicates that the terminal device is disconnected from the network, the VPN process is connected to the local server of the VPN process.

[0150] Please refer to Figure 4HFig. 6 is a flow chart of another server switching process provided by an exemplary embodiment of the present application, and the above embodiment will be explained in combination with Fig. 6. In the case that the VPN process is connected to the background server (at this time, the host application is not started), when the terminal device is disconnected from the network, the background server is in an unusable state, at this time, the VPN process local server is started, the terminal device informs the VPN process to reconnect the server, and the VPN process is connected to the VPN process local server. When the VPN process is connected to the VPN process local server, the VPN process local server can monitor whether the current network is available by starting a timer.

[0151] If the terminal device restores the network connection after the VPN process is connected to the VPN process local server (assuming that the host application is not started), the VPN process will attempt to switch the server and reconnect to the background server. Please refer to Figure 4I Fig. 7 is a flow chart of another server switching process provided by an exemplary embodiment of the present application, and the above embodiment will be explained in combination with Fig. 7. In the case that the VPN process is connected to the VPN process local server (at this time, the host application is not started), when the terminal device is connected to the network, the background server is in an available state, at this time, the terminal device informs the VPN process to reconnect the server, and the VPN process is connected to the background server.

[0152] In the present application, if the terminal device is completely disconnected from the network, and the operation object closes the VPN process, then the VPN process will not be automatically restarted, unless waiting for the terminal device to reconnect to the network or the operation object starts the host APP.

[0153] It should be noted that in the present scheme, the VPN process may need to be connected to the background server, and the VPN process needs to be connected to the background server to establish an MDM channel, that is, the terminal device is connected to the MDM background server. For the user of the terminal device, before using the method of recording the use time of the VPN process provided by the present application, the MDM configuration file needs to be installed on the terminal device, so that Figure 4FFor example, the figure shows the pre-configuration in the open youth guardian mode (supervision of the use of mobile devices by teenagers through the device use time record function). Specifically, it includes downloading files, installing files, and scanning files. When downloading files, an operation diagram will pop up on the terminal interface, and a prompt message "click the button below to go to the built-in browser of the IOS system, and a pop-up window will appear. Click 'Allow' and the 'Go to Download' control. When the user clicks the 'Go to Download' control, it will jump to the corresponding web page (for example: www.xxx.com), and the user will perform the corresponding operation according to the operation diagram to download the file. After executing the download file, install file and scan file, the MDM background server can establish an association with the terminal device, and prepare for the subsequent issuance of VPN configuration data by the MDM background server to the terminal device.

[0154] In an embodiment, the application can accurately record the use time data of the terminal device and display it. The operation object can freely view the use time data of a certain time period on the terminal device, so as to understand the use status of the terminal device in that time period, and facilitate the use management of the terminal device. Specifically, the terminal device can perform the following steps when the operation object performs a use time query operation:

[0155] (f1) In response to a triggering operation on the time selection control in the third application interface, determine the target time period corresponding to the triggering operation, and the target time period includes at least one unit time period.

[0156] In an embodiment, the operation object triggers the time selection control to perform time selection and other operations, and the terminal device responds to the operation to obtain the corresponding target time period (for example, March 7, 2022 00:00 to March 9, 2022 00:00), which includes at least one unit time period (for example, each unit time period is one day, that is, the target time period includes two unit time periods).

[0157] (f2) Obtain the use time of the terminal device in each unit time period from the database.

[0158] In an embodiment, the terminal device obtains the use time of the terminal device in each unit time period from the database (for example, obtains the use time from March 7, 2022 00:00 to March 8, 2022 00:00, and obtains the use time from March 8, 2022 00:00 to March 9, 2022 00:00).

[0159] (f3) Display the use time of the terminal device in each unit time period in the third application interface by a preset manner.

[0160] In an embodiment, the terminal device displays the usage time length of the terminal device corresponding to each unit time period in the third application interface in a preset manner (for example, in the form of a column chart, a line chart, a curve chart, a sector chart, or the like). For example, the terminal device can display the usage time length of the terminal device for each day in the last week in the form of a column chart in the third application interface, and can also display the average usage time length of the terminal device in the last week, so that the operation object can more intuitively view the recent usage status of the terminal device.

[0161] It should be noted that the unit time period of one day is only exemplary, and the unit time period can also be one hour, one week, one month, and the unit time period can be adjusted according to business conditions, which will not be described herein.

[0162] The following will be described by taking Figure 4J The above steps will be described with reference to Figure 4J The figure is an interface display diagram of a usage time length statistics provided by an exemplary embodiment of the present application, which displays a usage time length display interface in a mobile phone manager home guard scenario. The parent applet in the home guard scenario hopes to display the total usage time length of the terminal device by the teenager every day. The usage time length display interface includes the current viewing time (for example, March 3, Thursday), a time selection control (that is, the 403 control in the figure, which is used to select the viewing date of the usage time length), the current device state (for example, the device is not currently in use), the weekly usage time length statistics (for example, the average time length of the current week, and the usage time length of each day.

[0163] The dashed line in the figure represents the average time length of the current week). When the operation object triggers the time selection control in the third application interface, the terminal device can display a window such as a time selection list at a corresponding position of the third application interface, and the operation object can further select the time, and finally the terminal device displays the usage time length in the corresponding time range in the third application interface. Through the usage time length statistics function of the present application, the time of the teenager using the terminal device is managed, and the purpose of healthy online is achieved.

[0164] In an embodiment, when the terminal device detects that the usage time length is too large, the terminal device forcibly disconnects the connection between the currently connected servers, and prompts. Based on this, the terminal device can further perform the following steps:

[0165] (g1) obtaining a time length threshold corresponding to a time interval in which the current time is located.

[0166] (g2) if the usage time length of the terminal device is greater than or equal to the time length threshold, disconnecting the connection between the VPN process and the currently connected server.

[0167] In an embodiment, the time length threshold value can be set individually, for example, 3 hours. At this time, the terminal device can perform steps (g1-g2) when detecting that the use time length exceeds 3 hours. Meanwhile, the time length threshold value can also be set in combination with a time interval, that is, the time length threshold value in a certain time interval, for example, 14 hours per week. At this time, the terminal device can detect the use time length sum in the week in real time, and perform steps (g1-g2) when the use time length sum exceeds 14 hours.

[0168] (g3), canceling display of the identification information of the VPN process in the first application interface, and outputting prompt information, the prompt information being used to indicate that the use time length of the terminal device exceeds a specified time length.

[0169] In an embodiment, when the use time length of the terminal device is greater than or equal to the time length threshold value, the terminal device can disconnect the connection between the VPN process and the currently connected server, or directly close the VPN process. At this time, the terminal device cancels display of the identification information of the VPN process in the first application interface. When the use time length of the terminal device is greater than or equal to the time length threshold value, disconnecting the VPN process and stopping timing can reduce the power consumption in some scenarios and avoid resource consumption. For example, if it is specified that the use time length of the terminal device exceeds the time length threshold value within a certain time interval range, the terminal device directly reports and notifies the management device to perform subsequent management operations. At this time, the terminal device can reduce the power consumption by disconnecting the VPN process or closing the VPN process.

[0170] In an embodiment, when the use time length of the terminal device is greater than or equal to the time length threshold value, the terminal device outputs prompt information, for example, “You have reached ten hours of use time today, please put down your phone and rest”, which is used to indicate that the use time length of the terminal device exceeds a specified time length, so as to remind the operation object to stop using the terminal device.

[0171] In an embodiment, the terminal device can also be bound to a management device, and the management device is used to supervise the use status of the terminal device. When the use time length of the terminal device is greater than or equal to the time length threshold value, the terminal device can output prompt information in a certain application interface of the terminal device, which is used to prompt the operation object, and can also output the prompt information to the management device bound to the terminal device, so as to inform the management object that the use time length of the terminal device exceeds a specified range, thereby supervising the use of the device based on the use time length.

[0172] Based on the above embodiments, the application has the beneficial effects that: the application first starts the VPN process, and then obtains the device state information at the current time, which can include the start state information of the host application and the networking state information of the terminal device. Through various types of device state information, the current optimal server can be quickly and accurately determined, and then the VPN process is connected to the server to perform the timing task. Since each server in the application has different business function attributes, the effect of connecting the VPN process to each server is different. Therefore, the terminal device can also obtain the latest device state information in real time, and determine the optimal second target server that can be connected at the current time according to the latest device state information, so that the effect of performing the use time recording task is better, for example, the processing efficiency of the second target server is higher, the efficiency of restarting the VPN process after the VPN is disconnected is higher, and the like.

[0173] The application also proposes that when determining the target server according to the device state information, the start state information of the terminal device at the second time is first obtained; if the start state information indicates that the host application is started, the target server is determined as the host application local server; if the start state information indicates that the host application is closed, the networking state information is further obtained, if the networking state information indicates that the terminal device is connected to the network, the target server is determined as the background server; if the networking state information indicates that the terminal device is disconnected from the network, the target server is determined as the VPN process local server. That is to say, according to the different business function attributes of each server, the VPN process is connected in the order of the host application local server, the background server, and the VPN process local server from high to low priority, so that the effect of the VPN process performing the use time recording task is better.

[0174] The application also proposes that since the start state of the host application and the networking state of the terminal device can change at any time, the terminal device can determine in real time whether the server needs to be converted according to the start state information at the current time to connect to the current optimal server. For example, when the VPN process is connected to the host application local server, if the host application is closed and the terminal device is connected to the network, the connection is switched to the background server; if the host application is closed and the terminal device is disconnected from the network, the connection is switched to the VPN process local server. For another example, when the VPN process is connected to the background server or the VPN process local server, if the host application is started, the connection is switched to the background server; if the host application is closed and the terminal device is disconnected from the network, the connection is switched to the host application local server.

[0175] The application also proposes that when the VPN process first connects with the background server, the terminal device needs to first establish a long connection with the device management server. After the terminal device establishes a long connection with the device management server, if the background server detects that the VPN process is disconnected from it, the device management server will be notified to issue VPN configuration data to the terminal device. After the terminal device receives the VPN configuration data, the terminal device will connect the VPN process to the background server based on the VPN configuration data. After the long connection is established, and when the VPN process is connected to the background server, the background server can detect whether the VPN process is disconnected in real time, and reissue the VPN configuration data through the device management server when the VPN process is disconnected. When the terminal device receives the VPN configuration data, the VPN process is reconnected to the background server, so as to realize the real residence of the VPN process.

[0176] The application also proposes that the operation object can freely view the use time length data of a time period on the terminal device, so as to understand the use condition of the terminal device in the time period, so as to facilitate the use management of the terminal device. Moreover, when the terminal device detects that the use time length is too large, the terminal device will forcibly disconnect the connection between the currently connected servers, and prompt. The terminal device can also be bound with a management device, and the management device is used to supervise the use condition of the terminal device. When the use time length of the terminal device is greater than or equal to the time length threshold, the terminal device can output prompt information to the management device, so as to further supervise the use of the terminal device.

[0177] Please refer to Figure 5 , which is a schematic block diagram of a time length management device provided by an embodiment of the application. The time length management device can specifically include:

[0178] The execution module 501 is configured to start a timing task by using the VPN process after the VPN process is connected to the first target server.

[0179] The execution module 501 is further configured to restart the VPN process and reconnect the VPN process to the first target server if the VPN process is closed and the VPN process is disconnected from the first target server.

[0180] The acquisition module 502 is configured to acquire a target time length of the VPN process timing and recorded screen-on data of the terminal device.

[0181] The calculation module 503 is configured to determine a use time length of the terminal device according to the target time length and the screen-on data.

[0182] Optionally, the execution module 501 is further configured to:

[0183] In response to a triggering operation on the VPN starting control, a VPN process is started, and identification information of the VPN process is displayed on the first application interface.

[0184] Obtain device state information of the terminal device at a first time point;

[0185] Determine a first target server according to the device state information at the first time point, and connect the VPN process to the first target server, the first target server being one of a host application local server, a background server, and a VPN process local server.

[0186] Optionally, the execution module 501 is further configured to:

[0187] Obtain device state information of the terminal device at a second time point;

[0188] Determine a second target server according to the device state information at the second time point, the second target server being one of the host application local server, the background server, and the VPN process local server;

[0189] If the second target server is different from the first target server, disconnect the VPN process from the first target server, and connect the VPN process to the second target server.

[0190] Optionally, the device state information includes startup state information, and when determining the second target server according to the device state information at the second time point, the execution module 501 is specifically configured to:

[0191] Obtain startup state information of the terminal device at the second time point;

[0192] If the startup state information at the second time point indicates that the host application on the terminal device is started, determine the second target server as the host application local server.

[0193] Optionally, the execution module 501 is further configured to:

[0194] Obtain startup state information of the terminal device at a third time point;

[0195] If the startup state information at the third time point indicates that the host application on the terminal device is closed, obtain networking state information of the terminal device at the third time point;

[0196] If the networking state information at the third time point indicates that the terminal device is connected to a network, connect the VPN process to the background server;

[0197] If the networking state information at the third moment indicates that the terminal device is disconnected from the network, the VPN process is connected to the VPN process local server.

[0198] Optionally, the device state information further includes networking state information, and the execution module 501 is further configured to:

[0199] If the startup state information at the second moment indicates that the host application on the terminal device is closed, the networking state information of the terminal device at the second moment is acquired.

[0200] If the networking state information at the second moment indicates that the terminal device is connected to the network, the second target server is determined as the background server.

[0201] If the networking state information at the second moment indicates that the terminal device is disconnected from the network, the second target server is determined as the VPN process local server.

[0202] Optionally, after the second target server is determined as the background server, or after the second target server is determined as the VPN process local server, the execution module 501 is further configured to:

[0203] The startup state information of the terminal device at a fourth moment is acquired.

[0204] If the startup state information at the fourth moment indicates that the host application on the terminal device is started, the server to which the VPN process is connected is switched from the background server or the VPN process local server to the host application local server.

[0205] Optionally, the first target server is a background server, and the execution module 501 is further configured to:

[0206] After the configuration task corresponding to the connection configuration file is executed, a first connection request is sent to a device management server, the first connection request being used to instruct the device management server to send a connection message to a push notification server; the connection configuration file is acquired from a data node associated with the device management server when a trigger operation on a configuration file installation control in a second application interface is received.

[0207] The connection parameter returned by the push notification server based on the connection message is received, and a connection with the device management server is established based on the connection parameter.

[0208] A second connection request is sent to the device management server.

[0209] receive the VPN configuration data returned by the device management server based on the second connection request, and connect the VPN process to the background server based on the VPN configuration data.

[0210] Optionally, the execution module 501 is specifically configured to:

[0211] receive the VPN configuration data sent by the device management server based on the notification message of the background server, the notification message being sent by the background server to the device management server when determining to disconnect the VPN process;

[0212] reconnect the VPN process to the background server based on the VPN configuration data.

[0213] Optionally, the execution module 501 is further configured to:

[0214] obtain a duration threshold corresponding to a time interval in which the current time is located;

[0215] if the use duration of the terminal device is greater than or equal to the duration threshold, disconnect the connection between the VPN process and the currently connected server;

[0216] cancel displaying the identification information of the VPN process in the first application interface, and output prompt information, the prompt information being used to indicate that the use duration of the terminal device exceeds the specified duration.

[0217] Optionally, the execution module 501 is further configured to:

[0218] in response to a trigger operation on a time selection control in a third application interface, determine a target time period corresponding to the trigger operation, the target time period including at least one unit time period;

[0219] obtain the use duration of the terminal device corresponding to each unit time period in the at least one unit time period from a database;

[0220] display the use duration of the terminal device corresponding to each unit time period in the third application interface in a preset manner.

[0221] Based on the duration management apparatus, the VPN process can be connected to the first target server, and then the timing task can be started by using the VPN process, and the use duration of the terminal device can be determined according to the target duration of the VPN process timing and the recorded screen-on data of the terminal device.

[0222] Compared with recording the use time length of the device by using the use time length recording software, the use time length is recorded by using the VPN process, the VPN process can only be manually closed by the used object, the possibility of being closed by mistake by the used object or being forcibly closed by the system due to high memory occupation is reduced, and the accuracy of recording the use time length based on the VPN process is improved.

[0223] Since the VPN process occupies less memory than the use time length recording software, the use time length is counted by using the VPN process, the power consumption of the terminal device for recording the use time length is reduced. When the VPN process is closed, the terminal device starts the VPN process immediately and reconnects the VPN process to the first target server, so that the VPN process is always resident.

[0224] The above method enables the VPN process to quickly return to the timing task, so that stable and accurate timing operation is performed, and the accuracy of recording the use time length is further improved.

[0225] When determining the target server according to the device state information, the terminal device first acquires the start state information of the terminal device at the second time; if the start state information indicates that the host application is started, the target server is determined as the host application local server; if the start state information indicates that the host application is closed, the networking state information is further acquired, if the networking state information indicates that the terminal device is connected to the network, the target server is determined as the background server; if the networking state information indicates that the terminal device is disconnected from the network, the target server is determined as the VPN process local server.

[0226] According to different business function attributes of each server, the VPN process is connected in the order of the priority of the host application local server, the background server and the VPN process local server from high to low, so that the effect of the VPN process in performing the use time length recording task is better.

[0227] It should be noted that the functions of each functional module of the time length management device in the embodiment of the application can be implemented according to the method in the above method embodiment, and the specific implementation process can refer to the related description of the above method embodiment, which will not be described here.

[0228] Please refer to Figure 6 , which is a schematic block diagram of a computer device provided by an embodiment of the application. As shown in the embodiment, the intelligent terminal can include a processor 601, a storage device 602 and a communication interface 603. The processor 601, the storage device 602 and the communication interface 603 can exchange data.

[0229] The storage device 602 can include a volatile memory, such as a random-access memory (RAM); the storage device 602 can also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), or the like; the storage device 602 can also include a combination of the above-mentioned memories.

[0230] The processor 601 can be a central processing unit (CPU). In an embodiment, the processor 601 can also be a graphics processing unit (GPU). The processor 601 can also be a combination of a CPU and a GPU. In an embodiment, the storage device 602 is configured to store program instructions, and the processor 601 can invoke the program instructions to perform the following operations:

[0231] After the virtual private network (VPN) process is connected to a first target server, a timing task is started by using the VPN process;

[0232] If the VPN process is closed and the VPN process is disconnected from the first target server, the VPN process is restarted, and the VPN process is reconnected to the first target server;

[0233] A target duration of the VPN process timing and screen-on data of a terminal device are obtained;

[0234] A use duration of the terminal device is determined according to the target duration and the screen-on data.

[0235] Optionally, the processor 601 is further configured to:

[0236] In response to a trigger operation on a VPN starting control, a VPN process is started, and identification information of the VPN process is displayed on a first application interface.

[0237] Device state information of the terminal device at a first time point is obtained.

[0238] A first target server is determined according to the device state information at the first time point, and the VPN process is connected to the first target server, wherein the first target server is one of a host application local server, a background server, and a VPN process local server.

[0239] Optionally, the processor 601 is further configured to:

[0240] obtain device state information of the terminal device at a second time point;

[0241] determine a second target server according to the device state information at the second time point, the second target server being one of a host application local server, a background server, and a VPN process local server;

[0242] if the second target server is different from the first target server, disconnect the VPN process from the first target server and connect the VPN process to the second target server.

[0243] Optionally, the device state information includes startup state information, and the processor 601, when determining the second target server according to the device state information at the second time point, is specifically configured to:

[0244] obtain startup state information of the terminal device at the second time point;

[0245] if the startup state information at the second time point indicates that the host application on the terminal device is started, determine the second target server as the host application local server.

[0246] Optionally, the processor 601 is further configured to:

[0247] obtain startup state information of the terminal device at a third time point;

[0248] if the startup state information at the third time point indicates that the host application on the terminal device is closed, obtain networking state information of the terminal device at the third time point;

[0249] if the networking state information at the third time point indicates that the terminal device is connected to a network, connect the VPN process to the background server;

[0250] if the networking state information at the third time point indicates that the terminal device is disconnected from the network, connect the VPN process to the VPN process local server.

[0251] Optionally, the device state information further includes networking state information, and the processor 601 is further configured to:

[0252] if the startup state information at the second time point indicates that the host application on the terminal device is closed, obtain networking state information of the terminal device at the second time point;

[0253] if the networking state information at the second time point indicates that the terminal device is connected to a network, determine the second target server as the background server;

[0254] If the networking state information at the second moment indicates that the terminal device is disconnected from the network, the second target server is determined as the VPN process local server.

[0255] Optionally, after determining the second target server as the background server, or after determining the second target server as the VPN process local server, the processor 601 is further configured to:

[0256] obtain startup state information of the terminal device at a fourth moment;

[0257] If the startup state information at the fourth moment indicates that a host application on the terminal device is started, the server connected by the VPN process is switched from the background server or the VPN process local server to a host application local server.

[0258] Optionally, the first target server is a background server, and the processor 601 is further configured to:

[0259] after executing the configuration task corresponding to the connection profile, send a first connection request to a device management server, the first connection request being used to instruct the device management server to send a connection message to a push notification server; the connection profile is obtained from a data node associated with the device management server when a triggering operation on a profile installation control in a second application interface is received;

[0260] receive connection parameters returned by the push notification server based on the connection message, and establish a connection with the device management server based on the connection parameters;

[0261] send a second connection request to the device management server;

[0262] receive VPN configuration data returned by the device management server based on the second connection request, and connect the VPN process to the background server based on the VPN configuration data.

[0263] Optionally, when the processor 601 is used to reconnect the VPN process to the first target server, the processor 601 is specifically used to:

[0264] receive the VPN configuration data sent by the device management server based on a notification message of the background server, the notification message being sent by the background server to the device management server when it is determined that the VPN process is disconnected;

[0265] reconnect the VPN process to the background server based on the VPN configuration data.

[0266] Optionally, the processor 601 is further configured to:

[0267] obtain a duration threshold corresponding to a time interval in which the current time is located;

[0268] if the use duration of the terminal device is greater than or equal to the duration threshold, disconnect the connection between the VPN process and the currently connected server;

[0269] cancel displaying the identification information of the VPN process in the first application interface, and output prompt information, the prompt information being used to indicate that the use duration of the terminal device exceeds the specified duration.

[0270] Optionally, the processor 601 is further configured to:

[0271] in response to a triggering operation on a time selection control in a third application interface, determine a target time period corresponding to the triggering operation, the target time period including at least one unit time period;

[0272] obtain, from a database, the use duration of the terminal device corresponding to each unit time period in the at least one unit time period;

[0273] display, in the third application interface, the use duration of the terminal device corresponding to each unit time period by a preset manner.

[0274] Based on the computer device, the present application can start a timing task by connecting the VPN process to the first target server, and then determine the use duration of the terminal device according to the target duration of the VPN process and the recorded screen-on data of the terminal device.

[0275] Compared with using a use duration recording software to record the use duration of the device, the present application records the use duration by using the VPN process. The VPN process can only be manually closed by the user, which reduces the possibility of being mistakenly closed by the user and the possibility of being forcibly closed by the system due to high memory occupation, and improves the accuracy of recording the use duration based on the VPN process.

[0276] Since the VPN process occupies less memory than the use duration recording software, the use duration is counted by using the VPN process, which reduces the power consumption of the terminal device in recording the use duration. When the VPN process is closed, the terminal device will immediately start the VPN process and reconnect the VPN process to the first target server, ensuring the persistence of the VPN process.

[0277] The above method enables the VPN process to quickly return to the timing task, thereby performing stable and accurate timing operation, and further improving the accuracy of recording the use duration.

[0278] When a terminal device determines a target server based on its device status information, it first obtains the terminal device's startup status information at a second moment. If the startup status information indicates that the host application is running, the target server is determined to be the host application's local server. If the startup status information indicates that the host application is closed, the terminal device further obtains network status information. If the network status information indicates that the terminal device is connected to the network, the target server is determined to be a background server. If the network status information indicates that the terminal device is disconnected from the network, the target server is determined to be the VPN process's local server.

[0279] Based on the different business function attributes of each server, the VPN process is connected in descending order of priority: host application local server, background server, and VPN process local server. This makes the VPN process perform the usage duration recording task more effectively.

[0280] In specific implementation, the processor 601, storage device 602, and communication interface 603 described in the embodiments of this application can execute the embodiments of this application. Figure 2 or Figure 3 The implementation methods described in the relevant embodiments of the provided duration management method can also be implemented using the embodiments of this application. Figure 5 The implementation methods described in the relevant embodiments of the provided duration management device will not be repeated here.

[0281] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, and systems can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and other division methods may exist in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0282] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned duration management device. This computer program includes program instructions, and when a processor executes these program instructions, it can execute the aforementioned... Figure 2 , Figure 3The method in the corresponding embodiment will not be described here. In addition, the beneficial effects of using the same method will not be described here. For technical details not disclosed in the computer-readable storage medium embodiments involved in the present application, please refer to the description of the method embodiments of the present application. As an example, program instructions can be deployed on one computer device, or executed on multiple computer devices located in one place, or executed on multiple computer devices distributed in multiple places and interconnected through a communication network, which can constitute a blockchain system.

[0283] According to an aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device can perform the above Figure 2 、 Figure 3 The method in the corresponding embodiment will not be described here.

[0284] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the above-mentioned embodiments of the method. The above-mentioned storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM) or a random access memory (RAM), etc.

[0285] The above disclosure is only some embodiments of the present application, and of course cannot limit the scope of the rights of the present application. A person of ordinary skill in the art can understand that the implementation of all or part of the above-mentioned embodiments, and the equivalent changes made according to the claims of the present application, still fall within the scope of the present application.

Claims

1. A time management method, characterized in that, The method includes: After the VPN process connects to the first target server, a timing task is started using the VPN process; If the VPN process is shut down, causing the VPN process to disconnect from the first target server, then the VPN process is restarted and reconnected to the first target server. Obtain the target duration of the VPN process timing and the recorded screen-on data of the terminal device; The usage duration of the terminal device is determined based on the target duration and the screen-on data.

2. The method according to claim 1, characterized in that, The method further includes: In response to a trigger operation on the VPN startup control, the VPN process is started, and the identification information of the VPN process is displayed on the first application interface; Obtain the device status information of the terminal device at the first moment; The first target server is determined based on the device status information at the first moment, and the VPN process is connected to the first target server. The first target server is one of the host application local server, background server, and VPN process local server.

3. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain the device status information of the terminal device at the second moment; The second target server is determined based on the device status information at the second moment. The second target server is one of the host application local server, background server, and VPN process local server. If the second target server is different from the first target server, then the VPN process is disconnected from the first target server and connected to the second target server.

4. The method according to claim 3, characterized in that, The device status information includes startup status information, and the step of determining the second target server based on the device status information at the second moment includes: Obtain the startup status information of the terminal device at the second time point; If the startup status information at the second moment indicates that the host application on the terminal device has started, then the second target server is determined to be the local server of the host application.

5. The method according to claim 4, characterized in that, The method further includes: Obtain the startup status information of the terminal device at the third moment; If the startup status information at the third moment indicates that the host application on the terminal device is closed, then the network status information of the terminal device at the third moment is obtained; If the network status information at the third moment indicates that the terminal device is connected to the network, then the VPN process is connected to the background server; If the network status information at the third moment indicates that the terminal device is disconnected from the network, then the VPN process will be connected to the local server of the VPN process.

6. The method according to claim 4, characterized in that, The device status information also includes network status information, and the method further includes: If the startup status information at the second moment indicates that the host application on the terminal device is closed, then the network status information of the terminal device at the second moment is obtained; If the network status information at the second moment indicates that the terminal device is connected to the network, then the second target server is determined to be the backend server; If the network status information at the second moment indicates that the terminal device is disconnected from the network, then the second target server is determined to be the local server of the VPN process.

7. The method according to claim 6, characterized in that, After determining that the second target server is the backend server, or after determining that the second target server is the VPN process local server, the method further includes: Obtain the startup status information of the terminal device at the fourth time point; If the startup status information at the fourth moment indicates that the host application on the terminal device has started, then the server connected to the VPN process will be switched from the background server or the VPN process local server to the host application local server.

8. The method according to claim 1 or 2, characterized in that, The first target server is a backend server, and the method further includes: After executing the configuration task corresponding to the connection configuration file, a first connection request is sent to the device management server. The first connection request is used to instruct the device management server to send a connection message to the push notification server. The connection configuration file is obtained from the data node associated with the device management server when a trigger operation is received for the configuration file installation control in the second application interface. Receive connection parameters returned by the push notification server based on the connection message, and establish a connection with the device management server based on the connection parameters; Send a second connection request to the device management server; The device management server receives VPN configuration data returned based on the second connection request, and connects the VPN process to the backend server based on the VPN configuration data.

9. The method according to claim 8, characterized in that, The step of reconnecting the VPN process to the first target server includes: The device management server receives VPN configuration data based on a notification message from the backend server, wherein the notification message is sent by the backend server to the device management server when it determines that it is disconnected from the VPN process. The VPN process is reconnected to the backend server based on the VPN configuration data.

10. The method according to claim 1 or 2, characterized in that, The method further includes: Get the duration threshold corresponding to the current time interval; If the usage time of the terminal device is greater than or equal to the duration threshold, the connection between the VPN process and the currently connected server is disconnected. The VPN process identification information is removed from the first application interface, and a prompt message is output to indicate that the usage time of the terminal device has exceeded the specified time.

11. The method according to claim 1 or 2, characterized in that, The method further includes: In response to a trigger operation on a time selection control in a third application interface, a target time period corresponding to the trigger operation is determined, the target time period including at least one unit time period; Retrieve from the database the usage duration of the terminal device corresponding to each unit time period within the at least one unit time period; The third application interface displays the usage time of the terminal device corresponding to each unit time period in a preset manner.

12. A time management device, characterized in that, The device includes: An execution module is used to start a timing task using the VPN process after the VPN process connects to the first target server. The execution module is further configured to restart the VPN process and reconnect the VPN process to the first target server if the VPN process is shut down, causing the VPN process to disconnect from the first target server; The acquisition module is used to acquire the target duration of the VPN process timing and the recorded screen-on data of the terminal device; The calculation module is used to determine the usage time of the terminal device based on the target duration and the screen-on data.

13. A computer device, characterized in that, include: The processor, the communication interface, and the storage device are interconnected, wherein the storage device stores executable program code, and the processor is used to call the executable program code to implement the duration management method as described in any one of claims 1-11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions, which are executed by a processor to implement the time management method as described in any one of claims 1-11.

15. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, are used to implement the duration management method as described in any one of claims 1-11.

Citation Information

Patent Citations

  • Terminal use time management method and device

    CN106326065A

  • Terminal use time control method and apparatus, storage medium and intelligent terminal

    CN107608853A