CN107770746B - Data processing method and device, computer equipment and computer readable storage medium - Google Patents

Data processing method and device, computer equipment and computer readable storage medium Download PDF

Info

Publication number
CN107770746B
CN107770746B CN201710919033.XA CN201710919033A CN107770746B CN 107770746 B CN107770746 B CN 107770746B CN 201710919033 A CN201710919033 A CN 201710919033A CN 107770746 B CN107770746 B CN 107770746B
Authority
CN
China
Prior art keywords
flow
traffic
data
recommendation information
acquiring
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.)
Active
Application number
CN201710919033.XA
Other languages
Chinese (zh)
Other versions
CN107770746A (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710919033.XA priority Critical patent/CN107770746B/en
Publication of CN107770746A publication Critical patent/CN107770746A/en
Application granted granted Critical
Publication of CN107770746B publication Critical patent/CN107770746B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephonic Communication Services (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application relates to a data processing method and device, computer equipment and a computer readable storage medium. The method comprises the following steps: acquiring consumed flow, residual flow and effective flow duration; acquiring recommendation information according to the consumption flow, the residual flow and the flow effective duration, wherein the recommendation information is used for indicating the consumption of the residual flow; and outputting the recommendation information. The data processing method and device, the computer equipment and the computer readable storage medium can improve the viscosity of a user.

Description

Data processing method and device, computer equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus, a computer device, and a computer-readable storage medium.
Background
The intelligent terminal can realize data transmission through wireless signals and realize communication among different intelligent terminals. In order to make users reasonably use wireless signals and enable operators to realize reasonable management of the wireless signals, the service conditions of the wireless signals need to be counted in real time, and the traffic refers to the traffic of data generated when internet surfing or data value-added services are realized through a mobile communication technology. Generally, a user can purchase a flow package from an operator through an intelligent terminal, the intelligent terminal and the operator can count the flow used by the user, and if the flow package purchased by the user is used up or the validity period passes, the flow package is closed, and the user is prohibited from using the flow data.
Disclosure of Invention
The embodiment of the application provides a data processing method and device, computer equipment and a computer readable storage medium, which can improve the user viscosity of a system.
A method of data processing, the method comprising:
acquiring consumed flow, residual flow and effective flow duration;
acquiring recommendation information according to the consumption flow, the residual flow and the flow effective duration, wherein the recommendation information is used for indicating the consumption of the residual flow;
and outputting the recommendation information.
A data processing apparatus, the apparatus comprising:
the data acquisition module is used for acquiring consumed flow, residual flow and effective flow duration;
the information acquisition module is used for acquiring recommendation information according to the consumption flow, the residual flow and the flow effective duration, wherein the recommendation information is used for indicating the residual flow to be consumed;
and the information output module is used for outputting the recommendation information.
A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform steps that implement:
acquiring consumed flow, residual flow and effective flow duration;
acquiring recommendation information according to the consumption flow, the residual flow and the flow effective duration, wherein the recommendation information is used for indicating the consumption of the residual flow;
and outputting the recommendation information.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring consumed flow, residual flow and effective flow duration;
acquiring recommendation information according to the consumption flow, the residual flow and the flow effective duration, wherein the recommendation information is used for indicating the consumption of the residual flow;
and outputting the recommendation information.
According to the data processing method and device, the computer equipment and the computer readable storage medium, the recommendation information is obtained according to the consumed flow, the residual flow and the flow effective duration, and the recommendation information is output. The user can reasonably use the flow data through the recommendation information output by the terminal, and the viscosity of the user is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of an application environment of a data processing method in one embodiment;
FIG. 2 is a partial block diagram of a terminal in one embodiment;
FIG. 3 is a sequence diagram of interactions for implementing a virtual SIM card in one embodiment;
FIG. 4 is a flow diagram of a data processing method in one embodiment;
FIG. 5 is a flowchart of a data processing method in another embodiment;
FIG. 6 is a flow diagram of a method for consumption traffic statistics in one embodiment;
FIG. 7 is a schematic diagram of an embodiment of a traffic statistics system;
FIG. 8 is a schematic diagram of another embodiment of a traffic statistics system;
FIG. 9 is a flow diagram of a traffic statistics module counting traffic data in one embodiment;
FIG. 10 is a schematic diagram of the structure of a traffic query system in another embodiment;
FIG. 11 is a diagram of a data list storing traffic data in one embodiment;
FIG. 12 is a diagram of data objects storing traffic data in one embodiment;
FIG. 13 is a schematic diagram illustrating a terminal for recommending information in one embodiment;
FIG. 14 is a diagram illustrating a terminal display of traffic statistics in one embodiment;
FIG. 15 is a schematic diagram showing the structure of a data processing apparatus according to an embodiment;
fig. 16 is a block diagram of a partial structure of a mobile phone related to a computer device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client, without departing from the scope of the present application. Both the first client and the second client are clients, but they are not the same client.
FIG. 1 is a diagram of an application environment of a data processing method in one embodiment. As shown in fig. 1, the application environment includes a server 11 and a terminal 12. The server 11 is a server used by a virtual network operator to provide network traffic to the terminal 12, and may be a cloud server. The server 11 may provide the terminal 12 with virtual SIM (Subscriber Identity Module) card information and services for implementing network communication using the virtual SIM card. The terminal 12 may be provided with a virtual SIM card APP (Application) 121, a virtual SIM card SDK (Software Development Kit) 122, a virtual SIM card operating system 123, and a virtual SIM card adaptation layer 124. The virtual SIM card APP121, the virtual SIM card SDK122, the virtual SIM card operating system 123 and the virtual SIM card adapting layer 124 may all be disposed in an Application Processor (AP) on the terminal 12. The server 11 may send the virtual SIM card information to the virtual SIM card operating system 123 through the virtual SIM card APP 121; the virtual SIM card operating system 123 may implement communication with radio frequency communication control software disposed in a Baseband Processor (Baseband Processor, BP) through the virtual SIM card adaptation layer 124, so as to implement network communication using the virtual SIM card. The virtual SIM card SDK122 may be used for the integration and invocation of the virtual SIM card APP 121. Wherein the server 11 may provide the terminal 12 with a virtual SIM card APP121 related interface through which communication with the terminal 12 is enabled. The interface may include interfaces for user and equipment management, package and order management, encrypted transmission of SIM resources, etc. The server 11 may provide the virtual SIM card APP121 with a related interface in the form of a REST full Application Programming Interface (API). The virtual SIM card information may include, but is not limited to, basic information of the virtual SIM card, order information of virtual SIM card purchase, traffic usage information of the virtual SIM card, term information, and the like. The server 11 and the terminal 12 may count the used traffic data, record information such as consumed traffic, remaining traffic, and traffic validity duration, generate recommendation information according to the consumed traffic, the remaining traffic, and the traffic validity duration, and output the recommendation information through the terminal 12. It is understood that the generation of the recommendation information according to the consumed traffic, the remaining traffic and the traffic effective time may be performed in the terminal 12, or may be performed by the server 11, and then the recommendation information is sent to the terminal 12 for output.
Fig. 2 is a partial architecture diagram of a terminal, including modules associated with a virtual SIM card, according to one embodiment. As shown in fig. 2, a virtual SIM card operating system, a virtual SIM card adapting layer, a virtual SIM card APP, and a physical SIM card management module may be disposed on the application layer of the terminal. A Telephony Interface Layer and a Radio Interface Layer (Java) Layer may be disposed in the Framework Layer (Framework Layer). The Modem (Modem) can be a module consisting of a baseband processor, radio frequency and other peripheral chips, etc., and is a GSM/GPRS Modem. The Telephony interface layer is used for providing a universal interface, and the virtual SIM card operating system performs Socket interaction with the Modem through the Telephony interface layer, so that whether a virtual card exists or not and the position of a card slot where the virtual card is located can be judged. The virtual SIM card operating system performs Socket interaction with the Modem switched to the virtual SIM card channel through the virtual SIM card adapting layer, and can realize the functions of activating and closing the virtual card, using the virtual SIM card to perform network communication function and the like. It is to be understood that the structure shown in fig. 2 is only a part of the modules related to the present application, and does not constitute a limitation to the computer device to which the present application is applied, and a specific computer device may include more or less modules than those shown in the drawings, or combine some modules, or have a different module arrangement. The entity SIM card management module can communicate with a Telephony interface layer and realize the association of entity card information and the processing of related services of the entity SIM card.
In one embodiment, the terminal may provide a management operation interface of the virtual SIM card to the user through the virtual SIM card APP, and when detecting a relevant operation acting on the management operation interface, generate a corresponding virtual SIM card processing instruction, and send the processing instruction to the virtual SIM card operating system. The virtual SIM operating system can simulate the system logic of a real SIM card, implementing a protocol and file system of relevant specifications required for network communication. The virtual SIM card operating system can receive a processing instruction from the virtual SIM card App, send a message corresponding to the processing instruction to the Modem through the virtual SIM card adapting layer, receive response information made by the Modem and jointly realize the function of using the virtual SIM card to carry out network communication. The above-mentioned related protocols may include protocols of International Organization for standardization (ISO) 7816 and 3rd Generation Partnership Project (3 GPP) standards for Universal Integrated Circuit Card (UICC) and Universal Subscriber Identity Module (USIM).
In one embodiment, the processing instructions may include package purchase instructions, enable instructions, disable instructions, close instructions, and the like for the corresponding virtual SIM card. The implemented content of network communication using the virtual SIM card includes, but is not limited to, implementing interactive management of virtual SIM card information, dynamic update of state, statistics and rate limitation of traffic, and the like, such as implementing deletion of storage of the virtual SIM card information and enabling and closing of the virtual SIM card.
In one embodiment, as shown in fig. 3, a timing diagram is provided, which includes the interaction process between the modules in the scenario of package purchase, activation, monitoring and deactivation of the virtual SIM card. Referring to FIG. 3, the package purchase process includes steps 302-312; the package activation process comprises steps 314-324; the package monitoring process comprises steps 326-334; the package invalidation process comprises steps 336-346.
Step 302, the terminal sends a virtual SIM card purchase request to the server through the virtual SIM card APP.
In one embodiment, the terminal can display a virtual SIM card purchase interface to a user through the virtual SIM card APP, detect a purchase operation acting on the interface, trigger a purchase instruction according to the detected purchase operation, and send a virtual SIM card purchase request to the server. The purchasing interface can provide a virtual button corresponding to purchasing operation, and when the clicking operation of the virtual button is received, a purchasing instruction can be triggered, or when preset voice information or preset motion information corresponding to the purchasing instruction is detected, the purchasing instruction can be triggered. For example, the purchase instruction may be triggered when voice information including "purchase virtual card" is detected or preset motion information such as up and down shaking of the terminal is detected.
In one embodiment, the terminal may send the virtual SIM card purchase request to the server through a corresponding communication interface between a preset virtual SIM card APP and the server. Wherein, the purchase request includes the user identification. The user identifier is used for uniquely identifying the identity of the corresponding user and can be composed of numbers, letters or other characters with preset digits.
And step 304, the server acquires the corresponding virtual SIM card meal information according to the received virtual SIM card purchase request.
In one embodiment, the server may be a server for providing network traffic to the terminal, and the server may obtain one or more types of virtual SIM card meal information matching the purchase request according to the purchase request. In one embodiment, the purchase request may further include location information of the terminal, and the server may obtain one or more types of virtual SIM card meal information matching the location information. Each package information includes one or more kinds of field information such as corresponding flow total amount, valid time and price. The total traffic indicates the total amount of internet traffic available for the package, for example, 10GB internet traffic. The validity period may comprise a validity period of the package, such as 24 hours, 3 days, 7 days, or the like. The price represents information on the fee to be paid for purchasing the corresponding package.
Step 306, the server sends the virtual SIM card meal information to the terminal.
In one embodiment, the server may transmit virtual SIM card meal information corresponding to the virtual SIM card purchase request matching the request to the terminal. In one embodiment, multiple virtual SIM card package meal information may be sent for selection by the user.
And 308, the terminal receives the package information through the virtual SIM card APP and sends a package selection instruction to the server.
In one embodiment, the terminal may receive the package information through the virtual SIM card APP and perform displaying. The terminal can detect a selection operation acting on the package information display interface through the virtual SIM card APP, determine a corresponding selected package according to the detected selection operation, generate a package selection instruction for the package, and send the package selection instruction to the server. Wherein the selected set of meals may comprise one or more.
And 310, the server receives the package selection instruction and sends package data corresponding to the package selection instruction to the terminal.
In one embodiment, the server may receive a package selection instruction sent by the terminal, and identify package information corresponding to the package selection instruction. The package selection instruction can contain package identification of the selected package information, and the server can determine the package information corresponding to the package identification and acquire package data corresponding to the package information. The package identifier is used for uniquely identifying package information of a package. The package data contains basic data and flow data of the virtual SIM card. The basic data comprises necessary data such as operator information, network access parameter information, virtual SIM card identification and the like of the virtual SIM card for realizing virtual SIM card network communication. The traffic data includes information such as the size and the effective time of the corresponding network communication available traffic.
And step 312, the terminal receives the package data through the virtual SIM card APP and stores the package data through the virtual SIM card operating system.
In one embodiment, the terminal may receive package data sent by the server through the virtual SIM card APP and forward the package data to the virtual SIM card operating system. The virtual SIM card operating system can send the received package data to a Modem of the terminal through a virtual SIM card adapting layer and instruct the Modem to store the package data.
And step 314, the terminal acquires the package activation instruction through the virtual SIM card APP.
In one embodiment, the terminal can display the package activation interface through the virtual SIM card APP, detect activation operation acting on the package information display interface through the virtual SIM card APP, determine a package corresponding to activation according to the detected activation operation, generate a package activation instruction for the package, and send the package activation instruction to the server.
And step 316, sending the package activating instruction to the virtual SIM card operating system through the virtual SIM card APP.
In one embodiment, the virtual SIM card APP sends a package activation instruction to the virtual SIM card operating system in a preset communication mode with the virtual SIM card operating system, where the package activation instruction includes a package identifier corresponding to a package to be activated, so that the virtual SIM card operating system can determine the package to be activated according to the package identifier and the user identifier.
And step 318, the terminal performs package activation processing through the virtual SIM card operating system.
The virtual SIM card operating system can forward the package activating instruction to the Modem through the Telephony interface layer, and the Modem extracts corresponding package data according to the received package activating instruction and activates the corresponding package data.
And step 320, feeding back an activation processing result to the virtual SIM card APP through the virtual SIM card operating system.
The virtual SIM card operating system can acquire the processing result of the activation processing performed by the Modem, send the acquired processing result to the virtual SIM card APP, and instruct the virtual SIM card APP to further feed back the activation processing result to the server. The virtual SIM card APP can display an activation processing result on a terminal interface for a user to look up. The activation processing result may include results of activation success and activation failure.
Step 322, the terminal sends an activation use request to the server through the virtual SIM card APP.
In an embodiment, the virtual SIM card APP may send the obtained activation processing result to the server through the preset interface, and when the activation processing result is successful, the terminal further sends an activation use notification to the server through the virtual SIM card APP, where the notification is used to instruct the server to start providing a service for using the virtual SIM card to perform network communication.
In step 324, the server receives the request for activating use and feeds back response information for starting package monitoring to the terminal.
In an embodiment, after receiving the activation use request, the server starts the use service for the activated package data, and may monitor the use state of the package data according to a certain frequency, so as to provide a service for performing network communication using the corresponding package data, and feed back response information of package monitoring to the APP of the terminal. So that the user can know the server to successfully open the network communication service.
In step 326, the terminal obtains a package monitoring command.
After the terminal receives the response information for starting package monitoring, the terminal generates a package monitoring instruction and monitors the flow use condition in the package. The generation of package monitoring instructions may be in real-time or timed. For example, package monitoring instructions may be generated every 5 minutes. And after generating a package monitoring instruction, monitoring flow data in the package.
Step 328, the terminal generates a package monitoring request and sends the package monitoring request to the server.
It can be understood that the package monitoring process needs to generate recommendation information, and the generation of the recommendation information may be completed on the terminal or the server. If the monitoring information is generated on the server, the terminal needs to generate a package monitoring request and send the package monitoring request to the server.
In step 330, the server obtains the traffic data and generates recommendation information according to the traffic data.
In one embodiment, the traffic data may include consumed traffic, remaining traffic, and a traffic validity period, and then generate recommendation information according to the consumed traffic, the remaining traffic, and the traffic validity period. The recommendation information is information indicating consumption of the remaining traffic.
In step 332, the server sends the recommendation information to the terminal.
In step 334, the terminal outputs the recommendation information.
And the terminal receives the recommendation information sent by the server and outputs the recommendation information. The terminal can output the recommendation information through the interface, and also can output the recommendation information through the audio, and the user can use the flow in the package according to the recommendation information output by the terminal.
And 336, the terminal acquires the package invalidation instruction through the virtual SIM card APP.
In an embodiment, the virtual SIM card APP may use a timer set inside the terminal to count the use time of the package data, or may obtain the current time, and automatically trigger a package invalidation instruction when it is determined that the package data is invalidated according to the use time or the current obtaining time. Or the terminal can also display the package management interface through the virtual SIM card APP, detect the failure operation acting on the package information display interface through the virtual SIM card APP, determine the corresponding failed package according to the detected failure operation, generate a package failure request for the package, and send the package failure request to the server.
In step 338, the terminal sends a package invalidation request to the server through the virtual SIM card APP.
In one embodiment, the virtual SIM card APP may send a package invalidation request to the server after detecting that package data is invalid, where the request is used to instruct the server to perform a confirmation check on whether the relevant package is invalid. Wherein, the request carries package identification.
In step 340, the server receives the package invalidation request and performs package invalidation processing.
In one embodiment, the server may detect whether the corresponding package is invalid according to the received package invalidation request, and if the package invalidation request is confirmed to be invalid, the server may perform package invalidation processing to terminate the network communication service of the corresponding package data.
In step 342, the server feeds back package failure confirmation information to the terminal.
In step 344, the terminal receives the confirmation information through the virtual SIM card APP and sends a package invalidation processing instruction to the virtual SIM card operating system.
After receiving the confirmation information that the package is invalid, the terminal generates a package invalidation processing instruction and sends the processing instruction to the virtual SIM card operating system, wherein the instruction carries a package identifier.
And 346, the terminal virtual SIM card operating system performs package invalidation processing.
In one embodiment, the virtual SIM card operating system may further forward a package invalidation processing instruction to the Modem to instruct the Modem to delete the corresponding package data, or terminate the virtual SIM card communication using the package data, and may further resume the normal communication of the involved physical SIM cards in the terminal.
FIG. 4 is a flow diagram of a data processing method in one embodiment. As shown in fig. 4, the data processing method includes steps 402 to 406. Wherein:
step 402, acquiring consumed flow, remaining flow and effective flow duration.
In one embodiment, a user may perform a series of application operations through the terminal, and if the application operations need to be performed through the network, traffic consumption may occur. The user can purchase a certain amount of traffic data from the operator and surf the internet through the purchased traffic data. The consumed flow refers to the consumed flow, the remaining flow refers to the remaining available flow data, and the flow valid duration refers to the valid period of the remaining flow.
The traffic data refers to the amount of data generated when the mobile communication technology is used for surfing the internet or using related value-added services. The mobile communication technology refers to a technology for enabling communication between a mobile user and a fixed-point user or between mobile users, and may be not limited to GPRS (General Packet Radio Service), EDGE (Enhanced Data Rate for GSM Evolution), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), HSDPA (High Speed Downlink Packet Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), and the like.
In the embodiments provided in the present application, the statistical consumed flow specifically refers to flow data consumed in a certain time period. When the consumed flow is counted, the corresponding statistical parameters may be input first, and then the flow data may be obtained according to the statistical parameters. The statistical parameter refers to a parameter required for counting the consumed flow, and generally, the statistical parameter may include a start time and an end time. When the consumed flow is counted, the start time refers to the start time of the counted flow data, and the end time refers to the current time.
And step 404, acquiring recommendation information according to the consumption flow, the residual flow and the flow effective duration, wherein the recommendation information is used for indicating the residual flow to be consumed.
It can be understood that, when the intelligent terminal uses wireless signals for communication, data needs to be transmitted through dedicated communication channels, and the data volume generated in the communication channels is counted to be the counted traffic data. When different wireless signals transmit data, the used communication channels are different, and the traffic data generated by each wireless network can be counted by counting the data volume of each communication channel. Generally, various application programs are installed in an intelligent terminal, and man-machine interaction application is realized through the application programs, so that each application program consumes flow data when executing tasks.
In one embodiment, the historical consumed traffic data of the user can be known according to the historical consumed traffic. And acquiring recommendation information according to the consumed flow, the residual flow and the effective flow duration. The recommendation information is information indicating consumption of the remaining traffic. For example, if the user purchased 1GB of traffic and used 600MB for the first 3 days, where application 1 used 500MB, the recommendation message may be displayed suggesting that the user reduce the frequency of application 1 usage for the remaining 4 days.
Specifically, step 404 may include: acquiring a first average flow according to the consumption flow in a preset time period, and acquiring a second average flow according to the residual flow and the flow effective duration; and generating recommendation information according to the difference value of the first average flow and the second average flow. The preset time period is a preset time period, the consumption flow in the preset time period is obtained, and the average value of the consumption flow in the preset time period is calculated to be used as the first average flow. And comparing the first average flow with the second average flow, and generating recommendation information according to the comparison result. For example, if the consumed flow of the last week is 700MB, the first average flow is 100 MB/day, the current remaining flow is 100MB, the effective flow duration is 2 days, and the second average flow is 50 MB. If the first average flow rate is larger than the second average flow rate, the flow rate used in the last week is larger, and the user is advised to reduce the flow rate used today.
In one embodiment, the data processing method may further include: and acquiring the user travel time length. Step 404 may specifically include: if the user travel time is longer than the effective flow time, acquiring recommendation information according to the consumed flow, the residual flow and the effective flow time; and if the user travel time is less than or equal to the effective flow time, acquiring recommendation information according to the consumed flow, the residual flow and the user travel time. The user travel time refers to the remaining time of the travel of the user, and generally, the user may manually input the user travel time or obtain the user travel time according to the user travel data. For example, if the user can record a trip through a calendar, the length of time remaining for the trip can be calculated by retrieving the trip in the calendar.
Step 406, outputting recommendation information.
In one embodiment, the recommendation information is output through a terminal, a user can check through the terminal, and the use of the flow is reasonably arranged according to the recommendation information. Specifically, the recommendation information may be displayed through a display interface, and may also be output through an audio output device, where an output form of the recommendation information is not limited in this application.
According to the data processing method, the recommendation information is obtained according to the consumed flow, the residual flow and the effective flow duration, and the recommendation information is output. The user can reasonably use the flow data through the recommendation information output by the terminal, and the viscosity of the user is improved.
Fig. 5 is a flowchart of a data processing method in another embodiment. As shown in fig. 5, the data processing method includes steps 502 to 516. Wherein:
step 502, obtaining statistical parameters, wherein the statistical parameters include a start time and an end time.
In one embodiment, the statistical parameters refer to parameters required for performing traffic data statistics, and the statistical parameters may include, but are not limited to, a start time and an end time. Generally, the statistical flow refers to the flow data in a certain time period. For example, flow data is counted for a month, or flow data is counted for a day. The start time refers to the start time of the statistical traffic data, and the end time refers to the deadline of the traffic statistics. For example, if the flow rate in 8 months in 2017 is counted, the start time may be 00:00 in 1 month in 8 months in 2017, and the end time may be 24:00 in 31 months in 8 months in 2017. The ending time refers to a certain time before the current time, and may also refer to the current time, and the current time may be generally obtained directly through a time function. For example, if the current time is 14:22, the end time is a time before 14:22, or 14: 22. If the current time is obtained, the current year can be obtained through a date.
And 504, acquiring a flow query mode according to the statistical parameters, querying historical flow according to the flow query mode, and acquiring consumed flow according to the historical flow.
In one embodiment, the flow data of all application modules in the intelligent terminal is recorded and counted by a kernel flow counting module, the flow data counted by the kernel flow counting module is recorded in a database, and the application layer can query the flow data recorded in the database by calling a flow counting interface. By inputting the start time and the end time, the traffic data generated from the start time to the end time can be queried. The flow query mode refers to a mode of querying flow data, the start time and the end time of the statistical flow can be obtained through the statistical parameters, and the statistical duration can be calculated according to the start time and the end time. The statistical time duration refers to the calculation time duration of the statistical flow data, and may be the time duration of the interval between the start time and the end time. For example, if the flow rate is counted between 1/00/2017 and 11/1/00/2017, the counting time is 10 days. Then, the traffic query mode may be obtained according to the start time, the end time, and the statistical duration, where different start times, end times, and statistical durations correspond to different traffic query modes.
In one embodiment, the historical traffic refers to traffic data generated in a certain time period before the current time of the intelligent terminal, and the consumption traffic may refer to current consumption traffic. The current consumption flow refers to flow data generated between a certain time before the current time and the current time. The historical flow is first obtained, and then the current consumption flow can be calculated according to the historical flow. For example, if the current time is 19:00, the historical traffic may be traffic generated between 12:00 and 17:00, or may be traffic generated between 17:00 and 19: 00. The current consumption traffic data may refer to traffic generated between 12:00 and 19: 00.
Furthermore, the intelligent terminal can realize the flow statistics through a flow statistics module in the kernel layer, the kernel flow statistics module can perform the statistics on the flows generated by all application modules in the intelligent terminal, and the application layer can obtain the flow data counted by the kernel flow statistics module through a special flow statistics interface. When the traffic statistics interface is called to obtain the traffic data, the statistics parameters may include a start time and an end time, where the end time is a time before the current time. By searching the traffic data counted by the traffic counting module, the historical traffic generated from the starting time to the ending time can be searched. Generally, traffic data generated by a certain application module is counted, and the traffic data may include a receiving amount and a sending amount of the data, where the receiving amount refers to a total number of bytes of a received data packet, and the sending amount refers to a total number of bytes of a sent data packet. The statistical parameters may specifically include a module identifier, a start time, an end time, and the like, and then the historical traffic generated between the start time and the end time by the corresponding application module may be identified by the statistical module. The module identifier is a unique identifier of an application module which needs to be counted and generates flow consumption, and the application module is a functional module corresponding to an application program. For example, when installing an application program, the smart terminal assigns a UID (user identification) to each application program, and when performing flow statistics, inputs the UID, the start time, and the end time, so as to count flow data generated between the start time and the end time of the application program corresponding to the UID.
Specifically, the application layer may include a physical SIM card module and a virtual SIM card module. The difference is that the entity SIM card module realizes the mobile communication function by integrating user identity information through hardware, and the virtual SIM card module realizes the mobile communication function by storing the user identity information through software. The entity SIM card module can call a special flow counting interface in real time to inquire the flow data, so that the flow data in a certain time period is counted. In one embodiment, the entity SIM card module only counts the flow data in the current month each time, that is, counts the flow data between the starting time of the current month and the current time in real time, and counts the flow data again after the next month, and clears the flow data counted in the previous month. For example, if the current time is 12:00 in 21/9/2017, the entity SIM card module counts the traffic data generated between 00:00 in 1/2017/9/2017 and 12:00 in 21/2017/9/12/00. When the number 1 of each month is reached 00: and when 00, clearing the flow data of the current statistics and restarting the statistics.
The entity SIM card module records the counted flow data in a database in an application layer, so that the virtual SIM card module can be directly read through the database when needing to count the flow every time, a flow counting interface is not required to be called every time to read the flow data from the kernel, and a large amount of power consumption is reduced. However, since the entity SIM card module counts the traffic data in a certain time period, if the virtual SIM card module needs to count the time period exceeding the time period counted by the entity SIM card module, the virtual SIM card module can read a part of the traffic data from the database corresponding to the entity SIM card module, and read a part of the traffic from the kernel by calling the traffic counting interface. For example, the virtual SIM card module needs to count the traffic generated between 8/00/2017 and 21/2017 and 9/21/12/00, while the entity SIM card module only counts the traffic data between 9/1/00/2017 and 9/21/2017, so that the traffic data generated between 9/1/00/2017 and 9/21/2017 can be directly read from the database corresponding to the entity SIM card module, and the traffic data generated between 8/00/2017 and 9/1/00/2017 needs the virtual SIM card module to call the traffic counting interface and be acquired from the kernel.
Step 506, obtaining the remaining flow and the effective duration of the flow.
In one embodiment, after the terminal purchases traffic from the server, the server assigns an account to the terminal and records the usage of the traffic through the account. Generally, when the server issues the account information, the account information may include information such as an account identifier, a total traffic amount, and a valid period of the traffic. In the flow using process, the terminal and the server count the flow data and the using time used by the account, calculate the residual flow according to the total flow and the consumed flow, and change the account information according to the counted flow data and the residual flow. According to the account identification, the flow using condition of the corresponding account can be checked, and information such as corresponding consumed flow, residual flow, effective flow duration and the like is obtained.
And step 508, acquiring a first average flow according to the consumed flow in a preset time period, and acquiring a second average flow according to the remaining flow and the flow effective time length.
In one embodiment, the consumption flow rate in the preset period refers to the consumption flow rate in a certain period from the start time to the end time. The first average flow rate is an average value of the consumed flow rates in a preset time period. For example, if the consumption flow rate is 500MB from 8/month 12 to 8/month 17, the first consumption flow rate is calculated to be 100 MB/day, and so on. And obtaining a second average flow according to the residual flow and the flow effective duration, wherein the second average flow can be represented in the flow residual situation within the effective duration of the residual flow. For example, if the remaining traffic is 300MB and the traffic validity period is 2 days, the average traffic is 150 MB/day.
Step 510, obtain a difference between the first average flow rate and the second average flow rate.
It will be appreciated that the time unit calculated by comparing the first average flow rate with the second average flow rate is the same. For example, assuming that the first average flow rate is calculated in days, then the second average flow rate should also be calculated in days; assuming that the first average flow rate is calculated in hours, the second average flow rate should also be calculated in hours.
And step 512, if the difference is greater than zero, generating first recommendation information.
If the difference value is larger than zero, the average value of the historical consumed flow is larger than the average value of the residual flow, the residual flow is considered to be insufficient in the flow validity period, and then the first recommendation information is generated. The first recommendation information is information that suggests the user to slow down the traffic usage.
And step 514, if the value is less than or equal to zero, generating second recommendation information.
If the difference value is larger than zero, the average value of the historical consumed flow is smaller than the average value of the residual flow, the residual flow in the flow validity period is considered to be sufficient, and second recommendation information is generated. The second recommendation information is information that suggests the user to speed up the traffic.
In one embodiment, the consumed flow in each time period from the time when the flow function is turned on to the current time can also be obtained; acquiring the maximum value and the minimum value in the consumed flow in each time period, and acquiring the average flow according to the residual flow and the effective flow duration; if the average flow is smaller than the minimum value, generating first recommendation information; and if the average flow is larger than or equal to the maximum value, generating second recommendation information. The time when the flow function is turned on may be the time when the terminal activates the account after the server issues the account information.
And step 516, outputting recommendation information.
According to the data processing method, the recommendation information is obtained according to the consumed flow, the residual flow and the effective flow duration, and the recommendation information is output. The user can reasonably use the flow data through the recommendation information output by the terminal, and the viscosity of the user is improved.
FIG. 6 is a flow diagram of a method for consumption traffic statistics in one embodiment. As shown in fig. 6, the consumption flow statistical method includes steps 602 to 616. Wherein:
step 602, obtaining statistical parameters, wherein the statistical parameters include a start time and an end time.
In one embodiment, step 602 may specifically include: and when a statistical instruction is detected, acquiring statistical parameters. The statistical instruction refers to an instruction for triggering flow statistics, and the statistical instruction can be manually triggered by a user or automatically triggered when a system meets a preset condition. Generally, the statistical instructions are initiated by an application program in an application layer of the intelligent terminal.
For example, a user may purchase a virtual SIM card from an operator through the smart terminal, after purchasing the virtual SIM card, the server may allocate user information, traffic information, and a corresponding location code corresponding to the virtual SIM card to the smart terminal, and then the user may surf the internet through traffic data corresponding to the virtual SIM card. The user information refers to information for identifying different users, the position code refers to a geographical position identification code corresponding to the virtual SIM card, and flow statistics is started only when the intelligent terminal is within the geographical position range. The geo-location identifier may be, but not limited to, an MCC (Mobile Country Code), an MSIN (Mobile Subscriber identity Number), and the like. The intelligent terminal can acquire the current geographic position in real time, and if the current geographic position is within the geographic position range corresponding to the geographic position identifier of the virtual SIM card, a statistical instruction is triggered to start traffic statistics. Meanwhile, after the statistical instruction is triggered, the intelligent terminal can also send a statistical request to the server, wherein the statistical request is used for indicating the server to perform statistics on the flow used by the virtual SIM card.
It is understood that the statistical parameter may further include a network interface type, where the network interface type refers to a type of an interface for accessing a network, and may generally include Wi-Fi (Wireless Fidelity ) network interfaces, 2G network interfaces, 3G network interfaces, 4G network interfaces, and the like. The data traffic generated by the different network interfaces may be counted separately. The statistical parameters may further include module identifiers, and the module identifiers are unique identifiers for distinguishing different application modules. The consumption flow is obtained according to the statistical parameters, and the data flow corresponding to each application module can be counted.
And step 604, calculating the statistical duration according to the statistical parameters.
In one embodiment, the statistical duration is calculated according to a statistical parameter, which may include a start time and an end time, and the statistical duration is the duration of the interval between the start time and the end time. And then acquiring a flow query mode according to the statistical duration. Further, if the statistical duration is within the preset duration range, the traffic query mode is the first traffic query mode. And if the statistical duration exceeds the preset duration range, the flow query mode is a second flow query mode. If the flow query mode is the first flow query mode, reading the first historical flow and taking the first historical flow as the consumption flow; and if the flow query mode is the second flow query mode, reading the first historical flow and the second historical flow, and acquiring the consumed flow according to the first historical flow and the second historical flow.
In step 606, if the statistical duration is within the preset duration range, the traffic query mode is the first traffic query mode.
In one embodiment, the preset duration range refers to a duration range calculated according to a preset rule. It is understood that the preset duration range may be a fixed duration range, or may be calculated by a statistical parameter. Step 606 may be preceded by: and calculating a preset duration range according to the statistical parameters. For example, if the current time is 12:00 days on 12 days 9 month and 12:00 days 9 month and 1 day and 12:00 days 9 month and 12 days 12:00 are 12.5 days, the preset time period may be 0 to 12.5 days. If the calculated statistical duration is between 0 and 12.5 days, the flow query mode is a first flow query mode; and if the calculated statistical time duration exceeds 12.5 days, the flow query mode is a second flow query mode. The first traffic query mode and the first traffic query mode are two different methods for querying historical traffic.
At step 608, the first historical flow rate is read from the first flow rate database.
In the embodiment provided by the application, the intelligent terminal can uniformly count the flow generated by each application program through the flow counting module of the kernel layer, then record the counted flow in a database corresponding to the kernel layer, when the application program of the application layer needs to query the flow, the database of the kernel layer can be read through a special flow counting interface to obtain the flow data, and then the read flow data is stored in the database of the application layer. When the part of the traffic needs to be queried next time, the part of the traffic can be directly read from the database of the application layer without calling a traffic statistical interface, so that the power consumption of the system can be reduced. In one embodiment, the first traffic database may be a database corresponding to the application layer and used for recording statistical traffic, and the second database may be a database corresponding to the kernel layer and used for recording statistical traffic. The first historical flow refers to historical consumed flow data obtained from the first flow database, and the second historical flow refers to historical consumed flow data obtained from the second flow database.
It will be appreciated that the traffic data may be stored in the form of a data structure. The data structure refers to a collection for storing data and relations between data elements, and for example, the data structure may be in the form of a hash table, a red-black tree, a binary tree, or the like. Generally, traffic data is stored for a long period of time to facilitate querying the traffic data as needed. The flow data counted by the flow counting module is stored in the memory at the beginning, when the flow data is stored, an upper limit value is set for the total amount of the flow data, and when the total amount of the flow data reaches the upper limit value, the flow data in the memory is transferred to a specified file, so that the recorded flow data cannot be lost even if the intelligent terminal is closed.
In one embodiment, when the traffic statistics module performs traffic statistics, it performs statistics on consumed traffic data of each application module in each time period, and stores the consumed traffic data in each time period and the corresponding module identifier. The application module refers to a function module corresponding to an application program in the intelligent terminal, and the module identifier is a unique identifier for distinguishing the application module. For example, when an application is installed in an Android system, a UID is assigned to the installed application, and the system can distinguish the function modules corresponding to the applications through the UID. When historical flow is inquired, flow data corresponding to each time period from the starting time to the ending time can be inquired, and the historical flow is calculated according to the inquired flow data corresponding to each time period. For example, the flow statistics module records flow data every half hour, the recorded flow data representing the flow consumed during the recorded half hour. If historical traffic between 12:00 and 14:00 is to be counted, traffic data in four time periods of 12: 00-12: 30, 12: 30-13: 00, 13: 00-13: 30 and 13: 30-14: 00 can be searched from a database, wherein the traffic data are respectively 10MB, 20MB, 30MB and 12MB, and the counted historical traffic is the sum of the traffic data in the time period, namely 72 MB.
Step 610, the first historical flow is taken as the consumption flow.
In one embodiment, if the statistical duration is within the preset duration range, the flow data in the statistical time period may be all obtained from the first flow database. The first historical flow may be obtained from the first flow database directly according to the statistical parameter and taken as the consumed flow.
For example, the application layer in the intelligent terminal may include a first application program and a second application program, and the first application program may count the historical traffic in a first time period in real time and store the counted historical traffic in the first time period in a first traffic database. When the second application program needs to count the flow, the second application program may first input a statistical parameter, and calculate a second time period according to the statistical parameter, and if the second time period is within the first time period, the second application program may directly obtain the historical flow by reading the flow data in the first flow database.
In step 612, if the statistical duration exceeds the preset duration range, the traffic query mode is the second traffic query mode.
And 614, reading the first historical flow from the first flow database, inputting query parameters through the flow counting interface, and acquiring a second historical flow returned through the flow counting interface, wherein the second historical flow is acquired from the second flow database according to the query parameters.
In one embodiment, the first flow database stores flow data for only a certain time period, and the second database stores all flow data. If the statistical time length exceeds the preset time length range, the flow data in the statistical time period cannot be completely acquired from the first flow database, one part of the flow data needs to be acquired from the first flow database, and the other part of the flow data needs to be acquired from the second flow database. The flow rate statistics interface is a special interface for acquiring a second historical flow rate from a second flow rate database, query parameters can be input through the flow rate statistics interface, flow rate data is read from the second flow rate database according to the query parameters, and the second historical flow rate is calculated according to the acquired flow rate data.
Specifically, a first query parameter and a second query parameter are calculated according to the statistical parameter and a preset duration range, a first historical flow rate is read from a first flow rate database according to the first query parameter, and a second historical flow rate is read from a second flow rate database according to the second query parameter. For example, if the historical flow rates of 10:00 to 15:00 are stored in the first flow rate database, the preset time duration range is 5 hours, if statistics on the historical flow rates of 5:00 to 15:00 are needed, the first query parameters may be 10:00 and 15:00, and the second query parameters may be 5:00 and 10: 00.
Fig. 7 is a schematic structural diagram of a traffic statistic system in one embodiment. As shown in fig. 7, the traffic query system includes a traffic statistics application 702, a traffic statistics framework 704, and a traffic statistics module 706. The traffic statistics application 702 is located in an application layer of the system, and is configured to initiate a traffic query request. It is to be appreciated that traffic statistics application 702 can send a traffic query request to traffic statistics framework 704, the request including statistical parameters. The statistical parameters include a start time and a network interface type, the start time refers to a start time and an end time, the network type refers to a type of a network using traffic data, and a general network interface type includes a Wi-Fi network interface, a data network interface, and the like. The traffic statistics frame 704 is located at a frame layer of the system, and is configured to receive a traffic query request of the traffic statistics application 702, obtain historical traffic from the traffic statistics module 706 according to a statistical parameter in the traffic query request, and send a query result to the traffic statistics application 702.
Fig. 8 is a schematic structural diagram of a traffic statistic system in another embodiment. As shown in fig. 8, the system is divided into an application layer, a framework layer, and a kernel layer. The application layer includes a traffic consumption application, which is an application that consumes traffic data. For example, the flow consumption application may be a game APP, and a user plays a game through the game APP in a mobile phone, and during the playing process using the game APP, the game APP may generate consumption of flow data. When the intelligent terminal runs the traffic consumption application program and performs data transmission with the server, traffic data consumption can be generated. The traffic consuming application communicates with the kernel layer through an interface in the framework layer. When network access occurs, the traffic counting module inquires which application program accesses the network, then counts the data volume of the sent and received traffic data, and records the counted traffic data into the memory. When the framework layer needs to query the traffic data, the kernel layer maps the traffic data into a file through the file system. The framework layer can acquire and read the files through a system interface to acquire flow data. The transport layer is used to transport data and files, and the network layer is used to define data packets for transmission between different terminals.
For example, the flow statistics function of the Android kernel layer is performed by the module Xt _ qtaguid. This module main code is located in kernel/net/netfilter/xt _ qtaguid.c. The Xt _ qtaguid module utilizes a netfilter architecture of the kernel layer, realizes a network matcher, and sets a certain network interface matching rule. When the system is started, the matcher is loaded and operated by a netd process through an iptables command. When network access occurs, the netfilter framework informs the Xt _ qtaguid module to process, mainly inquires which uid module has access to the network access, and the quantity of data sent and received, and records the flow data into the memory. When the frame layer needs to access the flow data, the Xt _ qtaguid module maps out a proc file through the proc file system and writes the flow data into the file for the frame layer to read.
In one embodiment, the flow of the traffic statistic module for counting the traffic is shown in fig. 9. The traffic statistics module needs to initialize the data before starting to count the traffic data. Firstly creating a directory, then creating a traffic statistics proc file system and a network interface state proc file system, and registering a network matcher. Finally, the matcher is added to the iptable and the misc _ register module is registered. When network access occurs, receiving a network data receiving and sending notice, and starting to count the flow data. And matching the processing function through a matcher, analyzing and counting the flow data, and storing the counted flow data. The data can be stored in a binary tree form, the index value is the UID of the application module, the branch nodes are a plurality of multi-dimensional array structures, and the flow data are stored. When the upper layer application needs to read the flow data, the memory data is written into the file by calling a read function associated with the proc file, and the data is read from the file.
Fig. 10 is a schematic structural diagram of a traffic query system in another embodiment. As shown in fig. 10, the traffic statistics application program initiates a traffic query request, and the core service module in the framework layer is configured to respond to the traffic query request, coordinate the data query module, and serialize the storage module. The data query module provides an interface for querying flow through a flow reading interface, the flow query service reads data of a flow statistics proc file system in the kernel layer, and then the data is returned to the core service module. And the core service module sends the flow data to the serialization storage module. After the data are received by the serialization storage module, the flow data are firstly cached in the memory according to a certain format. When the flow data needs to be read, the cache content is stored in the serialized file or the data is recovered from the serialized file to the cache. Generally, the traffic data may be stored in a form of a data list, and is distinguished by a module identifier of an application module, each element is a data object, and the traffic data corresponding to the module identifier is stored.
It can be understood that, when the traffic statistics module performs traffic statistics, it performs traffic statistics on consumed traffic of each application module in each time period, and stores the traffic in each time period and a corresponding module identifier, which may be stored in a form of a data list. FIG. 11 is a diagram of a data list to store traffic data in one embodiment. As shown in fig. 11, the flow data is stored in the form of a Hash table. The index Key of the Hash table is mainly distinguished by the UID of the application module and a network interface, and the data in the data object stores the flow data of each time period according to a time axis. The data objects include traffic received volume, received packets, transmitted volume, and transmitted packets. The reception/transmission amount is the total number of bytes of the received and transmitted data packet, and the reception/transmission packet is the number of received and transmitted data packets.
FIG. 12 is a diagram of data objects storing traffic data, in one embodiment. As shown in fig. 12, a time axis is divided into time segments of a fixed size in one data object, and traffic data counted in each time segment is stored. When the flow data needs to be acquired, the starting time and the ending time are input, and the flow data corresponding to each time period from the starting time to the ending time is acquired, so that the total flow data generated between the starting time and the ending time can be known.
And 616, acquiring the consumption flow according to the first historical flow and the second historical flow.
In one embodiment, the obtained first historical flow and the second historical flow are added, and then the consumption flow can be obtained. The counted consumption flow can be displayed on an interface of the intelligent terminal, a data report is generated through the counted consumption flow every time, and the data report is displayed, so that a user can check the use condition of the flow in real time. And generating prompt information according to the counted consumption flow, and displaying the prompt information on an interface of the intelligent terminal. For example, when the consumed flow rate is more than 500MB within one day, the user is prompted through a prompt box.
Fig. 13 is a schematic diagram illustrating a terminal for recommending information in an embodiment. As shown in fig. 13, the terminal displays the historical usage of the traffic data, displays the current remaining traffic and the valid time, and generates recommendation information, which can reasonably suggest the usage of the traffic data by the user.
Fig. 14 is a terminal display diagram of traffic statistics in one embodiment. As shown in fig. 14, the traffic statistic result includes the traffic data consumed by each application program, and is shown separately. The variation of the flow data consumed by the various applications is shown by a graph.
FIG. 15 is a block diagram of a data processing apparatus according to an embodiment. As shown in fig. 15, the data processing apparatus 1500 may include a data acquisition module 1502, an information acquisition module 1504, and an information output module 1506. Wherein:
a data obtaining module 1502 is configured to obtain consumed traffic, remaining traffic, and a traffic effective time.
An information obtaining module 1504, configured to obtain recommendation information according to the consumed traffic, the remaining traffic, and the traffic validity duration, where the recommendation information is used to indicate that the remaining traffic is consumed.
And an information output module 1506, configured to output the recommendation information.
The data processing device acquires the recommendation information according to the consumed flow, the residual flow and the effective flow duration, and outputs the recommendation information. The user can reasonably use the flow data through the recommendation information output by the terminal, and the viscosity of the user is improved.
In one embodiment, the data obtaining module 1502 is further configured to obtain a statistical parameter according to which the consumption flow is obtained, wherein the statistical parameter includes a start time and an end time.
In one embodiment, the data obtaining module 1502 is further configured to obtain a traffic query mode according to the statistical parameter; and inquiring historical flow according to the flow inquiry mode, and acquiring consumed flow according to the historical flow.
In one embodiment, the information obtaining module 1504 is further configured to obtain a first average traffic according to the consumed traffic within a preset time period, and obtain a second average traffic according to the remaining traffic and the traffic effective duration;
and generating recommendation information according to the difference value of the first average flow and the second average flow.
In one embodiment, the information obtaining module 1504 is further configured to obtain a difference between the first average flow rate and the second average flow rate; if the difference value is larger than zero, generating first recommendation information; and if the value is less than or equal to zero, generating second recommendation information.
In one embodiment, the information obtaining module 1504 is further configured to obtain consumed traffic in each time period from the time when the traffic function is turned on to the current time; acquiring the maximum value and the minimum value in the consumed flow in each time period, and acquiring the average flow according to the residual flow and the effective flow duration; if the average flow is smaller than the minimum value, generating first recommendation information; and if the average flow is greater than or equal to the maximum value, generating second recommendation information.
In one embodiment, the information obtaining module 1504 is further configured to obtain a user travel time; if the user travel time is longer than the flow effective time, acquiring recommendation information according to the consumed flow, the residual flow and the flow effective time; and if the user travel time is less than or equal to the effective flow time, acquiring recommendation information according to the consumed flow, the residual flow and the user travel time.
The division of the modules in the data processing apparatus is only for illustration, and in other embodiments, the data processing apparatus may be divided into different modules as needed to complete all or part of the functions of the data processing apparatus.
The embodiment of the application also provides a computer readable storage medium. One or more non-transitory computer-readable storage media embodying computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of:
acquiring consumed flow, residual flow and effective flow duration;
acquiring recommendation information according to the consumption flow, the residual flow and the flow effective duration, wherein the recommendation information is used for indicating the consumption of the residual flow;
and outputting the recommendation information.
In one embodiment, said obtaining consumption traffic performed by said processor comprises:
and acquiring a statistical parameter, and acquiring the consumption flow according to the statistical parameter, wherein the statistical parameter comprises a start time and an end time.
In one embodiment, the obtaining consumption flow according to the statistical parameter performed by the processor comprises:
acquiring a flow query mode according to the statistical parameters;
and inquiring historical flow according to the flow inquiry mode, and acquiring consumed flow according to the historical flow.
In one embodiment, the obtaining of recommendation information according to the consumed traffic, the remaining traffic, and the traffic effective duration, performed by the processor, includes:
acquiring a first average flow according to the consumption flow in a preset time period, and acquiring a second average flow according to the residual flow and the flow effective duration;
and generating recommendation information according to the difference value of the first average flow and the second average flow.
In one embodiment, the generating recommendation information according to the difference between the first average flow rate and the second average flow rate, executed by the processor, includes:
acquiring a difference value between the first average flow and the second average flow;
if the difference value is larger than zero, generating first recommendation information;
and if the value is less than or equal to zero, generating second recommendation information.
In one embodiment, the obtaining of recommendation information according to the consumed traffic, the remaining traffic, and the traffic effective duration, performed by the processor, includes:
acquiring the consumed flow in each time period from the moment when the flow function is started to the current moment;
acquiring the maximum value and the minimum value in the consumed flow in each time period, and acquiring the average flow according to the residual flow and the effective flow duration;
if the average flow is smaller than the minimum value, generating first recommendation information;
and if the average flow is greater than or equal to the maximum value, generating second recommendation information.
In one embodiment, the method performed by the processor further comprises:
acquiring the user travel time length;
the obtaining of the recommendation information of the traffic consumption according to the consumed traffic, the remaining traffic and the effective duration of the traffic includes:
if the user travel time is longer than the flow effective time, acquiring recommendation information according to the consumed flow, the residual flow and the flow effective time;
and if the user travel time is less than or equal to the effective flow time, acquiring recommendation information according to the consumed flow, the residual flow and the user travel time.
The embodiment of the application also provides computer equipment. As shown in fig. 16, for convenience of illustration, only the portions related to the embodiments of the present application are shown, and details of the technology are not disclosed, please refer to the method portion of the embodiments of the present application. The computer device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking the computer device as the mobile phone as an example:
fig. 16 is a block diagram of a partial structure of a mobile phone related to a computer device provided in an embodiment of the present application. Referring to fig. 16, the cellular phone includes: radio Frequency (RF) circuitry 1610, memory 1620, input unit 1630, display unit 1640, sensor 1650, audio circuitry 1660, wireless fidelity (WiFi) module 1670, processor 1680, and power supply 1690. Those skilled in the art will appreciate that the handset configuration shown in fig. 16 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
RF circuit 1610 may be configured to receive and transmit signals during information transmission and reception or during a call, and may receive downlink information from a base station and then process the received downlink information to processor 1680; the uplink data may also be transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 1610 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to Global System for mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE)), e-mail, Short Messaging Service (SMS), and the like.
The memory 1620 may be used to store software programs and modules, and the processor 1680 executes the software programs and modules stored in the memory 1620, thereby executing various functional applications and data processing of the mobile phone. The memory 1620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as an application program for a sound playing function, an application program for an image playing function, and the like), and the like; the data storage area may store data (such as audio data, an address book, etc.) created according to the use of the mobile phone, and the like. Further, the memory 1620 may comprise high speed random access memory, and may also comprise non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone 1600. Specifically, the input unit 1630 may include a touch panel 1631 and other input devices 1632. The touch panel 1631, which may also be referred to as a touch screen, may collect touch operations performed by a user on or near the touch panel 1631 (e.g., operations performed by a user on or near the touch panel 1631 using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a preset program. In one embodiment, the touch panel 1631 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1680, and can receive and execute commands sent by the processor 1680. In addition, the touch panel 1631 may be implemented by various types, such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 1630 may include other input devices 1632 in addition to the touch panel 1631. In particular, other input devices 1632 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), and the like.
The display unit 1640 may be used to display information input by or provided to the user and various menus of the cellular phone. The display unit 1640 may include a display panel 1641. In one embodiment, the Display panel 1641 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. In one embodiment, touch panel 1631 can cover display panel 1641, and when touch panel 1631 detects a touch operation on or near touch panel 1631, processor 1680 can determine the type of touch event, and processor 1680 can then provide a corresponding visual output on display panel 1641 according to the type of touch event. Although in fig. 16, the touch panel 1631 and the display panel 1641 are implemented as two independent components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 1631 and the display panel 1641 may be integrated to implement the input and output functions of the mobile phone.
The cell phone 1600 may also include at least one sensor 1650, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1641 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 1641 and/or the backlight when the mobile phone is moved to the ear. The motion sensor can comprise an acceleration sensor, the acceleration sensor can detect the magnitude of acceleration in each direction, the magnitude and the direction of gravity can be detected when the mobile phone is static, and the motion sensor can be used for identifying the application of the gesture of the mobile phone (such as horizontal and vertical screen switching), the vibration identification related functions (such as pedometer and knocking) and the like; the mobile phone may be provided with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor.
Audio circuitry 1660, speaker 1661, and microphone 1662 may provide an audio interface between the user and the cell phone. The audio circuit 1660 can transmit the received electrical signal converted from the audio data to the speaker 1661, and the received electrical signal is converted into an acoustic signal by the speaker 1661 for output; on the other hand, the microphone 1662 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1660 and then converted into audio data, which is then processed by the audio data output processor 1680 and then transmitted to another mobile phone via the RF circuit 1610, or the audio data is output to the memory 1620 for subsequent processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 1670, and provides wireless broadband internet access for the user. Although a WiFi module 1670 is shown in fig. 16, it will be understood that it is not a required component of the handset 1600 and may be omitted as desired.
The processor 1680 is a control center of the mobile phone, connects various parts of the entire mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 1620 and calling data stored in the memory 1620, thereby performing overall monitoring of the mobile phone. In one embodiment, processor 1680 may include one or more processing units. In one embodiment, processor 1680 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, application programs, and the like; the modem processor handles primarily wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 1680.
The handset 1600 also includes a power supply 1690 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 1680 via a power management system to manage charging, discharging, and power consumption management functions via the power management system.
In one embodiment, the cell phone 1600 may also include a camera, a bluetooth module, and the like.
In the embodiment of the present application, the processor 1680 included in the mobile terminal implements the data processing method provided by the above-described embodiment when executing the computer program stored in the memory.
A computer program product comprising instructions which, when run on a computer, cause the computer to perform the data processing method provided by the above embodiments.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. Suitable non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of data processing, the method comprising:
acquiring statistical parameters and calculating statistical duration according to the statistical parameters, wherein the statistical parameters comprise start time and end time;
when the statistical duration is within a preset duration range, determining that a traffic query mode is a first traffic query mode, where the first traffic query mode includes: reading a first historical flow from a first flow database in an application layer, and acquiring the first historical flow as a consumed flow, wherein flow data in the first flow database is read from a second flow database in a kernel by calling a flow statistical interface in advance;
inquiring according to the determined flow inquiry mode to obtain the consumed flow;
acquiring residual flow and effective flow duration;
acquiring recommendation information according to the consumption flow, the residual flow and the flow effective duration, wherein the recommendation information is used for indicating the consumption of the residual flow;
and outputting the recommendation information.
2. The data processing method according to claim 1, wherein the obtaining recommendation information according to the consumed traffic, the remaining traffic, and the traffic validity duration comprises:
acquiring a first average flow according to the consumption flow in a preset time period, and acquiring a second average flow according to the residual flow and the flow effective duration;
and generating recommendation information according to the difference value of the first average flow and the second average flow.
3. The data processing method of claim 2, wherein generating recommendation information according to the difference between the first average flow and the second average flow comprises:
acquiring a difference value between the first average flow and the second average flow;
if the difference value is larger than zero, generating first recommendation information;
and if the difference is less than or equal to zero, generating second recommendation information.
4. The data processing method according to claim 1, wherein the obtaining recommendation information according to the consumed traffic, the remaining traffic, and the traffic validity duration comprises:
acquiring the consumed flow in each time period from the moment when the flow function is started to the current moment;
acquiring the maximum value and the minimum value in the consumed flow in each time period, and acquiring the average flow according to the residual flow and the effective flow duration;
if the average flow is smaller than the minimum value, generating first recommendation information;
and if the average flow is greater than or equal to the maximum value, generating second recommendation information.
5. The data processing method of claim 1, wherein the method further comprises:
acquiring the user travel time length;
the obtaining of the recommendation information of the traffic consumption according to the consumed traffic, the remaining traffic and the effective duration of the traffic includes:
if the user travel time is longer than the flow effective time, acquiring recommendation information according to the consumed flow, the residual flow and the flow effective time;
and if the user travel time is less than or equal to the effective flow time, acquiring recommendation information according to the consumed flow, the residual flow and the user travel time.
6. A data processing apparatus, characterized in that the apparatus comprises:
the data acquisition module is used for acquiring statistical parameters and calculating statistical duration according to the statistical parameters, wherein the statistical parameters comprise start time and end time, and when the statistical duration is within a preset duration range, a flow query mode is determined to be a first flow query mode, and the first flow query mode comprises the following steps: reading a first historical flow from a first flow database in an application layer, obtaining the first historical flow as a consumed flow, wherein flow data in the first flow database is read from a second flow database in a kernel in advance by calling a flow statistical interface, inquiring according to a determined flow inquiry mode to obtain the consumed flow, and obtaining the residual flow and the effective flow duration;
the information acquisition module is used for acquiring recommendation information according to the consumption flow, the residual flow and the flow effective duration, wherein the recommendation information is used for indicating the residual flow to be consumed;
and the information output module is used for outputting the recommendation information.
7. The apparatus of claim 6, wherein the information obtaining module is further configured to:
acquiring a first average flow according to the consumption flow in a preset time period, and acquiring a second average flow according to the residual flow and the flow effective duration;
and generating recommendation information according to the difference value of the first average flow and the second average flow.
8. The apparatus of claim 7, wherein the information obtaining module is further configured to:
acquiring a difference value between the first average flow and the second average flow;
if the difference value is larger than zero, generating first recommendation information;
and if the difference is less than or equal to zero, generating second recommendation information.
9. A computer device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform implementing the method of any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
CN201710919033.XA 2017-09-30 2017-09-30 Data processing method and device, computer equipment and computer readable storage medium Active CN107770746B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710919033.XA CN107770746B (en) 2017-09-30 2017-09-30 Data processing method and device, computer equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710919033.XA CN107770746B (en) 2017-09-30 2017-09-30 Data processing method and device, computer equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107770746A CN107770746A (en) 2018-03-06
CN107770746B true CN107770746B (en) 2020-04-24

