CN117715099A - Method for counting internet surfing time, electronic equipment and readable storage medium - Google Patents

Method for counting internet surfing time, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN117715099A
CN117715099A CN202310913329.6A CN202310913329A CN117715099A CN 117715099 A CN117715099 A CN 117715099A CN 202310913329 A CN202310913329 A CN 202310913329A CN 117715099 A CN117715099 A CN 117715099A
Authority
CN
China
Prior art keywords
application
connection
duration
preset period
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310913329.6A
Other languages
Chinese (zh)
Inventor
施磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310913329.6A priority Critical patent/CN117715099A/en
Publication of CN117715099A publication Critical patent/CN117715099A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a method for counting internet surfing time, electronic equipment and a readable storage medium, and relates to the technical field of communication. After the first application establishes connection with the corresponding server, monitoring the duration from the start of connection establishment to disconnection, and transmitting data by the first application and the corresponding server through the second device; and determining the surfing time of the first application according to the duration from the starting of connection establishment to disconnection. In the method, after connection is established between the application and the corresponding server, the connection can continuously exist in the whole application use process until the application stops using, so that the continuous time from the start of connection establishment to disconnection can be counted, various required internet surfing time can be counted accurately, and the use experience of a user on the routing product service is improved.

Description

Method for counting internet surfing time, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method for counting internet surfing time, an electronic device, and a readable storage medium.
Background
The personal mobile phone, tablet computer and other electronic devices can be connected to the internet through the connecting router, the router can record the electronic devices connected to the router, and the internet surfing time of the user can be counted. The router may count the internet surfing time according to the time of the message transmission, for example, after the application server receives the request from the application, the router transmits the message corresponding to the request to the application, where the time between the time when the message starts to be transmitted and the time when the message ends to be the internet surfing time of the application.
However, there is a certain difference between the internet surfing time counted according to the time length of the message transmission and the actual internet surfing time, for example, for a long video with a time length of 1 hour, the actual video buffering time is 10 minutes, in this case, since the message transmission only needs 10 minutes, the internet surfing time counted by the router is 10 minutes, but the user needs 1 hour to see the video, and the actual internet surfing time is 1 hour, therefore, the accuracy of the current method for counting the internet surfing time according to the time length of the message transmission is lower, and the actual internet surfing time of the user cannot be measured correctly.
Disclosure of Invention
The application provides a method for counting internet surfing time, electronic equipment and a readable storage medium, which can more accurately measure the actual internet surfing time of a user. The technical scheme is as follows:
In a first aspect, an embodiment of the present application provides a method for counting a duration of surfing the internet, where communication is supported between a first device and a second device, and at least one application is installed on the first device, where the method is applied to the second device, and includes:
after detecting that the first application and the corresponding server establish connection, monitoring the duration from the beginning of connection establishment to disconnection, wherein the first application and the corresponding server transmit data through the second device, and the first application is any application which establishes connection with the corresponding server in at least one application;
determining the surfing time of the first application according to the duration from the starting of connection to the disconnection,
based on the technical scheme, after the connection is established between the application and the corresponding server, the connection can continuously exist in the whole process of using the application by the user until the application stops being used, and the connection is not disconnected between the application and the corresponding server. Therefore, the second device can accurately count the online time corresponding to the first application by monitoring the duration from the starting of connection establishment to the disconnection, can more accurately measure the actual online time of the user, and improves the use experience of the user on the route product service.
With reference to the first aspect, the method further includes: and determining the internet surfing time length corresponding to the application of the same type in at least one application and/or the internet surfing time length corresponding to the first equipment according to the internet surfing time length of the first application.
The first application establishing connection with the corresponding server may be an application or may be a plurality of applications, where the plurality of applications may belong to the same type or may be different types, so that the second device may count, according to the connection corresponding to the first application, the internet surfing time duration corresponding to each application, the internet surfing time duration corresponding to the application of the same type, and the internet surfing time duration corresponding to the first device. The internet surfing time length corresponding to each application refers to the time length of the user surfing by using each application, and the same type of application belongs to a service. The internet surfing time length corresponding to the same type of application refers to the comprehensive time length of a user surfing a certain service, and the internet surfing time length corresponding to the first equipment refers to the time length of the user surfing the internet by using the first equipment.
With reference to the first aspect, in some implementations of the first aspect, after detecting that the first application establishes a connection with a corresponding server, the second device obtains at least one of an application identifier, an identifier of an application type, and a device identifier corresponding to the connection. Determining the internet surfing time of the first application according to the duration from the starting of connection establishment to disconnection, wherein the method comprises the following steps: and determining the Internet surfing time of the first application according to the duration from the starting of connection to the disconnection and the application identifier corresponding to the connection.
According to the internet surfing time length of the first application, determining the internet surfing time length corresponding to the same type of application in at least one application and/or the internet surfing time length corresponding to the first device comprises the following steps:
determining the internet surfing time length corresponding to the application of the same type in at least one application according to the internet surfing time length of the first application and the identifier of the application type corresponding to the connection; and/or determining the internet surfing time length corresponding to the first equipment according to the internet surfing time length of the first application and the equipment identifier corresponding to the connection.
Each connection corresponds to an application identifier, an identifier of an application type and a device identifier, and the second device can determine the connection belonging to the same application according to the application identifier, and determine the internet surfing time of each application according to the duration from the start of connection to disconnection of the connection. The second device may determine, according to the identification of the application type, connections belonging to the same service, and determine, according to the duration from the start of the connection to the disconnection, the duration of surfing the internet for each service. The second device may determine, according to the device identifier, connections belonging to the same device, and determine, according to the duration from the start of the connection to the disconnection, the duration of surfing the internet for each device.
With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, monitoring a duration from a start of connection establishment to disconnection includes: determining whether the connection is broken or not at each preset period; in the case where the connection is not broken, the duration of the connection is monitored for each preset period.
The second device determines whether the connection is disconnected or not at regular intervals; and monitoring the duration of the connection in the current preset period under the condition that the connection is not disconnected, wherein the duration of the connection in the current preset period is 0 under the condition that the connection is disconnected, so that the duration of the connection in each preset period is determined.
With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, determining a surfing time of the first application according to a duration from a start of connection establishment to a disconnection, includes: and determining the surfing time of the first application according to the duration of the connection in each preset period.
With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, determining the internet surfing time according to a duration of the connection lasting in each preset period includes: according to the duration of each connection corresponding to the first application in the same preset period, determining the surfing time of the first application in the same preset period; and adding the surfing time length of the first application in each preset period to obtain the surfing time length corresponding to the first application.
It should be understood that at least one connection may be established between an application and its corresponding server, and the second device may screen each connection corresponding to the first application from all the connections, and after monitoring a duration of each connection corresponding to the first application in each preset period, determine, according to the duration of each connection in the same preset period, a surfing duration of the first application in the preset period.
With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, determining a surfing time length of the first application in the same preset period includes: and determining the maximum duration of each connection corresponding to the first application in the duration of the same preset period as the surfing duration of the first application in the same preset period.
With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, monitoring a duration of the connection in each preset period includes:
determining a first time length and a second time length, wherein the first time length is the maximum allowed survival time length of the connection, and the second time length is the residual survival time length of the connection corresponding to the end time of each preset period;
Determining a difference between the first time period and the second time period;
when the difference value is smaller than the preset period, determining the difference value as the duration of the connection in the corresponding preset period; or alternatively, the first and second heat exchangers may be,
and under the condition that the difference value is greater than or equal to the preset period, determining the duration of the preset period as the duration of the connection in the corresponding preset period.
With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, monitoring a duration of the connection in each preset period includes:
acquiring a flag bit corresponding to a current preset period;
under the condition that the flag bit is a first flag bit, determining the duration of connection in the current preset period according to the difference value of the first duration and the second duration, wherein the first duration is the maximum allowed survival duration of connection, and the second duration is the residual survival duration of connection corresponding to the ending time of the current preset period; or alternatively, the first and second heat exchangers may be,
and under the condition that the flag bit is the second flag bit, determining the duration of the preset period as the duration of the connection in the current preset period.
The first flag bit and the second flag bit are determined according to a duration of time duration in a preset period before the current preset period, or the first flag bit and the second flag bit are determined according to a message received on the connection.
In some implementations, the second device may acquire a time when connection starts to be established and a time when connection starts to be disconnected, and determine a surfing time length corresponding to each application, a surfing time length corresponding to each service, and a surfing time length corresponding to the device according to the time when connection starts to be established and the time when connection starts to be disconnected.
In a second aspect, an embodiment of the present application provides an electronic device, including: one or more processors; one or more memories; the memory stores one or more programs that, when executed by the processor, cause the electronic device to perform any of the possible methods of the first aspect described above.
In a third aspect, an embodiment of the present application provides an apparatus, where the apparatus is included in an electronic device, and the apparatus has a function of implementing the foregoing first aspect and a behavior of the electronic device in a possible implementation manner of the foregoing first aspect. The functions may be realized by hardware, or may be realized by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the functions described above. Such as a display module or unit, a detection module or unit, a processing module or unit, etc.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having instructions stored therein, which when run on a computer, cause the computer to perform the method of the first aspect described above.
In a fifth aspect, embodiments of the present application provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the first aspect described above.
The technical effects obtained by the second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and are not described in detail herein.
Drawings
Fig. 1 illustrates an example of an application scenario provided in an embodiment of the present application;
FIG. 2 shows a software architecture block diagram of an example router provided by an embodiment of the present application;
FIG. 3 shows an exemplary interface diagram provided by an embodiment of the present application;
FIG. 4 shows a schematic diagram of another interface provided by an embodiment of the present application;
FIG. 5 shows a schematic diagram of another interface provided by an embodiment of the present application;
FIG. 6 shows a schematic diagram of another interface provided by an embodiment of the present application;
FIG. 7 shows a software architecture block diagram of yet another example router provided by an embodiment of the present application;
FIG. 8 is a schematic diagram illustrating an example of calculating a connection duration according to an embodiment of the present application;
FIG. 9 is a schematic diagram of still another example of calculating a connection duration according to an embodiment of the present application;
Fig. 10 is a schematic structural diagram of an example of an electronic device according to an embodiment of the present application;
FIG. 11 is a block diagram of a software architecture of an electronic device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of an example router according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, embodiments of the present application will be described in further detail below with reference to the accompanying drawings. The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.
Fig. 1 shows a schematic view of an application scenario according to an embodiment of the present application. As shown in fig. 1, this scenario involves an electronic device 100 (first device), a router 200 (second device), and the Internet (Internet).
The electronic device 100 may be connected to the internet by a wired or wireless manner, and when the electronic device 100 is connected to the internet by a wireless manner, the router 200 may be connected by a wireless communication technology. The router 200 may connect to the internet through a network transmission medium (e.g., fiber optic, coaxial cable, twisted pair, or radio waves) to enable the electronic device 100 to perform internet surfing functions (e.g., watch web video, play web games). If the electronic device 100 has a wired network interface, the electronic device 100 may also be connected to the router 200 by a wired manner.
Router 200 is a hardware device that connects two or more networks and acts as a gateway between the networks for forwarding packets in the networks. Taking the example that the user uses the application A in the electronic device, after the user clicks the application A in the electronic device, the electronic device starts the application A in response to the clicking operation of the user. The application A in the electronic equipment and the server corresponding to the application A can establish communication, and the data packet which needs to be interactively transmitted between the application A and the server corresponding to the application A can be forwarded through the router. The data packet interacted between the application a and the server corresponding to the application a may be referred to as a message.
Among other wireless communication technologies, but not limited to: wireless local area networks (wireless local area networks, WLAN), wireless fidelity (wireless fidelity, wi-Fi) networks, bluetooth (BT), fifth generation mobile communication technologies (5 th generation mobilenetworks or 5th generation wireless systems, abbreviated as 5G), global navigation satellite systems (global navigation satellite system, GNSS), frequency Modulation (FM), near field wireless communication technologies (near field communication, NFC), infrared technologies (IR), and the like.
The electronic device 100 may be a mobile phone, a tablet computer, a notebook computer, a smart watch, an ultra-mobile personal computer (UMPC), a personal digital assistant (personal digital assistant, PDA), a smart television, a wearable electronic device, or the like, which is not limited in the type of the electronic device in the embodiments of the present application.
The principle of forwarding a packet by a router is described below. Fig. 2 shows a software structure schematic diagram of a router according to an embodiment of the present application.
When the electronic equipment surfing the internet through the router, the electronic equipment packages data into a data packet and sends the data packet to a WIFI port of a driving layer in the router; after the WIFI port receives the data packet sent by the electronic device, the data packet can be transmitted to a protocol stack for unpacking, and the router can determine the target address corresponding to the data packet through unpacking analysis of the protocol stack. After the router determines the target address corresponding to the data packet, the router determines an optimal route according to a routing algorithm, and forwards the optimal route to the Internet through a network port at the other end of the router so as to enable the data packet to be transmitted to the target address. The router can also receive the data packet from the Internet through the network port, transmit the data packet to the protocol stack for unpacking, and forward the data packet to the electronic device through the WIFI port after unpacking analysis of the protocol stack. Among these, the protocol stack includes a series of network protocols, such as transmission control protocol (Transmission Control Protocol, TCP), network protocol (Internet Protocol, IP), etc., and defines rules for how the electronic device connects to the internet and how data is transferred between networks.
It should be noted that, the router is provided with an acceleration channel, and when the electronic device is surfing the internet, when there are more data packets in the sending queue, part of the data packets can be forwarded through the acceleration channel. The acceleration channel means: when the router forwards the data packet, the data packet does not pass through the protocol stack, but is directly forwarded from the driver at one end of the router to the driver at the other end, as shown in fig. 2, the data packet can be forwarded from the network port at one end of the router to the WIFI port at the other end, or the data packet is forwarded from the WIFI port at one end of the router to the network port at the other end, so as to transmit the data packet to the electronic device or the internet. When the router forwards the data packet, the processing of the protocol stack on the data packet is reduced, the processing load of the router is reduced, and the data forwarding performance can be improved, so that the aim of accelerating network data is fulfilled.
In addition, an identification module is arranged in a protocol stack of the router. The identification module can analyze each received data packet to identify the internet surfing information of the user. For example, the identification module may identify which service the user's internet information belongs to (e.g., games, video, etc.), and in particular which application in the category, by parsing the data packet, games such as queen glory, peaceful elite, etc., video, such as tremble, fast-handedness, loving, etc. For the data packet of the travel acceleration channel, the identification module can acquire the data packet through a callback module of the protocol stack, so as to analyze the data packet.
The identification module may also determine whether devices and applications are in use based on network throughput rates (packets per second, pps), and calculate the length of time to network access for different services or different applications based on the time of message transmission. The storage module can store the data analyzed by the identification module, such as the internet surfing time of a certain application, the internet surfing time of a certain service, and the like.
After the identification module analyzes the application information, the messages of the application and the service of the preset category can be processed preferentially. The electronic device of the router is connected with the WIFI drive to send the game message and the video message to the sending queue of different priorities according to the message mark, so that the message with high priority is accelerated to be forwarded, and game acceleration and net lesson acceleration functions are provided for users.
The processes of the application layer, such as a child protection process and a game acceleration process, can acquire the data in the storage module through a service process (fa process) to determine the surfing time of different services or different applications. For example, the game acceleration process registers the service statistics service with the service process, and the game acceleration process may periodically acquire the acceleration time length from the service process, and the game acceleration process may provide the acceleration time length to the electronic device, so that the electronic device may display the game acceleration time length.
That is, the router may provide the electronic device with a function of statistics of internet surfing information, for example, statistics of internet surfing time, and corresponding functions in the electronic device include a child internet surfing protection function, a game acceleration function, and the like, in addition to the internet surfing function. The following specifically takes the electronic device as an example of a mobile phone, and describes the internet surfing protection function and the game acceleration function of the electronic device.
Fig. 3 is a schematic diagram illustrating a child internet surfing protection function according to an embodiment of the present application. A user can manage a router connected with the electronic equipment through an intelligent space application in the electronic equipment, can also see the surfing time of the child mobile phone, and can start surfing protection of the child mobile phone.
Fig. 3 (a) is a schematic diagram of a home screen interface of the electronic device. The home screen interface may include an application icon display area for displaying various types of application (App) icons, such as clock icons, calendar icons, gallery icons, memo icons, file management icons, email icons, music icons, calculator icons, video icons, sports health icons, weather icons, browser icons, smart life icons, setup icons, recorder icons, application mall icons, camera icons, address book icons, phone icons, information icons, and the like. A status bar may also be displayed above the application icon display area, the status bar may include: one or more signal strength indicators of mobile communication signals, one or more signal strength indicators of Wi-Fi signals, a power indicator of an electronic device, a time indicator, etc.
The electronic device may receive a click operation of the user on the smart space APP icon, and the electronic device may start the smart space APP in response to the click operation of the user on the smart space APP icon, and display a smart space APP main interface as shown in (b) of fig. 3. In the smart space APP main interface, states of all devices and each device added to the smart space APP by the user are displayed, for example, a television located in the first room is displayed in an area 601 shown in (b) in fig. 3, and the television is in an on-line state; a television in a second room is displayed in region 602, and the television is in an on-line state; an intelligent projector in the fourth room is shown in area 603, and the intelligent projector is off-line; in area 604, a router located in the fourth room is shown, the router name being "glory route Z3 Pro", and the router being online.
The user may click on the area 604 to view the detailed information of the router, and in response to the clicking operation of the area 604 by the user, the electronic device may display a router management interface as shown in fig. 4 (a), the router management interface may display a full-house WLAN coverage thermodynamic diagram, and the user may edit a house type diagram in the home to generate the full-house WLAN coverage thermodynamic diagram. The router management interface may also display the network environment, the download rate and upload rate of the network, e.g., the current network environment is good. The router management interface may also display options for multiple functions provided by the router, such as an "access device" option, a "Beta bill of lading" option, a "child internet surfing" option, an "smart detection" option, etc., where a user may operate in the router management interface to manage the router.
When the user wants to view the surfing time of the surfing of the child, the user can click on the surfing option of the child. The electronic device, in response to a click operation of the "child internet" option by the user, may display an interface for selecting a device as shown in (b) of fig. 4, which may display a device that is using the child internet protection function, for example, may display a type of the device, a name of the device, and the like. In addition, the device that has been connected or connected to the router but has not turned on the child internet protection is also displayed in the interface of the selection device. As shown in fig. 4 (b), the mobile phone "glory V40 light luxury" is using the child internet surfing protection function, and other devices such as device 1, device 2, and device 3 do not turn on the child internet surfing protection function. The user may click on an indicator on the right side of the device identification to enter a details page, turn on or off child internet protection for a device, or view more detailed internet information.
For example, the user may click on an indicator on the right side of "glory V40 light luxury", and the electronic device may display a detail page interface corresponding to the mobile phone "glory V40 light luxury" as shown in (a) of fig. 5, and the detail page interface may display internet information (internet time length/application used, etc.) of the mobile phone "glory V40 light luxury" and related settings of internet protection of the mobile phone "glory V40 light luxury". For example, the details page interface displays a "one-click-to-break" option, and the user may click on the "one-click-to-break" option, and the electronic device sends a request to the router, and after receiving the request, the router disconnects the connection with the mobile phone "glory V40 light luxury" and prevents the mobile phone "glory V40 light luxury" from connecting to the internet. The drop-down option frame corresponding to the one-key-off option can comprise various choices of immediate off-line, off-line after 10 minutes, off-line after 30 minutes, off-line after 1 hour, and the like, one of which can be selected by a user, and the router can disconnect the network of the mobile phone 'glory V40 light luxury' after the corresponding time. The details page interface also displays a "all allowed" option, after which the protected device "glows V40 light luxury" will not be limited by other rules (e.g., duration limitations, period limitations, etc.) and immediately resume surfing.
The detail page interface also displays the contents of internet time statistics, internet surfing permission time period, internet surfing permission time duration, internet surfing permission application and the like. Specifically, the user may set a period of time that the protected device is allowed to surf the internet, and the protected device will not be able to surf the internet for a period of time that is not configured, e.g., the user sets that surfing can be done daily at 12:00-13:00, and then "glowing V40 light luxury" may surf the internet for a period of time of 12:00-13:00. The user can also set the duration that the protected device is allowed to surf the internet, and the protected device cannot surf the internet after the duration is used up. The surfing time is only valid in the surfing time period. For example, if the user does not set the time period for allowing surfing, and only sets the monday longest surfing time of the protected equipment to be 6 hours, surfing the protected equipment for 6 hours on monday whole day cannot be continued; if the maximum monday surfing time is set to be 6 hours and surfing is only allowed in the 8:00-23:00 time period, the protected equipment can only surf the internet for 6 hours in the 8:00-23:00 time period of monday. The user may also close or open the access rights of certain applications, e.g. after opening the game application switch, the 23 applications in the corresponding application list are allowed to be accessed.
The user may click on an indicator of the internet time statistics function, and in response to the click operation by the user, the electronic device may display an interface as shown in (b) in fig. 5, the internet time statistics function classifies applications identified by router support into five other categories of learning, social, video, game, and statistics according to different time periods (e.g., yesterday, today, and the week). The user can respectively see the internet surfing time of each class of application of the protected equipment in yesterday, today and week and the internet surfing condition of the specific application.
When the user wants to view the data after the game acceleration, the user may click on the "more" option as shown in (a) of fig. 4, and the electronic device may display an interface as shown in (a) of fig. 6, which displays more functional options such as net lesson acceleration, game acceleration, upgrade management, etc., in response to the click operation of the "more" option by the user.
The user may set the game acceleration, and may acquire acceleration information at the time of "game acceleration", for example, the user may click on a "game acceleration" option displayed in an interface shown in (a) of fig. 6, and the electronic device may display a "game acceleration" interface shown in (b) of fig. 6 in response to a click operation by the user. In the "game acceleration" interface, a record of game acceleration by the router is displayed, such as, for example, the current time, the acceleration duration, the reduced packet loss rate, the delay rate, and the like.
When implementing the above-mentioned internet information statistics function based on the principle of fig. 2, the router may calculate the internet time according to the current generated flow, that is, the time of transmitting the message, for example, after receiving the request from the application, the application server transmits the message corresponding to the request to the application, where the time between the time when the message starts to be transmitted and the time when the message ends to be the internet time of the application. The counted internet time length of the application is often considered as the actual internet time length of the user, but for some applications, such as games, short videos, long videos, lessons, social contact, etc., messages may not be always transmitted between the application and the application server in the whole connection process, so that the internet time length counted according to the message transmission time length has a certain difference from the actual internet time length.
For example, when the user looks at a long video with a duration of 1 hour, the actual video buffering time is 10 minutes, that is, the video data is already buffered 10 minutes, and the video playing will not generate traffic without message transmission after buffering, in this case, since the message transmission only needs 10 minutes, the internet surfing time counted by the router is 10 minutes, but the user needs 1 hour to look at the video, and the actual internet surfing time is 1 hour. For another example, when the user swipes the jittered audio and short videos, the flow of each short video may only need to transmit for 5 seconds, but the time required for watching the short video is 1 minute, in this case, the internet surfing time counted by the router is 5 seconds, which is 8% of the actual use time, and if the user is limited to watch the jittered audio and video for only 10 minutes, the time for the user to watch the jittered audio and video is actually much longer than 10 minutes. The duration of the user actually surfing the internet may be longer than the duration of surfing the internet counted by the router, which may cause the router to be unable to perform surfing limitation on devices (especially child devices) connected to the router according to the surfing duration preset by the user. For another example, the user plays a 1 hour and flat elite game, and only a lot of intermittent (for example, about 30 seconds) acceleration records are seen in the game acceleration records, and long-time game acceleration information is not displayed, so that the user cannot see the real acceleration time, and the user satisfaction may be reduced.
In short, the accuracy of the method for counting the actual internet time based on the time of message transmission is low, and the actual internet time of the user cannot be measured correctly.
In view of this, the embodiment of the present application provides a method for counting a duration of surfing the internet, at least one application is installed on an electronic device, after a user starts a first application, a connection is established between the first application and a corresponding application server, and a message is transmitted between the first application and the application server through a router. The router monitors a duration of connection establishment to disconnection from the beginning after detecting that the first application establishes a connection with the corresponding server. The router determines the surfing time of the first application according to the duration from the starting of connection establishment to disconnection.
Based on the calculation scheme, after connection is established between the application and the corresponding server, the connection can continuously exist in the whole process of using the application by a user, the connection can be sometimes provided with traffic and sometimes not provided with traffic, but the connection can always exist, and the connection can not be disconnected until the application stops being used, so that the connection between the application and the corresponding server is used for determining the internet surfing time from the beginning of the establishment to the disconnection, the required internet surfing time can be counted more accurately, the actual internet surfing time of the user can be measured more accurately, and the use experience of the user on the route product service is improved.
Wherein the first application is any application of the at least one application that establishes a connection with the application server. The first application may be one application or may be a plurality of applications, which may be of the same type or may be of different types. And determining the internet surfing time length corresponding to the application of the same type in at least one application and the internet surfing time length corresponding to the electronic equipment according to the internet surfing time length of the first application.
As a user launches an application, different interfaces of the application are opened, and various connections (conntrack) are established between the application and the corresponding server using different functions of the application. For example, when the application 1 is used by a user, the application 1 and the server can establish a connection related to chat, when the user uses the application 1 to watch video, the application 1 and the server can establish a connection related to video, and when the user uses the application 1 to pay, the application 1 and the server can establish a connection related to payment.
Wherein the router uses the Linux system, the router can monitor the duration of connection from the beginning of the connection establishment to the disconnection through connection tracking (nf_conntrack). The connection tracking mechanism supported by the router is described below.
As the name implies, connection tracking is to track a connection, and is used to identify a message sent by an electronic device to a server or a message sent by the server to the electronic device on a connection after the connection is established, record information related to the connection, and store a connection state. The connection and connection tracking are in a one-to-one correspondence, one connection tracking being used to identify a connection between a client (an application on an electronic device used by a user, such as a tremble client) and a corresponding server (such as a tremble server).
A number of messages (skb) are transmitted over a connection, one message belonging to each connection, through which the connection to which the message belongs can be found. After receiving a message, the router can analyze the message, if the message does not belong to the existing connection, which means that the application is establishing a new connection, the router needs to create a new connection track, identify the information of the message, and record a new piece of information related to the connection; if the message is found to belong to the existing connection after the message is analyzed, the information related to the connection recorded through connection tracking is updated.
The information related to the connection may include one or more of the following: basic information of applications and servers (e.g., five-tuple information, protocol type, source address, source port, destination address, destination port), application identification, application type (service) identification, connection lifetime, connection status, creation time, number of packets sent, network layer protocol, protocol type code of network layer, transport layer protocol type code, number of bytes sent, etc. The information related to the connection may be stored in a database and the router may maintain and constantly update the database.
Illustratively, one piece of information of the connection trace record may be: "ipv4, 2, tcp, 6, 192, ESTABLISHED, src = 192.168.3.3, dst= 101.91.33.146, sport=53332, dport=7889, src= 101.91.33.146, dst= 192.168.3.3, sport=7889, dport=53332, sc_id=100, sc_categ=4".
The protocol of the network layer is Internet protocol version 4 (Internet Protocol Version, ipv 4), the protocol type code of the ipv4 is 2, the protocol of the transmission layer is tcp, the protocol type code of tcp is 6, the connection life time is 192s, the connection state is ESTABLISHED, src represents a source address, dst represents a destination address, sport represents a source port, and dport represents a destination port.
Assuming that the port of the electronic device is "53332", the port of the server of the application a is "7889", the IP address of the electronic device is 192.168.3.3, and the IP address of the server of the application a is 101.91.33.146, that is, one terminal having the IP address 192.168.3.3 is connected to the terminal having the port 7889 by using the TCP protocol through the port 53332, and the IP address is 101.91.33.146. When the electronic device sends a message to the server, the source address src is 192.168.3.3, the source port spin is 53332, the destination address dst is 101.91.33.146, and the destination port dport is 7889. When the server sends a message to the electronic equipment, the source address src is 101.91.33.146, the source port sport is 7889, the destination address dst is 192.168.3.3, and the destination port dport is 53332.
Further, the sc_id field represents an application identification for determining to which application the connection belongs. The sc_category field represents the application type for determining to which service the connection belongs. Each application in the electronic device may be represented by an application identifier (Identity document, id), and specific application identifier information is not limited, for example, each application may be numbered in advance, and the number is used as the corresponding id. For example, application 1, application 2, application 3, application 4, application 5 may be numbered 100, 200, 301, 401, 804, respectively.
The plurality of applications in the electronic device may be classified into different types, one type of application corresponding to one type of service (category), the service may be classified into a video class, a game class (e.g., such as king glory, peaceful elite, heavenly fighter, etc.), a learning class (e.g., learning through, work group, etc.), a social class (e.g., weChat, QQ, microblog, etc.), a shopping class (e.g., naught, beijing le, box horse, etc.), a live broadcast class, net lesson class, etc. Different services may be represented by the identifier, and information specifically used as the identifier is not limited, for example, a corresponding number may be set in advance for each service, and the number may be used as the corresponding identifier. For example, the numbers of the video class, the game class, and the learning class may be 1, 2, and 3, respectively.
The connection status may include ESTABLISHED and others (e.g., TIME WAIT), which is in-use when the user uses the application to surf the internet, and which is indicated in the recorded information. After the application exits the background, the connection is disconnected and the recorded information is represented by TIME_WAIT. And when the internet surfing time is calculated, calculating through the connection with the state of ESTABLISHED.
The connection lifetime may also be referred to as the decay lifetime, and there is an initial lifetime, i.e. the maximum allowed lifetime of the connection, when a new connection is established, the lifetime decreases every second, the lifetime decreases by 1 second every 1 second(s) in the past, and the lifetime resets to the initial value whenever a new message on the connection is received. For example, the lifetime corresponding to a connection using tcp protocol may initially be 432000 seconds.
The router may determine the total length of surfing from the device dimensions for each device based on the five tuple information. Because the private fields sc_id and sc_category are added in the connection tracking, the router can also count the internet surfing time of each application in the electronic equipment from the application dimension through the sc_id, and can count the internet surfing time of each service in the electronic equipment from the service dimension through the sc_category.
Fig. 7 shows a schematic diagram of a router according to an embodiment of the present application. The principle of router forwarding data packets and counting the duration of surfing the internet is described below in connection with fig. 7.
When the mobile phone surfing the internet through the router, the mobile phone packages data into a data packet and sends the data packet to a WIFI port of a driving layer in the router; after the WIFI port receives the data packet sent by the mobile phone, the data packet can be transmitted to a protocol stack for unpacking, and the router can determine the target address corresponding to the data packet through unpacking analysis of the protocol stack. After the router determines the target address corresponding to the data packet, the router determines an optimal route according to a routing algorithm, and forwards the optimal route to the Internet through a network port at the other end of the router so as to enable the data packet to be transmitted to the target address. The router can also receive the data packet from the Internet through the network port, transmit the data packet to the protocol stack for unpacking, and forward the data packet to the mobile phone through the WIFI port after unpacking analysis of the protocol stack.
The protocol stack defines, among other things, rules how the electronic device connects to the internet and how data is transferred between networks. Included in the protocol stack are a number of network protocols such as transmission control protocol (Transmission Control Protocol, TCP), network protocol (Internet Protocol, IP), hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP), file transfer protocol (File Transfer Protocol, FTP), simple mail transfer protocol (Simple Mail Transfer Protocol, SMTP), user datagram protocol (User Datagram Protocol, UDP), address resolution protocol (Address Resolution Protocol, ARP), and routing protocol.
It should be noted that, the router is provided with an acceleration channel, and when the mobile phone is surfing the internet, when there are more data packets in the transmission queue, part of the data packets can be forwarded through the acceleration channel. The acceleration channel means: when the router forwards the data packet, the data packet does not pass through the protocol stack, but is directly forwarded from the driver at one end of the router to the driver at the other end, as shown in fig. 7, the data packet can be forwarded from the network port at one end of the router to the WIFI port at the other end, or the data packet is forwarded from the WIFI port at one end of the router to the network port at the other end, so as to transmit the data packet to the mobile phone or the internet. When the router forwards the data packet, the processing of the protocol stack on the data packet is reduced, the processing load of the router is reduced, and the data forwarding performance can be improved, so that the aim of accelerating network data is fulfilled.
An identification module is arranged in a protocol stack of the router. After the router receives the message, the identification module can analyze the message to identify which type of service the message belongs to and which application the message belongs to. And then recording the application identifier and the service identifier into the relevant information of the connection to which the message belongs, so that when the internet surfing time length is counted according to the information obtained by connection tracking, the corresponding internet surfing time length can be counted from the service dimension and the application dimension. It should be noted that, after the identification module identifies the application identifier and the service identifier in the first packet of one connection or in a certain packet, the subsequent packet on this connection does not identify the application and the service any more, that is, each packet does not need to be identified, so that the workload of the identification module is reduced, the processing load of the router is reduced, and the performance of the router can be improved.
Each piece of connection-related information of the connection tracking record is stored in the database (/ proc/nrt/nf_conntrack). The manager (cms process) can acquire information related to the connection from the database according to a preset period, and statistics on the internet time from the equipment dimension, the application dimension and the service dimension according to the information related to the connection. In the embodiment of the present application, the duration of the preset period is not limited, for example, the preset period may be 10s, the cms process counts the online duration once from the device dimension, the application dimension, and the service dimension every 10s, and writes the counted online duration into the storage module (/ proc/atp_sc/xxx_stats), and 3 files may be used to respectively store data in three dimensions.
For example, the specific file content of the file/var/serv_stats corresponding to the application dimension may be in the form of a table, as shown in table 1, where the index column is an application identifier, for example, 401 is application 4, 804 is application 5, the application identifier is negotiated by the electronic device, the application and the router, and when the electronic device receives the internet surfing time period corresponding to the identifier 401, the internet surfing time period of the application 4 may be displayed on the corresponding functional interface. The Active state Active indicates whether the application is surfing the internet, and if surfing the internet has stopped, the Active state Active is denoted as active=0, and if surfing the internet is performed, the Active state Active is denoted as active=1. The internet surfing time length is updated every 10s, if the application is surfing, the internet surfing time length is increased every 10s, if the application stops surfing, the internet surfing time length is not updated, for example, the application 5 is detected to stop surfing at 100s, the internet surfing time length is stopped at 80s, after the application 5 is detected to surfing again at 500s, and the internet surfing time length in 490s-500s period is 7s, and the 80s is updated to 87s at 500 s. The business dimension and the device dimension are similar to the application dimension. The index column in the file/var/category_stats corresponding to the service dimension may be the number of the service. In the file/var/host_stats corresponding to the device dimension, the index column may be a device number, for example, d2:09:7a:32:00:73.
It should be noted that, in any dimension, a new table may be generated at zero daily to record the time of surfing the internet on the same day, and the table has a storage time limit, and the storage time limit may be 7 days, 14 days, 30 days, or the like, for example, the storage time limit is 7 days, and then one table may be deleted after 7 days are created, so as to save the router memory. Or, recording the value of the surfing time length at the zero point time to determine the surfing time length of each day.
Table 1 internet time for each application
For the data packet of the travel acceleration channel, the identification module can acquire the data packet through a callback module of the protocol stack, so as to analyze the data packet. After the identification module analyzes the internet surfing information, the messages of the application and the service of the preset category can be processed preferentially. The router can actively identify messages and mark the game messages and the video messages when the mobile phone accessing the router through the WIFI accesses the game or watching the network class, and the WIFI driver places the game messages and the video messages into sending queues with different priorities according to the message marks, so that messages with high priority are accelerated to be forwarded, and game acceleration and network class acceleration functions are provided for users.
The processes of the application layer, such as a child protection process and a game acceleration process, can acquire the data in the storage module through a service process (fa process) to determine the surfing time of different services or different applications. For example, the game acceleration process registers the service statistics service with the service process, the service process may send the acceleration duration to the game acceleration process at regular time, and the game acceleration process may send the acceleration duration to the mobile phone, so that the mobile phone may display the game acceleration duration. For example, the service process obtains incremental statistics of applications/services and service activity information from the storage module every 30 seconds. The child protection process obtains incremental internet data for the device/application/service from the storage module every 2 minutes.
Taking the example that the first application comprises application 1 as an example, the internet surfing time length statistical method is described from the application dimension.
After the connection is established between the application 1 and the corresponding server, the cms process may acquire the information related to the connection, monitor the duration from the start to the end of the connection according to the information related to the connection, and then determine the internet surfing duration corresponding to the application 1 according to the duration from the start to the end of the connection. It should be understood that at least one connection is established between the application 1 and the corresponding server, and the cms process screens at least one connection corresponding to the application 1 from the database through the application identifier.
In one implementation, for each connection, the router records a time when the connection starts to be established (first time), and records a time when the connection is disconnected (second time), and determines a union of duration of the plurality of connections according to the plurality of first times and the plurality of second times corresponding to the plurality of connections, so as to determine a surfing duration corresponding to the application 1. The first time and the second time may be stored in a database as information related to the connection.
For example, the connection 1, the connection 2 and the connection 3 are corresponding to the application 1, the first time and the second time of the connection 1 are respectively 13:00 and 15:00, the first time and the second time of the connection 1 are respectively 08:00 and 14:00, the first time and the second time of the connection 3 are respectively 19:00 and 20:00, and the union is 08:00-15:00 plus 19:00-20:00, and the surfing time period corresponding to the application 1 is 8 hours.
When a user enters a functional interface shown in fig. 5 and 6, the electronic device can request to acquire the internet surfing time length from the router, the router can judge whether the connection of the application 1 is disconnected or not, and if the connection of the application 1 is disconnected, the disconnection time of each connection is a second time; if the connection of the application 1 is not disconnected, determining the current moment as a second moment of disconnection; and determining duration time of a plurality of connections according to the first moment and the second moment, and further determining the current internet surfing time of the application 1. The router sends the internet surfing time of the application 1 to the electronic equipment, and the electronic equipment displays the internet surfing time.
Or, whether the electronic device requests to acquire the internet surfing time length, the router can count the internet surfing time length every day or every week, for example, the router monitors the internet surfing time length of the application 1 every certain time period, the time period length can be 30 minutes, 1 hour, 2 hours and the like, and the first time and the second time corresponding to the application 1 can be determined during monitoring, wherein if the connection of the application 1 is disconnected, the disconnection time of each connection is the second time; if the connection of the application 1 is not disconnected, the current moment is determined as a second moment of disconnection.
Under the condition that the maximum internet time is set by a user, the router can monitor the earliest first moment corresponding to the application 1, monitor whether the internet time of the application 1 reaches the maximum internet time or not at intervals of a certain period, and prohibit the application 1 from surfing the internet when the maximum internet time is reached; if the maximum internet time is not reached, continuing monitoring. The time period length may be determined according to the maximum internet time length, for example, the maximum internet time length is 6 hours, and then the time period length may be 1 hour, 2 hours, or the like. The router may calculate the remaining internet surfing time length of the application 1 at each monitoring time, and continuously reduce the time period length according to the remaining internet surfing time length, for example, the maximum internet surfing time length is 6 hours, the remaining internet surfing time length is 6 hours, the time period length may be 6 hours, the remaining internet surfing time length is 1 hour, and the time period length may be 20 minutes.
If the internet surfing time of each day is counted, the first time and the second time can be determined according to the natural day in the time of day (00:00-24:00). If the time to surf the internet weekly is counted, the first time and the second time may be determined during the time of the week (e.g., from monday 00:00 to sunday 24:00).
It should be understood that the service dimension and the device dimension may also determine the internet surfing time in this manner, which will not be described in detail later.
In another implementation, a preset period is first determined, for example, the preset period is 10s, and then the cms process determines the surfing time of the application 1 in one preset period at 10s, 20s, 30s, … …, respectively. Specifically, at each preset period node, calculating the duration of each connection in each preset period, determining the surfing time of the application 1 in one preset period according to the duration of each connection in the same preset period, and adding the surfing time of each preset period to obtain the surfing time corresponding to the application 1. According to the period statistics, the internet surfing time length of each dimension can be determined more timely, the internet surfing time length is displayed in an interface of the electronic equipment timely, and the limitation of the internet surfing time length is realized.
For a duration of a connection that lasts for a preset period, in one implementation, at each period node, a duration of the connection that lasts for the preset period is determined according to the first duration and the second duration. The first duration is the survival duration of the initialization of the connection, namely the maximum allowed survival duration, and the second duration is the remaining survival duration corresponding to the end time of the preset period of the connection. Specifically, the cms process calculates the difference between the first duration and the second duration, and if the difference is smaller than a preset period, the duration of connection in the preset period is the duration corresponding to the difference. If the difference is greater than or equal to the preset period, the duration of the connection in the preset period is the duration of one period.
For example, as shown in fig. 8, application 1 corresponds to connection 1 and connection 2, connection 1 is established at 15s, connection 2 is established at 2s, and the initialized connection lifetime is 200s. For connection 1, when the 20 th s counts the online time period, the connection survival time period decays to 195s, then the first time period minus the second time period equals 5s,5s <10s, so the duration of connection 1 is 5s in the period of 10s-20 s. For connection 2, when the 20 th s statistics surfing time period, the connection survival time period decays to 182s, then the first time period minus the second time period is equal to 18s,18s >10s, and therefore, in the period of 10s-20s, the connection 2 has a duration of 10s.
In another implementation, the duration of the connection for one period is determined from the flag bit (active) of the connection. Acquiring a current marker bit connected with each period node; under the condition that the flag bit is a first flag bit (active=0), determining duration of connection in a current preset period according to a difference value between the first duration and the second duration; in the case where the flag bit is the second flag bit (active=1), the duration of the preset period is determined as the duration of the connection in the current preset period. By setting the flag bit, the duration of the connection in the period can be more accurately determined.
In one implementation, the first flag bit and the second flag bit may be determined from a message received over the connection. When a new connection is established, the initialization flag bit is set to active=0, and when a new message on the connection is received, the flag bit is set to active=1.
In another implementation manner, the first flag bit and the second flag bit may be determined according to a duration of time in a previous preset period connected to the current preset period, where the duration of time in the previous preset period is 0, then active=0, and the duration of time in the previous preset period is greater than 0, then active=1. Specifically, after receiving a message, the router finds that there is no corresponding connection in the database, establishes a new connection, and sets an initialization flag bit to active=0 when a new connection is established. And screening out the connection with the state of ESTABLISHED in all the connections corresponding to the application at the statistical node, if the active=0 of the connection, the duration of the connection in the period is the difference between the first duration and the second duration, and if the difference is greater than 0, the active of the connection is updated to be 1. If active=1 of a connection, the duration of the connection in a cycle is the cycle length. After determining the duration of the connection in the period, the active state of all the connections to which the application corresponds is updated, and for the connections of other states than ESTABLISHED, the active=0 is updated. The flag bit may be stored in a database as information related to the connection.
Illustratively, as shown in FIG. 8, connection 1 is established at 15s and connection 2 is established at 2 s. When the 20 th s counts the online time period, the states of the connection 1 and the connection 2 are ESTABLISHED, the active of the connection 1=0 and the active of the connection 2=1, so that in the period of 10s-20s, the duration of the connection 1 is 5s, the duration of the connection 2 is 10s, then the active of the connection 1 is updated to 1, and the active of the connection 2 is still 1. When the 30s statistics is on the internet time, the states of the connection 1 and the connection 2 are ESTABLISHED, the active of the connection 1 is=1, and the active of the connection 2 is=1, so that in the period of 20s-30s, the duration of the connection 1 and the connection 2 is 10s, and the updated active is still 1. When the 40 th s counts the internet TIME, the state of the connection 1 is changed and is in the time_wait state, so that the duration of the connection 1 is 0s in the period of 30s-40s, and then the active of the connection 1 is updated to 0. The state of connection 2 is also ESTABLISHED, active=1 of connection 2, and the duration of connection 1 is 10s in the period of 30s-40s, and the updated active is still 1. If the connection 1 is multiplexed afterwards, the active state of the connection can be updated and the duration of the connection 1 calculated.
After the duration of each connection in each period is calculated, comparing a plurality of durations obtained in the period in one statistical period, determining the longest duration as the surfing duration of the application 1 in the statistical period, and adding the surfing duration of the application 1 in each statistical period to obtain the actual surfing duration of the application 1.
For example, as shown in fig. 9, the connection corresponding to the application 1 includes: connection 1, connection 2, connection 3, connection 4, connection 5, connection 1 being established at 15s, connection 2 being established at 2s, connection 3 being established at 13s, connection 4 being established at 11s, connection 5 being established at 6 s. The duration of connection 2 is 8s and the duration of connection 5 is 4s in a period of 0s-10s, and the internet surfing duration of application 1 is 8s in a period of 0s-10s because of 8s >4 s. In the period of 10s-20s, the duration of connection 1 is 5s, the duration of connection 2 is 10s, the duration of connection 3 is 7s, the duration of connection 4 is 9s, and the duration of connection 5 is 10s, so the surfing duration of application 1 in the period of 10s-20s is 10s. Similarly, the Internet surfing time of application 1 is 10s in the period of 20s-30 s. Of the durations of 0s-30s, the surfing duration of application 1 is 8s+10s+10s=28s.
For the service dimension, one type of service corresponds to at least one application, for example, the game service includes an application 1 and an application 2, the connection corresponding to the application 1 includes a connection 1 to a connection 5, and the connection corresponding to the application 2 includes a connection 6 and a connection 7. The router acquires all information (such as information from connection 1 to connection 7) related to a certain type of service (such as game) from the database according to the service identification, monitors the duration from the start of connection establishment to the end of connection, and then determines the Internet surfing duration corresponding to the certain type of service according to the duration from the start of connection establishment to the end of connection. The specific calculation method is similar to the application dimension, and by way of example, the duration of each connection in each period can be calculated by the implementation in the application dimension. And in one statistical period, comparing a plurality of duration obtained in the period, determining the longest duration as the surfing duration of the type of service in the statistical period, and adding the surfing duration of the type of service in each statistical period to obtain the actual surfing duration of the type of service.
For the device dimension, the router may connect to a plurality of electronic devices, one electronic device may have at least one application installed thereon, and the router may obtain, from the database, all connection-related information corresponding to the first electronic device according to quintuple information (e.g., a source address), monitor a duration of connection from start to end, and then determine a duration of surfing the internet corresponding to the first electronic device according to the duration of connection from start to end. The specific calculation method is similar to the application dimension, and by way of example, the duration of each connection in each period can be calculated by the implementation in the application dimension. And in one statistical period, comparing a plurality of duration obtained in the period, determining the longest duration as the internet surfing duration of the first electronic equipment in the statistical period, and adding the internet surfing duration of the first electronic equipment in each statistical period to obtain the actual internet surfing duration of the first electronic equipment.
In one implementation manner, the internet time of the application may be calculated first, and then the internet time of the service and the internet time of the first electronic device may be calculated. For example, for a service dimension/device dimension, in one statistical period, the internet surfing time lengths of a plurality of applications obtained in the period are compared, the longest internet surfing time length is determined as the internet surfing time length of the service of the type or the internet surfing time length of the first electronic device in the statistical period, and then the internet surfing time lengths in each statistical period are added to obtain the total internet surfing time length. For example, the first electronic device installs the application 1 and the application 2, the application 1 and the application 2 are both game types, the internet surfing time length of the application 1 is 8s in a period of 0s-10s, the internet surfing time length of the application 2 is 10s, the internet surfing time length of the game service is 10s in a period of 0s-10s, and the internet surfing time length of the first electronic device is 10s.
It should be noted that, in some scenarios, the router is connected to an electronic device, and an application is installed in the electronic device, and when the internet surfing time length is counted, the router does not need to obtain application identification, service identification and device identification information.
Based on the above method, when the duration of the user watching the video is 1 hour, the duration of the video surfing is 1 hour, and when the duration of the user playing the game is 10 minutes, the duration of the game acceleration is 10 minutes, which is displayed in the interface shown in fig. 6 (b).
In summary, in the embodiment of the present application, by modifying the link native connection tracking nf_conntrack, the connection between the application client and the application server can be associated with a specific service and an application, and the internet surfing time can be counted from the device dimension, the service dimension and the specific application dimension, respectively. The router records the related information of the whole process of communication between the application client and the application server through connection tracking, counts the surfing time according to the time that the client and the server keep the connection, can determine the connection state every 10s after connection establishment, can increase the surfing time if the connection state is not disconnected, and stops counting the surfing time if the connection is disconnected. Based on the method provided by the embodiment of the application, the router can accurately count the Internet surfing time length of the electronic equipment, the Internet surfing time length of the service and the Internet surfing time length of the application, so that the electronic equipment can accurately display the Internet surfing time length of the equipment, the game and class acceleration time length and the like on the app, the use experience of a user on the service of the routing product is improved, and the method belongs to a general solution.
A schematic hardware architecture of the electronic device 100 that may implement the method provided in the present application is described below. Fig. 10 is a schematic diagram illustrating a hardware structure of an electronic device 100 according to an embodiment of the present application.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present invention is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, voice call, video call, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, the electronic device 100 may range using the distance sensor 180F to achieve quick focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it may be determined that there is an object in the vicinity of the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there is no object in the vicinity of the electronic device 100. The electronic device 100 can detect that the user holds the electronic device 100 close to the ear by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs a reduction in the performance of a processor located in the vicinity of temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid the low temperature causing the electronic device 100 to be abnormally shut down. In other embodiments, when the temperature is below a further threshold, the electronic device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the invention, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated. It should be noted thatIn an embodiment of the present application, the operator system of the electronic device may include, but is not limited to(Symbian)、/>(Andriod)、/>(iOS)、/>The operating system (Blackberry), hong (harmyos), etc., the present application is not limited in any way. Fig. 11 shows a software block diagram of the electronic device 100 according to the embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 11, the application package may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in fig. 11, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The workflow of the electronic device 100 software and hardware is illustrated below in connection with capturing a photo scene.
When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is issued to the kernel layer. The kernel layer processes the touch operation into the original input event (including information such as touch coordinates, time stamp of touch operation, etc.). The original input event is stored at the kernel layer. The application framework layer acquires an original input event from the kernel layer, and identifies a control corresponding to the input event. Taking the touch operation as a touch click operation, taking a control corresponding to the click operation as an example of a control of a camera application icon, the camera application calls an interface of an application framework layer, starts the camera application, further starts a camera driver by calling a kernel layer, and captures a still image or video by the camera 193.
Fig. 12 shows a schematic structural diagram of a router according to an embodiment of the present application. As shown in fig. 12, the router 200 may include: processor 210, wireless communication module 220, memory 230, power module 240, communication interface 250, switch 260, and antenna.
Processor 210 may include one or more processing units such as, for example: the processor 210 may include CPU, GPU, DSP, ISP, AP, NPU, modem processor, controller, video codec, baseband processor, etc. In some embodiments, the different processing units may be separate devices or may be integrated in one or more processors. The CPU is a final execution unit for information processing and program running, and the main work of the CPU comprises processing instructions, execution operations, control time, processing data and the like. The CPU may include a controller, an operator, a cache memory, and a bus for connecting these components.
The wireless communication module 220 may provide Wi-Fi, frequency modulation (frequency modulation, FM), bluetooth, or NFC, among others. The wireless communication module 220 may be one or more devices that integrate at least one communication processing module. The wireless communication module 220 receives electromagnetic waves via an antenna, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 210. The wireless communication module 220 may also receive a signal to be transmitted from the processor 210, frequency modulate and amplify the signal, and convert the signal to electromagnetic waves through an antenna to radiate.
Memory 230 may be used to store computer-executable program code that includes computer instructions. The processor 210 performs various functions and data processing by executing instructions stored in the memory 230. The memory 230 may include a stored program area and a stored data area. The storage program area may store application programs required by at least one function (such as counting internet surfing time, sending a message, etc.). The storage data area may store connection-related information, etc. In addition, the memory 230 may include a high-speed random access memory, a nonvolatile memory, and the like.
The power module 240 may be used to receive power input, store electrical energy, and power the processor 210, the wireless communication module 220, the memory 230, etc.
The communication interface 250 may be used to communicate with external devices such as electronic devices, mobile hard disks, and U-discs. The communication interface 250 may be any possible interface, such as a network interface or a universal serial bus (universal serial bus, USB) interface.
The switch 260 is used to trigger the router to turn on or off.
The device (router) provided in this embodiment is configured to perform the above method, and thus the same effects as those of the implementation method described above can be achieved. In case of an integrated unit, the device may comprise a processing module, a storage module and a communication module. The processing module may be configured to control and manage actions of the device, for example, may be configured to support the device to execute steps executed by the processing unit. The memory module may be used to support the device in executing stored program code, data, etc. And the communication module can be used for supporting the communication between the device and other devices.
Embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps that may implement the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a device, causes the device to perform steps that enable the respective method embodiments described above to be carried out.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component, or a module, and may include a processor and a memory connected to each other; the memory is configured to store computer-executable instructions, and when the device is operated, the processor may execute the computer-executable instructions stored in the memory, so that the chip performs the methods in the above method embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/device and method may be implemented in other manners. For example, the apparatus/device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow in the methods of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program may implement the steps of each method embodiment described above when executed by a processor. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/terminal apparatus, recording medium, computer memory, read-only memory (ROM), random access memory (random access memory, RAM), electrical carrier signals, telecommunications signals, and software distribution media. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In the description above, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that reference to "a plurality" in this specification and the appended claims refers to two or more. In the description of the present application, "/" means or, unless otherwise indicated, for example, a/B may represent a or B; "and/or" herein is merely an association describing an associated object, and refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations, e.g., a and/or B, which may represent: a exists alone, A and B exist together, and B exists alone.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Furthermore, references to "one embodiment" or "some embodiments" or the like described in this specification mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. A method for counting a length of surfing the internet, wherein communication is supported between a first device and a second device, wherein at least one application is installed on the first device, and wherein the method is applied to the second device, the method comprising:
monitoring a duration from the start of connection establishment to disconnection of a first application to a corresponding server after the connection establishment of the first application to the corresponding server is detected, wherein the first application and the corresponding server transmit data through the second device, and the first application is any application which establishes connection with the corresponding server in the at least one application;
And determining the surfing time of the first application according to the duration from the starting of the connection to the disconnection.
2. The method according to claim 1, wherein the method further comprises:
and determining the internet surfing time length corresponding to the application of the same type in the at least one application and/or the internet surfing time length corresponding to the first equipment according to the internet surfing time length of the first application.
3. The method of claim 2, wherein after detecting that the first application establishes a connection with the corresponding server, the method further comprises:
acquiring at least one of an application identifier, an application type identifier and a device identifier corresponding to the connection;
the step of determining the internet surfing time of the first application according to the duration from the starting of the connection to the disconnection, which comprises the following steps:
determining the internet surfing time of the first application according to the application identifier corresponding to the connection and the duration from the start of the connection to the disconnection;
the determining the internet surfing time length corresponding to the application of the same type in the at least one application and/or the internet surfing time length corresponding to the first device includes:
and determining the internet surfing time length corresponding to the application of the same type in the at least one application and/or the internet surfing time length corresponding to the first equipment according to the internet surfing time length of the first application, the identification of the application type corresponding to the connection and/or the equipment identification.
4. A method according to any one of claims 1 to 3, wherein said monitoring the duration of the connection from the start of the establishment to the disconnection comprises:
determining whether the connection is broken or not at each preset period;
monitoring the duration of the connection in each preset period without disconnection of the connection;
the step of determining the internet surfing time of the first application according to the duration from the starting of the connection to the disconnection, which comprises the following steps:
and determining the surfing time of the first application according to the duration of the connection in each preset period.
5. The method of claim 4, wherein the determining the internet surfing time of the first application according to the duration of the connection in each preset period comprises:
according to the duration of each connection corresponding to the first application in the same preset period, determining the surfing time of the first application in the same preset period;
and adding the surfing time length of the first application in each preset period to obtain the surfing time length of the first application.
6. The method of claim 5, wherein the determining the duration of surfing the internet for the first application within the same preset period comprises:
And determining the maximum duration of the duration of each connection corresponding to the first application in the same preset period as the surfing duration of the first application in the same preset period.
7. The method according to any one of claims 4 to 6, wherein said monitoring the duration of said connection for each preset period comprises:
acquiring a first time length and a second time length, wherein the first time length is the maximum allowed survival time length of the connection, and the second time length is the residual survival time length of the connection corresponding to the ending time of each preset period;
determining a difference between the first time period and the second time period;
if the difference value is smaller than the preset period, determining the difference value as the duration of the connection lasting in the corresponding preset period; or alternatively, the first and second heat exchangers may be,
and under the condition that the difference value is greater than or equal to the preset period, determining the duration of the preset period as the duration of the connection in the corresponding preset period.
8. The method according to any one of claims 4 to 6, wherein said monitoring the duration of said connection for each preset period comprises:
Acquiring a flag bit corresponding to the current preset period;
under the condition that the flag bit is a first flag bit, determining the duration of the connection in the current preset period according to the difference value between a first duration and a second duration, wherein the first duration is the maximum allowed survival duration of the connection, and the second duration is the residual survival duration of the connection corresponding to the ending time of the current preset period; or alternatively, the first and second heat exchangers may be,
and under the condition that the flag bit is a second flag bit, determining the duration of the preset period as the duration of the connection in the current preset period.
9. An electronic device, comprising: one or more processors; one or more memories; the memory stores one or more programs that, when executed by the processor, cause the electronic device to perform the method of any of claims 1-8.
10. A computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of any of claims 1 to 8.
CN202310913329.6A 2023-07-24 2023-07-24 Method for counting internet surfing time, electronic equipment and readable storage medium Pending CN117715099A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310913329.6A CN117715099A (en) 2023-07-24 2023-07-24 Method for counting internet surfing time, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310913329.6A CN117715099A (en) 2023-07-24 2023-07-24 Method for counting internet surfing time, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117715099A true CN117715099A (en) 2024-03-15

