Memory frame rate detection method and device, computer device and storage medium

By creating a sub-thread on the terminal to continuously obtain memory values ​​and delaying the acquisition, and combining this with the vertical synchronization signal to calculate the frame rate, the problem of not being able to monitor terminal memory and frame rate simultaneously in existing technologies is solved. This achieves real-time and accurate acquisition of memory and frame rate, and improves the terminal's anomaly detection capabilities.

CN114637651BActive Publication Date: 2026-06-19PING AN TECH (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2022-03-15
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies cannot simultaneously and accurately monitor terminal memory and frame rate, and the frame rate monitoring framework cannot monitor memory at the same time, making it difficult to obtain terminal memory information in a timely and accurate manner.

Method used

A sub-thread is created in the target terminal. The sub-thread retrieves memory values ​​in a loop and delays the retrieval after a preset time threshold. The frame rate is calculated in conjunction with the vertical synchronization signal. The memory and frame rate are then pushed to the display interface. Blockchain is used to store the data to ensure security.

Benefits of technology

It enables real-time acquisition of terminal memory and frame rate, avoiding lag during acquisition, improving efficiency and accuracy, and identifying abnormal terminal operations through anomaly detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114637651B_ABST
    Figure CN114637651B_ABST
Patent Text Reader

Abstract

This application belongs to the field of communication technology and relates to a memory frame rate detection method. The method includes creating a sub-thread in a target terminal and cyclically acquiring the memory value of the target terminal application based on the sub-thread; determining whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold; if the acquisition time is greater than or equal to the preset time threshold, delaying the acquisition of the current application's memory value; detecting the vertical synchronization signal of the target terminal, acquiring the synchronization time difference of the vertical synchronization signal, and calculating the current frame rate of the target terminal based on the synchronization time difference; determining the total memory of the target terminal based on the memory value, and pushing the total memory and current frame rate to the display interface of the target terminal. This application also provides a memory frame rate detection device, a computer device, and a storage medium. Furthermore, this application also relates to blockchain technology, where the memory value can be stored in the blockchain. This application achieves real-time acquisition of the target terminal's memory and frame rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to memory frame rate detection methods, apparatus, computer equipment and storage media. Background Technology

[0002] Currently, it's not possible to directly view the memory usage and frame drop information of internal applications on mobile devices. Checking terminal memory often requires accessing the system settings, and some systems will actively close or release memory when switching to the background. Therefore, it's often difficult to obtain timely and accurate memory information. For monitoring the terminal's frame rate, the Trace-canary framework is currently the primary method, but this framework can only monitor the frame rate and cannot simultaneously monitor memory. Therefore, finding a way to accurately detect terminal memory usage while simultaneously acquiring frame rate information is a pressing issue that needs to be addressed. Summary of the Invention

[0003] The purpose of this application is to provide a memory frame rate detection method, apparatus, computer device, and storage medium to solve the current technical problem that it is impossible to simultaneously monitor the memory and frame rate of a terminal.

[0004] To address the aforementioned technical problems, this application provides a memory frame rate detection method, which employs the following technical solution:

[0005] A sub-thread is created in the target terminal, and the memory value of the application on the target terminal is obtained in a loop based on the sub-thread;

[0006] Determine whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is greater than or equal to the preset time threshold, delay the acquisition of the current application's memory value.

[0007] The vertical synchronization signal of the target terminal is detected, the synchronization time difference of the vertical synchronization signal is obtained, and the current frame rate of the target terminal is calculated based on the synchronization time difference.

[0008] The total memory of the target terminal is determined based on the memory value, and the total memory and the current frame rate are pushed to the display interface of the target terminal.

[0009] Furthermore, the step of creating a sub-thread in the target terminal and cyclically retrieving the memory value of the target terminal application based on the sub-thread includes:

[0010] Create a target object in the target terminal, and start the sub-thread based on the target object;

[0011] Create a timer, and read the memory value of the target terminal application in a loop in the sub-thread according to the timer.

[0012] Furthermore, the step of delaying the acquisition of the current application's memory value when the acquisition duration is greater than or equal to the preset time threshold includes:

[0013] When the acquisition duration is greater than or equal to the preset time threshold, an initial delay value is acquired;

[0014] The delay duration is calculated based on a preset proportional value of the initial delay value, and the memory value of the current application is obtained with delay based on the delay duration.

[0015] Furthermore, the step of calculating the current frame rate of the target terminal based on the synchronization time difference includes:

[0016] Obtain the standard interrupt period of the vertical synchronization signal and the standard frame rate of the target terminal;

[0017] Calculate the difference between the standard interrupt period and the synchronization time difference, and calculate the current frame rate of the target terminal based on the difference and the standard frame rate.

[0018] Furthermore, after the step of pushing the total memory and the current frame rate to the display interface of the target terminal, the method further includes:

[0019] The total memory and the current frame rate are stored in the storage card of the target terminal. When an anomaly detection command is received from the target terminal, the storage records of the storage card and the application log of the target terminal are retrieved.

[0020] Based on the stored records and the application logs, it is determined whether the target terminal is abnormal.

[0021] Furthermore, the step of determining whether the target terminal is abnormal based on the stored records and the application logs includes:

[0022] Based on the storage records and the application logs, find the first moment when the memory change difference is greater than or equal to the first preset difference, and find the second moment when the frame rate change is greater than or equal to the second preset difference;

[0023] The terminal execution operations at the first time point and the second time point are obtained, and it is determined whether the terminal execution operation is an abnormal operation type. If the terminal execution operation is the abnormal operation type, it is determined that the target terminal is abnormal.

[0024] Furthermore, after the step of delaying the acquisition of the current application's memory value when the acquisition duration is greater than or equal to the preset time threshold, the method further includes:

[0025] Obtain the historical memory value of the target terminal and push the historical memory value to the display interface of the target terminal.

[0026] To address the aforementioned technical problems, this application also provides a memory frame rate detection device, which employs the following technical solution:

[0027] The acquisition module is used to create a sub-thread in the target terminal and cyclically acquire the memory value of the application on the target terminal based on the sub-thread.

[0028] The confirmation module is used to determine whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is greater than or equal to the preset time threshold, the acquisition of the current application's memory value is delayed.

[0029] The detection module is used to detect the vertical synchronization signal of the target terminal, obtain the synchronization time difference of the vertical synchronization signal, and calculate the current frame rate of the target terminal based on the synchronization time difference.

[0030] The push module is used to determine the total memory of the target terminal based on the memory value, and push the total memory and the current frame rate to the display interface of the target terminal.

[0031] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:

[0032] A sub-thread is created in the target terminal, and the memory value of the application on the target terminal is obtained in a loop based on the sub-thread;

[0033] Determine whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is greater than or equal to the preset time threshold, delay the acquisition of the current application's memory value.

[0034] The vertical synchronization signal of the target terminal is detected, the synchronization time difference of the vertical synchronization signal is obtained, and the current frame rate of the target terminal is calculated based on the synchronization time difference.

[0035] The total memory of the target terminal is determined based on the memory value, and the total memory and the current frame rate are pushed to the display interface of the target terminal.

[0036] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:

[0037] A sub-thread is created in the target terminal, and the memory value of the application on the target terminal is obtained in a loop based on the sub-thread;

[0038] Determine whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is greater than or equal to the preset time threshold, delay the acquisition of the current application's memory value.

[0039] The vertical synchronization signal of the target terminal is detected, the synchronization time difference of the vertical synchronization signal is obtained, and the current frame rate of the target terminal is calculated based on the synchronization time difference.

[0040] The total memory of the target terminal is determined based on the memory value, and the total memory and the current frame rate are pushed to the display interface of the target terminal.

[0041] The memory frame rate detection method proposed in this application creates a sub-thread in the target terminal and uses this sub-thread to repeatedly acquire the memory value of the target terminal application, avoiding the occupation of the main thread and improving the efficiency of memory acquisition. Next, it determines whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is greater than or equal to the preset time threshold, the acquisition of the current application's memory value is delayed, thereby avoiding long acquisition times for high memory consumption. Then, it detects the vertical synchronization signal of the target terminal, acquires the synchronization time difference of the vertical synchronization signal, and calculates the current frame rate of the target terminal based on the synchronization time difference. Finally, it determines the total memory of the target terminal based on the memory value and pushes the total memory and current frame rate to the target terminal's display interface. This achieves real-time acquisition of the target terminal's memory and frame rate, avoids stuttering during memory and frame rate acquisition, and further improves the efficiency and accuracy of memory and frame rate acquisition for the target terminal. Attached Figure Description

[0042] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;

[0044] Figure 2 A flowchart of an embodiment of the memory frame rate detection method according to this application;

[0045] Figure 3 This is a schematic diagram of one embodiment of the memory frame rate detection device according to this application;

[0046] Figure 4 This is a schematic diagram of the structure of one embodiment of the computer device according to this application.

[0047] Reference numerals: memory frame rate detection device 300, acquisition module 301, confirmation module 302, detection module 303, and push module 304. Detailed Implementation

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0049] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0050] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0051] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0052] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.

[0053] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.

[0054] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.

[0055] It should be noted that the memory frame rate detection method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the memory frame rate detection device is generally set in the server / terminal device.

[0056] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0057] Continue to refer to Figure 2 A flowchart illustrating an embodiment of the memory frame rate detection method according to this application is shown. The memory frame rate detection method includes the following steps:

[0058] Step S201: Create a sub-thread in the target terminal, and use the sub-thread to repeatedly obtain the memory value of the target terminal application.

[0059] In this embodiment, to avoid memory acquisition lag caused by frequent calls to the main thread, a sub-thread is created in the target terminal. A timer within this sub-thread is used to cyclically acquire the current memory of the target terminal. Specifically, a target object (such as a handlerThread object) is created in the target terminal, and a sub-thread can be started based on this target object. Then, the memory value of the application on the target terminal is cyclically acquired within this sub-thread. Specifically, the cyclic acquisition can be timed; when the sub-thread starts, a timed task is created, and this timed task performs timed cyclic acquisition of the application's memory value.

[0060] Step S202 is used to determine whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is greater than or equal to the preset time threshold, the acquisition of the current application's memory value is delayed.

[0061] In this embodiment, when acquiring the memory value of the current application on the target terminal, it is determined whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is less than the preset time threshold, the memory value of the current application is recorded. When the memory values ​​of all applications on the target terminal are acquired, the total memory of the target terminal is calculated and pushed to the display interface of the target terminal. If the acquisition time is greater than or equal to the preset time threshold, it indicates that the target terminal may experience lag or excessive CPU load when the memory value of the current application is acquired for the first time. In this case, the acquisition of the memory value of the current application is stopped, the previously acquired historical memory value is directly displayed, and the acquisition of the current memory value is delayed. Specifically, if the memory value of the current application is not acquired within the preset time threshold for the first time, a preset delay time is waited for, and then the memory value of the application is acquired again. If the acquisition time of the application's memory value for the second time is greater than the first acquisition time, and the memory value of the application cannot be acquired the second time, the acquisition is delayed again, and the acquisition time for each subsequent acquisition is adjusted until the memory value of the application is acquired.

[0062] Step S203: Detect the vertical synchronization signal of the target terminal, obtain the synchronization time difference of the vertical synchronization signal, and calculate the current frame rate of the target terminal based on the synchronization time difference.

[0063] In this embodiment, the vertical synchronization signal is sent by the target terminal's display interface after each frame is displayed. The vertical synchronization signal experiences periodic hardware interruptions, with a standard interrupt period typically of 16ms. Therefore, by detecting the target terminal's vertical synchronization signal and obtaining its synchronization time difference, if the synchronization time difference is greater than the standard interrupt period of the vertical synchronization signal, it indicates that the target terminal may be experiencing frame drops; if the synchronization time difference is less than or equal to the standard interrupt period of the vertical synchronization signal, it indicates that the target terminal's frame rate is normal. The synchronization time difference is the time difference between two vertical synchronization signals, and the current frame rate of the target terminal is calculated based on this synchronization time difference.

[0064] Step S204: Determine the total memory of the target terminal based on the memory value, and push the total memory and the current frame rate to the display interface of the target terminal.

[0065] In this embodiment, when the memory value and current frame rate of the target terminal are obtained, the total memory of the target terminal is calculated based on the memory value, and the total memory and the target frame rate are pushed to the display interface of the target terminal.

[0066] It should be emphasized that, to further ensure the privacy and security of the aforementioned memory values, these memory values ​​can also be stored in a node of a blockchain.

[0067] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0068] This application enables real-time acquisition of target terminal memory and frame rate, and avoids stuttering during current memory and frame rate acquisition, further improving the efficiency and accuracy of target terminal memory and frame rate acquisition.

[0069] In some optional implementations of this embodiment, the step of creating a sub-thread in the target terminal and cyclically retrieving the memory value of the target terminal application based on the sub-thread includes:

[0070] Create a target object in the target terminal, and start the sub-thread based on the target object;

[0071] Create a timer, and read the memory value of the target terminal application in a loop in the sub-thread according to the timer.

[0072] In this embodiment, the target object is the thread processing object of the target terminal. Based on this target object, a sub-thread can be started and its tasks processed. Therefore, a target object (such as a HandlerThread object) is created in the target terminal, a sub-thread is started based on this target object, and then a timer is created. The sub-thread continuously reads the current memory value of the target terminal application according to the timer, and stops acquiring the memory value of the target terminal application when the timer reaches its set time. The timer is a tool for timing the duration of memory value acquisition for the application.

[0073] This embodiment uses a timer to cyclically acquire the memory value of the target terminal application in a sub-thread. This timer allows for timing the duration of each memory acquisition, thereby adjusting the acquisition method based on the acquisition duration to avoid detecting high memory usage and further improve memory acquisition efficiency.

[0074] In some optional implementations of this embodiment, the step of delaying the acquisition of the current application's memory value when the acquisition duration is greater than or equal to the preset time threshold includes:

[0075] When the acquisition duration is greater than or equal to the preset time threshold, an initial delay value is acquired;

[0076] The delay duration is calculated based on a preset proportional value of the initial delay value, and the memory value of the current application is obtained with delay based on the delay duration.

[0077] In this embodiment, when the acquisition time of the target terminal application's memory value is greater than or equal to a preset time threshold, an initial delay value is acquired. This initial delay value is the default delay duration after the first acquisition time is greater than or equal to the preset time threshold. Upon completion of the first acquisition of the application's memory value, the initial delay value is delayed, and the application's memory value is acquired a second time. If the second acquisition time is still greater than or equal to the preset time threshold, the acquisition time of the application's memory value is delayed based on a preset proportional value of the initial delay value. When an appropriate delay duration is reached, the application's memory value is acquired again until the memory value is obtained. For example, if the initial delay value is 2 seconds and the delay proportional value is 2, then the subsequent delay durations are calculated to be 4 seconds, 8 seconds, 16 seconds, etc. When acquiring the target terminal application's memory value, the application's memory value is acquired sequentially according to this delay duration.

[0078] In addition to limiting the delay time for each acquisition, the preset time threshold for the acquisition time of each memory value can also be adjusted. For example, if the memory value is not acquired the first time, after the corresponding delay time, the preset time threshold for the second acquisition is adjusted to 4 seconds. If the memory value is still not acquired within 4 seconds, the acquisition will be delayed sequentially.

[0079] This embodiment improves memory acquisition efficiency by delaying the retrieval of application memory values, thus avoiding the time wasted due to prolonged retrieval of high memory values.

[0080] In some optional implementations of this embodiment, the step of calculating the current frame rate of the target terminal based on the synchronization time difference includes:

[0081] Obtain the standard interrupt period of the vertical synchronization signal and the standard frame rate of the target terminal;

[0082] Calculate the difference between the standard interrupt period and the synchronization time difference, and calculate the current frame rate of the target terminal based on the difference and the standard frame rate.

[0083] In this embodiment, the vertical synchronization signal of the target terminal is periodically interrupted. The standard interrupt period may vary depending on the hardware device; typically, the standard interrupt period for the vertical synchronization signal is 16ms. The standard interrupt period of the target terminal's vertical synchronization signal and the target terminal's standard frame rate are obtained. The difference between the synchronization time difference and the standard interrupt period, as well as the ratio of this difference to the synchronization time difference, are calculated. Then, this ratio is multiplied by the standard frame rate to obtain the frame rate difference. Subtracting this frame rate difference from the standard frame rate yields the current frame rate of the target terminal. For example, if the synchronization time difference is 32ms and the standard interrupt period is 16ms, the difference is 16ms, indicating a 16ms delay. If the standard frame rate is 60 frames per second, the calculated current frame rate is 30 frames per second.

[0084] This embodiment calculates the current frame rate of the target terminal by using the synchronization time difference and the standard frame rate, so that the frame rate of the current target terminal can be accurately calculated by using the synchronization time difference of the vertical synchronization signal.

[0085] In some optional implementations of this embodiment, after the step of pushing the total memory and the current frame rate to the display interface of the target terminal, the method further includes:

[0086] The total memory and the current frame rate are stored in the storage card of the target terminal. When an anomaly detection command is received from the target terminal, the storage records of the storage card and the application log of the target terminal are retrieved.

[0087] Based on the stored records and the application logs, it is determined whether the target terminal is abnormal.

[0088] In this embodiment, after the total memory and current frame rate are pushed to the target terminal's display interface, these values ​​are stored in the target terminal's memory card (such as an SD card). When an anomaly detection command is received from the target terminal, the storage records on the memory card and the target terminal's application logs are retrieved. Based on these records, the time points when abnormal changes occur in the total memory and frame rate of the target terminal are determined, thereby locating the anomaly. If, based on the storage records and application logs, the target terminal's total memory and frame rate both fluctuate within a fixed range, then it is determined that the target terminal is not abnormal.

[0089] This embodiment monitors total memory and frame rate by using the target terminal's storage records and application logs, achieving efficient detection of target terminal anomalies and avoiding device lag caused by terminal anomalies.

[0090] In some optional implementations of this embodiment, the step of determining whether the target terminal is abnormal based on the stored records and the application logs includes:

[0091] Based on the storage records and the application logs, find the first moment when the memory change difference is greater than or equal to the first preset difference, and find the second moment when the frame rate change is greater than or equal to the second preset difference;

[0092] The terminal execution operations at the first time point and the second time point are obtained, and it is determined whether the terminal execution operation is an abnormal operation type. If the terminal execution operation is the abnormal operation type, it is determined that the target terminal is abnormal.

[0093] In this embodiment, upon obtaining storage records and application records, memory values ​​and frame rate values ​​at different time points are acquired based on these records and application logs. A first moment when the memory change difference is greater than or equal to a first preset difference, and a second moment when the frame rate change value is greater than or equal to a second preset difference are determined. The first moment is the moment when the memory difference is greater than or equal to the first preset difference; this first moment can include multiple moments, and the same applies to the second moment. Upon obtaining the first and second moments, the terminal operations corresponding to these moments are acquired, and it is determined whether the terminal operation is an abnormal operation type. If the terminal operation is an abnormal operation type, it is determined that the target terminal is abnormal; if the terminal operation is not an abnormal operation type, it is determined that the target terminal is not abnormal. The abnormal operation type can be operations such as adding, modifying, or deleting sensitive information in the target terminal.

[0094] This embodiment identifies moments with significant changes in memory values ​​and frame rates by storing records and application logs. Then, based on these moments, it determines whether there are any abnormal operations on the target terminal, thus achieving precise location of abnormal operations and improving the efficiency of anomaly detection on the target terminal.

[0095] In some optional implementations of this embodiment, after the step of delaying the acquisition of the memory value of the current application when the acquisition duration is greater than or equal to the preset time threshold, the method further includes:

[0096] Obtain the historical memory value of the target terminal and push the historical memory value to the display interface of the target terminal.

[0097] In this embodiment, to push the memory usage of the target terminal in real time, if the memory acquisition time of an application is greater than or equal to a preset time threshold, the memory acquisition of the application is delayed. Afterward, the historical memory value of the target terminal can be acquired and pushed to the display interface of the target terminal. Alternatively, if the memory value of the application cannot be acquired, the available memory values ​​of other applications can be accumulated to obtain a temporary memory value, which is then pushed to the display interface of the target terminal. This avoids prolonged memory acquisition for applications with high memory usage.

[0098] This embodiment further realizes the real-time push of the target terminal's memory values ​​by pushing historical memory values ​​to the target terminal's display interface.

[0099] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).

[0100] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0101] Further reference Figure 3 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of a memory frame rate detection device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0102] like Figure 3 As shown, the memory frame rate detection device 300 described in this embodiment includes: an acquisition module 301, a confirmation module 302, a detection module 303, and a push module 304. Wherein:

[0103] The acquisition module 301 is used to create a sub-thread in the target terminal and cyclically acquire the memory value of the target terminal application based on the sub-thread.

[0104] In some optional implementations of this embodiment, the acquisition module 301 includes:

[0105] An initiation unit is used to create a target object in the target terminal and initiate the sub-thread based on the target object;

[0106] A creation unit is used to create a timer, which reads the memory value of the target terminal application in a loop in the sub-thread according to the timer.

[0107] In this embodiment, to avoid memory acquisition lag caused by frequent calls to the main thread, a sub-thread is created in the target terminal. A timer within this sub-thread is used to cyclically acquire the current memory of the target terminal. Specifically, a target object (such as a handlerThread object) is created in the target terminal, and a sub-thread can be started based on this target object. Then, the memory value of the application on the target terminal is cyclically acquired within this sub-thread. Specifically, the cyclic acquisition can be timed; when the sub-thread starts, a timed task is created, and this timed task performs timed cyclic acquisition of the application's memory value.

[0108] The confirmation module 302 is used to determine whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is greater than or equal to the preset time threshold, the acquisition of the current application's memory value is delayed.

[0109] In some optional implementations of this embodiment, the confirmation module 302 includes:

[0110] The first acquisition unit is used to acquire an initial delay value when the acquisition duration is greater than or equal to the preset time threshold.

[0111] The second acquisition unit is used to calculate the delay duration based on a preset proportional value of the initial delay value, and to acquire the memory value of the current application based on the delay duration.

[0112] In this embodiment, when acquiring the memory value of the current application on the target terminal, it is determined whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is less than the preset time threshold, the memory value of the current application is recorded. When the memory values ​​of all applications on the target terminal are acquired, the total memory of the target terminal is calculated and pushed to the display interface of the target terminal. If the acquisition time is greater than or equal to the preset time threshold, it indicates that the target terminal may experience lag or excessive CPU load when the memory value of the current application is acquired for the first time. In this case, the acquisition of the memory value of the current application is stopped, the previously acquired historical memory value is directly displayed, and the acquisition of the current memory value is delayed. Specifically, if the memory value of the current application is not acquired within the preset time threshold for the first time, a preset delay time is waited for, and then the memory value of the application is acquired again. If the acquisition time of the application's memory value for the second time is greater than the first acquisition time, and the memory value of the application cannot be acquired the second time, the acquisition is delayed again, and the acquisition time for each subsequent acquisition is adjusted until the memory value of the application is acquired.

[0113] The detection module 303 is used to detect the vertical synchronization signal of the target terminal, obtain the synchronization time difference of the vertical synchronization signal, and calculate the current frame rate of the target terminal based on the synchronization time difference.

[0114] In some optional implementations of this embodiment, the detection module 303 includes:

[0115] The third acquisition unit is used to acquire the standard interrupt period of the vertical synchronization signal and the standard frame rate of the target terminal.

[0116] The calculation unit is used to calculate the difference between the standard interrupt period and the synchronization time difference, and to calculate the current frame rate of the target terminal based on the difference and the standard frame rate.

[0117] In this embodiment, the vertical synchronization signal is sent by the target terminal's display interface after each frame is displayed. The vertical synchronization signal experiences periodic hardware interruptions, with a standard interrupt period typically of 16ms. Therefore, by detecting the target terminal's vertical synchronization signal and obtaining its synchronization time difference, if the synchronization time difference is greater than the standard interrupt period of the vertical synchronization signal, it indicates that the target terminal may be experiencing frame drops; if the synchronization time difference is less than or equal to the standard interrupt period of the vertical synchronization signal, it indicates that the target terminal's frame rate is normal. The synchronization time difference is the time difference between two vertical synchronization signals, and the current frame rate of the target terminal is calculated based on this synchronization time difference.

[0118] The push module 304 is used to determine the total memory of the target terminal based on the memory value, and push the total memory and the current frame rate to the display interface of the target terminal.

[0119] In this embodiment, when the memory value and current frame rate of the target terminal are obtained, the total memory of the target terminal is calculated based on the memory value, and the total memory and the target frame rate are pushed to the display interface of the target terminal.

[0120] It should be emphasized that, to further ensure the privacy and security of the aforementioned memory values, these memory values ​​can also be stored in a node of a blockchain.

[0121] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0122] In some optional implementations of this embodiment, the memory frame rate detection device 400 further includes:

[0123] The storage submodule is used to store the total memory and the current frame rate into the storage card of the target terminal. When an anomaly detection command is received from the target terminal, the storage records of the storage card and the application log of the target terminal are called.

[0124] The confirmation submodule is used to determine whether there is an anomaly in the target terminal based on the stored records and the application logs.

[0125] In some optional implementations of this embodiment, the confirmation submodule includes:

[0126] The search unit is used to search for a first moment when the difference in memory change is greater than or equal to a first preset difference, and a second moment when the difference in frame rate change is greater than or equal to a second preset difference, based on the storage record and the application log.

[0127] The confirmation unit is used to acquire the terminal execution operation at the first time and the second time, determine whether the terminal execution operation is an abnormal operation type, and if the terminal execution operation is the abnormal operation type, determine that the target terminal is abnormal.

[0128] In this embodiment, after the total memory and current frame rate are pushed to the target terminal's display interface, these values ​​are stored in the target terminal's memory card (such as an SD card). When an anomaly detection command is received from the target terminal, the storage records on the memory card and the target terminal's application logs are retrieved. Based on these records, the time points when abnormal changes occur in the total memory and frame rate of the target terminal are determined, thereby locating the anomaly. If, based on the storage records and application logs, the target terminal's total memory and frame rate both fluctuate within a fixed range, then it is determined that the target terminal is not abnormal.

[0129] In some optional implementations of this embodiment, the memory frame rate detection device 400 further includes:

[0130] The acquisition submodule is used to acquire the historical memory value of the target terminal and push the historical memory value to the display interface of the target terminal.

[0131] In this embodiment, to push the memory usage of the target terminal in real time, if the memory acquisition time of an application is greater than or equal to a preset time threshold, the memory acquisition of the application is delayed. Afterward, the historical memory value of the target terminal can be acquired and pushed to the display interface of the target terminal. Alternatively, if the memory value of the application cannot be acquired, the available memory values ​​of other applications can be accumulated to obtain a temporary memory value, which is then pushed to the display interface of the target terminal. This avoids prolonged memory acquisition for applications with high memory usage.

[0132] The memory frame rate detection device proposed in this embodiment realizes real-time acquisition of the target terminal's memory and frame rate, and avoids stuttering during the acquisition of current memory and frame rate, further improving the efficiency and accuracy of acquiring the target terminal's memory and frame rate.

[0133] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0134] The computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected via a system bus. It should be noted that only the computer device 6 with components 61-63 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0135] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.

[0136] The memory 61 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as the hard disk or memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 6. Of course, the memory 61 may include both the internal storage unit and its external storage device of the computer device 6. In this embodiment, the memory 61 is typically used to store the operating system and various application software installed on the computer device 6, such as computer-readable instructions for memory frame rate detection methods. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or will be output.

[0137] In some embodiments, the processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to execute computer-readable instructions stored in the memory 61 or to process data, for example, to execute computer-readable instructions for the memory frame rate detection method.

[0138] The network interface 63 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 6 and other electronic devices.

[0139] The computer device proposed in this embodiment realizes real-time acquisition of the target terminal's memory and frame rate, and avoids the stuttering of current memory and frame rate acquisition, further improving the efficiency and accuracy of acquiring the target terminal's memory and frame rate.

[0140] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the memory frame rate detection method described above.

[0141] The computer-readable storage medium proposed in this embodiment enables real-time acquisition of the target terminal's memory and frame rate, and avoids stuttering during the acquisition of current memory and frame rate, further improving the efficiency and accuracy of acquiring the target terminal's memory and frame rate.

[0142] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0143] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.

Claims