Family

ID=61267802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710919033.XA Active CN107770746B (en) 2017-09-30 2017-09-30 Data processing method and device, computer equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107770746B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111294743A (en) * 2018-12-06 2020-06-16 中兴通讯股份有限公司 Data flow monitoring method, mobile terminal, system and storage medium
CN109327866B (en) * 2018-12-19 2022-01-04 惠州Tcl移动通信有限公司 Flow control method, flow control device, mobile terminal and storage medium
CN111628902B (en) * 2019-02-28 2022-10-04 腾讯科技(深圳)有限公司 Rate testing method and apparatus, electronic device, and computer-readable storage medium
CN110688615B (en) * 2019-09-24 2023-07-11 北京达佳互联信息技术有限公司 Method, device, equipment and storage medium for providing resource package service
CN113535058B (en) * 2020-03-02 2023-08-18 网易(杭州)网络有限公司 Method, device, equipment and storage medium for recommending equipment in game
CN112351250B (en) * 2020-10-21 2023-05-26 杭州海康威视数字技术股份有限公司 Coding parameter adjustment method, device and equipment and storage medium
CN114268690B (en) * 2021-12-17 2023-04-18 中国电信股份有限公司 Application program control method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103813356A (en) * 2014-02-28 2014-05-21 宇龙计算机通信科技(深圳)有限公司 Flow management device and flow management method thereof
CN104349367A (en) * 2014-11-12 2015-02-11 深圳市中兴移动通信有限公司 Mobile terminal and predicting reminding method and device of flow consumption of mobile terminal
CN106304011A (en) * 2016-08-16 2017-01-04 努比亚技术有限公司 A kind of flow bag recommendation apparatus and method
CN107124708A (en) * 2017-05-24 2017-09-01 努比亚技术有限公司 The display methods of international roaming service, device, computer-readable recording medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103813356A (en) * 2014-02-28 2014-05-21 宇龙计算机通信科技(深圳)有限公司 Flow management device and flow management method thereof
CN104349367A (en) * 2014-11-12 2015-02-11 深圳市中兴移动通信有限公司 Mobile terminal and predicting reminding method and device of flow consumption of mobile terminal
CN106304011A (en) * 2016-08-16 2017-01-04 努比亚技术有限公司 A kind of flow bag recommendation apparatus and method
CN107124708A (en) * 2017-05-24 2017-09-01 努比亚技术有限公司 The display methods of international roaming service, device, computer-readable recording medium

