Classroom mobile phone use time monitoring and timing method based on mobile application program
By dynamically detecting device status and user behavior, intelligently controlling the timer status in mobile applications, the problem that the prior art cannot manage timers in different states is solved, and the continuous and accurate timing of timers is realized, and the user experience is improved.
Patent Information
- Application Number
- CN202510247030.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology cannot intelligently manage the timer status in different states such as background and lock screen, affecting the user experience.
By dynamically detecting the operating status of the device and user behavior, the running status of the timer is intelligently controlled, including the front desk, background, small window mode, lock screen status, etc., to ensure the continuous and accurate timing of the timer in different environments.
It realizes the stable and accurate operation of the timer in different environments, improving the user experience, especially in multi-task scenarios.
Smart Images

Figure CN119781845A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mobile terminal application management, and mainly to a classroom mobile phone usage time monitoring and timing method based on mobile application. Background Art
[0002] In today's digital age, smartphones have been deeply integrated into people's lives, and students are no exception. For students, while mobile phones bring convenient communication and rich learning resources, they also cause a series of problems that cannot be ignored. In classroom scenarios, the phenomenon of students playing with mobile phones in class is becoming more and more common, which seriously distracts students' attention, causing a significant decrease in learning efficiency, and thus affecting the quality of teaching.
[0003] To solve this problem, the following two solutions are currently used: Forcing students to hand in their mobile phones: This method is common in all kinds of schools. Schools formulate rules and regulations to require students to hand in their mobile phones before class, which will be kept by teachers or the school and returned to students after class or after school. However, this approach has many disadvantages and is prone to cause a series of disputes.
[0004] Classroom mobile phone behavior monitoring system based on AI monitoring: With the rapid development of video surveillance technology and artificial intelligence technology, classroom mobile phone behavior monitoring system based on AI monitoring has emerged. The system uses video surveillance equipment to collect classroom images, and with the help of advanced image processing and artificial intelligence algorithms, it can monitor students' behavior in the classroom in real time and accurately, especially the intelligent identification of mobile phone behavior. Once a student is detected using a mobile phone, the system will automatically issue a real-time alarm. This system has many advantages. It can eliminate interference factors such as light and shadows, accurately identify students using mobile phones, and has high accuracy and reliability. Managers can also customize and adjust the algorithm as needed, set different alarm thresholds, alarm methods, alarm contents, etc. to adapt to different educational scenarios and security needs. However, the system is not perfect. On the one hand, its initial construction cost is high, requiring schools to invest a lot of money in purchasing hardware equipment and software systems; on the other hand, there are certain risks in data privacy protection. Students' classroom behavior data may be at risk of being leaked during collection, storage and transmission.
[0005] Currently, mobile timer applications usually pause timing when switching to the background or locking the screen, or cannot handle the problem of continuous timing in multi-tasking scenarios. The existing technology cannot achieve intelligent management of timer status in different states such as background and lock screen, thus affecting the user experience. Summary of the invention
[0006] In response to the above problems, the present invention dynamically detects the operating status of the device and user behavior, and intelligently controls the operating status of the timer, including foreground, background, small window mode, lock screen status, etc., to ensure the continuous and accurate timing of the timer in different environments.
[0007] According to a first aspect of the present invention, a method for monitoring and timing the usage time of mobile phones in a classroom based on a mobile application is proposed, and the specific steps include: When the application is started, the application enters the view rendering and timer starting phase; when the user interacts with the application, the application enters the foreground switching and timer activity phase, at which time the timer continues to run; When the application is switched to the background, lock screen or small window mode, the system will enter the timer management stage in the background, lock screen and small window mode, during which the timer will be paused or adjusted; When the application returns to the foreground, the foreground recovery and timer continuation phase is entered, and the timer resumes normal operation; When the user exits the application or the application is destroyed, it enters the destruction and exit phase, where the application is closed and resources are released.
[0008] Furthermore, the specific steps of the view rendering and timer starting phase include: The view thread completes the first rendering and displays the initial timing page. At this time, the user logs in to the timing page and the timer starts timing; The view thread notifies the application service thread through the interface to start timing and enter the Ready state; The application service thread enters the Active state through the received onReady event and starts the timing operation; The application service thread continuously receives data transmitted from the view thread to ensure the consistency and accuracy of the data.
[0009] Furthermore, the specific steps of the foreground switching and timer activity phase include: The view thread continuously updates the interface in the Active state to display the real-time timing results. When the timer status changes, the view thread re-renders the interface and updates the timer status through the message passing mechanism. When the application service thread is in the Active state, it periodically synchronizes the current timing data to the background according to the timer status to ensure data persistence; at the same time, the application service thread always monitors the device status, including the switching between the foreground and the background, the lock screen status, and the window mode. If it switches to the background, the onHide event is triggered.
[0010] Furthermore, the specific steps of the timer management stage in the background, lock screen and small window modes include: When the application switches to the background or locks the screen, the view thread suspends rendering and updating of the timer and enters the End state; The view thread notifies the timer to pause, but if the screen is locked, the timer will continue to run unaffected; The application service thread keeps the timer running through the background service and is not affected by the lock screen mode; When the device enters the background, the application service thread automatically switches to the Alive state to maintain background management of the timer; Once the system detects that the user switches to the foreground, the application service thread will return to the Alive state and continue timing.
[0011] Furthermore, the specific steps of the foreground recovery and timer continuation phase include: When the user switches back to the application from the background or lock screen state, the view thread detects the onShow event and resumes the timer interface rendering to display the timing data at that time; The view thread triggers the timer to continue running through the message passing mechanism; When the application service thread receives the onShow event, it resumes the timer, continues timing, and synchronizes the timing data to the background.
[0012] Furthermore, the specific steps of the destruction and exit phase include: When the user exits the application or destroys the view, the view thread enters the End state, stopping interface rendering and timer updates; The view thread turns off the timer by terminating rendering, updating, and timing operations; The application service thread closes the timer process through the onUnload event, saves the final timing data and destroys all related resources; When the application completely exits, the application service thread shuts down the background service to ensure resource release.
[0013] Furthermore, the application appears in a multi-tasking window or split-screen mode, which includes multiple threads for data processing, setting priorities for different threads to avoid deadlock caused by timer changes when switching between the foreground and background under multi-tasking.
[0014] According to a second aspect of the present invention, a computer program product is provided, on which one or more computer programs are stored. When the one or more computer programs are executed by a computer processor, the above method is implemented.
[0015] According to a third aspect of the present invention, a computer system is provided, comprising a processor and a memory, wherein the processor is configured to implement the above method during execution.
[0016] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects: 1) Intelligent timer status management: The system can dynamically adjust the timer's operating status according to the device's foreground, background, lock screen, small window and other states.
[0017] 2) Stable timing in multi-tasking scenarios: The background service technology supports the timer to continue running in the background and lock screen state to ensure that the timing data is not lost.
[0018] 3) User experience optimization: The present invention ensures that users can stably use the timer function in any application state (foreground, background, lock screen, etc.), thereby improving the fluency of multi-tasking. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.
[0020] Figure 1 A flow chart of a method for monitoring and timing mobile phone usage time in a classroom based on a mobile application according to an embodiment of the present invention is shown.
[0021] Figure 2 It is a structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION
[0022] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0023] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0024] Figure 1FIG. 1 is a flow chart showing a method for monitoring and timing classroom mobile phone usage time based on a mobile application according to an embodiment of the present invention. Figure 1 As shown, the timer starts timing after the user enters the timing page of the timer application. When the user enters the page for the first time, a new timer is created, and each subsequent entry will read the last timing record to continue timing. When the user switches applications and leaves the timing page (including page switching within the application), the timer is paused until the user returns to the timer page again and the timer continues timing. In addition, if the screen is locked while the timer page is in timing state, the timer continues timing and is not affected by the background switching action. The specific operation steps include: Step 1: Application startup phase; When the application starts, the system enters the Start state. The view thread performs initialization operations, loads necessary resources, and prepares to receive user input.
[0025] The view thread receives initialization data from the application service thread, including the specified usage time of the student (e.g., 30 minutes), and renders the interface based on the data. Then, the view thread enters the Inited state, waiting for data to load until the timer initial data is received.
[0026] The application service thread starts and enters the Created state, executes the onLoad and onShow events, and prepares to start the timer's related services.
[0027] After the application service thread receives the initial data from the view thread, it completes the necessary data synchronization and prepares to enter the Active state.
[0028] Initialize the application, load resources, and render the initial interface. The view thread is ready to receive data and user input. Ensure that resources are fully prepared and the interface is loaded in time when the application starts to improve the user experience.
[0029] The application service thread starts and prepares to start related services, performs necessary data synchronization and timer settings, and prepares the application's timer and data in the background to ensure that the application can smoothly enter the next stage after the view thread receives the data.
[0030] Step 2: View rendering and timer start phase; When the application is started, the application enters the view rendering and timer starting phase; The view thread completes the first rendering and displays the initial timing page, including. At this point, the user sees the timer interface and the timer starts. Then, the view thread notifies the application service thread through the interface to start timing and enters the Ready state.
[0031] The application service thread enters the Active state through the received onReady event and starts the timing operation; the application service thread continuously receives the data transmitted from the view thread to ensure the consistency and accuracy of the data.
[0032] In this embodiment, after startup, the view thread will render a timing interface for the student's online time and start timing. Once the timer is started, the timer will be displayed in real time for the student to use the phone. The application service thread will receive the event of the view thread and enter the Active state to start the timing operation. If the student enters the APP at the beginning of the class, the timer will be recorded and started. The timer will continue to track the online time and synchronize the data to the view thread every minute or within a set period.
[0033] The view thread renders the initial interface and starts the timer, displays the timer status to the user, responds to the user quickly and displays the real-time timing status, improving the user's feedback perception of the application.
[0034] The application service thread activates the timer and ensures data synchronization, ensures that the timer keeps running accurately in the background, and synchronizes the data to the view thread to ensure real-time updates.
[0035] Step 3, foreground switching and timer activity stage; When the user interacts with the application, the application enters the foreground switching and timer activity phase, and the timer continues to run; In this embodiment, if the student switches applications or interacts with the application, the timer will continue to run. The view thread will update the timing interface in real time and send a "continue timing" instruction to the application service thread.
[0036] When the timer status changes, the application service thread periodically synchronizes the current timing data to the background and saves it persistently to ensure the accuracy of the timing data and avoid time loss caused by device status switching (such as lock screen, background).
[0037] The view thread continuously updates the interface in the Active state to display the real-time timing results. When the timer status changes, the view thread re-renders the interface and updates the timer status through the message passing mechanism. When the application service thread is in the Active state, it periodically synchronizes the current timing data to the background according to the timer status to ensure data persistence; at the same time, the application service thread always monitors the device status, including the switching between the foreground and the background, the lock screen status, and the window mode. If it switches to the background, the onHide event is triggered.
[0038] The view thread continuously renders the real-time updated interface and updates the display when the timer status changes. Users can always see real-time timing data during use, enhancing the user interaction experience.
[0039] The application service thread regularly synchronizes timing data to ensure the continuity and accuracy of timing, even when the application is in the background; it maintains the stability of timing data in the background to ensure that timing is not interrupted or data is lost.
[0040] Step 4: Timer management phase in background, lock screen and window mode; When the application is switched to the background, lock screen or small window mode, the system will enter the timer management stage in the background, lock screen and small window mode, during which the timer will be paused or adjusted; When the application switches to the background or locks the screen, the view thread suspends rendering and updating of the timer and enters the End state; The view thread notifies the timer to pause, but if the screen is locked, the timer will continue to run unaffected; The application service thread keeps the timer running through the background service and is not affected by the lock screen mode; When the device enters the background, the application service thread automatically switches to the Alive state to maintain background management of the timer; Once the system detects that the user switches to the foreground, the application service thread will return to the Alive state and continue timing.
[0041] In this embodiment, when the student's device switches to the background or lock screen mode, the view thread stops rendering and updating the timer, but the timer continues to run in the background. The view thread enters the End state and stops the timing display.
[0042] The application service thread will switch to the Alive state, keeping the timer running in the background, unaffected by the lock screen or background state, ensuring that the timer continues to track the student's online time.
[0043] The view thread suspends interface updates and stops rendering when the app enters the background or locks the screen, reducing system resource consumption while ensuring that it can be quickly restored when the user uses it again.
[0044] The application service thread ensures that the timer continues to run in the background or when the screen is locked, and resumes normal timing when switching back to the foreground; by continuously running in the background, the accuracy and continuity of the timing data are guaranteed even if the user is not in the application.
[0045] Step 5, the foreground is restored and the timer continues to run; When the application returns to the foreground, the foreground recovery and timer continuation phase is entered, and the timer resumes normal operation; When the user switches back to the application from the background or lock screen state, the view thread detects the onShow event and resumes the timer interface rendering to display the timing data at that time; The view thread triggers the timer to continue running through the message passing mechanism; When the application service thread receives the onShow event, it resumes the timer, continues timing, and synchronizes the timing data to the background.
[0046] In this embodiment, when the student unlocks the screen or switches back to the application, the view thread detects the onShow event and resumes rendering the timer interface. The interface will be updated to the current timing data and continue timing.
[0047] The timer resumes running, continues to record the student's online time, and regularly synchronizes the timing data to the background.
[0048] The view thread restores the timer interface and displays the current data, and continues to update the timer; quickly restores the user experience and ensures that the timer status is consistent with user expectations.
[0049] The application service thread resumes the timer and synchronizes the data to the background, ensuring that the timer is still accurate when it is resumed and synchronized with the background to avoid data loss.
[0050] Step 6: Application destruction and exit phase; When the user exits the application or the application is destroyed, it enters the destruction and exit phase, and the application is closed and resources are released; When the user exits the application or destroys the view, the view thread enters the End state, stopping interface rendering and timer updates; The view thread turns off the timer by terminating rendering, updating, and timing operations; The application service thread closes the timer process through the onUnload event, saves the final timing data and destroys all related resources; When the application completely exits, the application service thread shuts down the background service to ensure resource release.
[0051] The view thread stops rendering the interface, destroys timers and resources, and releases the resources occupied by the application to ensure a smooth and efficient exit operation.
[0052] The application service thread turns off the timer and releases background resources, ensuring that resources are effectively released, preventing memory leaks or background processes from continuing to run, and improving system stability.
[0053] In this embodiment, when the student exits the application or the timer ends, the view thread will stop rendering the interface and turn off the timer. The final time of the timer will be submitted to the application service thread.
[0054] The application service thread will receive the onUnload event, save the student's timing data, and release related resources.
[0055] The application appears in a multi-tasking window or split-screen mode, which includes multiple threads for data processing, setting priorities for different threads to avoid deadlock caused by timer changes when switching between the foreground and background under multi-tasking.
[0056] In this embodiment, a data screening and warning system is introduced; Through the timer, the application service thread records the online time of each student and stores it in the background database.
[0057] When a student's usage time exceeds the set time (for example: 30 minutes), the application will trigger a warning and notify the teacher or student through a notification or report.
[0058] The application can use the filtering function to quickly view all students who have exceeded the prescribed time, helping teachers take targeted measures.
[0059] In summary, in order to monitor the phenomenon of students playing with their mobile phones during class, the present invention provides an application to count the time students use their mobile phones. This application includes a timer function that can accurately record the time students are online, and trigger a warning or perform data statistics after exceeding the specified time. By counting the time students spend online in the application, students who exceed the specified time can be flexibly screened out.
[0060] The present invention is based on a mobile application and requires the program to have the following permissions: 1. The ability to distinguish whether the current application page is running in the foreground or background of the operating system, including the small window operation mode.
[0061] 2. The ability to distinguish whether the current mobile device is locked.
[0062] 3. The ability to distinguish whether the current page is the top-level page of the application.
[0063] Mobile applications include but are not limited to WeChat mini-programs, Alipay mini-programs, TikTok mini-programs, iOS APPs, Android APPs, Hongmeng OS APPs, etc.
[0064] By implementing a student behavior monitoring application with a timer function, you can accurately track the length of time students use their phones during class. Combined with background data synchronization and foreground and background switching management, ensure that the timer runs uninterruptedly, thereby effectively monitoring student behavior, providing timely feedback and supporting flexible data filtering.
[0065] Reference below Figure 2, which shows a schematic diagram of the structure of a computer system 200 suitable for implementing an electronic device of an embodiment of the present application. Figure 2 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0066] like Figure 2 As shown, the computer system 200 includes a central processing unit (CPU) 201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 202 or a program loaded from a storage part 208 into a random access memory (RAM) 203. In the RAM 203, various programs and data required for the operation of the system 200 are also stored. The CPU 201, the ROM 202, and the RAM 203 are connected to each other via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.
[0067] The following components are connected to the I / O interface 205: an input section 206 including a keyboard, a mouse, etc.; an output section 207 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN card, a modem, etc. The communication section 209 performs communication processing via a network such as the Internet. A drive 210 is also connected to the I / O interface 205 as needed. A removable medium 211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 210 as needed, so that a computer program read therefrom is installed into the storage section 208 as needed.
[0068] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 209, and / or installed from the removable medium 211. When the computer program is executed by the central processing unit (CPU) 201, the above functions defined in the method of the present application are executed. It should be noted that the computer-readable storage medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wireline, optical cable, RF, etc., or any suitable combination of the foregoing.
[0069] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0070] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0071] The modules involved in the embodiments of the present application may be implemented by software or by hardware.
[0072] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or it may exist independently and not be assembled into the electronic device. The above computer-readable storage medium carries one or more programs. When the above one or more programs are executed by the electronic device, the electronic device: when the application is started, the application enters the view rendering and timer start phase; when the user interacts with the application, the application enters the foreground switching and timer activity phase, at which time the timer continues to run; when the application is switched to the background, lock screen or small window mode, the system will enter the timer management phase in the background, lock screen and small window mode, in which the timer will be paused or adjusted; when the application returns to the foreground, it enters the foreground recovery and timer continuation phase, and the timer resumes normal operation; when the user exits the application or the application is destroyed, it enters the destruction and exit phase, and the application is closed and resources are released.
[0073] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. A classroom mobile phone usage time monitoring and timing method based on mobile application, characterized in that: The following steps are involved: When the application is started, the application enters the view rendering and timer starting phase; when the user interacts with the application, the application enters the foreground switching and timer activity phase, at which time the timer continues to run; When the application is switched to the background, lock screen or small window mode, the system will enter the timer management stage in the background, lock screen and small window mode, during which the timer will be paused or adjusted; When the application returns to the foreground, the foreground recovery and timer continuation phase is entered, and the timer resumes normal operation; When the user exits the application or the application is destroyed, it enters the destruction and exit phase, where the application is closed and resources are released.
2. The classroom mobile phone usage time monitoring and timing method according to claim 1 is characterized in that: The specific steps of the view rendering and timer starting phase include: The view thread completes the first rendering and displays the initial timing page. At this time, the user logs in to the timing page and the timer starts timing; The view thread notifies the application service thread through the interface to start timing and enter the Ready state; The application service thread enters the Active state through the received onReady event and starts the timing operation; The application service thread continuously receives data transmitted from the view thread to ensure the consistency and accuracy of the data.
3. The method for monitoring and timing the use time of mobile phones in the classroom according to claim 1, characterized in that: The specific steps of the foreground switching and timer activity phase include: The view thread continuously updates the interface in the Active state to display the real-time timing results. When the timer status changes, the view thread re-renders the interface and updates the timer status through the message passing mechanism. When the application service thread is in the Active state, it periodically synchronizes the current timing data to the background according to the timer status to ensure data persistence; at the same time, the application service thread always monitors the device status, including the switching between the foreground and the background, the lock screen status, and the window mode. If it switches to the background, the onHide event is triggered.
4. The method for monitoring and timing the use time of mobile phones in the classroom according to claim 1, characterized in that: The specific steps of the timer management stage in the background, lock screen and small window modes include: When the application switches to the background or locks the screen, the view thread suspends rendering and updating of the timer and enters the End state; The view thread notifies the timer to pause, but if the screen is locked, the timer will continue to run unaffected; The application service thread keeps the timer running through the background service and is not affected by the lock screen mode; When the device enters the background, the application service thread automatically switches to the Alive state to maintain background management of the timer; Once the system detects that the user switches to the foreground, the application service thread will return to the Alive state and continue timing.
5. The method for monitoring and timing the use time of mobile phones in the classroom according to claim 1, characterized in that: The specific steps of the foreground recovery and timer continuation phase include: When the user switches back to the application from the background or lock screen state, the view thread detects the onShow event and resumes the timer interface rendering to display the timing data at that time; The view thread triggers the timer to continue running through the message passing mechanism; When the application service thread receives the onShow event, it resumes the timer, continues timing, and synchronizes the timing data to the background.
6. The classroom mobile phone usage time monitoring and timing method according to claim 1 is characterized in that: The specific steps of the destruction and exit phase include: When the user exits the application or destroys the view, the view thread enters the End state, stopping interface rendering and timer updates; The view thread turns off the timer by terminating rendering, updating, and timing operations; The application service thread closes the timer process through the onUnload event, saves the final timing data and destroys all related resources; When the application completely exits, the application service thread shuts down the background service to ensure resource release.
7. The method for monitoring and timing the use time of mobile phones in classrooms according to any one of claims 1 to 6, characterized in that: The application appears in a multi-tasking window or split-screen mode, which includes multiple threads for data processing, setting priorities for different threads to avoid deadlock caused by timer changes when switching between the foreground and background under multi-tasking.
8. A computer program product, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
9. A computer system, characterized in that: The method comprises a processor and a memory, wherein the processor is configured to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Application using management method and mobile terminal
CN108009014A
Mobile terminal and application control method thereof
CN113742037A
Application use duration statistical method and device, equipment and storage medium
CN114036152A
Application use management method and device, equipment and storage medium
CN118245314A
Task execution method, substrate management controller, storage medium and electronic equipment
CN119149207A