1. A memory frame rate detection method, characterized in that, Includes the following steps: A sub-thread is created in the target terminal, and the memory value of the application on the target terminal is obtained in a loop based on the sub-thread; Determine whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is greater than or equal to the preset time threshold, delay the acquisition of the current application's memory value. The vertical synchronization signal of the target terminal is detected, the synchronization time difference of the vertical synchronization signal is obtained, and the current frame rate of the target terminal is calculated based on the synchronization time difference. The total memory of the target terminal is determined based on the memory value, and the total memory and the current frame rate are pushed to the display interface of the target terminal. The step of calculating the current frame rate of the target terminal based on the synchronization time difference includes: Obtain the standard interrupt period of the vertical synchronization signal and the standard frame rate of the target terminal; Calculate the difference between the standard interruption period and the synchronization time difference, and the ratio of the difference to the synchronization time difference; Multiply the ratio by the standard frame rate to obtain the frame rate difference, and subtract the frame rate difference from the standard frame rate to calculate the current frame rate of the target terminal.

2. The memory frame rate detection method according to claim 1, characterized in that, The step of creating a sub-thread in the target terminal and cyclically retrieving the memory value of the application on the target terminal based on the sub-thread includes: Create a target object in the target terminal, and start the sub-thread based on the target object; Create a timer, and use the timer to cyclically read the memory values ​​of the application on the target terminal in the sub-thread.

3. The memory frame rate detection method according to claim 1, characterized in that, The step of delaying the acquisition of the current application's memory value when the acquisition duration is greater than or equal to the preset time threshold includes: When the acquisition duration is greater than or equal to the preset time threshold, an initial delay value is acquired; The delay duration is calculated based on a preset proportional value of the initial delay value, and the memory value of the current application is obtained with delay based on the delay duration.

4. The memory frame rate detection method according to claim 1, characterized in that, Following the step of pushing the total memory and the current frame rate to the display interface of the target terminal, the method further includes: The total memory and the current frame rate are stored in the storage card of the target terminal. When an anomaly detection command is received from the target terminal, the storage records of the storage card and the application log of the target terminal are retrieved. Based on the stored records and the application logs, it is determined whether the target terminal is abnormal.

5. The memory frame rate detection method according to claim 4, characterized in that, The step of determining whether the target terminal is abnormal based on the stored records and the application logs includes: Based on the storage records and the application logs, find the first moment when the memory change difference is greater than or equal to the first preset difference, and the second moment when the frame rate change value is greater than or equal to the second preset difference; The terminal execution operations at the first time point and the second time point are obtained, and it is determined whether the terminal execution operation is an abnormal operation type. If the terminal execution operation is the abnormal operation type, it is determined that the target terminal is abnormal.

6. The memory frame rate detection method according to claim 1, characterized in that, After the step of delaying the acquisition of the current application's memory value when the acquisition duration is greater than or equal to the preset time threshold, the method further includes: Obtain the historical memory value of the target terminal and push the historical memory value to the display interface of the target terminal.

7. A memory frame rate detection device, characterized in that, include: The acquisition module is used to create a sub-thread in the target terminal and cyclically acquire the memory value of the application on the target terminal based on the sub-thread. The confirmation module is used to determine whether the acquisition time of the current application's memory value is greater than or equal to a preset time threshold. If the acquisition time is greater than or equal to the preset time threshold, the acquisition of the current application's memory value is delayed. The detection module is used to detect the vertical synchronization signal of the target terminal, obtain the synchronization time difference of the vertical synchronization signal, and calculate the current frame rate of the target terminal based on the synchronization time difference. The push module is used to determine the total memory of the target terminal based on the memory value, and push the total memory and the current frame rate to the display interface of the target terminal; The detection module is further configured to acquire the standard interrupt period of the vertical synchronization signal and the standard frame rate of the target terminal; calculate the difference between the standard interrupt period and the synchronization time difference, and the ratio of the difference to the synchronization time difference; Multiply the ratio by the standard frame rate to obtain the frame rate difference, and subtract the frame rate difference from the standard frame rate to calculate the current frame rate of the target terminal.

8. A computer device comprising a memory and a processor, the memory storing computer-readable instructions, wherein the processor, when executing the computer-readable instructions, implements the steps of the memory frame rate detection method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the memory frame rate detection method as described in any one of claims 1 to 6.