Also Published As

Publication number Publication date
CN107770746A (en) 2018-03-06

Similar Documents

Publication Publication Date Title
CN107770746B (en) Data processing method and device, computer equipment and computer readable storage medium
CN107708084B (en) Data processing method and device, computer equipment and computer readable storage medium
CN107682910B (en) Traffic resource sharing method and device, mobile terminal and storage medium
CN107562835B (en) File searching method and device, mobile terminal and computer readable storage medium
CN108320744B (en) Voice processing method and device, electronic equipment and computer readable storage medium
CN107484154B (en) Data switching method and device, terminal and computer readable storage medium
CN107734495B (en) Information processing method, device, storage medium and terminal
CN107707369A (en) The method and apparatus of flow order management, computer equipment, readable storage medium storing program for executing
CN109634990B (en) Information processing method and system, electronic device, computer-readable storage medium
US20160198321A1 (en) Method for Implementing Card-Free Mobile Phone, Mobile Phone, and Server
CN107690131A (en) Information processing method, device, mobile terminal and computer-readable recording medium
CN107484201B (en) Flow statistical method and device, terminal and computer readable storage medium
CN107682851A (en) Information processing method, device, mobile terminal and computer-readable recording medium
CN107623612B (en) Flow display method and device, computer equipment and computer readable storage medium
CN107635220A (en) Network service processing method, device, storage medium and terminal
CN107743080B (en) Flow statistical method and device, computer equipment, computer readable storage medium
CN107566398B (en) Flow control methods and device, computer equipment, computer readable storage medium
CN107743303B (en) Information processing method, device, mobile terminal and computer readable storage medium
CN107682552B (en) Information processing method, device, mobile terminal and computer readable storage medium
CN107708092B (en) Flow information update method and device, terminal, computer readable storage medium
CN107770767B (en) Information processing method, device, mobile terminal and computer readable storage medium
US11109226B2 (en) Information process method, computer readable storage medium and computer device
CN107682832B (en) Data processing method and device, computer equipment and computer readable storage medium
CN107682892B (en) Flow control method and device, computer equipment and computer readable storage medium
CN107734492B (en) Information processing method, device, mobile terminal and computer 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
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant