CN106817370B - Method and device for transmitting network data - Google Patents
Method and device for transmitting network data Download PDFInfo
- Publication number
- CN106817370B CN106817370B CN201710034840.3A CN201710034840A CN106817370B CN 106817370 B CN106817370 B CN 106817370B CN 201710034840 A CN201710034840 A CN 201710034840A CN 106817370 B CN106817370 B CN 106817370B
- Authority
- CN
- China
- Prior art keywords
- network
- application
- capability
- network connection
- network capability
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000005540 biological transmission Effects 0.000 claims description 11
- 230000000694 effects Effects 0.000 abstract description 15
- 238000004891 communication Methods 0.000 description 18
- 101150053844 APP1 gene Proteins 0.000 description 16
- 101100189105 Homo sapiens PABPC4 gene Proteins 0.000 description 16
- 102100039424 Polyadenylate-binding protein 4 Human genes 0.000 description 16
- 230000006870 function Effects 0.000 description 15
- 230000008569 process Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000001514 detection method Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000001914 filtration Methods 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005236 sound signal Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000010079 rubber tapping Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/02—Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
- H04L63/0227—Filtering policies
- H04L63/0236—Filtering by address, protocol, port number or service, e.g. IP-address or URL
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
- H04L63/101—Access control lists [ACL]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72448—User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
- H04M1/72463—User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions to restrict the functionality of the device
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/11—Allocation or use of connection identifiers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W8/00—Network data management
- H04W8/22—Processing or transfer of terminal data, e.g. status or physical capabilities
- H04W8/24—Transfer of terminal data
- H04W8/245—Transfer of terminal data from a network towards a terminal
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a method and a device for transmitting network data, and belongs to the technical field of terminals. The method comprises the following steps: when network data aiming at a first application is detected through a data interface included in a network connection management service, determining network capacity of a network connection required for transmitting the network data according to an interface identifier of the data interface, wherein the network capacity is used for explaining the capacity of the network connection for transmitting the network data, and determining a network white list corresponding to the network capacity from a local storage, wherein the network white list is used for storing application identifiers of application programs capable of using the network connection with the network capacity, and when the application identifier of the first application is included in the network white list, the network data is transmitted through the network connection with the network capacity. The invention improves the effect of transmitting network data and saves cost.
Description
Technical Field
The present invention relates to the field of terminal technologies, and in particular, to a method and an apparatus for transmitting network data.
Background
With the development of terminal technology, terminals such as mobile phones and tablet computers are increasingly popularized. The terminal can generally install and run different applications to implement different functions, and in the process of implementing some functions, network data is generally required to be transmitted between the terminal and other terminals through the network so as to interact with other terminals. However, when the terminal transmits the network data, a certain data traffic is usually consumed, and further a certain cost is generated, which increases the cost of the user for using the terminal.
In the related art, the terminal-installed applications capable of transmitting network data include two types, a first type of application is capable of initiating a network request to establish a network connection and transmitting network data through the established network connection, and a second type of application is capable of transmitting network data only through an existing network connection. Since network connections with different network capabilities are usually required for transmitting different network data, when a terminal receives a network request sent by any application program in a first type of application through a built-in network connection management service, a network connection with a corresponding network capability can be established through the network connection management service based on network capability information carried by the network request, and a situation that the network connection with the network capability is successfully established is notified to each application program installed in the terminal, and then each application program can use the network connection with the network capability.
Since each application can use the network connection with the network capability after the terminal establishes the network connection with the network capability, the terminal has poor effect of transmitting network data, and it is difficult to reduce the traffic cost of the user using the terminal.
Disclosure of Invention
In order to improve the effect of transmitting network data and reduce the cost of using the terminal, the embodiment of the invention provides a method and a device for transmitting network data. The technical scheme is as follows:
in a first aspect, a method for transmitting network data is provided, the method comprising:
when network data aiming at a first application is detected through a data interface included in a network connection management service, determining the network capacity of a network connection required for transmitting the network data according to an interface identifier of the data interface, wherein the network capacity is used for explaining the capacity of the network connection for transmitting the network data;
determining a network white list corresponding to the network capability from a local storage, wherein the network white list is used for storing application identifications of application programs capable of using network connection with the network capability;
and when the application identification of the first application is included in the network white list, transmitting the network data through a network connection with the network capability.
Optionally, before determining the network white list corresponding to the network capability from the local storage, the method further includes:
when a network request is received through the network connection management service and the network request carries network capacity information corresponding to the network capacity, determining a sharing mode of the network connection with the network capacity, and determining at least one application identifier based on the sharing mode, wherein the sharing mode is used for indicating an application program capable of sharing the network connection with the network capacity, and the network capacity information is used for explaining the network capacity of the network connection requested to be established;
judging whether a network connection with the network capability is established currently or not based on the network capability information;
if the network connection with the network capability is not established currently, establishing the network connection with the network capability based on the network capability information, and generating a network white list corresponding to the network capability based on the at least one application identifier;
and if the network connection with the network capability is established currently, adding the at least one application identification into a network white list corresponding to the network capability.
Optionally, the determining at least one application identifier based on the sharing mode includes:
when the sharing mode is a group mode, determining an application identifier of a second application, wherein the second application is an application program sending the network request, and the group mode is used for indicating that the application programs belonging to the same application group as the second application can share the network connection with the network capability;
determining an application group which corresponds to the network capability information and comprises an application identifier of the second application from the stored correspondence between the network capability information and the application group;
determining the application identifier included by the application group as the at least one application identifier.
Optionally, before determining, from the stored correspondence between the network capability information and the application group, an application group that corresponds to the network capability information and includes the application identifier of the second application, the method further includes:
acquiring application identifications of all currently installed application programs;
determining at least one application group based on the network capability information and the acquired application identifiers, wherein each application group comprises at least one application identifier of an application program which can send the network request to establish network connection with the network capability;
storing the network capability information and the at least one application group in a correspondence between the network capability information and application groups.
Optionally, the determining at least one application identifier based on the sharing mode includes:
when the sharing mode is a private mode, determining an application identifier of a second application, wherein the private mode is used for indicating that the second application can use the network connection with the network capability but other application programs cannot share the network connection with the network capability, and determining the application identifier of the second application as the at least one application identifier; or,
and when the sharing mode is a global mode, determining the application identifier of each application which is installed currently as the at least one application identifier, wherein the global mode is used for indicating that all the installed application programs can share the network connection with the network capability.
Optionally, the determining a sharing mode of the network connection having the network capability includes:
determining a preset sharing mode as a sharing mode of the network connection with the network capability; or,
displaying a plurality of sharing modes, and when a sharing mode selection instruction is received based on the plurality of sharing modes, determining the sharing mode selected by the sharing mode selection instruction as the sharing mode of the network connection with the network capability; or,
when the network request carries sharing mode information, determining a sharing mode of the network connection with the network capability based on the sharing mode information; or,
determining a sharing mode of the network connection with the network capability based on a second application sending the network request.
In a second aspect, an apparatus for transmitting network data is provided, the apparatus comprising:
the network connection management system comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is used for determining the network capacity of the network connection required for transmitting the network data according to the interface identification of a data interface when the network data aiming at a first application is detected through the data interface included by the network connection management service, and the network capacity is used for explaining the capacity of the network connection for transmitting the network data;
a second determining module, configured to determine, from a local storage, a network white list corresponding to the network capability, where the network white list is used to store application identifiers of application programs that can use a network connection with the network capability;
a transmission module, configured to transmit the network data through a network connection with the network capability when the application identifier of the first application is included in the network white list.
Optionally, the apparatus further comprises:
a third determining module, configured to determine, when a network request is received through the network connection management service and the network request carries network capability information corresponding to the network capability, a sharing mode of a network connection with the network capability, and determine at least one application identifier based on the sharing mode, where the sharing mode is used to indicate an application program capable of sharing the network connection with the network capability, and the network capability information is used to indicate the network capability of the network connection requested to be established;
the judging module is used for judging whether the network connection with the network capability is established currently or not based on the network capability information;
the establishing module is used for establishing the network connection with the network capability based on the network capability information and generating a network white list corresponding to the network capability based on the at least one application identifier if the network connection with the network capability is not established currently;
and the adding module is used for adding the at least one application identifier into a network white list corresponding to the network capability if the network connection with the network capability is established currently.
Optionally, the third determining module includes:
a first determining submodule, configured to determine an application identifier of a second application when the sharing mode is a group mode, where the second application is an application program that sends the network request, and the group mode is used to indicate that all application programs belonging to the same application group as the second application can share a network connection with the network capability;
the second determining submodule is used for determining an application group which corresponds to the network capability information and comprises an application identifier of the second application from the stored correspondence between the network capability information and the application group;
a third determining sub-module, configured to determine the application identifier included in the application group as the at least one application identifier.
Optionally, the third determining module further includes:
the obtaining submodule is used for obtaining application identifications of all currently installed application programs;
a fourth determining submodule, configured to determine at least one application group based on the network capability information and the obtained application identifier, where each application group includes at least one application identifier that can issue the network request to request establishment of a network connection with the network capability;
a storage sub-module, configured to store the network capability information and the at least one application group in a correspondence between the network capability information and the application group.
Optionally, the third determining module includes:
a fifth determining sub-module, configured to determine an application identifier of a second application when the sharing mode is a private mode, where the private mode is used to indicate that the second application can use the network connection with the network capability but other application programs cannot share the network connection with the network capability, and determine the application identifier of the second application as the at least one application identifier; or,
a sixth determining sub-module, configured to determine, when the sharing mode is a global mode, an application identifier of each currently installed application program as the at least one application identifier, where the global mode is used to indicate that all installed application programs can share the network connection with the network capability.
Optionally, the third determining module includes:
a seventh determining submodule, configured to determine a preset sharing mode as a sharing mode of a network connection having the network capability; or,
a display sub-module, configured to display a plurality of sharing modes, and when a sharing mode selection instruction is received based on the plurality of sharing modes, determine the sharing mode selected by the sharing mode selection instruction as a sharing mode of a network connection having the network capability; or,
an eighth determining submodule, configured to determine, when the network request carries sharing mode information, a sharing mode of a network connection with the network capability based on the sharing mode information; or,
a ninth determining sub-module for determining a sharing mode of the network connection having the network capability based on a second application sending the network request.
The method for transmitting network data and the device for transmitting network data provided by the invention have the following beneficial effects:
firstly, when network data aiming at a first application is detected through a data interface, the network capacity of network connection required for transmitting the network data is determined according to an interface identifier of the data interface, then a network white list corresponding to the network capacity is determined, and when the application identifier of the first application is included in the network white list, the network data is transmitted through the network connection with the network capacity, namely, the application program using the network connection with the network capacity can be filtered through the network white list corresponding to the network capacity, so that the probability that any application program in the terminal can transmit the network data through the network connection with the network capacity is reduced, compared with the existing transmission method of the network data without filtering, the transmission of the network connection with the same network capacity can be reduced by a plurality of application programs simultaneously, therefore, the effect of transmitting network data can be improved, and the flow cost of the terminal can be saved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for transmitting network data according to an embodiment of the present invention;
fig. 2 is a flow chart of another method for transmitting network data according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for transmitting network data according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another apparatus for transmitting network data according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is a flowchart of a method for transmitting network data according to an embodiment of the present invention, and referring to fig. 1, the method includes:
step 101: when the network data aiming at the first application is detected through a data interface included by the network connection management service, the network capability of the network connection required for transmitting the network data is determined according to the interface identification of the data interface, and the network capability is used for explaining the capability of the network connection for transmitting the network data.
Step 102: a network white list corresponding to the network capability is determined from a local store, wherein the network white list is used for storing application identifications of application programs capable of using the network connection with the network capability.
Step 103: and when the application identification of the first application is included in the network white list, transmitting the network data through the network connection with the network capability.
In the embodiment of the present invention, first, when network data (e.g., Multimedia information) for a first application (the first application may be any application installed in a terminal, for example, an MMS (Multimedia Messaging Service) application, an application identifier of which is UID (User Identification) 1) is detected through a data interface, a network capability (e.g., MMS) of a network connection required for transmitting the network data may be determined according to an interface identifier (e.g., net.data0) of the data interface, and then a network white list corresponding to the network capability (the network white list is used to store an identifier of an application capable of using the network connection having the network capability, for example, an application identifier capable of using the MMS capability may be stored in the network white list corresponding to the network capability), and when the network white list includes the application identifier of the first application, transmitting the network data through the network connection with the network capability (for example, transmitting multimedia information through the network connection with MMS capability, that is, transmitting multimedia information through the data interface rm.net.data0), that is, filtering the application program using the network connection with the network capability through the network white list corresponding to the network capability, so as to reduce the probability that any application program in the terminal can transmit the network data through the network connection with the network capability (for example, when only UID1 is stored in the network white list corresponding to the MMS capability, only the MMS application in the terminal can transmit multimedia information through the network connection with MMS capability), compared with the existing unfiltered network data transmission method, it is able to reduce the possibility that a plurality of application programs simultaneously transmit through the network connection with the same network capability, the effect of transmitting network data is improved, and the flow cost of the terminal is saved.
Fig. 2 is a flowchart of a method for transmitting network data according to an embodiment of the present invention, referring to fig. 2, where the method is used in a terminal, and the method includes:
step 201: when the terminal receives a network request through the network connection management service and the network request carries network capacity information, determining a sharing mode of network connection with network capacity corresponding to the network capacity information, wherein the sharing mode is used for indicating an application program capable of sharing the network connection with the network capacity.
Since the terminal generally needs to transmit network data for a certain application program through a network connection with a certain network capability during the process of running the application program, including receiving the network data or sending the network data, if the network data for other application programs is also transmitted through the network connection with the certain network capability during the process, that is, other application programs can also use the network connection with the certain network capability, the terminal may have a poor effect of transmitting the network data for the application program, and the cost of the user for using the terminal may be increased. Therefore, when a network request is received, based on the network capability information carried by the network request, a sharing mode of a network connection having a network capability corresponding to the network capability information can be determined, so that based on the sharing mode, an application program capable of using the network connection having the network capability can be determined.
The terminal can be a mobile phone, a tablet computer, a smart watch, or other terminals, and certainly, in practical applications, the terminal can also be other terminals capable of installing an application program and establishing network connection so as to transmit network data, and the application program installed in the terminal can be an application program that needs to use network connection.
It should be noted that the network connection management Service may be a Service built in the terminal, for example, when the terminal is a terminal installed with an android operating system, the network connection management Service may include Connectivity Service.
It should be further noted that the network request may be issued by any application installed in the terminal and having a capability of initiating a network request, and the network request may carry network capability information, so as to request to establish a network connection having a network capability corresponding to the network capability information. Of course, in practical applications, the network request may also carry other information, for example, the network request may also carry an application identifier of a second application that sends the network request, sharing mode information for describing a sharing mode of a network connection with the network capability, and the like.
Wherein the second application may be any application installed in the terminal. The application identifier is used to uniquely identify an application, and may be a UID of the application or a Package Name of the application. Of course, in practical applications, the application identifier may also be other identifiers capable of uniquely identifying an application program.
It should be noted that the network capability information is used to describe the network capability of the network connection requested to be established, and the network capability is used to describe the capability of the network connection to transmit network data. For example, when the network CAPABILITY information is network capabilities, net _ CAPABILITY _ MMS, it indicates that the network CAPABILITY of the network connection requested to be established is MMS. Of course, in practical applications, The network capability information may also be in other formats, and The network capability requested by The network capability information to establish a network connection may be other network capabilities, such as Internet (Internet), SUPL (Secure user plane Location, Secure user plane Location service), FOTA (Firmware Over-The-Air, Over-The-Air software upgrade), and other network capabilities.
Further, since the required sharing mode is generally different when network data is transmitted through network connections having different network capabilities, for example, when a certain application having a positioning function in the terminal transmits network data through a SUPL-capable network connection to position the terminal, only the network data for the application having a positioning function may be allowed to be transmitted. Therefore, in order to improve the effect of transmitting network data and reduce the cost of the user using the terminal, the terminal can determine the sharing mode of the network connection having the network capability.
Wherein the sharing mode may include one or more of a private mode, a group mode, and a global mode. The group mode is used for indicating that the application programs belonging to the same application group with the second application can share the network connection with the network capability, the private mode is used for indicating that the second application can use the network connection with the network capability but other application programs cannot share the network connection with the network capability, and the global mode is used for indicating that all the application programs installed can share the network connection with the network capability. As can be seen from the foregoing, the second application is an application program that sends the network request, and therefore, for the group mode, all application programs belonging to the same application group as the second application can share the network connection with the network capability, that is, only application programs belonging to the same application group as the application program that sends the request can share the network connection with the network capability. For private mode, the second application is able to use the network connection with the network capability but other applications cannot share the network connection with the network capability, i.e., it means that only the application sending the network request is able to use the network connection with the network capability.
It should be noted that the sharing mode may be represented by a character or a character string, for example, the private mode may be represented by a numeral 0, the group mode may be represented by a numeral 1, and the global mode may be represented by a numeral 2. Of course, in practical applications, the sharing mode may also be identified by other forms or kinds of characters or character strings.
The terminal can determine the sharing mode of the network connection with the network capability through at least four implementation modes as follows:
in a first implementation manner, in order to reduce interaction with a user and improve efficiency of determining a sharing mode, a preset sharing mode is determined as a sharing mode of a network connection having the network capability.
The terminal may set a sharing mode for each network capability in advance, and then, the terminal may directly determine the sharing mode set in advance for the network capability as the sharing mode of the network connection with the network capability.
For example, the network capability corresponding to the network capability information carried by the network request is SUPL, and the sharing mode preset by the network capability SUPL is the private mode, so that the terminal can determine the sharing mode of the SUPL-capable network connection as the private mode.
In order to improve the accuracy of determining the sharing mode and further improve the effect of transmitting the network data, the sharing mode of the network connection with the network capability may be determined by the user each time a network request is received, that is, a plurality of sharing modes are displayed, and when a sharing mode selection command is received based on the plurality of sharing modes, the sharing mode selected by the sharing mode selection command is determined as the sharing mode of the network connection with the network capability.
The terminal may display the plurality of sharing modes in a window or pop-up window manner, and of course, in practical applications, the terminal may also display the plurality of sharing modes in other manners.
It should be noted that the sharing mode selection instruction is used to select a sharing mode, and the sharing mode selection instruction may be triggered by a user through executing a preset operation, where the preset operation may be a click operation, a touch operation, a key operation, and the like.
In order to reduce interaction with a user and improve efficiency of determining a sharing mode, when the network request carries sharing mode information, a sharing mode of a network connection with the network capability is determined based on the sharing mode information.
The sharing mode information is used for explaining the sharing mode of the network connection with the network capability requested to be established by the network request. For example, when the sharing mode information is "sharing mode: 0 ", then it is determined that the sharing mode of the network connection with the network capability requested to be established by the network request is the private mode.
In order to improve the accuracy of determining the sharing mode and further improve the effect of transmitting the network data, the fourth implementation manner may determine the sharing mode of the network connection with the network capability based on the second application sending the network request.
Wherein, for each application installed by the terminal, the terminal may preset a sharing mode of a network connection that the application can request to establish, and thus, when the terminal receives the network request, the sharing mode of the network connection having the network capability may be determined based on the second application that transmitted the network request. That is, the sharing mode of the network connection that the same application can request to establish is the same.
For example, the terminal receives a network request sent by APP (Application) 1 through the network connection management service, and the sharing mode of the network connection that APP1 preset by the terminal for APP1 can request to establish is a group mode, so the terminal determines the sharing mode of the network connection with the network capability that APP1 currently requests to establish as the group mode.
In addition, since the global mode is used to indicate that all installed applications can share the network connection with the network capability, when the sharing mode is the global mode, the terminal may not perform the operations described in the following step 202 and 203, but directly determine whether the network connection with the network capability is established currently, if not, establish the network connection with the network capability, and if so, delete the network white list corresponding to the network data.
The terminal may determine whether the currently established network connection includes a network connection with the network capability through the network connection management service, determine that the currently established network connection with the network capability is established if the currently established network connection includes the network connection with the network capability, and determine that the currently established network connection with the network capability is not established if the currently established network connection does not include the network connection with the network capability.
For example, when the terminal is a terminal installed with an android operating system, the terminal may determine, through ConnectivityService, whether a network connection with the network capability is currently established, and if not, establish a network connection with the network capability through a network factory.
In addition, when the terminal establishes the network connection with the network capability, a data interface can be determined for the network connection with the network capability, so that network data can be transmitted through the data interface later.
The terminal may select a data interface corresponding to the network capability from a plurality of preset data interfaces (for example, the plurality of data interfaces may be preset data interfaces of a relevant technician, and each data interface corresponds to one network capability).
It should be noted that, when the plurality of data interfaces are preset, the terminal may determine the network capability corresponding to each data interface, and store the interface identifier of the data interface and the network capability into the correspondence between the interface identifier and the network capability. Then, the terminal may determine a data interface corresponding to the network capability from the correspondence between the interface identifier and the network capability based on the network capability.
Of course, in practical applications, when the terminal establishes the network connection with the network capability, it may also determine a data port in other manners (for example, the terminal may also generate a new data port for the network capability) and store the interface identifier of the determined data interface and the network capability in the corresponding relationship between the interface identifier and the network capability.
Step 202: the terminal determines at least one application identity based on the sharing mode.
It should be noted that the network white list is used to store the application identifications of the applications that are currently able to use the network connection with the network capability.
Since different sharing modes indicate different applications that can use the network capable network connection, it is necessary to determine at least one application identity based on the sharing mode to ensure that the at least one application identity can use the network capable network connection.
Wherein, since the sharing mode may include one or more of a private mode, a group mode and a global mode, when the sharing mode is the private mode, the application identifier of the second application is determined, and the application identifier of the second application is determined as the at least one application identifier. When the sharing mode is the global mode, the application identification of each application program which is installed currently is determined as the at least one application identification. When the sharing mode is a group mode, determining an application identifier of a second application, determining an application group corresponding to the network capability information and including the application identifier of the second application from the stored correspondence between the network capability and the application group, and determining the application identifier included in the application group as the at least one application identifier.
For example, the terminal receives a network request sent by the APP1 through the network connection management service, the network capability corresponding to the network information carried by the network request is MMS, and the terminal determines that the sharing mode of the network connection 1 requested to be established by the APP1 is a group mode, where the network connection 1 is a network connection with MMS capability. Therefore, the terminal determines the application groups corresponding to the MMS to be group 1 and group 2 from the stored correspondence between the network capabilities and the application groups as described in table 1 below based on the application identifier UID1 of the APP1, where the application identifiers included in group 1 are UID1, UID2, UID3, and the application identifiers included in group 2 are UID4, UID5, UID 6. Since the UID1 is included in group 1, the terminal determines the UID1, UID2, and UID3 included in group 1 as the at least one application identifier.
TABLE 1
It should be noted that, in the embodiment of the present invention, only the correspondence between the network capabilities and the application groups described in table 1 is taken as an example for description, and table 1 does not limit the embodiment of the present invention.
Further, the terminal may obtain application identifiers of all currently installed application programs before determining an application group that corresponds to the network capability information and includes an application identifier of the second application from the stored correspondence between the network capability and the application group, determine at least one application group based on the network capability and the obtained application identifiers, where each application group includes at least one application identifier of an application program that can issue the network request and request a network connection with the network capability, and store the network capability and the at least one application group in the correspondence between the network capability and the application group.
For example, the application identifiers acquired by the terminal are UID1, UID2, UID3, UID4, UID5, UID6, UID7, UID8, UID9, UID10, UID11 and UID12, where UID n is the application identifier of APP n. If APP1 and APP4 have the capability of sending network requests to request establishment of network connection 1, APP 2, APP 3, APP4, APP 5, and APP 6 need to use network connection 1 to transmit network data, so the terminal can determine 2 application groups corresponding to network capability MMS to be group 1 and group 2, respectively, based on MMS and the obtained 12 application identifiers, where group 1 includes UID1, UID2, and UID3, and group 2 includes UID4, UID5, and UID 6.
The terminal can display grouping prompt information, the grouping prompt information comprises the acquired application identifiers, the grouping prompt information is used for prompting a user to group the acquired application identifiers, and when a grouping instruction is received based on the displayed grouping prompt information, the at least one application group is determined based on the grouping instruction.
It should be noted that the terminal may display the network configuration prompt information in a window or pop-up window manner, and certainly, in practical applications, the terminal may display the network configuration prompt information in other manners.
It should be further noted that the grouping instruction is used to group the obtained application identifiers, and the grouping instruction may be triggered by a user by performing a preset operation.
For each application program in all application programs installed by the terminal, before determining at least one application group based on the network capability and the obtained application identifier (for example, when the application program is installed or runs for the first time), the terminal may display network configuration prompt information to prompt a user whether the application program needs to use a network connection, if the application program needs to use a network connection, the network capability of the network connection required by the application program, whether a network request can be initiated, if the network request can be initiated, and information such as the network capability corresponding to the network capability information carried by the initiated network request. Certainly, in practical application, the terminal may also prompt the user through other manners whether the application needs to use network connection, if the application needs to use network connection, the network capability of the network connection required by the application, whether the network request can be initiated, and if the network request can be initiated, the network capability corresponding to the network capability information carried by the initiated network request, and other information.
It should be noted that the terminal may display the network configuration prompt information in a window or pop-up window manner, and certainly, in practical applications, the terminal may display the network configuration prompt information in other manners.
Further, in order to improve the accuracy of acquiring the at least one application identifier, each application program may only exist in one group of the at least one group, that is, any two groups in the at least one group may not include the application identifier of the same application program.
Further, since all applications installed in the terminal generally include application programs that do not require network connection using the network capability, in order to improve flexibility in determining the at least one application group, the number of application identifiers included in the at least one group may be less than or equal to the number of application identifiers acquired by the terminal, that is, the at least one group may not include an application identifier of an application installed in the terminal.
In addition, for a network connection with any network capability that can be established by the terminal, the terminal may determine, based on the network capability and the obtained application identifier, at least one application group corresponding to the network capability information.
Step 203: whether the network connection with the network capability is established currently is judged based on the network capability information, if the network connection with the network capability is not established currently, the network connection with the network capability is established based on the network capability information, a network white list corresponding to the network capability is generated based on the at least one application identifier, and if the network connection with the network capability is established currently, the at least one application identifier is added into the network white list corresponding to the network capability.
When receiving the network request of the second application, the terminal may or may not currently establish the network connection with the network capability, and therefore, in order to reduce the probability of repeatedly establishing the network connection with the same network capability and thus reduce the waste of system resources of the terminal, the terminal may determine whether the network connection with the network capability is currently established.
The terminal may create a network white list corresponding to the network capability, and add the at least one application identifier to the network white list, so as to generate the network white list corresponding to the network capability based on the at least one application identifier.
It should be noted that, if a network connection with the network capability is currently established, it indicates that a network white list corresponding to the network capability is currently created, and therefore, the at least one application identifier may be directly added to the currently existing network white list corresponding to the network capability. Of course, in order to ensure the accuracy of adding the at least one application identifier to the white list corresponding to the network capability, so as to improve the effect of transmitting the network data, before the terminal adds the at least one application identifier to the existing network white list corresponding to the network capability, it may be determined whether a network white list corresponding to the network capability is created currently, if so, the at least one application identifier is added to the existing network white list corresponding to the network capability, and if not, the network white list corresponding to the network capability is created, and the at least one application identifier is added to the network white list.
Further, if the number of the application identifiers included in the network white list corresponding to the network capability is the same as the number of the application programs currently installed by the terminal, that is, the network white list corresponding to the network capability includes the application identifier of each application program currently installed by the terminal, the terminal may delete the network white list corresponding to the network capability.
Further, after step 203, the terminal may further notify that the network connection with the network capability of the application program corresponding to the at least one application identifier has been established based on the at least one application identifier, so as to ensure that the network connection with the network capability of the application program corresponding to the at least one application identifier can be used by the application program corresponding to the at least one application identifier.
The terminal may notify the application program corresponding to the at least one application identifier in a broadcast manner, and of course, may also send a notification message to each application program corresponding to the at least one application identifier, respectively, so as to notify the application program corresponding to the at least one application identifier.
Through the above step 201 and 203, the terminal receives the network request of the second application, determines the network capability of the network connection requested to be established by the second application and the sharing mode of the network connection with the network capability, and determines the network white list corresponding to the network capability based on the sharing mode, so that in the next step 204 and 205, the application program using the network connection with the network capability can be filtered based on the network white list corresponding to the network capability, thereby reducing the effect that multiple application programs simultaneously use the network connection with the same network capability for transmission, improving the effect of transmitting network data, and saving the traffic cost of the terminal.
Step 204: when the terminal detects the network data aiming at the first application through a data interface included in the network connection management service, the network capacity of the network connection required for transmitting the network data is determined according to the interface identification of the data interface.
The terminal may determine the network capability of the network connection required for transmitting the network data from the stored correspondence between the interface identifier and the network capability according to the interface identifier of the data interface.
It should be noted that the first application and the second application described above may be the same application program or different application programs.
Step 205: when the network capability of the network connection required for transmitting the network data is the network capability, the terminal determines a network white list corresponding to the network capability from a local storage, and when the network white list comprises the application identifier of the first application, the network data is transmitted through the network connection with the network capability.
For example, when the terminal is a terminal installed with an android operating system, the terminal may add a corresponding filtering rule in a Filter Chain included in an Iptables (firewall), so as to ensure that only an application program corresponding to an application identifier included in the network white list in the terminal can use a network connection with the network capability.
When the network white list corresponding to the network capability only includes the application identifier of one application program, the sharing mode of the network connection with the network capability may be a private mode, and the first application and the second application are the same application program, that is, only the application program requesting to establish the network connection with the network capability can use the network connection with the network capability. If the white list of the network corresponding to the network capability only includes the application identifier of more than one application program, when the second application initiates the network request, the sharing mode of the network connection with the network capability determined by the terminal may include three cases: in the first case, the sharing mode of the network connection with the network capability is the private mode, and the more than one application programs all send the network request to establish the network connection with the network capability; in the second case, the sharing mode of the network connection with the network capability is a group mode, and the at least one application program may be the same application program or an application program in the same group, that is, after an application program in the same application group requests to establish the network connection with the network capability, other application programs in the application group may all share the network connection with the network capability; in a third case, the sharing mode of the network connection with the network capability is a global mode, and the at least one application may be any application currently installed in the terminal, that is, each application currently installed in the terminal may use the network connection with the network capability as long as any application in the terminal sends the network request.
For example, the application identifications of the application programs currently installed by the terminal are UID1, UID2, UID3, UID4, UID5, UID6, UID7, UID8, UID9, UID10, UID11, and UID 12. If the network white list corresponding to the network capability MMS includes UID1 and UID4, it may be that both APP1 and APP4 send a network request requesting to establish the network connection 1, and when the terminal receives the network request sent by APP1 and APP4 through the network connection management service, both determine that the sharing mode of both the network connection 1 is the private mode. If the network white list corresponding to the network capability MMS includes UID1, UID2, UID3, UID4, it may be that both APP1 and APP4 have sent the network request, and when the terminal receives the network request sent by APP1 through the network connection management service, it determines that the sharing mode of network connection 1 is the group mode, so that APP1, APP 2, and APP 3 can use network connection 1, and when the terminal receives the network request sent by APP4 through the network connection management service, it determines that the sharing mode of network connection 1 is the private mode, that is, only APP4 can use network connection 1 in the group where APP4 is located. If the network white list corresponding to the network capability MMS includes UID1, UID2, UID3, UID4, UID5 and UID6, it may be that both APP1 and APP4 have sent the network request, and when the terminal receives the network requests sent by APP1 and APP4 through the network connection management service, both determine that the sharing mode of the network connection 1 is the group mode. If the network white list corresponding to the network capability MMS includes UID1, UID2, UID3, UID4, UID5, UID6, UID7, UID8, UID9, UID10, UID11 and UID12, it may be that APP1 or APP4 sends the network request, and when the terminal receives the network request sent by APP1 or APP4 through the network connection management service, it determines that the sharing mode of network connection 1 is the global mode.
It should be noted that, when the terminal cannot determine the network white list corresponding to the network capability, that is, when the network white list corresponding to the network capability is not created currently, the terminal may also transmit the network data directly through the network connection having the network capability, that is, the application program using the network connection having the network capability is not filtered.
Further, for cost saving or other reasons, the terminal may also disconnect the network connection with the network capability, for example, when detecting that the idle duration of the network connection with the network capability is greater than the preset duration, the terminal may disconnect the network connection with the network capability.
For example, when the terminal is a terminal installed with an android operating system, the terminal may disconnect a network connection with the network capability through an ibider.
In the embodiment of the present invention, first, when network data for a first application is detected through a data interface, a network capability of a network connection required for transmitting the network data is determined according to an interface identifier of the data interface, then, a network white list corresponding to the network capability is determined, and when an application identifier of the first application is included in the network white list, the network data is transmitted through the network connection having the network capability, that is, an application program using the network connection having the network capability can be filtered through the network white list corresponding to the network capability, so that a probability that any application program in the terminal can transmit the network data through the network connection having the network capability is reduced, compared with an existing unfiltered network data transmission method, a plurality of application programs can be transmitted through the network connection having the same network capability at the same time, the effect of transmitting network data is improved, and the flow cost of the terminal is saved. Secondly, when the terminal receives a request for network connection with the network capability, the terminal can determine a sharing mode of the network connection with the network capability, determine at least one application identifier based on the sharing mode, and add the at least one application identifier to a network white list corresponding to the network capability. In addition, when the sharing mode is a private mode, the terminal can only allow the application program sending the network request to use the network connection with the network capability, and when the sharing mode is a group mode, the terminal can only allow the application program in the same application group as the application program sending the network request to use the network connection with the network capability, so that the probability that any application program in the terminal can use the network connection with the network capability is reduced, and the traffic cost for using the terminal is further reduced.
The method for transmitting image data according to the present invention is described above with reference to the detailed description and the accompanying drawings, and an apparatus corresponding to the method is described below with reference to the accompanying drawings.
Fig. 3 is a block diagram of an apparatus for transmitting network data according to an embodiment of the present invention, and referring to fig. 3, the apparatus includes: a first determining module 301, a second determining module 302 and a transmitting module 303.
A first determining module 301, configured to, when network data for a first application is detected through a data interface included in a network connection management service, determine, according to an interface identifier of the data interface, a network capability of a network connection required for transmitting the network data, where the network capability is used to describe a capability of the network connection to transmit the network data;
a second determining module 302, configured to determine, from a local storage, a network white list corresponding to the network capability, where the network white list is used to store application identifiers of application programs that can use a network connection with the network capability;
a transmitting module 303, configured to transmit the network data through a network connection with the network capability when the application identifier of the first application is included in the network white list.
Optionally, the apparatus further comprises:
a third determining module, configured to determine, when a network request is received through the network connection management service and the network request carries network capability information corresponding to the network capability, a sharing mode of a network connection with the network capability, and determine at least one application identifier based on the sharing mode, where the sharing mode is used to indicate an application program capable of sharing the network connection with the network capability, and the network capability information is used to indicate the network capability of the network connection requested to be established;
the judging module is used for judging whether the network connection with the network capability is established currently or not based on the network capability information;
the establishing module is used for establishing the network connection with the network capability based on the network capability information if the network connection with the network capability is not established currently, and generating a network white list corresponding to the network capability based on the at least one application identifier;
and the adding module is used for adding the at least one application identifier into a network white list corresponding to the network capability if the network connection with the network capability is established currently.
Optionally, the third determining module includes:
a first determining submodule, configured to determine an application identifier of a second application when the sharing mode is a group mode, where the second application is an application program that sends the network request, and the group mode is used to indicate that application programs belonging to the same application group as the second application can share a network connection with the network capability;
the second determining submodule is used for determining an application group which corresponds to the network capability information and comprises an application identifier of the second application from the stored correspondence between the network capability information and the application group;
and the third determining submodule is used for determining the application identifier included by the application group as the at least one application identifier.
Optionally, the third determining module further includes:
the obtaining submodule is used for obtaining application identifications of all currently installed application programs;
a fourth determining submodule, configured to determine at least one application group based on the network capability information and the obtained application identifier, where each application group includes at least one application identifier that can send the network request to establish a network connection with the network capability;
and the storage submodule is used for storing the network capability information and the at least one application group in the corresponding relation between the network capability information and the application group.
Optionally, the third determining module includes:
a fifth determining sub-module, configured to determine an application identifier of a second application when the sharing mode is a private mode, where the private mode is used to indicate that the second application can use the network connection with the network capability but other application programs cannot share the network connection with the network capability, and determine the application identifier of the second application as the at least one application identifier; or,
and a sixth determining sub-module, configured to determine, as the at least one application identifier, an application identifier of each currently installed application program when the sharing mode is a global mode, where the global mode is used to indicate that all installed application programs can share the network connection with the network capability.
Optionally, the third determining module includes:
a seventh determining submodule, configured to determine a preset sharing mode as a sharing mode of a network connection having the network capability; or,
a display sub-module for displaying a plurality of sharing modes, and when receiving a sharing mode selection instruction based on the plurality of sharing modes, determining the sharing mode selected by the sharing mode selection instruction as the sharing mode of the network connection having the network capability; or,
an eighth determining submodule, configured to determine, when the network request carries sharing mode information, a sharing mode of a network connection having the network capability based on the sharing mode information; or,
a ninth determining sub-module for determining a sharing mode of the network connection having the network capability based on the second application sending the network request.
In the embodiment of the present invention, first, when network data for a first application is detected through a data interface, a network capability of a network connection required for transmitting the network data is determined according to an interface identifier of the data interface, then, a network white list corresponding to the network capability is determined, and when an application identifier of the first application is included in the network white list, the network data is transmitted through the network connection having the network capability, that is, an application program using the network connection having the network capability can be filtered through the network white list corresponding to the network capability, so that a probability that any application program in the terminal can transmit the network data through the network connection having the network capability is reduced, compared with an existing unfiltered network data transmission method, a plurality of application programs can be transmitted through the network connection having the same network capability at the same time, the effect of transmitting network data is improved, and the flow cost of the terminal is saved.
It should be noted that: in the apparatus for transmitting network data according to the foregoing embodiment, when transmitting network data, only the division of the functional modules is described as an example, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus for transmitting network data and the method for transmitting network data provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 4 is a schematic structural diagram of an apparatus for transmitting network data according to an embodiment of the present invention. Referring to fig. 4, the apparatus 400 may include components such as a communication unit 410, a memory 420 including one or more computer-readable storage media, an input unit 430, a display unit 440, a sensor 450, an audio circuit 460, a WIFI (Wireless Fidelity) module 470, a processor 480 including one or more processing cores, and a power supply 490. Those skilled in the art will appreciate that the configuration of the device shown in fig. 4 does not constitute a limitation of the device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the communication unit 410 may be used for receiving and transmitting information or signals during a call, and the communication unit 410 may be an RF (Radio Frequency) circuit, a router, a modem, or other network communication devices. In particular, when the communication unit 410 is an RF circuit, downlink information of a base station is received and then processed by the one or more processors 480; in addition, data relating to uplink is transmitted to the base station. Generally, the RF circuit as a communication unit includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the communication unit 410 may also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (general packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (long term Evolution), email, SMS (Short Messaging Service), and the like. The memory 420 may be used to store software programs and modules, and the processor 480 executes various functional applications and data processing by operating the software programs and modules stored in the memory 420. The memory 420 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the apparatus 400, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 420 may also include a memory controller to provide access to memory 420 by processor 480 and input unit 430.
The input unit 430 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. Preferably, the input unit 430 may include a touch-sensitive surface 431 and other input devices 432. The touch-sensitive surface 431, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 431 (e.g., operations by a user on or near the touch-sensitive surface 431 using any suitable object or attachment such as a finger, a stylus, etc.) and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 431 may comprise both 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, sends the touch point coordinates to the processor 480, and receives and executes commands sent from the processor 480. In addition, the touch-sensitive surface 431 may be implemented in various types, such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 430 may include other input devices 432 in addition to the touch-sensitive surface 431. Preferably, other input devices 432 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 440 may be used to display information input by or provided to a user and various graphical user interfaces of the apparatus 400, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 440 may include a Display panel 441, and optionally, the Display panel 441 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 431 may overlay the display panel 441, and when a touch operation is detected on or near the touch-sensitive surface 431, the touch operation is transmitted to the processor 480 to determine the type of the touch event, and then the processor 480 provides a corresponding visual output on the display panel 441 according to the type of the touch event. Although in FIG. 4 the touch sensitive surface 431 and the display panel 441 are two separate components to implement input and output functions, in some embodiments the touch sensitive surface 431 and the display panel 441 may be integrated to implement input and output functions.
The apparatus 400 may also include at least one sensor 450, such as a light sensor, motion sensor, and other sensors. The light sensor may include an ambient light sensor that adjusts the brightness of the display panel 441 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 441 and/or the backlight when the device 400 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are also configured to the apparatus 400, detailed descriptions thereof are omitted.
In order to realize wireless communication, a wireless communication unit 470 may be configured on the device, and the wireless communication unit 470 may be a WIFI module. WIFI is a short-range wireless transmission technology, and the apparatus 400 can help a user send and receive e-mails, browse web pages, access streaming media, and the like through the wireless communication unit 470, and provide the user with wireless broadband internet access. Although the wireless communication unit 470 is shown in the drawing, it is understood that it does not belong to the essential constitution of the apparatus 400 and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 480 is the control center of the device 400, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the device 400 and processes data by operating or executing software programs and/or modules stored in the memory 420 and calling data stored in the memory 420, thereby performing overall monitoring of the mobile phone. Optionally, processor 480 may include one or more processing cores; preferably, the processor 480 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 480.
The apparatus 400 further includes a power supply 490 (e.g., a battery) for supplying power to the various components, which may preferably be logically connected to the processor 480 via a power management system, such that the power management system may be used to manage charging, discharging, and power consumption. The power supply 460 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the apparatus 400 may further include a camera, a bluetooth module, etc., which will not be described herein.
In this embodiment, the apparatus further includes one or more programs, stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the following described network data transmission provided by the embodiments of the present invention, including:
when network data aiming at a first application is detected through a data interface included in the network connection management service, determining the network capacity of a network connection required for transmitting the network data according to the interface identification of the data interface, wherein the network capacity is used for explaining the capacity of the network connection for transmitting the network data;
determining a network white list corresponding to the network capability from a local storage, wherein the network white list is used for storing application identifications of application programs capable of using network connection with the network capability;
and when the application identification of the first application is included in the network white list, transmitting the network data through the network connection with the network capability.
Optionally, before determining the network white list corresponding to the network capability from the local storage, the method further includes:
when a network request is received through the network connection management service and the network request carries network capability information corresponding to the network capability, determining a sharing mode of the network connection with the network capability, and determining at least one application identifier based on the sharing mode, wherein the sharing mode is used for indicating an application program capable of sharing the network connection with the network capability, and the network capability information is used for explaining the network capability of the network connection requested to be established;
judging whether a network connection with the network capability is established currently or not based on the network capability information;
if the network connection with the network capability is not established currently, the network connection with the network capability is established based on the network capability information, and a network white list corresponding to the network capability is generated based on the at least one application identifier;
and if the network connection with the network capability is established currently, adding the at least one application identification into a network white list corresponding to the network capability.
Optionally, determining at least one application identifier based on the sharing mode includes:
when the sharing mode is a group mode, determining an application identifier of a second application, wherein the second application is an application program sending the network request, and the group mode is used for indicating that the applications belonging to the same application group as the second application can share the network connection with the network capability;
determining an application group which corresponds to the network capability information and comprises an application identifier of the second application from the stored correspondence between the network capability information and the application group;
and determining the application identifier included by the application group as the at least one application identifier.
Optionally, before determining, from the stored correspondence between the network capability information and the application group, an application group that corresponds to the network capability information and includes the application identifier of the second application, the method further includes:
acquiring application identifications of all currently installed application programs;
determining at least one application group based on the network capability information and the obtained application identifiers, wherein each application group comprises at least one application identifier of an application program which can send the network request to establish network connection with the network capability;
storing the network capability information and the at least one application group in a correspondence between the network capability information and the application group.
Optionally, determining at least one application identifier based on the sharing mode includes:
when the sharing mode is a private mode, determining an application identifier of a second application, wherein the private mode is used for indicating that the second application can use the network connection with the network capability but other application programs cannot share the network connection with the network capability, and determining the application identifier of the second application as the at least one application identifier; or,
and when the sharing mode is a global mode, determining the application identifier of each application program which is installed currently as the at least one application identifier, wherein the global mode is used for indicating that all the installed application programs can share the network connection with the network capability.
Optionally, determining a sharing mode of the network connection having the network capability comprises:
determining a preset sharing mode as a sharing mode of network connection with the network capability; or,
displaying a plurality of sharing modes, and when a sharing mode selection instruction is received based on the plurality of sharing modes, determining the sharing mode selected by the sharing mode selection instruction as the sharing mode of the network connection with the network capability; or,
when the network request carries sharing mode information, determining a sharing mode of the network connection with the network capability based on the sharing mode information; or,
based on the second application sending the network request, a sharing mode of the network connection with the network capability is determined.
In the embodiment of the present invention, first, when network data for a first application is detected through a data interface, a network capability of a network connection required for transmitting the network data is determined according to an interface identifier of the data interface, then, a network white list corresponding to the network capability is determined, and when an application identifier of the first application is included in the network white list, the network data is transmitted through the network connection having the network capability, that is, an application program using the network connection having the network capability can be filtered through the network white list corresponding to the network capability, so that a probability that any application program in the terminal can transmit the network data through the network connection having the network capability is reduced, compared with an existing unfiltered network data transmission method, a plurality of application programs can be transmitted through the network connection having the same network capability at the same time, the effect of transmitting network data is improved, and the flow cost is saved.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (8)
1. A method of transmitting network data, the method comprising:
when a network request is received through a network connection management service and the network request carries network capacity information, determining a sharing mode of network connection with network capacity corresponding to the network capacity information, and determining at least one application identifier based on the sharing mode, wherein the network capacity information is used for explaining the network capacity of the network connection requested to be established, the network capacity is used for explaining the capacity of the network connection for transmitting network data, and the sharing mode is used for indicating an application program capable of sharing the network connection with the network capacity;
judging whether a network connection with the network capability is established currently or not based on the network capability information;
if the network connection with the network capability is not established currently, establishing the network connection with the network capability based on the network capability information, and generating a network white list corresponding to the network capability based on the at least one application identifier;
if the network connection with the network capability is established currently, adding the at least one application identifier into a network white list corresponding to the network capability;
when network data aiming at a first application is detected through a data interface included in the network connection management service, determining the network capacity of a network connection required for transmitting the network data according to an interface identification of the data interface;
determining a network white list corresponding to the network capability from a local storage, wherein the network white list is used for storing application identifications of application programs capable of using network connection with the network capability;
and when the application identification of the first application is included in the network white list, transmitting the network data through a network connection with the network capability.
2. The method of claim 1, wherein said determining at least one application identification based on said sharing mode comprises:
when the sharing mode is a group mode, determining an application identifier of a second application, wherein the second application is an application program sending the network request, and the group mode is used for indicating that the application programs belonging to the same application group as the second application can share the network connection with the network capability;
determining an application group which corresponds to the network capability information and comprises an application identifier of the second application from the stored correspondence between the network capability information and the application group;
determining the application identifier included by the application group as the at least one application identifier.
3. The method of claim 2, wherein before determining the application group corresponding to the network capability information and including the application identifier of the second application from the stored correspondence between the network capability information and the application group, further comprising:
acquiring application identifications of all currently installed application programs;
determining at least one application group based on the network capability information and the acquired application identifiers, wherein each application group comprises at least one application identifier of an application program which can send the network request to establish network connection with the network capability;
storing the network capability information and the at least one application group in a correspondence between the network capability information and application groups.
4. The method of claim 1, wherein said determining at least one application identification based on said sharing mode comprises:
when the sharing mode is a private mode, determining an application identifier of a second application, wherein the private mode is used for indicating that the second application can use the network connection with the network capability but other application programs cannot share the network connection with the network capability, and determining the application identifier of the second application as the at least one application identifier; or,
and when the sharing mode is a global mode, determining the application identifier of each application which is installed currently as the at least one application identifier, wherein the global mode is used for indicating that all the installed application programs can share the network connection with the network capability.
5. An apparatus for transmitting network data, the apparatus comprising:
a third determining module, configured to determine, when a network request is received through a network connection management service and the network request carries network capability information, a sharing mode of a network connection having a network capability corresponding to the network capability information, and determine at least one application identifier based on the sharing mode, where the network capability information is used to describe a network capability of the network connection requested to be established, the network capability is used to describe a capability of the network connection to transmit network data, and the sharing mode is used to indicate an application program capable of sharing the network connection having the network capability;
the judging module is used for judging whether the network connection with the network capability is established currently or not based on the network capability information;
the establishing module is used for establishing the network connection with the network capability based on the network capability information and generating a network white list corresponding to the network capability based on the at least one application identifier if the network connection with the network capability is not established currently;
an adding module, configured to add the at least one application identifier to a network white list corresponding to the network capability if a network connection with the network capability is currently established;
a first determining module, configured to determine, when network data for a first application is detected through a data interface included in the network connection management service, the network capability of a network connection required for transmitting the network data according to an interface identifier of the data interface;
a second determining module, configured to determine, from a local storage, a network white list corresponding to the network capability, where the network white list is used to store application identifiers of application programs that can use a network connection with the network capability;
a transmission module, configured to transmit the network data through a network connection with the network capability when the application identifier of the first application is included in the network white list.
6. The apparatus of claim 5, wherein the third determination module comprises:
a first determining submodule, configured to determine an application identifier of a second application when the sharing mode is a group mode, where the second application is an application program that sends the network request, and the group mode is used to indicate that all application programs belonging to the same application group as the second application can share a network connection with the network capability;
the second determining submodule is used for determining an application group which corresponds to the network capability information and comprises an application identifier of the second application from the stored correspondence between the network capability information and the application group;
a third determining sub-module, configured to determine the application identifier included in the application group as the at least one application identifier.
7. The apparatus of claim 6, wherein the third determining module further comprises:
the obtaining submodule is used for obtaining application identifications of all currently installed application programs;
a fourth determining submodule, configured to determine at least one application group based on the network capability information and the obtained application identifier, where each application group includes at least one application identifier that can issue the network request to request establishment of a network connection with the network capability;
a storage sub-module, configured to store the network capability information and the at least one application group in a correspondence between the network capability information and the application group.
8. The apparatus of claim 5, wherein the third determination module comprises:
a fifth determining sub-module, configured to determine an application identifier of a second application when the sharing mode is a private mode, where the private mode is used to indicate that the second application can use the network connection with the network capability but other application programs cannot share the network connection with the network capability, and determine the application identifier of the second application as the at least one application identifier; or,
a sixth determining sub-module, configured to determine, when the sharing mode is a global mode, an application identifier of each currently installed application as the at least one application identifier, where the global mode is used to indicate that all installed application programs can share the network connection with the network capability.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710034840.3A CN106817370B (en) | 2017-01-18 | 2017-01-18 | Method and device for transmitting network data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710034840.3A CN106817370B (en) | 2017-01-18 | 2017-01-18 | Method and device for transmitting network data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106817370A CN106817370A (en) | 2017-06-09 |
CN106817370B true CN106817370B (en) | 2020-03-03 |
Family
ID=59113163
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710034840.3A Active CN106817370B (en) | 2017-01-18 | 2017-01-18 | Method and device for transmitting network data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106817370B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107566398B (en) * | 2017-09-30 | 2019-02-05 | Oppo广东移动通信有限公司 | Flow control methods and device, computer equipment, computer readable storage medium |
CN112153633B (en) * | 2019-06-29 | 2021-12-03 | 华为技术有限公司 | Method and equipment for sending and receiving capability information |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1878083A (en) * | 2005-06-09 | 2006-12-13 | 华为技术有限公司 | Method and system for recording usage network capability and application therefor |
CN103634470A (en) * | 2013-12-02 | 2014-03-12 | 无锡交大联云科技有限公司 | Human-computer interaction prediction method based on terminal mobile data access network Qos |
CN105704066A (en) * | 2016-01-12 | 2016-06-22 | 北京奇虎科技有限公司 | Networking control method, device and system, security gateway and mobile terminal |
-
2017
- 2017-01-18 CN CN201710034840.3A patent/CN106817370B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1878083A (en) * | 2005-06-09 | 2006-12-13 | 华为技术有限公司 | Method and system for recording usage network capability and application therefor |
CN103634470A (en) * | 2013-12-02 | 2014-03-12 | 无锡交大联云科技有限公司 | Human-computer interaction prediction method based on terminal mobile data access network Qos |
CN105704066A (en) * | 2016-01-12 | 2016-06-22 | 北京奇虎科技有限公司 | Networking control method, device and system, security gateway and mobile terminal |
Also Published As
Publication number | Publication date |
---|---|
CN106817370A (en) | 2017-06-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107094294B (en) | Network connection method and device | |
CN106851654B (en) | Pseudo base station identification method, pseudo base station identification device and terminal | |
KR101978590B1 (en) | Message updating method, device and terminal | |
CN108549519B (en) | Split screen processing method and device, storage medium and electronic equipment | |
CN106371964B (en) | Method and device for prompting message | |
CN103455343A (en) | Method and device for updating application programs | |
CN103455330A (en) | Application program management method, terminal, equipment and system | |
CN108668328B (en) | Network switching method and mobile terminal | |
WO2019011324A1 (en) | Method for determining access method of mobile terminal, storage medium, and mobile terminal | |
WO2017096909A1 (en) | Data connection establishing method and apparatus | |
CN104915091A (en) | Method and device for displaying status bar prompt message | |
EP2869604B1 (en) | Method, apparatus and device for processing a mobile terminal resource | |
CN110072013B (en) | Terminal control method and device | |
WO2015081880A1 (en) | Method, device and system for processing cluster service attribute | |
CN104917905A (en) | Strange incoming call processing method, terminal and server | |
CN106470234B (en) | Equipment discovery method and device | |
CN106817370B (en) | Method and device for transmitting network data | |
CN106899959B (en) | Method, device, terminal and system for obtaining SIM card information | |
CN107463395B (en) | Component calling method and device | |
CN105703808A (en) | Method and device for transmitting data | |
CN106933626B (en) | Application association method and device | |
CN106210325B (en) | Method, device and terminal for setting incoming call ringtone of social application | |
CN108234275B (en) | Method and device for releasing communication information | |
CN106445594B (en) | System application installation method and device and terminal equipment | |
CN112261634B (en) | Bluetooth transmission control method and device, terminal equipment and 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder | ||
CP01 | Change in the name or title of a patent holder |
Address after: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11 Patentee after: Qingdao Hisense Mobile Communication Technology Co.,Ltd. Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11 Patentee before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd. |