Family

ID=90155839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310913329.6A Pending CN117715099A (en) 2023-07-24 2023-07-24 Method for counting internet surfing time, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117715099A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018137887A1 (en) * 2017-01-24 2018-08-02 Magnus Albring Method and device for measuring the duration of internet access
CN110445935A (en) * 2019-08-16 2019-11-12 深圳传音控股股份有限公司 Upper network protection method and online protective device
CN111262817A (en) * 2018-11-30 2020-06-09 中移物联网有限公司 Control method, control platform, gateway device and computer storage medium
CN113630777A (en) * 2021-07-16 2021-11-09 荣耀终端有限公司 Internet access control system, method and routing equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018137887A1 (en) * 2017-01-24 2018-08-02 Magnus Albring Method and device for measuring the duration of internet access
CN111262817A (en) * 2018-11-30 2020-06-09 中移物联网有限公司 Control method, control platform, gateway device and computer storage medium
CN110445935A (en) * 2019-08-16 2019-11-12 深圳传音控股股份有限公司 Upper network protection method and online protective device
CN113630777A (en) * 2021-07-16 2021-11-09 荣耀终端有限公司 Internet access control system, method and routing equipment

Similar Documents

Publication Publication Date Title
WO2021000807A1 (en) Processing method and apparatus for waiting scenario in application
US11736224B2 (en) Data transmission method and electronic device
US20220291934A1 (en) Method for Displaying Splash Screen Information of Application and Electronic Device
WO2020155014A1 (en) Smart home device sharing system and method, and electronic device
CN113254409B (en) File sharing method, system and related equipment
CN113170019B (en) Incoming call display method and terminal equipment based on application
WO2021000923A1 (en) Router configuration method, terminal, and router
EP3893529B1 (en) Communication method based on bluetooth low energy
CN111316604B (en) Data transmission method and electronic equipment
CN110751503B (en) Advertisement processing method and electronic equipment
WO2022247446A1 (en) Performance optimization method and related device
EP4224830A1 (en) Data sharing method, apparatus and system, and electronic device
CN116486500B (en) Mail sending method and electronic equipment
CN117348894A (en) Software upgrading method, terminal equipment and system
WO2020216144A1 (en) Method for adding mail contact, and electronic device
CN117715099A (en) Method for counting internet surfing time, electronic equipment and readable storage medium
CN116414500A (en) Recording method, acquisition method and terminal equipment for operation guide information of electronic equipment
CN114172860B (en) Mail processing method and device
CN114205318B (en) Head portrait display method and electronic equipment
CN115460445B (en) Screen projection method of electronic equipment and electronic equipment
US20240045651A1 (en) Audio Output Method, Media File Recording Method, and Electronic Device
US20240201932A1 (en) Display method, electronic device, and system
CN117251223A (en) Cloud function plug-in configuration and scheduling method, system and electronic equipment
CN117785312A (en) Audio playing method, electronic device and storage medium
CN117555700A (en) Message pushing method, terminal equipment, pushing server and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination