Method and equipment for determining service time of equipment

Through the analysis of the number of interactive messages between the router and the device, combined with various methods such as counting the number of messages and judging the descent speed, the problem of inaccurate monitoring of equipment usage time in the prior art is solved, and more accurate tracking of equipment usage time is achieved.

CN119537124APending Publication Date: 2025-02-28HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311099068.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-28
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The prior art is difficult to accurately monitor and count the usage time of electronic devices, especially when the device plays cached content, the number of interactive messages is reduced, and it is easy to misjudgment that the device is not used.

Method used

The usage status of the device is determined by the number of interactive messages between the router and the device. Various methods are adopted, such as counting the number of messages at the first n times, judging the decline rate of the number of messages, and calculating the usage probability, etc., to determine the usage time of the device.

Benefits of technology

Improve the accuracy of monitoring the device usage time, avoid misjudgment caused by the decrease in the number of interactive messages during the playback of cached content, and ensure accurate tracking of device usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537124A_ABST
    Figure CN119537124A_ABST
Patent Text Reader

Abstract

The invention provides a method and equipment for determining the use time of equipment. The use time of an electronic product can be monitored more accurately. For example, a first device is connected with a second device; the first device obtains a first message number, wherein the first message number comprises the number of all messages received from and / or sent to the second device by the first device before the first moment; according to the number of the first messages, determining whether the second equipment is used at the first moment; and if it is determined that the second device is used at the first moment, recording the first moment as the use moment of the second device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method and device for determining device usage time. Background Art

[0002] Devices, especially mobile phones and computers, have gradually become essential electronic products for every household. Electronic products are installed with a variety of applications, such as online games, online novels, etc., which can easily make people addicted. Especially for teenagers, addiction to electronic products will seriously affect their healthy growth. Summary of the invention

[0003] A method and device for determining device usage time provided in an embodiment of the present application are helpful to improve the accuracy of determining device usage time.

[0004] In a first aspect, a method for determining device usage time is provided. The method can be applied to a first device, and the first device can be, for example, a router. The method includes: connecting to a second device; obtaining a first message quantity, wherein the first message quantity includes the quantity of all messages received by the first device from the second device and / or sent to the second device before a first moment; determining whether the second device is used at the first moment according to the first message quantity; if it is determined that the second device is used at the first moment, determining the first moment as the usage moment of the second device.

[0005] Taking the first device as a router and the second device as a mobile phone as an example, in the embodiment of the present application, the router can determine whether the mobile phone is used at each moment, and then count the usage time (or usage duration) of the mobile phone. Among them, when the router determines whether the mobile phone is used at the first moment, it will judge according to the number of interactive messages between the router and the mobile phone before the first moment, and the usage time of the mobile phone can be determined more accurately. This is because, for applications that can cache content, since more content can be cached at one time, the number of messages interacting with the router when the mobile phone plays the cached content is small, and the router will misjudge that the mobile phone is not used. Through the technical solution of the embodiment of the present application, when the mobile phone plays the cached content, although the number of messages interacting with the router is small, the router will not directly determine that the mobile phone is not used, but judge whether the mobile phone is used according to the number of messages interacted between the mobile phone and the router before this, which can improve the accuracy of determining the usage time of the mobile phone. In this way, the embodiment of the present application can monitor the usage time of electronic products more accurately and avoid users from using electronic products for a long time.

[0006] In one possible design, determining whether the second device is used at the first moment based on the first message quantity includes: determining a usage probability of the second device at the first moment based on the first message quantity, the usage probability being used to describe the possibility of a user using the second device at the first moment; determining whether the second device is used at the first moment based on the usage probability.

[0007] In an embodiment of the present application, the router can determine the usage probability of the mobile phone at the first moment based on the number of interaction messages between the router and the mobile phone before the first moment, and then determine whether the mobile phone is used at the first moment. This method can improve the accuracy of determining the usage time of the mobile phone.

[0008] In one possible design, based on the usage probability, determining whether the second device is used at the first moment includes: if the usage probability is greater than or equal to a preset probability, determining that the second device is used at the first moment; otherwise, determining that the second device is not used at the first moment.

[0009] In the embodiment of the present application, the router can determine the usage probability of the mobile phone at the first moment according to the number of interactive messages between the router and the mobile phone before the first moment. If the usage probability is high, it is determined that the mobile phone is used at the first moment, otherwise, it is determined that the mobile phone is not used at the first moment. This method can improve the accuracy of determining the usage time of the mobile phone.

[0010] In a possible design, the usage probability is positively correlated with the number of the first messages. For example, the more the number of first messages, the greater the probability of the mobile phone being used at the first moment, and vice versa, the fewer the number of first messages, the smaller the probability of the mobile phone being used at the first moment. This is because, for applications that can cache content, the number of messages that the mobile phone interacts with the router before the cache is completed is large, and the number of messages that the mobile phone interacts with the router after the cache is completed is small. Therefore, the more the number of interactive messages before the first moment, it means that the mobile phone is caching content before the first moment, then there is a high probability that the mobile phone will play the cached content at the first moment, that is, the probability of the mobile phone being used at the first moment is high. Conversely, if the number of interactive messages between the mobile phone and the router before the first moment is small, it means that the possibility of the mobile phone caching content before the first moment is low, then the probability of the user using the mobile phone at the first moment is low. In this way, the probability of the mobile phone being used at the first moment can be determined more accurately, and the accuracy of determining the usage time of the mobile phone can be improved.

[0011] In one possible design, the first number of messages includes the number of all messages received from the second device and / or sent to the second device by the first device at n moments before the first moment, where n is a positive integer, and determining the usage probability of the second device at the first moment based on the first number of messages includes: determining, based on the first number of messages and a first corresponding relationship, a first usage probability corresponding to the first number of messages in the first corresponding relationship as the usage probability of the second device at the first moment; the first corresponding relationship is used to describe the correspondence between the usage probability of the second device at the first moment and the number of messages received from the second device and / or sent to the second device by the first device at n moments before the first moment.

[0012] In an embodiment of the present application, the router can determine the usage probability of the mobile phone at the first moment based on the number of interaction messages before the first moment, which can improve the accuracy of determining the usage time of the mobile phone, and determine the usage probability of the mobile phone at the first moment by means of the first corresponding relationship. Since the first corresponding relationship can be stored in advance, the processing efficiency is higher.

[0013] In one possible design, the first number of messages includes the number of all messages received from and / or sent to the second device by the first device at a second moment before the first moment, and the utilization probability of the second device at the first moment is determined based on the first number of messages, including: determining a decreasing rate of the number of messages received from and / or sent to the second device by the first device from the second moment to the first moment based on the first number of messages and the second number of messages, the second number of messages being the number of all messages received from and / or sent to the second device by the first device at the first moment; and determining the utilization probability based on the decreasing rate of the number of messages.

[0014] In the embodiment of the present application, considering that the number of interactive messages between the mobile phone and the router is large before the caching is completed, and the number of interactive messages between the mobile phone and the router is small after the caching is completed, that is, the number of interactive messages decreases rapidly after the caching is completed, the router can judge the usage probability of the mobile phone at the first moment according to the decreasing speed of the number of interactive messages between the router and the mobile phone during the period from the second moment to the first moment. In this way, the usage time of the mobile phone can be determined more accurately.

[0015] In a possible design, the usage probability is positively correlated with the drop rate. For example, the faster the drop rate of the number of interactive messages between the router and the mobile phone during the period from the second moment to the first moment, the greater the usage probability of the mobile phone at the first moment; conversely, the slower the drop rate of the number of interactive messages between the router and the mobile phone during the period from the second moment to the first moment, the smaller the usage probability of the mobile phone at the first moment. This is because the number of interactive messages with the router before the mobile phone cache is completed is large, and the number of interactive messages between the mobile phone and the router after the cache is completed is small, so if the number of interactive messages from the second moment to the first moment drops quickly, it means that the mobile phone has completed the cache during this period, then the mobile phone is likely to be playing the cached content at the first moment, so the usage probability of the mobile phone at the first moment is high. Conversely, if the number of interactive messages from the second moment to the first moment drops slowly, it means that the mobile phone has already completed the cache (for example, the cache was completed at the second moment or before the second moment), so the messages at the second moment and the first moment are small, and there is no obvious drop, then the usage probability of the mobile phone at the first moment is low.

[0016] In a possible design, the first number of messages includes the number of all messages received from and / or sent to the second device by the first device at n moments before the first moment, where n is a positive integer, and determining the usage probability of the second device at the first moment based on the first number of messages includes: determining that the first number of messages is within a first range; determining a second corresponding relationship based on the first range, the second corresponding relationship being used to describe the correspondence between the usage probability of the second device at the first moment and the number of messages received from and / or sent to the second device by the first device at the first moment, when the number of messages received from and / or sent to the second device by the first device at n moments before the first moment is within the first range; determining, based on the second number of messages and the second corresponding relationship, a second usage probability corresponding to the second number of messages in the second corresponding relationship as the usage probability of the second device at the first moment, the second number of messages being the number of all messages received from and / or sent to the second device by the first device at the first moment.

[0017] In an embodiment of the present application, the router can determine whether the mobile phone is used at each moment, and then count the usage time (or usage duration) of the mobile phone. When the router determines whether the mobile phone is used at the first moment, it will make a comprehensive judgment based on the number of first messages of the mobile phone at n moments before the first moment and the number of second messages at the first moment, so as to improve the accuracy of determining the usage time of the mobile phone. For example, the router determines the second corresponding relationship based on the number of first messages at n moments before the first moment, and then determines the usage probability of the mobile phone at the first moment based on the number of second messages at the first moment and the second corresponding relationship. The reason why the router determines the second corresponding relationship based on the number of first messages at n moments before the first moment is that, in the embodiment of the present application, when the number of interactive messages between the router and the mobile phone at n moments before the first moment is in different ranges (for example, the two ranges of 0-500 and 500-1000), the corresponding relationship between the use probability of the mobile phone at the first moment and the number of interactive messages between the router and the mobile phone at the first moment is different, so the router first determines the range in which the number of first messages at n moments before the first moment is, assuming that it is in the range of 0-500, then determines the corresponding relationship (i.e., the second corresponding relationship) corresponding to the range of 0-500, which describes the corresponding relationship between the use probability of the mobile phone at the first moment and the number of interactive messages between the router and the mobile phone at the first moment when the number of interactive messages between the router and the mobile phone at n moments before the first moment is in the range of 0-500.

[0018] In one possible design, determining a second corresponding relationship based on the first range includes: determining a second corresponding relationship among multiple corresponding relationships based on the first range, different corresponding relationships among the multiple corresponding relationships are used to describe the correspondence between the probability of using the second device at the first moment and the number of messages received from and / or sent to the second device by the first device at the first moment when the number of messages received from and / or sent to the second device by the first device at n moments before the first moment is in different ranges.

[0019] The embodiment of the present application takes into account that when the number of interactive messages between the router and the mobile phone at n moments before the first moment is in different ranges (for example, the two ranges of 0-500 or 500-1000), the corresponding relationship between the use probability of the mobile phone at the first moment and the number of interactive messages between the router and the mobile phone at the first moment is different, so a plurality of corresponding relationships are stored in the router. For example, the router includes corresponding relationship 2 and corresponding relationship 3. Corresponding relationship 2 is used to describe the corresponding relationship between the use probability of the mobile phone at the first moment and the number of interactive messages between the router and the mobile phone at the first moment when the number of interactive messages between the router and the mobile phone at n moments before the first moment is in the range of 0-500. Corresponding relationship 3 is used to describe the corresponding relationship between the use probability of the mobile phone at the first moment and the number of interactive messages between the router and the mobile phone at the first moment when the number of interactive messages between the router and the mobile phone at n moments before the first moment is in the range of 500-1000. Therefore, in the embodiment of the present application, a corresponding relationship can be determined from multiple corresponding relationships based on the size of the number of interactive messages between the router and the mobile phone at n moments before the first moment, and then the number of interactive messages between the router and the mobile phone at the first moment (i.e., the second message number) is used to determine the usage probability of the mobile phone at the first moment in the corresponding relationship, so that a more accurate usage time can be determined.

[0020] In one possible design, the messages corresponding to the first number of messages and / or the second number of messages are messages of a first application in the first device, and the first application is any application in the first device.

[0021] In a possible design, the second corresponding relationship is related to the first application or the application type of the first application.

[0022] For example, the first device can count the number of interactive messages between a certain application in the first device and the second device (i.e., the number of first messages), and then determine the second corresponding relationship according to the range of the number of interactive messages between the application and the second device, and then use the second corresponding relationship to determine the usage probability of the second device at the first moment. The second corresponding relationship determined in this way is more accurate, which improves the accuracy of the determined usage probability.

[0023] In one possible design, the messages corresponding to the first message quantity and / or the second message quantity are messages of a second application in the second device, and the second application is any application in the second device.

[0024] In a possible design, the second corresponding relationship is related to the second application or the application type of the second application.

[0025] For example, the first device can count the number of interactive messages between the first device and an application in the second device (i.e., the number of first messages), and then determine the second corresponding relationship based on the range of the number of interactive messages with the application in the second device. The second corresponding relationship determined in this way is more accurate, which improves the accuracy of the determined usage probability.

[0026] In a possible design, the application types include: battle type, cache type, stand-alone type, and periodic type. For example, battle type is for example a battle game. Cache type is for example a video playback application, an online reading application, etc. Stand-alone type is for example Minecraft Periodic categories such as short video applications.

[0027] In a possible design, n=1, and before determining the second corresponding relationship from the plurality of corresponding relationships according to the first range, the method further includes: acquiring a data set, wherein the data set includes: [Q t-1 , Q t , Used t ]; where the tth moment is before the first moment, Q t-1 represents the number of messages received from and / or sent to the second device by the first device at a time before time t, Q t Indicates the number of messages received by the first device from the second device and / or sent to the second device at time t. t Indicates whether the second device is used or not used at time t; the data set is divided into the Q t-i The size of is divided into multiple subsets, and the Q corresponding to different subsets t-i The range is different, and each subset includes [Q t , Used t ], used to describe the corresponding relationship between the usage probability of the second device at time t and the number of messages received by the first device from the second device and / or sent to the second device at time t; according to the multiple subsets, determine the multiple corresponding relationships, wherein one subset corresponds to one corresponding relationship, and different corresponding relationships correspond to different Q t-1 scope.

[0028] As mentioned above, a plurality of corresponding relationships are stored in the router. In the embodiment of the present application, the router can self-learn to obtain a plurality of corresponding relationships, realize continuous iteration of the corresponding relationships, and improve the accuracy of determining the device usage time.

[0029] In a possible design, before determining whether the second device is used at the first moment based on the first message quantity, it also includes: obtaining the second message quantity, the second message quantity including the number of all messages received by the first device from the second device and / or sent to the second device at the first moment; and determining that the second message quantity is less than the first threshold.

[0030] In one possible design, the method further includes: if the number of the second messages is greater than or equal to the first threshold, determining that the second device is used at the first moment.

[0031] In the embodiment of the present application, if the number of second messages at the first moment is greater than or equal to the first threshold, the router determines that the mobile phone is in use at the first moment. If the number of second messages at the first moment is less than the first threshold, the router will not directly determine that the mobile phone is not in use at the first moment, but will determine whether the mobile phone is in use at the first moment based on the number of first messages before the first moment, so as to improve the accuracy of the determined usage time.

[0032] In a possible design, the method further includes: calculating a usage time of the second device according to the determined usage time of the second device, and when the usage time is greater than a preset time, performing at least one of the following steps:

[0033] Outputting a prompt message, wherein the prompt message is used to prompt that the usage time is longer than a preset time; or,

[0034] The Internet access function of the second device is interrupted.

[0035] In the embodiment of the present application, if the router determines that the usage time of the mobile phone is longer than the preset time, it can intervene by prompting or disconnecting the network to prevent users (especially teenagers) from becoming addicted to electronic products.

[0036] In one possible design, the messages corresponding to the first number of messages are messages of a first application in the first device, and the first application is any application in the first device; or, the messages corresponding to the first number of messages are messages of a second application in the second device, and the second application is any application in the second device.

[0037] In an embodiment of the present application, the router can count the number of interactive messages with an application in the mobile phone, and then determine the usage time of the application, thereby monitoring the usage time at the application level.

[0038] In a second aspect, a device is provided, comprising: a processor, a memory, and one or more programs; wherein the one or more programs are stored in the memory, and the one or more programs include instructions, and when the instructions are executed by the processor, the device performs the method steps provided in the first aspect above.

[0039] According to a third aspect, a readable storage medium is provided, wherein the readable storage medium is used to store a program. When the program is executed on a device, the device executes the method provided in the first aspect.

[0040] According to a fourth aspect, a program product is provided, comprising a program, wherein when the program is run on a computer, the computer is caused to execute the method provided in the first aspect.

[0041] In the fifth aspect, a chip system is also provided, which is coupled to the memory in the device, and is used to call the program stored in the memory and execute the technical solution of the first aspect of the embodiment of the present application. In the embodiment of the present application, "coupling" refers to the direct or indirect combination of two components with each other.

[0042] For the technical effects that can be achieved by the above-mentioned second to fifth aspects, please refer to the description of the technical effects that can be achieved by the corresponding design scheme in the above-mentioned first aspect, and this application will not repeat them here. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of a system provided in accordance with an embodiment of the present application;

[0044] Figure 2 A schematic diagram of the structure of a router provided in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of a first solution for determining device usage time provided in an embodiment of the present application;

[0046] Figure 4 A schematic diagram of a second solution for determining device usage time provided in an embodiment of the present application;

[0047] Figure 5 A schematic diagram of the corresponding relationship between the number of messages at the previous n moments and the usage probability at the current moment provided in an embodiment of the present application;

[0048] Figure 6 Another schematic diagram of the corresponding relationship between the number of messages at the previous n moments and the usage probability at the current moment provided by an embodiment of the present application;

[0049] Figure 7A schematic diagram of multiple corresponding relationships between the number of messages at the current moment and the usage probability at the current moment when the number of messages at the previous n moments provided by an embodiment of the present application is in different ranges;

[0050] Figure 8 Another schematic diagram of multiple corresponding relationships between the number of messages at the current moment and the usage probability at the current moment when the number of messages at the previous n moments provided by an embodiment of the present application is in different ranges;

[0051] Fig. 9 Another schematic diagram of multiple corresponding relationships between the number of messages at the current moment and the usage probability at the current moment when the number of messages at the previous n moments provided by an embodiment of the present application is in different ranges;

[0052] Figure 10A-10C A schematic diagram of a router self-learning process provided by an embodiment of the present application;

[0053] Fig.11 A schematic diagram of multiple corresponding relationships between the number of messages at the current moment and the usage probability at the current moment when the number of messages at the previous n moments of a certain application provided by an embodiment of the present application is in different ranges;

[0054] Fig.12 A schematic diagram of the structure of a device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0055] Below, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.

[0056] The at least one involved in the embodiments of the present application includes one or more; wherein, more than one means greater than or equal to two. In addition, it should be understood that in the description of this specification, words such as "first" and "second" are only used for the purpose of distinguishing the description, and cannot be understood as expressing or implying relative importance, nor can they be understood as expressing or implying order. For example, the first moment and the second moment do not represent the importance of the two or the order of the two, but are only for distinguishing the description. In the embodiments of the present application, "and / or" is only a description of the association relationship, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship.

[0057] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the specification. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0058] The method for determining the device usage time provided in the embodiment of the present application can be applied to the system. The system includes a first device and a second device. Among them, the second device can be connected to the first device to realize the Internet access function. Exemplarily, the first device can be a router, a customer premises equipment (CPE) or other routing device. The second device can be any device that can access the router. For example, the second device can be a mobile phone, a tablet computer, a laptop computer, a watch, a bracelet, a television, a projector, a virtual reality (VR) device, an augmented reality (AR) device, a mixed reality (MR) device, etc. In short, the embodiment of the present application does not limit the device types of the first device and the second device.

[0059] For ease of understanding, this article mainly uses the example that the first device is a router and the second device is a mobile phone. Figure 1 , is a schematic diagram of a system provided in an embodiment of the present application. The system includes a first device and a second device, the first device is a router, and the second device is a mobile phone. The mobile phone can be connected to the router to realize the Internet access function.

[0060] It should be noted that the method for determining the device usage time provided in the embodiment of the present application can be executed by a router or a mobile phone. For ease of understanding, this article mainly uses the execution of a router as an example for description.

[0061] For example, see Figure 2 , is a schematic diagram of the structure of a router provided in an embodiment of the present application. Figure 2 , the router includes an antenna 22 and a processor 21. It can be understood that, Figure 2 The components shown do not constitute a specific limitation on the router. The router in the embodiment of the present application may include Figure 2More or fewer components. For example, a memory (not shown in the figure) may also be included. Of course, the router may also be provided with ports (not shown in the figure), such as a wide area network (WAN) port, a local area network (LAN) port, a power interface, etc.

[0062] Among them, the antenna 22 is used to transmit and receive electromagnetic wave signals. Optionally, each antenna can be used to cover a single or multiple communication frequency bands, which is not limited in the embodiments of the present application. Among them, the number of antennas 22 can be 2, 4, etc., which is not limited in the embodiments of the present application. The router connects other communication devices such as mobile phones and tablet computers to the router through the antenna 22. Taking the connection between the router and the mobile phone as an example, the router generates interactive messages with the mobile phone through the antenna 22. For example, the router receives a request message sent by the mobile phone through the antenna 22 or sends a response message to the mobile phone through the antenna 22.

[0063] The processor 21 may include one or more processing units, for example, the processor 21 may be a central processing unit, a modem processor, a controller, a memory, a baseband processor, etc. Among them, different processing units may be independent devices or integrated in one or more processors. Among them, a memory may also be provided in the processor 21 for storing instructions and data. In some embodiments, the memory in the processor 21 is a cache memory. The memory may store instructions or data that the processor 21 has just used or circulated. If the processor 21 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 21 is reduced, and the efficiency of the system is improved.

[0064] Among them, the processor 21 can be used to execute the method flow for determining the device usage time provided in the embodiment of the present application. For example, the processor 21 can monitor the message receiving and sending of the antenna 22. For example, the processor 21 can count the number of messages sent by the mobile phone received by the antenna 22 at the first moment, and / or the number of messages sent to the mobile phone by the antenna 22 at the first moment, and obtain the first message number of the mobile phone at the first moment. The first message number includes the number of all messages received by the mobile phone from the router and / or sent to the router at the first moment. The processor 21 can also determine whether the mobile phone is used at the second moment (after the first moment) based on the first message number at the first moment, and when it is determined that the mobile phone is being used at the second moment, record the second moment as the usage time of the mobile phone. The specific implementation process will be described later.

[0065] Below Figure 1 Taking the system as an example, the technical solution provided by the embodiment of the present application is introduced in combination with the accompanying drawings.

[0066] To facilitate understanding, let's briefly explain Figure 1 The process of surfing the Internet on a mobile phone in a mobile phone. Taking the mobile phone turning on the Wi-Fi function as an example, the mobile phone can display a Wi-Fi list. The Wi-Fi list includes the names of the surrounding routers, the Wi-Fi signal strength, etc. After the user finds the name of the router he wants to connect to in the Wi-Fi list, he clicks on the name of the router. When the mobile phone detects an operation on the name of a router in the Wi-Fi list, it can display a password input box to prompt the user to enter the password. After the mobile phone detects that the user has entered the correct password, it connects to the router, and then the mobile phone can surf the Internet. Taking the browser application in the mobile phone as an example, when the mobile phone receives an operation of searching for a certain content in the browser application by the user, it can send a request message to the router. The request message is used to request the content. The router sends the request message to the server corresponding to the browser application, and then receives the content requested by the user from the server. The router returns a response message to the mobile phone, and the response message includes the content. The mobile phone displays the content. Therefore, the mobile phone searches for the content that the user wants through the browser application. It should be noted that the above is a simple description of the process of surfing the Internet on a mobile phone, and it is not a limitation on the process of surfing the Internet. In actual applications, the process of surfing the Internet on a mobile phone can be more complicated than the above process, and the embodiment of this application is not described in detail.

[0067] Through a simple description of the mobile phone Internet access process, it can be known that the mobile phone will generate interactive messages with the router during the Internet access process. For example, the mobile phone sends a request message to the router, and the router sends a response message to the mobile phone. Therefore, in an embodiment of the present application, the router can count the number of interactive messages between the mobile phone and the mobile phone, and determine whether the mobile phone is currently in use based on the number of interactive messages. For example, when there are currently interactive messages or there are many interactive messages, it is determined that the mobile phone is currently in use; when there are currently no interactive messages or there are few interactive messages, it is determined that the mobile phone is not currently in use. In this way, the usage time of the mobile phone can be monitored, family members (especially minors) can be prevented from surfing the Internet without restraint, and correct Internet access habits can be cultivated. Among them, the number of interactive messages between the router and the mobile phone can include: the number of messages sent by the router to the mobile phone, and / or, the number of messages received by the router from the mobile phone.

[0068] It is understandable that the number of interactive messages changes dynamically in real time. Therefore, the router can count the number of interactive messages in real time. Among them, "real-time statistics" can be counted once a minute, or once a second, or once a millisecond. Taking counting once a second as an example, the router counts the number of interactive messages between the mobile phone and the router once a second. Among them, the router counting once a second means counting the number of interactive messages generated in this second once a second. For example, counting once in the tth second means counting the number of interactive messages in the tth second, and t is a positive integer. Among them, the number of interactive messages per second can be expressed by the number of packets per second (PPS). Therefore, the router will get a PPS every second. The router can determine whether the mobile phone is being used at the current moment (in seconds) based on the PPS.

[0069] In the first solution, the router determines whether the mobile phone is being used at the current moment based on the current PPS of the mobile phone.

[0070] As mentioned above, the router gets a PPS every second. For the convenience of description, taking the current time as time t, the PPS at the current time is expressed as PPS t , whether the mobile phone is currently in use is indicated by Used t 。 Used t Is 0 or 1. t 1 means the phone is used at time t. t 0 means that the mobile phone is not in use at time t. Therefore, in simple terms, the first solution is that the router uses PPS t , judge Used t Is it 0 or 1.

[0071] One possible way is that the router sends PPS t Compared with threshold 1, if PPS t Greater than or equal to threshold 1, confirm Used t Is 1; if PPS t Less than the threshold 1, confirm Used t is 0. Therefore, the router can determine the Used t Is it 0 or 1, then use t The sum of all the times when is 1 is the usage time of the mobile phone. For example, see Figure 3, is a schematic diagram of a coordinate system, the horizontal axis of the coordinate system is time, and the vertical axis is PPS. After the router determines the PPS at each moment, it marks it in the coordinate system to form a curve (the curve is referred to as the PPS curve). The router determines the part of the curve whose vertical axis is higher than the threshold 1 (i.e., the dotted line). The range of the horizontal axis corresponding to this part (i.e., t1-t2) is the usage time of the mobile phone.

[0072] In some scenarios, the usage time determined by the first solution is less accurate. Take the scenario where a user uses a video application in a mobile phone to watch a movie as an example. Assume that when watching a movie, the user is accustomed to using the mobile phone to cache the movie first, and then watch it after the cache is completed. For example, the mobile phone starts caching from time t1 to time t2. During the caching period, the mobile phone will generate a large number of interactive messages with the router. The router monitors that the PPS is greater than or equal to the threshold 1, determines that the mobile phone is being used, and records t1-t2 as the mobile phone usage time (or usage time). After the cache is completed, the mobile phone does not need to generate a large number of interactive messages with the router. The router monitors that the PPS is less than the threshold 1 and determines that the mobile phone is not being used. But in fact, after the movie cache is completed, the mobile phone will play the cached movie, that is, the mobile phone is still in use. Therefore, for this scenario, the usage time determined by the first solution is less accurate. Take the scenario where a user uses a mobile phone to read an online novel as an example. Generally, when a mobile phone loads a novel, it will load multiple pages at a time. Assume that the mobile phone starts loading from time t1 to time t2 and loads multiple pages at a time. During loading, the router monitors that the PPS is greater than or equal to threshold 1, determines that the mobile phone is being used, and records t1-t2 as the mobile phone usage time (or usage duration). After loading is completed (i.e., moment t2), the router monitors that the PPS is less than threshold 1, and determines that the mobile phone is not being used. But in fact, after loading is completed, since multiple pages are loaded at a time, the mobile phone is still in use for a period of time after moment t2. Therefore, for this scenario, the accuracy of the usage time determined by the first solution above is also low. In summary, for applications that can cache content, since more content can be cached at a time, the PPS generated when the mobile phone plays the cached content is small, which will cause the router to misjudge that the mobile phone is not in use, so the usage duration of the mobile phone determined by the router is inaccurate.

[0073] In the second solution, the router determines whether the mobile phone is being used at the current moment based on the PPS of the mobile phone at the previous n moments. n is a positive integer. The previous n moments include the n moments before the current moment.

[0074] For the convenience of description, taking the current time as the tth time as an example, the PPS at the current time is expressed as PPS t The PPS of the first n moments includes PPS t-i i is an integer from 1 to n. Taking n=3 as an example, the PPS of the first three moments includes PPSt-1 、PPS t-2 、PPS t-3 Among them, PPS t-1 refers to the PPS at the t-1th moment, PPS t-2 refers to the PPS at time t-2, PPS t-3 Refers to the PPS at time t-3. Whether the mobile phone is currently in use is indicated by Used t 。 Used t Is 0 or 1. t When it is 1, it means that the mobile phone is being used at time t. t When it is 0, it means that the mobile phone is not in use at time t. Therefore, in simple terms, the second solution is that the router uses PPS t-i (i is an integer from 1 to n), determine the Used at time t t Is it 0 or 1.

[0075] Among them, the router is based on PPS t-i , determine the Used at time t t For the specific implementation method of whether it is 0 or 1, please refer to Method A to Method D below.

[0076] In the third solution, the router determines whether the mobile phone is being used at the current moment according to the current PPS of the mobile phone and the PPS of the previous n moments, which is a combination of the first solution and the second solution.

[0077] In short, the third solution is that the router is based on PPS t and PPS t-i (i is an integer from 1 to n), determine the Used at time t t Is it 0 or 1.

[0078] One possible way is that the third solution includes steps 1 and 2. Step 1: The router sends the PPS t Compared with threshold 1 (i.e. the first solution); if PPS t Greater than or equal to threshold 1, confirm Used t Is 1; if PPS t If it is less than the threshold 1, the Used value is not directly determined. t is 0, but executes step 2 (the second solution). Step 2: The router t-i , determine the Used at time t t is 1 or 0. For the implementation of step 2, please refer to the following methods A to D. For example, please refer to Figure 4, is a schematic diagram of a coordinate system, the horizontal axis of the coordinate system is time, and the vertical axis is PPS. After the router determines the PPS at each moment, it marks it in the coordinate system to form a curve. The router executes step 1, that is, determines the part of the curve whose vertical axis is higher than the threshold 1, and determines that the range of the horizontal axis corresponding to this part is t1-t2, which is the usage time of the mobile phone. The router determines that the vertical coordinate PPS at time t3 (the next moment after time t2) is less than the threshold 1. At this time, it will not directly determine the Used time at time t3. t3 is 0, but step 2 is executed, that is, according to PPS t3-i (i is an integer from 1 to n), determine the Used at time t3 t3 Is it 0 or 1. If the router determines that the Used t3 If t1 is 1, then the time t3 is recorded as the time when the mobile phone is used. Then, the usage time of the mobile phone determined by the router includes t1 to t3.

[0079] contrast Figure 3 and Figure 4 It can be seen that Figure 3 The router uses the first solution to determine the usage time as t1-t2. Figure 4 The router uses the third solution to determine the usage time as t1-t3. Compared with the first solution, the third solution is more accurate. This is because, for applications that can cache content, the PPS is high during the cache period (for example, t1-t2), and the router determines that the phone is being used. After the cache is completed (for example, at time t3), although the PPS is low, the router will not directly determine that the phone is not in use at time t3, but will determine whether the phone is in use based on the PPS of the previous n moments to improve the accuracy of determining the phone usage time.

[0080] The following mainly takes the third solution as an example for explanation.

