CN108989244B - Data processing method, data processing device, storage medium and electronic equipment - Google Patents

Data processing method, data processing device, storage medium and electronic equipment Download PDF

Info

Publication number
CN108989244B
CN108989244B CN201810949914.0A CN201810949914A CN108989244B CN 108989244 B CN108989244 B CN 108989244B CN 201810949914 A CN201810949914 A CN 201810949914A CN 108989244 B CN108989244 B CN 108989244B
Authority
CN
China
Prior art keywords
data
sending
layer
priority class
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810949914.0A
Other languages
Chinese (zh)
Other versions
CN108989244A (en
Inventor
林进全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810949914.0A priority Critical patent/CN108989244B/en
Publication of CN108989244A publication Critical patent/CN108989244A/en
Application granted granted Critical
Publication of CN108989244B publication Critical patent/CN108989244B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/61Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements

Abstract

The application discloses a data processing method, a data processing device, a storage medium and electronic equipment. The method comprises the following steps: when the current network condition meets a preset condition, sending the data of the application layer to the network layer; determining the type of data in a network layer, and sending the data to a data link layer; and at the data link layer, dividing the data into corresponding priority classes of the sending queue according to the type of the data, and sending the data in the corresponding priority classes of the sending queue to the physical layer according to the sending sequence determined by the sending queue. The method and the device can reduce queuing time delay of the data of the specific application and improve experience of a user on the specific application.

Description

Data processing method, data processing device, storage medium and electronic equipment
Technical Field
The present application belongs to the field of terminal technologies, and in particular, to a data processing method and apparatus, a storage medium, and an electronic device.
Background
With the continuous development of terminal technology, applications in the terminal are more and more abundant. But as applications increase, more and more data needs to be sent into the network. At present, before sending data to a network, a terminal needs to put data into a queue uniformly, then take out the data from the queue, and send the data to the network. When a certain application generates a large amount of data and needs to be sent to the network, or when the current network quality is poor, the data of some applications often passes through a long queuing process in the queue, so that the data cannot be sent to the network in time, and bad application experience is brought to users.
Disclosure of Invention
Embodiments of the present application provide a data processing method, an apparatus, a storage medium, and an electronic device, which can reduce queuing delay of data for a specific application.
An embodiment of the present application provides a data processing method, including:
when the current network condition meets a preset condition, sending the data of the application layer to the network layer;
determining the type of the data in the network layer, and sending the data to a data link layer;
and at the data link layer, dividing the data into corresponding priority classes of a sending queue according to the type of the data, and sending the data in the corresponding priority classes of the sending queue to a physical layer according to the sending sequence determined by the sending queue.
An embodiment of the present application provides a data processing apparatus, including:
the application layer sending module is used for sending the data of the application layer to the network layer when the current network condition meets the preset condition;
a network layer sending module, configured to determine, at the network layer, a type of the data, and send the data to a data link layer;
and the data link layer sending module is used for dividing the data into corresponding priority classes of a sending queue according to the type of the data and sending the data in the corresponding priority classes of the sending queue to the physical layer according to the sending sequence determined by the sending queue.
The embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer is caused to execute the steps in the data processing method provided by the embodiment of the present application.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the steps in the data processing method provided in the embodiment of the present application by calling the computer program stored in the memory.
In the embodiment of the application, when the current network condition meets the preset condition, the terminal can divide the data of the specific application into the first priority class and divide the data of other applications into the second priority class by determining the type of the data, and the sending sequence of the first priority class is higher than that of the second priority class, so that the data of the specific application can be sent to the network preferentially, the queuing delay of the data of the specific application is reduced, and the experience degree of a user on the specific application is improved.
Drawings
The technical solution and the advantages of the present invention will be apparent from the following detailed description of the embodiments of the present invention with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a data processing method according to an embodiment of the present application.
Fig. 2 is another schematic flow chart of the data processing method according to the embodiment of the present application.
Fig. 3 is a schematic flowchart of a data processing method according to an embodiment of the present application.
Fig. 4 is a scene schematic diagram of a data processing method according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application.
Fig. 6 is another schematic structural diagram of a data processing apparatus according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.
Fig. 8 is another schematic structural diagram of a mobile terminal according to an embodiment of the present application.
Detailed Description
Referring now to the drawings, in which like numerals represent like elements, the principles of the present invention are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the invention and should not be taken as limiting the invention with regard to other embodiments that are not detailed herein.
It can be understood that the execution subject of the embodiment of the present application may be a terminal device such as a smart phone or a tablet computer.
Referring to fig. 1, fig. 1 is a schematic flow chart of a data processing method according to an embodiment of the present application, where the flow chart may include:
101. and when the current network condition meets the preset condition, sending the data of the application layer to the network layer.
102. At the network layer, the type of data is determined and the data is sent to the data link layer.
103. And at the data link layer, dividing the data into corresponding priority classes of the sending queue according to the type of the data, and sending the data in the corresponding priority classes of the sending queue to the physical layer according to the sending sequence determined by the sending queue.
It is understood that the data may be generated by an application of the application layer, and then the terminal may encapsulate the data of the application layer, send the encapsulated data to the network layer via the transport layer, then encapsulate the data by the network layer, send the encapsulated data to the data link layer, then encapsulate the data by the data link layer, and send the encapsulated data to the physical layer, so that the physical layer sends the data to the network. When the current network quality is poor, or when a certain application has a large amount of data to be sent to the network, the data generated by other applications cannot be sent to the network in time.
In this embodiment, when the current network condition satisfies the preset condition, the data of the application layer may be sent to the network layer. When the current network quality is lower than a preset threshold value, determining that the current network condition meets a preset condition; or, when it is detected that data exceeding a preset size needs to be sent to the physical layer, it may be determined that the current network condition satisfies a preset condition. The preset threshold and the preset size may be set according to actual conditions, and are not specifically limited herein.
When the data reaches the network layer, the type of the data needs to be determined in addition to the conventional process of encapsulating the data. Specifically, each application has an application number corresponding to it, and the number can uniquely refer to the application. When the application generates data and needs to send the data to the network, the number corresponding to the application can be carried in the data. Thus, when data is sent to the network layer, the network layer can determine the type of the data by identifying the number corresponding to the application carried in the data.
For example, if data of a specific application is to be sent preferentially, after the data is sent to the network layer, whether the data is the data of the specific application may be identified by identifying the number of the data, and if the data is the data of the specific application, the data is determined to be the data of the first type, and the data may be marked and then sent to the data link layer; if the data is not the data of the specific application, determining that the data is the data of the second type, and directly sending the data to the data link layer without marking the data. It is worth mentioning that the first type of data is data that is preferentially sent to the network, and the data may be from one application or from multiple applications; the second type of data is data that is not preferentially sent to the network, and the data may also be from one application or from multiple applications, depending on actual needs, and is not particularly limited herein.
In this embodiment, the transmission queue may include a first priority class and a second priority class, where the transmission order of data in the first priority class is higher than that of the second priority class.
At the data link layer, data may be classified into corresponding priority classes of the transmit queues according to the type of data. For example, after receiving data, checking whether a mark exists in the data, if so, determining that the data is the first type of data, and then classifying the data into a first priority class of a sending queue; if no flag is present, the data is determined to be of a second type and may then be classified into a second priority class of transmit queues.
When the data in the transmission queue needs to be transmitted to the physical layer so that the network card of the physical layer transmits the data to the network, the data in the corresponding priority category of the transmission queue can be transmitted to the physical layer according to the transmission sequence determined by the transmission queue, and then the network card of the physical layer transmits the data to the network. In this embodiment, since the transmission order of the data in the first priority class is higher than that of the data in the second priority class, the data in the first priority class may be transmitted first, and after the data in the first priority class is transmitted, the data in the second priority class may be transmitted again.
In particular, the transmission queue may further include a third priority class, wherein the data in the first priority class is transmitted in a higher order than the second priority class, and the data in the second priority class is transmitted in a higher order than the third priority class. Because a default queue exists in the terminal and the data volume generated when the terminal is started is small, the default queue can be deleted when the terminal is started and then added into the sending queue. The time required for deleting the default queue and adding the sending queue is short, and the data generated between the default queue and the sending queue can be directly sent to the network, so that the terminal cannot be greatly influenced. When the current network quality does not meet the preset condition, the data can be put into a second priority class in the sending queue by default, and the data is sent directly according to a first-in first-out rule; when the current network quality meets the preset condition, sending data according to the steps in the embodiment; or after the terminal joins the sending queue, the following steps are executed: sending the data of the application layer to a network layer; determining the type of data in a network layer, and sending the data to a data link layer; at a data link layer, dividing the data into corresponding priority classes of a sending queue according to the type of the data; and in the data link layer, sending the data in the corresponding priority class of the sending queue to the physical layer according to the sending sequence determined by the sending queue, so that the data of the specific application can be sent preferentially after the terminal is added into the sending queue without considering the current network condition.
In this embodiment, when the current network condition meets the preset condition, the terminal may classify the data of the specific application into the first priority class and classify the data of the other applications into the second priority class by determining the type of the data, and the sending order of the first priority class is higher than that of the second priority class, so that the data of the specific application may be preferentially sent to the network, the queuing delay of the data of the specific application is reduced, and the experience of the user on the specific application is improved.
Referring to fig. 2, fig. 2 is another schematic flow chart of a data processing method according to an embodiment of the present application, where the flow chart may include:
201. and when the current network condition meets the preset condition, sending the data of the application layer to the network layer.
When the current network condition meets the preset condition, before the step of sending the data of the application layer to the network layer, the method may further include:
detecting whether the current network quality is lower than a preset threshold value;
and if the current network quality is detected to be lower than the preset threshold value, determining that the current network condition meets the preset condition.
When the current network condition meets the preset condition, before the step of sending the data of the application layer to the network layer, the method may further include:
detecting whether data exceeding a preset size exists at present and needing to be sent to a physical layer;
and if the data with the size exceeding the preset size is detected to be sent to the physical layer, determining that the current network condition meets the preset condition.
Specifically, whether the current network quality is lower than a preset threshold value may be detected based on the network quality parameter.
The network quality parameter may be network signal strength, network transmission delay, or network packet loss rate. Based on the method, the terminal determines whether the network quality is lower than a preset threshold value according to the following method;
(1) the terminal monitors whether the network signal intensity of the current network is lower than a preset signal intensity threshold value or not in real time, and when the network signal intensity is monitored to be lower than the preset signal intensity threshold value, the current network quality is determined to be lower than the preset threshold value;
(2) the terminal monitors whether the network transmission delay of the current network is larger than a preset network transmission delay threshold value or not in real time, and when the network transmission delay is detected to be larger than the preset network transmission delay threshold value, the current network quality is determined to be lower than the preset threshold value;
(3) and the terminal monitors whether the network packet loss rate of the current network is greater than a preset network packet loss rate threshold value or not in real time, and when the network packet loss rate is greater than the preset network packet loss rate, the current network quality is determined to be lower than the preset threshold value.
It should be noted that the method for detecting whether the network quality is lower than the preset threshold is not limited to the above description.
It can be understood that when the current network quality is poor or a large amount of data of a certain current application in an application layer needs to be sent to the network, the data of other applications cannot be sent to the network in time, which causes problems such as jamming or refresh failure of other applications. In order to avoid this phenomenon, the terminal may preferentially send data of some specific applications to the network when the current network quality is lower than a preset threshold or there is data that exceeds a preset size and needs to be sent to the physical layer, where the preset size may be 10MB, 30MB, or 50MB, and so on, and is not limited in particular herein, subject to actual requirements. Therefore, the terminal can detect whether the current network quality is lower than a preset threshold value or whether data exceeding a preset size needs to be sent to the physical layer or not, and if the current network quality is lower than the preset threshold value or the data exceeding the preset size needs to be sent to the physical layer, it is determined that the current network condition meets a preset condition; if the current network condition is determined not to meet the preset condition, the data can be sent according to the rule that the data which enters the queue firstly is sent firstly, and certain data does not need to be sent preferentially. It should be noted that how to process the data when determining that the current network condition does not satisfy the preset condition is not limited to the above description.
And when the current network condition meets the preset condition, the data of the application layer can be sent to the network layer.
202. In the network layer, whether the data meets the preset requirement is detected, if the data meets the preset requirement, the step is entered 203, and if the data does not meet the preset requirement, the step is entered 205.
As shown in fig. 3, the step of detecting whether the data meets the preset requirement may include:
2021. a first encoding of data is obtained.
2022. An encoding set is obtained, the encoding set comprising at least one second encoding.
2023. Judging whether the coding set comprises a second code which is the same as the first code, and if the coding set comprises the second code which is the same as the first code, entering 2024; if a second code that is the same as the first code is not included in the code set, 2025 is entered.
2024. And determining that the data meets the preset requirements.
2025, determining that the data does not meet the preset requirements.
203. The data is determined to be of a first type and sent to the data link layer.
204. At the data link layer, data of a first type is classified into a first priority class.
205. The data is determined to be of a second type and sent to the data link layer.
206. At the data link layer, the second type of data is classified into a second priority class.
When the network layer receives the data, a first encoding of the data may be obtained. Wherein, the first code uniquely refers to the application to which the data belongs. Each application in the terminal will have its corresponding code, and the code for each application is different, and the code may refer to the application uniquely. For example, the code for the X-mail application may be 0001, the code for the X-treasure application may be 0002, or the code for the X-fish live broadcast, such as 0003, etc.
In some embodiments, it may be preset that data of some applications in the terminal is preferentially sent into the network. For example, each application has a unique code corresponding to it; the terminal can obtain the codes of the selected application needing to send data preferentially, and then the codes are combined to form a code set; after the application generates data, the code corresponding to the application can be added to the data. After the data reaches the network layer, whether the code of the data is included in the code set can be determined by comparing the code of the data with the codes in the code set, and if the code set includes the code of the data, the data can be determined to meet the preset requirement, namely the data is the data which needs to be preferentially sent to the network; if the code set does not include the code of the data, the data can be determined not to meet the preset requirement, namely the data is the data which does not need to be preferentially sent to the network.
In particular, when an application is started, more or less data is always generated to be sent to the network. It is assumed that the data of the preset live-broadcast applications can be preferentially sent to the network, and therefore, the codes of all the live-broadcast applications can be combined into a code set. After the data reaches the network layer, whether the code of the data is included in the code set can be detected, if the data belongs to the data of the live broadcast application, the code of the data is necessarily included in the code set, and therefore the data can be determined to meet the preset requirement, namely the data is the data of the first type; if the data belongs to data of a non-live broadcast application, the encoding of the data is certainly not included in the encoding set, and therefore it can be determined that the data does not meet the preset condition, that is, the data is the data of the second type.
Particularly, it may also be preset that data of the shopping applications is preferentially sent to the network, and then codes of all the shopping applications in the terminal may be grouped together to form a code set, so that after the network layer receives the data, the code of the data is compared with the codes in the code set, and it is further determined whether the data is the data that needs to be preferentially sent to the network. The type of application or the priority of data sent to the network by which application is preset may be determined according to the actual situation, and is not limited specifically here.
When the network layer determines that the data is the data of the first type, the data can be marked, and then the data is sent to the data link layer; and when the network layer determines that the data is the second type of data, the data is not marked and is directly sent to the data link layer.
After the data link layer receives the data, the data can be identified as the first type of data or the second type of data by detecting whether the data has a flag through a filter of the transmission queue. Specifically, if the data is detected to have the mark, the data is determined to be the first type of data, and the data can be classified into a first priority class; if no marker is detected for the data, the data is determined to be of a second type, and the data may be classified into a second priority class. Wherein, the function of filter is: the corresponding data is divided into the corresponding priority classes of the sending queue according to the set division rule, which may be configured by the user, and the method is not specifically limited herein, subject to the actual requirement.
207. Data in the first priority class is sent to the physical layer.
208. And when the data in the first priority class is detected to be sent completely, sending the data in the second priority class to the physical layer.
In this embodiment, the order of transmission of data in the first priority class is higher than the second priority class. Therefore, the data in the first priority class can be sent to the physical layer, and after the data in the first priority class is sent, the data in the second priority class is sent to the physical layer.
In some embodiments, the terminal may be configured to send data of a certain application to the network preferentially according to the following steps. For example, a user opens a live application in a mobile phone to perform live broadcasting, and data generated by live broadcasting must be uploaded to a network instantly, so that a viewer can watch live content smoothly, and therefore, the data of a certain live application is preferably sent.
The encoding assumption for this live application is 10010, and the data mark value for this live application is 0x100, as follows:
iptables-t mangle-I OUTPUT-m owner-uid-owner 10010-j MARK-set-mark 0x100。
deleting the default queue on the network card interface, assuming that the interface name corresponding to the network card is wlan0 (because the data generated during the boot is less, the default queue can be deleted during the boot), as follows:
tc qdisc del dev wlan0root。
adding a sending queue on a wlan interface, wherein the sending queue defaults to have 3 subclasses which are respectively classid 1:1, classid 1:2 and classid 1: 3; respectively for high, medium and low priority categories, where the data in the high priority category is sent in a higher order than the medium priority category, and the data in the medium priority category is sent in a higher order than the low priority category (correspondingly, the default queue may be added immediately after deletion), as follows:
tc qdisc add dev wlan0root handle 1:prio。
configuring a filter to classify data marked with a 0x100mark value into high priority classes as follows:
tc filter add dev wlan0parent 1:protocol ip prio 1handle 0x100fw classid 1:1。
after the terminal is set according to the steps, the data of the live broadcast application can be preferentially sent to the network.
In this embodiment, when the current network condition meets the preset condition, the terminal may classify the data of the specific application into the first priority class and classify the data of the other applications into the second priority class by determining the type of the data, and the sending order of the first priority class is higher than that of the second priority class, so that the data of the specific application may be preferentially sent to the network, the queuing delay of the data of the specific application is reduced, and the experience of the user on the specific application is improved.
Referring to fig. 4, fig. 4 is a schematic view of a scenario of a data processing method according to an embodiment of the present application.
In some embodiments, a trigger button may be set at the terminal, and the trigger button is used to trigger whether to select the data priority transmission of a certain application. For example, the user may click the trigger button, i.e. may display a list of applications including all applications in the terminal. After a user clicks an application, a prompt message can be generated, wherein the prompt message is used for prompting the user whether to select to preferentially send the data of the application, and if so, the prompt message indicates that the user selects to preferentially send the data of the application to the network.
In some embodiments, the terminal may preset some target applications. Once the terminal detects that a certain target application is running, the data of the target application can be preferentially sent to the network when the current network condition of the terminal meets the preset condition. These target applications may be applications that need to send the generated data to the network on the fly. For example, a user opens a live application in a mobile phone to perform live broadcasting, and data generated by live broadcasting must be uploaded to a network in real time, so that viewers can watch live contents smoothly.
As shown in fig. 4, the following takes an example of preferentially sending data of a live application, where the live application includes an X fish live application. The following specifically takes the transmission of data of live X fish, data of non-live application X message, and data of X treasure as an example to assist in explaining the scheme of the present invention.
First, the terminal may obtain codes of live broadcast applications in advance, and then combine them into a code set, where the code of live broadcast of X fish is 0001, the code of live broadcast of X mail is 0002, and the code of live broadcast of X mail is 0003. Therefore 0001 is also included in the encoding set.
Suppose that the current network condition meets the preset condition, and the live X fish, the live X mail and the live X mail all generate data to be uploaded to a physical layer. Therefore, the data of the X letter, the data of the X treasure and the data of the X fish live broadcast of the application layer can be sent to the network layer. Data of the application layer needs to be sent to the network layer through the transport layer, but the processing of the transport layer is only to encapsulate the data, and therefore details are not described herein.
When the network layer receives the data, the received data may be identified. The method specifically comprises the following steps: acquiring a code and a code set of the data, detecting whether the code set comprises a code which is the same as the code of the data, if the code set comprises the code which is the same as the code of the data, determining that the data meets a preset requirement, namely the data is the data of a first type, and then marking the data; if the code set does not include the code which is the same as the code of the data, determining that the data does not meet the preset requirement, namely the data is the data of the second type, and not marking the data; wherein the first type of data needs to be sent preferentially into the network. Therefore, after the live data of the roe arrives at the network layer, the network layer can determine that the live data is the data of the first type through recognition, and therefore the data can be marked; after the data of the X letter and the X treasure reaches the network layer, the network layer can determine that the data is the second type of data through identification, and therefore the data can not be marked. When the network layer determines the type of data received, it may send it to the data link layer.
After receiving data, the data link layer may detect whether the data has a flag by using a filter, and if the data has the flag, determine that the data is of a first type, so that the data may be classified into a first priority class of a transmission queue; if the data does not have a marker, the data is determined to be of a second type, and therefore the data may be classified into a second priority class of the transmit queue. Therefore, when the live data of the Xfish reaches the data link layer, the filter can detect that the data has the mark, so that the data is determined to be the data of the first type, and therefore the data can be classified into the first priority class; and when the data of the X letter and the X treasure reaches the data link layer, the filter detects that the data does not have the mark, so that the data is determined to be the second type of data, and therefore the data can be classified into a second priority class. In this embodiment, the data in the first priority category is sent in a higher order than the data in the second priority category, so that the data in the first priority category may be sent to the physical layer, and after the data in the first priority category is sent, the data in the second priority category is sent to the physical layer. Because the data of the live X fish is divided into the first priority class and the data of the live X mail are divided into the second priority class, the data of the live X fish can be guaranteed to be preferentially sent to the network, the queuing time delay of the data of the live X fish is reduced, and the experience degree of a user on the application of the live X fish including the live X fish is improved.
In some embodiments, before the data in the second priority class is sent, if there are more data classified into the first priority class, sending of the data in the second priority class may be suspended first, and after the data in the first priority class is sent, the data in the second priority class may be sent again, so that the data of the specific application may be sent to the network preferentially, thereby avoiding frequent jamming and bringing better application experience to the user.
In some embodiments, the data is in the form of a plurality of data packets, and the data packets in the transmission queue are transmitted to the network in such a manner that one data packet is transmitted and then another data packet is transmitted. Therefore, if there are more packets classified into the first priority class before the plurality of packets in the second priority class are completely transmitted, the packets in the first priority class may be transmitted after the transmission of the packets being transmitted is completed.
In this embodiment, when the current network condition meets the preset condition, the terminal may classify the data of the specific application into the first priority class and classify the data of the other applications into the second priority class by determining the type of the data, and the sending order of the first priority class is higher than that of the second priority class, so that the data of the specific application may be preferentially sent to the network, the queuing delay of the data of the specific application is reduced, and the experience of the user on the specific application is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present disclosure. The data processing apparatus 300 may include: an application layer transmission module 301, a network layer transmission module 302 and a data link layer transmission module 303.
An application layer sending module 301, configured to send data of an application layer to a network layer when a current network condition meets a preset condition.
A network layer sending module 302, configured to determine, at the network layer, a type of the data, and send the data to a data link layer.
A data link layer sending module 303, configured to, at a data link layer, divide the data into corresponding priority classes of a sending queue according to the type of the data, and send the data in the corresponding priority classes of the sending queue to a physical layer according to a sending order determined by the sending queue.
In some embodiments, the network layer sending module 302 may be specifically configured to:
detecting whether the data meet preset requirements or not;
and if the data meet the preset requirement, determining that the data are the data of the first type.
The data link layer sending module 303 may be specifically configured to:
the first type of data is classified into a first priority class.
The network layer sending module 302 may be further specifically configured to:
and if the data does not meet the preset requirement, determining that the data is the data of the second type.
The data link layer sending module 303 may be further specifically configured to:
the second type of data is classified into a second priority class.
The sending order of the data in the first priority class is higher than that in the second priority class, and the data link layer sending module 303 may specifically be configured to:
sending the data in the first priority class to a physical layer;
and when the data in the first priority category is detected to be sent completely, sending the data in the second priority category to a physical layer.
In some embodiments, the network layer sending module 302 may be further specifically configured to:
obtaining a first code of the data;
acquiring a code set, wherein the code set comprises at least one second code;
judging whether a second code which is the same as the first code is included in the code set;
if the code set comprises a second code which is the same as the first code, determining that the data meets a preset requirement;
and if the code set does not comprise a second code which is the same as the first code, determining that the data does not meet the preset requirement.
As shown in fig. 6, in some embodiments, the apparatus may further include:
a detecting module 304, configured to detect whether a current network quality is lower than a preset threshold; and if the current network quality is detected to be lower than the preset threshold value, determining that the current network condition meets the preset condition.
In some embodiments, the detection module 304 may be further configured to: detecting whether data exceeding a preset size exists at present and needing to be sent to a physical layer; and if the data with the size exceeding the preset size is detected to be sent to the physical layer, determining that the current network condition meets the preset condition.
In this embodiment, when the current network condition meets the preset condition, the terminal may classify the data of the specific application into the first priority class and classify the data of the other applications into the second priority class by determining the type of the data, and the sending order of the first priority class is higher than that of the second priority class, so that the data of the specific application may be preferentially sent to the network, the queuing delay of the data of the specific application is reduced, and the experience of the user on the specific application is improved.
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer is caused to execute the steps in the data processing method provided by the present embodiment.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the steps in the data processing method provided in this embodiment by calling the computer program stored in the memory.
For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Referring to fig. 7, fig. 7 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.
The mobile terminal 400 may include components such as a microphone 401, memory 402, processor 403, and the like. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 7 is not intended to be limiting of mobile terminals and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The microphone 401 may be used to pick up speech uttered by the user, etc.
The memory 402 may be used to store applications and data. The memory 402 stores applications containing executable code. The application programs may constitute various functional modules. The processor 403 executes various functional applications and data processing by running the application program stored in the memory 402.
The processor 403 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing an application program stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the mobile terminal.
In this embodiment, the processor 403 in the mobile terminal loads the executable code corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 403 runs the application programs stored in the memory 402, thereby implementing the steps:
when the current network condition meets a preset condition, sending the data of the application layer to the network layer;
determining the type of the data in a network layer, and sending the data to a data link layer;
and at a data link layer, dividing the data into corresponding priority classes of a sending queue according to the type of the data, and sending the data in the corresponding priority classes of the sending queue to a physical layer according to a sending sequence determined by the sending queue.
Referring to fig. 8, a mobile terminal 500 may include a microphone 501, a memory 502, a processor 503, an input unit 504, an output unit 505, a speaker 506, and the like.
The microphone 501 may be used to pick up speech uttered by a user, etc.
The memory 502 may be used to store applications and data. Memory 502 stores applications containing executable code. The application programs may constitute various functional modules. The processor 503 executes various functional applications and data processing by running an application program stored in the memory 502.
The processor 503 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing an application program stored in the memory 502 and calling data stored in the memory 502, thereby performing overall monitoring of the mobile terminal.
The input unit 504 may be used to receive input numbers, character information, or user characteristic information (such as a fingerprint), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The output unit 505 may be used to display information input by or provided to a user and various graphic user interfaces of the mobile terminal, which may be configured by graphics, text, icons, video, and any combination thereof. The output unit may include a display panel.
In this embodiment, the processor 503 in the mobile terminal loads the executable code corresponding to the process of one or more application programs into the memory 502 according to the following instructions, and the processor 503 runs the application programs stored in the memory 502, thereby implementing the steps:
when the current network condition meets a preset condition, sending the data of the application layer to the network layer;
determining the type of the data in a network layer, and sending the data to a data link layer;
and at a data link layer, dividing the data into corresponding priority classes of a sending queue according to the type of the data, and sending the data in the corresponding priority classes of the sending queue to a physical layer according to a sending sequence determined by the sending queue.
In some embodiments, the processor 503, when performing the step of determining the type of the data, may perform: detecting whether the data meet preset requirements or not; and if the data meet the preset requirement, determining that the data are the data of the first type. The processor 503, when performing the step of classifying the data into corresponding priority classes of a transmission queue according to the type of the data, may perform: the first type of data is classified into a first priority class.
In some embodiments, the processor 503 may further perform: and if the data does not meet the preset requirement, determining that the data is the data of the second type. The processor 503, when performing the step of classifying the data into corresponding priority classes of a transmission queue according to the type of the data, may perform: the second type of data is classified into a second priority class.
In some embodiments, the sending order of the data in the first priority class is higher than that of the second priority class, and when the processor 503 executes the step of sending the data in the corresponding priority class of the sending queue to the physical layer according to the sending order determined by the sending queue, it may execute: sending the data in the first priority class to a physical layer; and when the data in the first priority class is detected to be sent completely, sending the data in the second priority class to a physical layer.
In some embodiments, when the processor 503 performs the step of detecting whether the data meets the preset requirement, it may perform: obtaining a first code of the data; acquiring a code set, wherein the code set comprises at least one second code; judging whether a second code which is the same as the first code is included in the code set; if the code set comprises a second code which is the same as the first code, determining that the data meets a preset requirement; and if the second code which is the same as the first code is not included in the code set, determining that the data does not meet the preset requirement.
In some embodiments, before the step of sending the data of the application layer to the network layer when the current network condition satisfies the preset condition, the processor 503 may further perform: detecting whether the current network quality is lower than a preset threshold value; and if the current network quality is detected to be lower than the preset threshold value, determining that the current network condition meets the preset condition.
In some embodiments, before the step of sending the data of the application layer to the network layer when the current network condition satisfies the preset condition, the processor 503 may further perform: detecting whether data exceeding a preset size exists at present and needing to be sent to a physical layer; and if the data with the size exceeding the preset size is detected to be sent to the physical layer, determining that the current network condition meets the preset condition.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the data processing method, and are not described herein again.
The data processing apparatus provided in the embodiment of the present application and the data processing method in the above embodiment belong to the same concept, and any method provided in the embodiment of the data processing method may be run on the data processing apparatus, and a specific implementation process thereof is described in the embodiment of the data processing method in detail, and is not described herein again.
It should be noted that, for the data processing method described in the embodiment of the present application, it can be understood by those skilled in the art that all or part of the process of implementing the data processing method described in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and during the execution, the process of the embodiment of the data processing method can be included. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the data processing apparatus according to the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The foregoing describes in detail a data processing method, an apparatus, a storage medium, and an electronic device provided in an embodiment of the present application, and specific examples are applied herein to explain the principles and embodiments of the present invention, and the above description of the embodiments is only used to help understanding the method and its core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (9)

1. A data processing method, comprising:
deleting a default queue, adding the default queue into a sending queue, and adding data of an application layer into the sending queue, wherein the sending queue comprises a first priority class and a second priority class, and the sending sequence of the first priority class is higher than that of the second priority class;
when the current network condition does not meet the preset condition, the data of the application layer is put into the second priority class and is sent to the physical layer according to the preset rule;
when the current network condition meets a preset condition, sending the data of the application layer to the network layer;
determining the type of the data in the network layer, and sending the data to a data link layer;
at the data link layer, dividing the data into corresponding priority classes of a sending queue according to the types of the data, and sending the data in the first priority class to the physical layer; and when the data in the first priority class is detected to be sent completely, sending the data in the second priority class to the physical layer.
2. The data processing method of claim 1, wherein the step of determining the type of the data comprises:
detecting whether the data meet preset requirements or not;
if the data meet the preset requirements, determining that the data are the data of the first type;
the step of classifying the data into corresponding priority classes of a transmission queue according to the type of the data includes:
the first type of data is classified into a first priority class.
3. The data processing method of claim 2, wherein the method further comprises:
if the data do not meet the preset requirements, determining that the data are of a second type;
the step of classifying the data into corresponding priority classes of a transmission queue according to the type of the data includes:
the second type of data is classified into a second priority class.
4. The data processing method according to claim 2, wherein the step of detecting whether the data meets a preset requirement comprises:
obtaining a first code of the data;
acquiring a code set, wherein the code set comprises at least one second code;
judging whether a second code which is the same as the first code is included in the code set or not;
if the code set comprises a second code which is the same as the first code, determining that the data meets a preset requirement;
and if the second code which is the same as the first code is not included in the code set, determining that the data does not meet the preset requirement.
5. The data processing method according to any one of claims 1 to 4, wherein before the step of sending the data of the application layer to the network layer when the current network condition satisfies the preset condition, the method further comprises:
detecting whether the current network quality is lower than a preset threshold value;
and if the current network quality is detected to be lower than the preset threshold value, determining that the current network condition meets the preset condition.
6. The data processing method according to any one of claims 1 to 4, wherein before the step of sending the data of the application layer to the network layer when the current network condition satisfies the preset condition, the method further comprises:
detecting whether data exceeding a preset size exists at present and needs to be sent to the physical layer;
and if the data with the size exceeding the preset size is detected to be required to be sent to the physical layer, determining that the current network condition meets the preset condition.
7. A data processing apparatus, comprising:
the device comprises a deleting module, a sending module and a sending module, wherein the deleting module is used for deleting a default queue, adding the default queue into a sending queue and adding data of an application layer into the sending queue, the sending queue comprises a first priority class and a second priority class, and the sending sequence of the first priority class is higher than that of the second priority class;
the first sending module of the application layer is used for putting the data of the application layer into the second priority class and sending the data to the physical layer according to a preset rule when the current network condition does not meet the preset condition;
the second sending module of the application layer is used for sending the data of the application layer to the network layer when the current network condition meets the preset condition;
a network layer sending module, configured to determine, at the network layer, a type of the data, and send the data to a data link layer;
a data link layer sending module, configured to divide, at the data link layer, the data into corresponding priority classes of a sending queue according to the type of the data, and send the data in the first priority class to the physical layer; and when the data in the first priority class is detected to be sent completely, sending the data in the second priority class to the physical layer.
8. A storage medium having stored therein a computer program which, when run on a computer, causes the computer to execute the data processing method of any one of claims 1 to 6.
9. An electronic device, characterized in that the electronic device comprises a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to execute the data processing method according to any one of claims 1 to 6 by calling the computer program stored in the memory.
CN201810949914.0A 2018-08-20 2018-08-20 Data processing method, data processing device, storage medium and electronic equipment Active CN108989244B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810949914.0A CN108989244B (en) 2018-08-20 2018-08-20 Data processing method, data processing device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810949914.0A CN108989244B (en) 2018-08-20 2018-08-20 Data processing method, data processing device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN108989244A CN108989244A (en) 2018-12-11
CN108989244B true CN108989244B (en) 2022-08-05

Family

ID=64554161

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810949914.0A Active CN108989244B (en) 2018-08-20 2018-08-20 Data processing method, data processing device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN108989244B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113949674A (en) * 2020-06-29 2022-01-18 成都鼎桥通信技术有限公司 Data transmission method, system, network equipment, media equipment and receiving equipment
CN112752284B (en) * 2020-12-30 2022-11-04 惠州Tcl移动通信有限公司 Application network optimization method, device, equipment and medium under double WIFI

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557386A (en) * 2008-04-10 2009-10-14 华为技术有限公司 Method and device for sending data and method and device for receiving data
CN101309195A (en) * 2008-06-18 2008-11-19 华为技术有限公司 Method and apparatus for guarantee quality of service of secure socket layer of virtual private network
CN103929490A (en) * 2014-04-28 2014-07-16 中国科学院微电子研究所 Data transmission method for body area network system
CN107846363A (en) * 2017-09-06 2018-03-27 天津大学 Space flight Ethernet time triggered compatible bus business multiplexing of transmission method
CN107743096B (en) * 2017-10-13 2021-06-08 北京小米移动软件有限公司 Network optimization method, device, terminal and storage medium
CN107612846A (en) * 2017-11-01 2018-01-19 北京天创凯睿科技有限公司 A kind of business datum adaptive transmission method and device

Also Published As

Publication number Publication date
CN108989244A (en) 2018-12-11

Similar Documents

Publication Publication Date Title
CN108200134B (en) Request message management method and device, and storage medium
CN108023808B (en) Message distribution method and device in application program
CN105141496B (en) A kind of instant communication message playback method and device
CN109152095B (en) Wireless network connection method for terminal
US20170324859A1 (en) Information processing method, terminal, and computer-readable storage medium
CN106201409B (en) Processing method and system for application program operation interface
CN110035004B (en) User name card sharing method, friend adding method and related device
CN108023829B (en) Message processing method and device, storage medium and electronic equipment
WO2021109767A1 (en) Network device and method for reducing transmission delay therefor
CN108989244B (en) Data processing method, data processing device, storage medium and electronic equipment
CN107302493B (en) Message processing method, message processing device and intelligent terminal
US11671678B2 (en) Method and device, equipment, and storage medium for data processing
CN111796747B (en) Multi-open application processing method and device and electronic equipment
CN111526081B (en) Mail forwarding method, device, equipment and storage medium
CN108933947B (en) Bullet screen display method and device
CN114726947A (en) Message display method and device, user terminal and readable storage medium
CN112333114B (en) Data transmission method, device, storage medium, terminal and network access point equipment
CN114285906B (en) Message processing method and device, electronic equipment and storage medium
CN107402816B (en) Method, device, terminal and storage medium for adjusting work queue of touch screen
CN107888772B (en) Method, device and storage medium for determining configuration information
CN107729136B (en) Processing priority configuration method and device based on FPGA
CN105991417B (en) Method and device for receiving dynamic information of friends in social network
CN111901561B (en) Video data processing method, device and system in monitoring system and storage medium
CN114363379A (en) Vehicle data transmission method and device, electronic equipment and medium
CN109144639B (en) Bullet screen message distribution method, device, 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