[0081] As mentioned above, the third solution includes two steps. Step 1: The router sends the PPS t Compare with threshold 1; if PPS t Greater than or equal to threshold 1, confirm Used t Is 1; if PPS t If the value is less than threshold 1, go to step 2. Step 2: The router calculates the value of the PPS. t-i (i is an integer from 1 to n), determine the Used at time t t Is 1 or 0. In the embodiment of the present application, step 2 may include: the router according to the PPS t-i , determine the probability of using the mobile phone at time t, and then determine the Used t Is 1 or 0. For example, if the probability of using a mobile phone at time t is greater than or equal to the preset probability, determine Usedt Is 1, otherwise, confirm Used t The following mainly describes the router according to PPS t-i , determine the implementation principle of the probability of using a mobile phone at time t. For the convenience of description, the probability of using a mobile phone at time t is expressed as P t .

[0082] Method A

[0083] The router stores a threshold value 2. The router stores the PPS t-i (i ranges from 1 to n) and is compared with the threshold value 2. Since i is an integer from 1 to n, the following two cases are described: n=1 and n>1.

[0084] Taking n=1 as an example, since i can only be 1, the router will set PPS t-1 Compare with threshold 2. If PPS t-1 is greater than or equal to threshold 2, the router determines P t is probability 1; otherwise, determine P t is probability 2. Probability 1 is higher than probability 2. For example, probability 1 is 1 and probability 2 is 0.

[0085] Taking n>1 as an example, since i ranges from 1 to n, and n>1, PPS t-i There are n in total. The router will PPS t-i (i ranges from 1 to n, and n>1) and compares them with threshold 2 respectively. Assume that among these n PPS, X are greater than or equal to threshold 2, and Y are less than threshold 2. If X is greater than Y, determine P t With probability 1, if X is less than Y, determine P t is probability 2. Probability 1 is higher than probability 2. For example, probability 1 is 1 and probability 2 is 0. Of course, there is a case where X=Y, in which case probability 1 equals probability 2 equals 0.5, or it can be further determined using other methods below.

[0086] Optionally, threshold 2 may be pre-configured, for example, configured when the router leaves the factory.

[0087] From the above description, we can see that P t With PPS t-i Positive correlation. That is, PPS t-i The more P t The larger the PPS t-i The less, P t It should be noted that for applications that can cache content, the PPS is high before caching is completed and low after caching is completed, so the PPS t-i The more, it means that the mobile phone is caching in the previous n moments, so the probability of using the mobile phone at the next moment, that is, at time t, is higher. t-iThe smaller the number, the lower the probability that the mobile phone cached content in the previous n moments, and the lower the probability of using the mobile phone at the next moment, that is, at time t. In this way, the probability of using the mobile phone at time t can be accurately judged, and the accuracy of determining the usage time of the mobile phone can be improved.

[0088] Method B

[0089] PPS is stored in the router t-i With P t The router determines the PPS based on the corresponding relationship 1. t-i The corresponding P t Since i is an integer from 1 to n, the following two cases are described: n=1 and n>1.

[0090] Taking n=1 as an example, the router stores PPS t-1 With P t 1. For example, the corresponding relationship 1 is as follows: Figure 5 . Router according to PPS t-1 The specific value of Figure 5 Determine the corresponding P t Assuming PPS t-1 It is 80, the router is based on Figure 5 , determine P t is 0.1. Assuming PPS t-1 It is 150. The router is based on Figure 5 , determine P t is 0.2.

[0091] Taking n>1 as an example, assuming n=2, the router stores PPS t-2 、PPS t-1 With P t 1. For example, the corresponding relationship 1 is as follows: Figure 6 . Router according to PPS t-2 and PPS t-1 The specific value of Figure 6 Determine the corresponding Pt in . Assuming PPS t-2 Yes 150, PPS t-1 It is 80, the router is based on Figure 6 , determine the corresponding P t is 0.1. Assuming PPS t-2 Yes 150, PPS t-1 It is 120. The router is based on Figure 6 , determine the corresponding P t is 0.2.

[0092] It should be understood that the above correspondence 1 can be in the form of a table, or in other forms, such as a curve form or a software code form, which is not limited in the present embodiment. Optionally, the above correspondence 1 can be pre-configured, for example, the router is configured when it leaves the factory.

[0093] Method C

[0094] Router according to PPS t-n and PPS t , determine the rate of decrease of PPS from time tn to time t, and compare the rate of decrease with threshold 3. If it is greater than or equal to threshold 3, determine P t is probability 3, otherwise, determine P t is probability 4. Probability 3 is higher than probability 4. For example, probability 3 is 1 and probability 4 is 0. The decreasing rate of PPS from time tn to time t can be referred to as (PPS t-n -PPS t ) / n. It should be noted that for applications that can cache content, the PPS is high before the cache is completed and low after the cache is completed, so the PPS difference before and after the cache is completed is large and the decline rate is fast. Therefore, in the embodiment of the present application, when the router determines that the decline rate of the PPS from time tn to time t is large, it determines that the usage probability at time t is high, otherwise, it determines that the usage probability at time t is low. In this way, the usage probability of the mobile phone at time t can be accurately judged, and the accuracy of determining the usage time of the mobile phone can be improved.

[0095] Method D

[0096] The router stores multiple correspondences. Each of the multiple correspondences corresponds to a different PPS. t-i (i ranges from 1 to n) used to describe different PPS t-i In the range, P t With PPS t of changes.

[0097] Take n=1 as an example, Figure 7 , take two corresponding relations as an example, such as corresponding relation 2 and corresponding relation 3. The PPS corresponding to corresponding relation 2 t-1 The range is 0-500, that is, the corresponding relationship 2 is used to describe the PPS t-1 When in the range of 0-500, P t With PPS t The PPS corresponding to the corresponding relationship 3 t-1 The range is 500-1000, that is, the corresponding relationship 3 is used to describe the PPS t-1 When P is in the range of 500-1000, t With PPSt Therefore, the router changes according to the PPS t-1 Select a corresponding relationship from multiple corresponding relationships, assuming that PPS t-1 is 300, then select corresponding relationship 2. Assume that PPS t-1 If it is 800, select correspondence 3. After the router selects the correspondence, it will t Determine the corresponding P in the selected correspondence t Taking the corresponding relationship 2 as an example, assuming that PPS t is 350, based on the corresponding relationship 2, determine P t It is 0.2.

[0098] It should be noted that the above-mentioned multiple corresponding relationships, such as corresponding relationship 2 and corresponding relationship 3, can also be in other forms, such as a curve form, that is, Figure 8 Optionally, the multiple correspondences may be pre-configured, or may be self-learned by the router. The self-learning process will be described later.

[0099] Take n>1 as an example, for example, n=2, such as Fig. 9 , corresponding to the PPS of relation 2 t-2 The range is 0-1000, PPS t-1 The range is 0-500, that is, the corresponding relationship 2 is used to describe PPS t-2 In the range of 0-1000, PPS t-1 When in the range of 0-500, P t With PPS t The PPS corresponding to the corresponding relationship 3 t-2 The range is 0-1000, PPS t-1 The range is 500-1000, that is, the corresponding relationship 3 is used to describe PPS t-2 In the range of 0-1000, PPS t-1 When P is in the range of 500-1000, t With PPS t The PPS corresponding to the corresponding relationship 4 t-2 The range is 1000-2000, PPS t-1 The range is 1000-1500, that is, the corresponding relationship 4 is used to describe PPS t-2 In the range of 1000-2000, PPS t-1 When it is in the range of 1000-1500, P t With PPS t The PPS corresponding to the corresponding relationship 5 t-2 The range is 1000-2000, PPS t-1The range is 1500-2000, that is, the corresponding relationship 5 is used to describe PPS t-2 In the range of 1000-2000, PPS t-1 When it is in the range of 1500-2000, P t With PPS t Therefore, the router changes according to the PPS t-2 and PPS t-1 Select a corresponding relationship from multiple corresponding relationships, assuming that PPS t-2 Yes 1500, PPS t-1 If it is 1100, then select corresponding relationship 4. After selecting corresponding relationship 4, according to PPS t Determine the corresponding P in the corresponding relationship 4 t Assuming PPS t is 1000, based on the corresponding relationship 4, P is determined t It is 0.1.

[0100] The above lists four ways (method A to method D) for the router to determine the usage probability of the mobile phone at time t. The router can use any of these four ways. For example, the router uses one of the four ways by default when it leaves the factory. Alternatively, the user can set which of the four ways the router uses. For example, a button (for example, a physical button) is provided on the router, which can be used to switch between different ways. Alternatively, the user can also set which way the router uses through an application on the mobile phone. For example, the mobile phone has an application for managing the router, wherein the application is used to manage the router, and can include: for setting which devices cannot access the router, or, for setting web pages that a certain device cannot access, etc., or, for setting the usage time of a certain device, etc.

[0101] The following mainly takes method D as an example for explanation.

[0102] As mentioned above, the multiple corresponding relationships in mode D can be self-learned by the router. As mentioned above, each of the multiple corresponding relationships corresponds to a different PPS t-i (i ranges from 1 to n) used to describe different PPS t-i In the range, P t With PPS t Therefore, the following takes n=1 and n>1 as examples to illustrate the router self-learning process.

[0103] Take n=1 as an example, that is, each of the multiple corresponding relationships corresponds to a different PPS t-1 Range, used to describe the different PPS t-1 In the range, P t With PPS tThe process of router self-learning includes the following steps:

[0104] (1) Collecting data sets. The data set includes multiple groups of data, each of which is in the form of [PPS t-1 ,PPS t , Used t ]. Where t = 2, ..., K, Used t = 0 or 1. For example, the data set is as follows: ,

[0105] [PPS1, PPS2, Used2], [PPS2, PPS3, Used3], …, [PPS t-1 ,PPS t , Used t ].

[0106] For example, in the data set [PPS1, PPS2, Used2], Used2 is 0 or 1, which is determined based on PPS2. For example, when PPS2 is greater than or equal to threshold 1, Used2 is 1, otherwise, Used2 is 0. Similarly, in the data set [PPS2, PPS3, Used3], Used3 is 0 or 1, which is determined based on PPS3. For example, when PPS3 is greater than or equal to threshold 1, Used3 is 1, otherwise, Used3 is 0. For threshold 1, please refer to the previous description. For example, the data set may be {[800, 1200, 1], [900, 1300, 1], [1000, 1000, 1], [400, 900, 1], [300, 800, 0]}.

[0107] (2) Classify the data set. The router classifies the data set according to the PPS t-1 The values ​​of are classified to obtain multiple subsets. For example, the router collects the data into PPS t-1 The values ​​between 0 and 500 are divided into a subset, and PPS t-1 The data set between 500 and 1000 is divided into another subset. For example, the router can divide the data set into two subsets:

[0108] PPS of the first subset t-1 The range is 0-500, and this subset includes: {[400, 900, 1], [300, 800, 0]}; or, the PPS of each group of data in this subset t-1 If the value of is removed, the first subset includes: {[900, 1], [800, 0]}.

[0109] PPS of the second subset t-1 The range is 500-1000, and this subset includes: {[800, 1200, 1], [900, 1300, 1], [1000, 1000, 1]}, or, the PPS of each group of data in the second subset t-1 The second subset includes: {[1200, 1], [1300, 1], [1000, 1]}. For ease of understanding, the first subset is Fig. 10A , the second subset is Fig. 10B .

[0110] (3) Perform probability fitting for each subset.

[0111] For example, for Fig. 10A The data in the first subset {[900, 1], [800, 0]} are fitted with probability, and we get Fig. 10C Curve 1 in Fig. 10B The probability fitting of the data in the second subset {[1200, 1], [1300, 1], [1000, 1]} is obtained Fig. 10C Curve 2 in .

[0112] Please compare the previous Figure 8 With here Fig. 10C , Figure 8 and Fig. 10C , that is, through the above self-learning process, the router obtains Figure 8 The probability fitting curve is then used to determine P using the method D above. t .

[0113] Take n>1 as an example, that is, each of the multiple corresponding relationships corresponds to a different PPS t-i (i ranges from 1 to n, and n>1) used to describe different PPS t-i In the range, P t With PPS t Assuming n = 2, the router self-learning process includes the following steps:

[0114] (1) Collecting data sets. The data set includes multiple groups of data, each of which is in the form of [PPS t-2 ,PPS t-1 ,PPS t , Used t ]. Where t = 3, ..., K, Used t = 0 or 1. For example, the data set is as follows: ,

[0115] [PPS1, PPS2, PPS3, Used3], [PPS2, PPS3, PPS4, Used4], …, [PPS t-2 ,PPS t-1 ,PPS t , Used t ].

[0116] (2) Classify the data set. The router classifies the data set according to the PPS t-2 The values ​​of are classified to obtain multiple subsets. Assume that the router is classified according to PPS t-2 The router classifies the values ​​of into two subsets, subset 1 and subset 2. Then, the router classifies subset 1 according to PPS t-1 The values ​​of t-1 Assume that the router classifies subset 1 into sub-subset 1 and sub-subset 2, and classifies subset 2 into sub-subset 3 and sub-subset 4.

[0117] (3) Perform probability fitting for each subset. For example, perform a probability fitting for each subset 1, subset 2, subset 3, and subset 4 to obtain a probability fitting curve.

[0118] It should be noted that the above steps (1)-(3) take the example of the router counting once per second, that is, obtaining a PPS per second. As mentioned above, the router can also count once per minute or per millisecond. Taking the example of counting once per minute or per millisecond, a Q is obtained per minute. The above PPS can be replaced with Q.

[0119] Optionally, the router may perform self-learning periodically, and the period may be, for example, 1 day, 2 days, or a week, etc., which is not limited in the embodiment of the present application.

[0120] In the embodiment of the present application, after the router determines the usage probability of the mobile phone at time t, it is also necessary to determine the Used t Is 1 or 0. For example, when the usage probability is greater than or equal to the preset probability, the Used t When the usage probability is less than the preset probability, the Used t The specific size of the preset probability is not limited in this embodiment of the application. t The sum of all moments when the value is 1 is the usage time of the mobile phone. In this way, the usage time of the mobile phone can be determined more accurately.

[0121] In the embodiment of the present application, after the router determines the usage time of the mobile phone, it can determine whether the usage time is greater than or equal to the preset time. If so, at least one of the following steps is performed:

[0122] (1) Outputting a prompt message. The prompt message is used to prompt that the usage time of the mobile phone is greater than or equal to the preset time.

[0123] Optionally, the router outputs the prompt information, which may be the router itself outputting the prompt information, and the prompt information may be voice information or light information (for example, the indicator light on the router flashes). Optionally, the router may also output the prompt information through other devices. Other devices may be mobile phones, which may be mobile phones whose usage time is counted. For example, the router counts the usage time of mobile phone A (child’s mobile phone) and sends a prompt information to mobile phone A when it is determined that the usage time is greater than a preset time. Alternatively, the router counts the usage time of mobile phone A (child’s mobile phone) and sends a prompt information to mobile phone B (adult’s mobile phone) when it is determined that the usage time is greater than a preset time, to prompt that the usage time of mobile phone A (child’s mobile phone) exceeds the preset time. The way in which the router outputs the prompt information through the mobile phone may be that the router sends a command to the mobile phone, which is used to instruct the mobile phone to output the prompt information, and the prompt information may be in any of a variety of forms such as text, picture, voice, vibration, etc.

[0124] (2) Interrupt the Internet access function of the mobile phone.

[0125] For example, the router counts the usage time of mobile phone A (the child's mobile phone) and when it is determined that the usage time is longer than the preset time, the router automatically disconnects from mobile phone A to interrupt the Internet access function of mobile phone A. Alternatively, the router sends a control command to mobile phone A, which is used to control mobile phone A to disconnect from the router, for example, to control mobile phone A to turn off the Wi-Fi function, exit the application, or shut down.

[0126] In the above embodiment, when the mobile phone is surfing the Internet, it will generate interactive messages with the router, so the router counts the number of interactive messages in real time. It is understandable that the mobile phone can run multiple applications at the same time, and multiple applications can generate interactive messages with the router, so in the above embodiment, the number of interactive messages counted by the router can include the sum of the number of interactive messages generated by each application in the multiple applications. Therefore, in other embodiments, the router can also count the interactive messages of different applications separately. For example, the number of interactive messages of application A is counted separately, the number of interactive messages of application B is counted separately, and so on.

[0127] Taking the example of counting the number of interactive messages of application A alone, the router can count once per second or once per minute. Taking counting once per second as an example, the router counts the number of interactive messages with application A once per second. Therefore, the router will get a PPS of application A every second. The mobile phone can determine whether application A is being used at the current moment based on the PPS of application A. The mobile phone can determine whether application A is being used at the current moment based on the PPS of application A, and any of the first to third solutions mentioned above can be used. Take the third solution as an example. The router uses the third solution to determine whether application A is being used at the current moment, including: Step 1, the router will apply the PPS of application A t Compare with threshold 1; if PPS t Greater than or equal to threshold 1, determine the Used value of application A t Is 1; if PPS t If the value is less than threshold 1, go to step 2. Step 2: The router calculates the PPS of application A. t-i , determine the Used value of application A at time t t is 1 or 0. For the implementation of step 2, please refer to Method A to Method D below. Therefore, the router can determine the Used t At all times when is 1, calculate the usage time of application A.

[0128] Taking the example of counting the number of interaction messages of application B separately, the router can count once per second or once per minute. Taking counting once per second as an example, the router will get a PPS of application B every second, and determine whether application B is being used at the current moment based on the PPS of application B. The router determines whether application B is being used at the current moment based on the PPS of application B, and can use any of the first to third solutions mentioned above. It should be noted that since the interaction messages of application A and application B need to be counted separately, the router needs to determine which messages of application A and application B are messages of application B in the interaction messages with the mobile phone. One possible implementation method is that the interaction message between the mobile phone and the router will carry the package name of the application. The router determines which application the message belongs to through the package name of the application in the interaction message, and then counts the messages of different applications separately. Take the third solution as an example. The router uses the third solution to determine whether application B is being used at the current moment, including: Step 1, the router counts the PPS of application B t Compare with threshold 1; if PPS t Greater than or equal to threshold 1, determine the Used value of application B t Is 1; if PPS t If the value is less than threshold 1, go to step 2. Step 2: The router calculates the value of the PPS of application B. t-i , determine the Used value of application B at time t tis 1 or 0. For the implementation of step 2, please refer to Method A to Method D below. Therefore, the router can determine the Used t At all times when is 1, calculate the usage time of application B.

[0129] That is to say, for application A, step 2 has four modes, namely, mode A to mode D; and for application B, step 2 also has four modes, namely, mode A to mode D.

[0130] Assume that for both application A and application B, the router uses method A to implement step 2. As mentioned above, threshold 2 needs to be used in method A. In an embodiment of the present application, for different applications or application types (the application type will be described later), the value of threshold 2 can be the same, or the value of threshold 2 is related to the application or application type, that is, the values ​​of threshold 2 corresponding to different applications or different application types are different. For example, the value of threshold 2 corresponding to application A is different from the value of threshold 2 corresponding to application B. Or, the application type of application A is type A, and the application type of application B is type B. Among them, the value of threshold 2 corresponding to type A is different from the value of threshold 2 corresponding to type B. Therefore, the router can determine the specific value of threshold 2 based on application A or type A of application A, assuming the value is X1, and then use method A, that is, the PPS of application A. t-i (i ranges from 1 to n) and is compared with X1. Similarly, the router can determine the specific value of threshold 2 based on application B or type B of application B. Assuming the value is X2, then use method A, that is, application B will PPS t-i (i ranges from 1 to n) and is compared with X2.

[0131] Assume that for both application A and application B, the router uses method B to implement step 2. As mentioned above, correspondence 1 needs to be used in method B. In an embodiment of the present application, for different applications or application types (the application type will be described later), correspondence 1 may be the same, or correspondence 1 is related to the application or application type, that is, the correspondence 1 corresponding to different applications or different application types is different. For example, the correspondence 1 corresponding to application A is different from the correspondence 1 corresponding to application B. Or, the application type of application A is type A, and the application type of application B is type B. The correspondence 1 corresponding to type A is different from the correspondence 1 corresponding to type B. For example, the PPS in the correspondence 1 of application A t-1 In the range of 0-100 is the corresponding P t is 0.1, applying the corresponding relationship 1 of B to PPS t-1 In the range of 0-100 is the corresponding P t is 0.2. Therefore, the router can determine the correspondence 1 according to application A or type A of application A, and then use method B, that is, according to the PPS of application A.t-i , find the corresponding P in the determined correspondence 1 t Similarly, the router can determine the corresponding relationship 1 according to application B or type B of application B, and then use method B, that is, according to the PPS of application B. t-i , find the corresponding P in the determined correspondence 1 t .

[0132] Assume that for both application A and application B, the router uses method C to implement step 2. As mentioned above, threshold 3 is required in method C. In an embodiment of the present application, for different applications or application types (the application type will be described later), the value of threshold 3 can be the same, or the value of threshold 3 is related to the application or application type, that is, the value of threshold 3 corresponding to different applications or different application types is different. For example, the value of threshold 3 corresponding to application A is different from the value of threshold 3 corresponding to application B. Or, the application type of application A is type A, and the application type of application B is type B. The value of threshold 3 corresponding to type A is different from the value of threshold 3 corresponding to type B. Therefore, the router can determine the specific value of threshold 3 based on application A or type A of application A, assuming the value is X3, and then use method C, that is, compare the rate of decrease of the PPS of application A from time tn to time t with X3. Similarly, the router can determine the specific value of threshold 3 according to application B or type B of application B, assuming that the value is X4, and then use method C, that is, compare the PPS drop rate of application B from time tn to time t with X4.

[0133] Assume that for both application A and application B, the router uses method D to implement step 2. As mentioned above, method D requires multiple corresponding relationships (for the convenience of description, multiple corresponding relationships are referred to as corresponding relationship sets), for example Figure 8 In the correspondence 2 and correspondence 3 in the embodiment of the present application, for different applications or application types (the application type will be described later), the correspondence set can be the same, or the correspondence sets corresponding to different applications or different application types are different. For example, the correspondence set corresponding to application A is different from the correspondence set corresponding to application B. Or, the application type of application A is type A, and the application type of application B is type B. The correspondence set corresponding to type A is different from the correspondence set corresponding to type B. For example, the correspondence set of application A is as follows: Figure 8 , which includes correspondence 2 and correspondence 3. The correspondence set of application B is as follows Fig.11 , including correspondence 6 and correspondence 7. Therefore, the router can determine the correspondence set according to application A or type A of application A, for example, Figure 8After determining the corresponding relationship set, use method D, that is, according to the PPS of application A t-1 exist Figure 8 Select a corresponding relationship (for example, corresponding relationship 2) from the corresponding relationship set, and then apply the PPS of A t-1 And the selected correspondence (e.g., correspondence 2) determines P t Similarly, the router can determine the corresponding relationship set based on application B or type B of application B, for example, Fig.11 After determining the corresponding relationship set, use method D, that is, apply A according to PPS t-1 exist Fig.11 Select a corresponding relationship (for example, corresponding relationship 6) from the corresponding relationship set, and then apply the PPS of A t-1 And determine P in the selected correspondence (for example, correspondence 6) t .

[0134] In the above embodiment, it is mentioned that the router determines the corresponding relationship set ( Figure 8 The corresponding relationship set is determined according to application B or type B of application B ( Fig.11 A possible implementation is that the router pre-stores a corresponding relationship set corresponding to different applications, or a corresponding relationship set corresponding to different application types. Another possible implementation is that the router self-learns a corresponding relationship set corresponding to different applications, or a corresponding relationship set corresponding to different application types. The self-learning principle is the same as the self-learning principle in the previous text, and is not repeated for the sake of brevity.

[0135] In the embodiment of the present application, the application types may include: battle type, cache type, stand-alone type, and periodic type. For example, the battle type is a battle game. The cache type is a video playback application, an online reading application, etc. The stand-alone type is a My World application. Periodic categories such as short video applications.

[0136] It should be noted that in the above embodiment, the router is used as the execution subject, that is, the router counts the number of messages with the mobile phone, and then determines the usage time of the mobile phone according to the number of interactive messages. Optionally, the technical solution of the embodiment of the present application can also be executed by the mobile phone, that is, the mobile phone counts the number of interactive messages between the local machine and the router and determines the usage time of the mobile phone according to the number of interactive messages. Among them, the number of interactive messages counted by the mobile phone may include: the number of messages sent by the mobile phone to the router, and / or the number of messages received by the mobile phone from the router. The way in which the mobile phone determines the usage time of the local machine is the same as the way in which the router determines the usage time of the mobile phone, and will not be repeated. Optionally, the technical solution of the embodiment of the present application can also be executed by the mobile phone and the router in cooperation. For example, after the router counts the number of interactive messages with the mobile phone, it sends the statistical results to the mobile phone, and the mobile phone determines the usage time of the mobile phone according to the statistical results (the number of interactive messages).

[0137] Fig.12 The schematic diagram of the structure of the device 1200 provided in the embodiment of the present application. The device 1200 may be the first device (eg, a router) or the second device (eg, a mobile phone) mentioned above. Fig.12 As shown, the device 1200 may include: one or more processors 1201; one or more memories 1202; a communication interface 1203, and one or more programs 1204, and the above-mentioned devices may be connected via one or more communication buses 1205. The one or more programs 1204 are stored in the above-mentioned memory 1202 and are configured to be executed by the one or more processors 1201, and the one or more programs 1204 include instructions. For example, when the device 1200 is the first device in the above text, i.e., a router, the instruction may be used to execute the relevant steps of the router in the corresponding embodiment above, for example, connecting with a mobile phone and obtaining a first message number, the first message number includes the number of all messages received from and / or sent to the mobile phone by the router before the first moment; according to the first message number, determining whether the mobile phone is used at the first moment; if it is determined that the mobile phone is used at the first moment, determining the first moment as the use moment of the mobile phone. Taking the first moment as the tth moment as an example, the first message number includes the number of all messages received from and / or sent to the mobile phone by the router before the tth moment. The first message number can be expressed in PPS t-i Indicates that i is an integer ranging from 1 to n. Taking n=1 as an example, the number of the first message is PPS t-1 .PPS t-1 is the PPS at time t-1. The router uses the PPS at time t-1 to t-1 , determine whether the mobile phone is used at time t (for example, the PPS at time t-1 can be used to determine whether the mobile phone is used at time t-1). t-1, determine the usage probability of the mobile phone at time t, and then determine whether the mobile phone is used at time t according to the usage probability). Taking n=2 as an example, the first message quantity includes PPS t-1 and PPS t-2 .PPS t-1 refers to the PPS at the t-1th moment, PPS t-2 Refers to the PPS at time t-2. The router uses the PPS at time t-1. t-1 , and the PPS at time t-2 t-2 , determine whether the mobile phone is used at time t (for example, the PPS at time t-1 can be used to determine whether the mobile phone is used at time t-1). t-1 , and the PPS at time t-2 t-2 , determine the usage probability of the mobile phone at time t, and then determine whether the mobile phone is used at time t according to the usage probability). The process of determining the usage probability of the mobile phone at time t can be found in the above methods A to D, which are not repeated here for the sake of brevity. The communication interface 1203 is used to realize communication between the device 1200 and other devices, for example, the communication interface can be a transceiver.

[0138] In the embodiments provided by the present application, the method provided by the embodiments of the present application is introduced from the perspective of a device (e.g., a router) as an execution subject. In order to implement the functions in the methods provided by the embodiments of the present application, the device may include a hardware structure and / or a software module, and the functions are implemented in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a function in the functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.

[0139] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a program product. The program product includes one or more instructions. When the instructions are loaded and executed on a device or computer, all or part of the processes or functions described in the embodiments of the present invention are generated.

[0140] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a program product implemented in one or more available storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain program code.

[0141] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and program products according to the present application. It should be understood that each flow and / or box in the flow chart and / or block diagram, as well as the combination of the flow chart and / or box in the flow chart and / or block diagram, can be implemented by program instructions.

[0142] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for determining device usage time, applied to a first device, characterized in that: include: Connecting a second device; Acquire a first message quantity, where the first message quantity includes a quantity of all messages received by the first device from the second device and / or sent to the second device before a first moment; determining, according to the number of the first messages, whether the second device is used at the first moment; If it is determined that the second device is used at the first moment, the first moment is determined as the usage moment of the second device.

2. The method according to claim 1, characterized in that Determining, according to the first message quantity, whether the second device is used at the first moment includes: determining, according to the first message quantity, a usage probability of the second device at the first moment, the usage probability being used to describe the possibility of a user using the second device at the first moment; It is determined whether the second device is used at the first moment according to the usage probability.

3. The method according to claim 2, characterized in that Determining, according to the usage probability, whether the second device is used at the first moment includes: If the usage probability is greater than or equal to the preset probability, it is determined that the second device is used at the first moment; otherwise, it is determined that the second device is not used at the first moment.

4. The method according to claim 2 or 3, characterized in that: The first number of messages includes the number of all messages received by the first device from the second device and / or sent to the second device at n moments before the first moment, where n is a positive integer, and determining, according to the first number of messages, the use probability of the second device at the first moment, includes: Determine, according to the first message quantity and the first corresponding relationship, a first usage probability corresponding to the first message quantity in the first corresponding relationship as the usage probability of the second device at the first moment; The first corresponding relationship is used to describe the corresponding relationship between the usage probability of the second device at the first moment and the number of messages received from the second device and / or sent to the second device by the first device at n moments before the first moment.

5. The method according to claim 2 or 3, characterized in that: The first number of messages includes the number of all messages received by the first device from the second device and / or sent to the second device at a second moment before the first moment, and determining, according to the first number of messages, the use probability of the second device at the first moment includes: Determine, according to the first message quantity and the second message quantity, a decreasing speed of the number of messages received by the first device from the second device and / or sent to the second device from the second moment to the first moment, where the second message quantity is the number of all messages received by the first device from the second device and / or sent to the second device at the first moment; The usage probability is determined according to the decreasing speed of the number of messages.

6. The method according to claim 2 or 3, characterized in that: The first number of messages includes the number of all messages received by the first device from the second device and / or sent to the second device at n moments before the first moment, where n is a positive integer, and determining, according to the first number of messages, the use probability of the second device at the first moment, includes: Determining that the number of the first messages is within a first range; determining, according to the first range, a second corresponding relationship, where the second corresponding relationship is used to describe a corresponding relationship between a usage probability of the second device at the first moment and a number of messages received from and / or sent to the second device by the first device at the first moment, when the number of messages received from and / or sent to the second device by the first device at n moments before the first moment is within the first range; According to the second message quantity and the second corresponding relationship, determine that the second usage probability corresponding to the second message quantity in the second corresponding relationship is the usage probability of the second device at the first moment, and the second message quantity is the number of all messages received from the second device and / or sent to the second device by the first device at the first moment.

7. The method according to claim 6, characterized in that Determining a second corresponding relationship according to the first range includes: According to the first range, a second corresponding relationship is determined among multiple corresponding relationships, and different corresponding relationships among the multiple corresponding relationships are used to describe the correspondence between the usage probability of the second device at the first moment and the number of messages received from and / or sent to the second device by the first device at the first moment when the number of messages received from and / or sent to the second device by the first device at n moments before the first moment is in different ranges.

8. The method according to any one of claims 1 to 7, characterized in that: Before determining, according to the first message quantity, whether the second device is used at the first moment, the method further includes: Acquire a second number of messages, where the second number of messages includes the number of all messages received by the first device from the second device and / or sent by the first device to the second device at the first moment; Determine that the number of the second messages is less than the first threshold.

9. The method according to claim 8, characterized in that The method further comprises: If the number of the second messages is greater than or equal to the first threshold, it is determined that the second device is used at the first moment.

10. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: Calculate the usage time of the second device according to the determined usage time of the second device, and when the usage time is greater than a preset time, perform at least one of the following steps: Outputting a prompt message, wherein the prompt message is used to prompt that the usage time is longer than a preset time; or, The Internet access function of the second device is interrupted.

11. A device, characterized in that: include: a processor, a memory, and one or more programs; The one or more programs are stored in the memory, and the one or more programs include instructions, and when the instructions are executed by the processor, the device performs the method steps as claimed in any one of claims 1 to 10.

12. A readable storage medium, characterized in that: The readable storage medium is used to store a program, and when the program is executed on a device, the device is caused to execute the method according to any one of claims 1 to 10.