CN107070811B - Data sending method, terminal and data processing system - Google Patents
Data sending method, terminal and data processing system Download PDFInfo
- Publication number
- CN107070811B CN107070811B CN201710108545.8A CN201710108545A CN107070811B CN 107070811 B CN107070811 B CN 107070811B CN 201710108545 A CN201710108545 A CN 201710108545A CN 107070811 B CN107070811 B CN 107070811B
- Authority
- CN
- China
- Prior art keywords
- data
- priority
- achievement rate
- time window
- network environment
- 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
- 238000012545 processing Methods 0.000 title claims abstract description 95
- 238000000034 method Methods 0.000 title claims abstract description 54
- 230000005540 biological transmission Effects 0.000 claims abstract description 190
- 230000008569 process Effects 0.000 claims description 22
- 238000001514 detection method Methods 0.000 claims description 16
- 238000011084 recovery Methods 0.000 claims description 13
- 230000008859 change Effects 0.000 claims description 8
- 230000008901 benefit Effects 0.000 abstract description 6
- 230000000694 effects Effects 0.000 abstract description 6
- 238000004364 calculation method Methods 0.000 description 18
- 238000012546 transfer Methods 0.000 description 18
- 238000010586 diagram Methods 0.000 description 12
- 230000004044 response Effects 0.000 description 7
- 238000012544 monitoring process Methods 0.000 description 5
- 238000012360 testing method Methods 0.000 description 5
- 230000003828 downregulation Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000009825 accumulation Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 238000000638 solvent extraction Methods 0.000 description 2
- 230000003827 upregulation Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000005034 decoration Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2425—Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
- H04L47/2433—Allocation of priorities to traffic types
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a data transmission method, a terminal and a data processing system, which divide a network environment into a plurality of different grades, divide data into a plurality of priority levels according to importance degree, detect which grade the current network environment is in according to the transmission condition of the data by the terminal, select the priority level according to the preset corresponding relation according to the current network environment grade, and transmit the data to be transmitted with the selected priority level according to the set sequence, such as the priority sequence or the time sequence. Therefore, when data transmission is carried out, priority transmission of important data can be realized only by defining the important data as data with high priority, transmission effectiveness of the important data is effectively guaranteed, user experience is improved, benefits of a service provider are guaranteed, and a win-win effect of a user and the service provider is achieved.
Description
Technical Field
The present invention relates to the technical field of data transmission, and in particular, to a data transmission method, a terminal, and a data processing system.
Background
With the continuous development of communication technology, data transmission of people in daily life is more and more frequent. The data transmission technology adopted at present is to transmit the data generated by the user together according to the time sequence, and meanwhile, when the server processes the data, the server processes the data according to the sequence of the received data. However, it is known that when the network environment is not ideal, a data transmission failure often occurs. Some important data, if it fails to be transmitted, will not only affect the user's experience, but also may cause a practical loss of the service provider, for example: when a user conducts actions such as games and shopping, if commodity purchase information interaction fails, the user is likely to not purchase the commodity any more, and huge loss is caused to a service provider. Therefore, it is necessary to provide a new data transmission method to ensure that important data can be effectively transmitted even under the condition that the network environment is not ideal, so as to improve the user experience and ensure the benefits of the service provider.
Disclosure of Invention
The invention provides a data sending method, a terminal and a data processing system, which aim to solve the problem that the transmission effectiveness of important data cannot be ensured under the condition that the network environment is not ideal in the existing data transmission technology.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method of data transmission, comprising:
detecting the current network environment level based on the data sending condition;
selecting a priority based on the current network environment level;
and sending the data to be sent with the selected priority.
Further, the detecting the current network environment level based on the data transmission condition comprises:
counting the data transmission condition in the preset time period according to the preset time period;
determining an achievement rate statistical period and the time length of a current time window, determining a statistical time point according to the achievement rate statistical period, and determining the current time window according to the statistical time point and the time length;
calculating the data transmission achievement rate in the current time window according to the data transmission condition recorded in the current time window;
and obtaining the current network environment level according to the corresponding relation between the preset data transmission achievement rate and the network environment level and the data transmission achievement rate.
Further, the data transmission method further includes: and adjusting the time length of the achievement rate statistical period and the time window according to the change trend between the data transmission achievement rates calculated by the adjacent statistical periods.
Further, the adjusting the time length of the achievement rate statistic period and the time window according to the variation trend between the data transmission achievement rates calculated by the adjacent statistic periods comprises:
calculating the data transmission achievement rate in a time window corresponding to the current achievement rate statistical period;
calculating the difference between the data transmission achievement rate in the time window corresponding to the current achievement rate statistical period and the data transmission achievement rate in the time window corresponding to the previous achievement rate statistical period;
if the difference is larger than or equal to a first threshold value, reducing the time length of the achievement rate statistical period and the time window;
if the difference value is smaller than the first threshold value and larger than or equal to the second threshold value, controlling the time length of the achievement rate statistical period and the time window to be unchanged;
and if the difference value is smaller than a second threshold value, increasing the time length of the achievement rate statistical period and the time window.
Further, the calculating the data transmission achievement rate in the current time window comprises:
acquiring the number of data transmission pieces of a terminal in a current time window;
acquiring the number of data which are received by the terminal and fed back by the server in a current time window;
and calculating the ratio of the number of the data fed back by the server received by the terminal in the current time window to the number of the data sent by the terminal in the current time window as the data transmission achievement rate.
Further, the data transmission method further includes:
when the network environment level detected at N (N > 2) continuous statistical time points does not meet the requirement of the preset network environment level, sending control data to a server; the control data is used for informing the server to select and process data according to a preset data processing strategy;
when the network environment grades detected at M (M > 2) continuous statistical time points all meet the requirement of a preset network environment grade, sending recovery control data to the server; the recovery control data is used to inform the server to recover processing of all data.
Further, after said selecting a priority based on the current network environment level, further comprising:
determining the sending proportion of each data to be sent with different priorities under the current network environment level based on the current network environment level and a preset strategy;
and transmitting each data to be transmitted based on the transmission proportion and the priority of each data to be transmitted.
A terminal, comprising:
the network detection module is used for detecting the current network environment level based on the data sending condition;
a priority determination module for selecting a priority based on the current network environment level;
and the data sending module is used for sending the data to be sent with the priority selected by the priority determining module.
Further, the network detection module comprises:
the data sending recording submodule is used for regularly recording the data sending condition in the preset time period according to the preset time length;
the processing submodule is used for determining an achievement rate statistical period and the time length of a current time window, determining a statistical time point according to the achievement rate statistical period, and determining the current time window according to the statistical time point and the time length;
the data transmission achievement rate calculating submodule is used for calculating the data transmission achievement rate in the current time window according to the data sending condition recorded in the current time window;
and the network environment judgment submodule is used for obtaining the current network environment level according to the corresponding relation between the preset data transmission achievement rate and the network environment level and the data transmission achievement rate.
Further, the terminal further includes:
the data proportion determining submodule is used for determining the sending proportion of each piece of data to be sent with different priorities under the current network environment level based on the current network environment level and a preset strategy;
and the data sending submodule is used for sending each data to be sent based on the sending proportion and the priority of each data to be sent.
A data processing system comprising: a server and any one of the terminals;
the server receives data sent by the terminal; processing the received data according to a preset processing strategy; and sending the processed result data to the terminal.
Further, the preset processing strategy comprises:
carrying out priority processing on the received data with the priority higher than the preset priority;
and sequentially processing the received other data according to the preset quantity proportion of the data with different priorities.
Further, the preset processing policy further includes:
when unprocessed data of a certain priority exceeds a preset third threshold, increasing the proportion of the number of the data of the priority;
and when the unprocessed data of a certain priority is lower than a preset fourth threshold, reducing the proportion of the data quantity of the priority.
Advantageous effects
The data transmission method, the terminal and the data processing system provided by the invention can divide the network environment into a plurality of different grades, the terminal can detect which grade the current network environment is in according to the transmission condition of the data, select the priority according to the current network environment grade according to the preset corresponding relation, and transmit the data to be transmitted with the selected priority according to the set sequence, such as the priority sequence or the time sequence. Therefore, when data transmission is carried out, priority transmission of important data can be realized only by defining the important data as data with high priority, transmission effectiveness of the important data is effectively guaranteed, user experience is improved, benefits of a service provider are guaranteed, and a win-win effect of a user and the service provider is achieved.
Drawings
Fig. 1 is a schematic flow chart of a data transmission method according to a first embodiment of the present invention;
fig. 2 is a schematic flowchart of detecting a current network environment level based on a data transmission condition according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a network detection module according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data transmission achievement rate calculation sub-module according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of a network detection module according to a second embodiment of the present invention;
fig. 7 is a schematic structural diagram of an adjustment submodule according to a second embodiment of the present invention;
fig. 8 is a schematic structural diagram of a terminal according to a second embodiment of the present invention;
fig. 9 is a schematic structural diagram of an alternative terminal according to a second embodiment of the present invention;
FIG. 10 is a block diagram of a data processing system according to a third embodiment of the present invention;
fig. 11 is a schematic structural diagram of an alternative server according to a third embodiment of the present invention;
fig. 12 is a schematic flow chart illustrating a method for setting a terminal display module according to a third embodiment of the present invention.
Detailed Description
The first embodiment is as follows:
in order to ensure that a terminal can also achieve effective transmission of important data under the condition that a network environment is not ideal, the present embodiment provides a method for data transmission based on data priority, referring to fig. 1, where fig. 1 is a schematic flow chart of a data transmission method provided by the present embodiment, and the method includes:
s101: detecting the current network environment level based on the data sending condition;
in this embodiment, in order to define the quality of the network environment, the network environment is divided into a plurality of different levels, the number of the divided levels may be determined according to actual test requirements, and the more the number of the divided levels is, the more detailed the quality of the network environment can be reflected.
It should be noted that, in this embodiment, a preset association relationship exists between the network environment level and the data transmission situation, and the association relationship enables the current network environment level to be determined according to the data transmission situation.
In this embodiment, the current network environment level may be detected periodically, and the current network environment level is detected once every other period of time, for example, if the period is set to 100ms, the current network environment level is detected once every 100ms according to the data transmission condition. Therefore, the terminal can continuously and automatically detect the current network environment level, and is more intelligent.
S102: selecting a priority based on a current network environment level;
it should be understood that, the terminal generates data to be transmitted in the application process, and in this embodiment, the data to be transmitted generated by the terminal is prioritized according to a predefined partitioning rule according to the importance of the data. For example, taking a terminal as an example of game application, according to a predefined division rule, according to the importance of data, the priority of important data such as data related to revenue, such as payment and purchase in a user game, account behavior data or control data can be defined as the highest level, the priority of more important data such as scene basic data, player basic data and the like loaded in a game can be defined as the second highest level, and the priority of the rest data can be defined as common.
It should be noted that the division of the data priority can be performed according to the actual requirement, and the more the number of the divided priorities is, the finer the control of the data to be transmitted can be realized.
In this embodiment, which priority to be sent data can be selected based on the current network environment level may be sent, that is, the priority of the data to be sent is selected once according to the current network environment level, and only the data to be sent with the selected priority is sent. For example, the network environment level is divided into a good level and a poor level 3, when the current network environment level is detected as good, all the priorities are selected, and at the moment, data to be sent of all the priorities are sent; when the current network environment level is detected to be medium, selecting the highest level and the second highest level in the priority, and only transmitting data to be transmitted with the priority of the highest level and the second highest level; and when the current network environment level is detected to be poor, selecting the highest level in the priority levels, and only transmitting the data to be transmitted with the highest level of the priority levels.
S103: and transmitting the data to be transmitted with the selected priority.
In this embodiment, when data to be sent corresponding to the selected priority is sent, the data to be sent with a high priority may be sent preferentially according to the order of the priorities. For example, if the selected priorities are priority 1, priority 2 and priority 3 in sequence from high to low, the data to be transmitted corresponding to priority 1 is transmitted first, the data to be transmitted corresponding to priority 2 is transmitted second, and the data to be transmitted corresponding to priority 3 is transmitted last.
In this embodiment, when the data to be sent corresponding to the selected priority is sent, the data to be sent may also be sent according to the time sequence of each data to be sent. For example, if the selected priority is priority 1, priority 2, and priority 3, the data corresponding to priority 1, priority 2, and priority 3 are sequentially transmitted according to the sequence generated by the terminal.
In this embodiment, step S101: detecting the current network environment level based on the data transmission condition further includes, referring to fig. 2:
s201: recording the data transmission condition in the preset time period according to the preset time period;
it should be understood that, in this embodiment, the statistics on the data transmission condition may be performed automatically, and after every other preset time period, the data transmission condition in the time period is detected automatically, and the data transmission condition in the time period is recorded. For example, if the preset time duration is 100ms, the data transmission condition within the 100ms will be automatically recorded every 100 ms.
It should be noted that, in an extreme case in this embodiment, the preset duration may be set to be infinite, and the terminal records the data transmission condition at every moment. That is, after the terminal sends a piece of data to be sent or receives a piece of data fed back by the server, the terminal records sending a piece of data or receiving a piece of data.
S202: determining an achievement rate statistical period and the time length of a current time window, determining a statistical time point according to the achievement rate statistical period, and determining the current time window according to the statistical time point and the time length;
in this embodiment, the detection of the current network environment level may be performed periodically, wherein the statistical time point of this time can be determined by adding the current achievement rate statistical period to the last statistical time point, for example, the last time at t0Data transmission achievement rate statistics is carried out at the moment, and the current achievement rate statistical period is t1This time at t0+t1Data transmission achievement rate statistics is carried out at the moment.
In this embodiment, the time window refers to a time period in which the time length before the statistical time point is the time length of the time window, for example, the current statistical time point is t2At the moment, the time length of the current time window is t, and the current time window is t2Time t to t2The time of day.
S203: calculating the data transmission achievement rate in the current time window according to the data transmission condition recorded in the current time window;
in this embodiment, the data sending condition mainly includes: and in the current time window, the total number of data transmission pieces of the terminal and the number of data fed back by the server received by the terminal.
When calculating the data transmission achievement rate in the current time window, only the number of data transmission pieces of the terminal in the current time window and the number of data pieces of the terminal receiving the server feedback in the current time window need to be obtained. At this time, the ratio of the number of data pieces received by the terminal in the current time window and fed back by the server to the number of data sending pieces in the current time window is calculated, and the ratio is the data transmission achievement rate in the current time window.
In fact, in order to ensure the number of data transmission pieces of the terminal in the current time window and the accuracy of the number of data pieces of the terminal receiving the feedback from the server in the current time window, the terminal records the data ID of the transmitted data each time the terminal transmits the data; each time data fed back by the server is received, the data ID of the received data is also recorded. In this way, the number of data IDs of the data transmitted and the number of data IDs of the received data in the time period represented by the time window may be statistically recorded according to the time window.
It should be noted that, in this embodiment, the received data of the server is necessarily feedback of a certain piece of sending data of the terminal, that is, the data fed back by the server is necessarily data sent by a corresponding terminal, for example, the data fed back by the server is basic data for loading a certain application scenario, and then the terminal must send a request data for loading a certain application scenario to the server before. Namely: if the data A sent by the server is received, the terminal must send data A' corresponding to the data A to the server before.
In a specific implementation manner of this embodiment, when calculating the data transfer achievement rate in a time window, the data sent by the corresponding terminal and the data fed back by the server may be set as follows: only when the corresponding terminal sending data and the server feedback data are both in the same time window, the server feedback data are counted in the number of data fed back by the terminal to the server, that is, when the server feedback data and the corresponding terminal sending data are not in the same time window, the server feedback data are not used for calculating the data transmission achievement rate, and at this time, the data ID of the server feedback data are not recorded.
For example, the current time window is t2Time t to t2At time t, the terminal1Receiving data A (t) fed back by the server at the moment1At a time t2Time t to t2Within time) and the transmission data a' of the terminal corresponding to the data a is at t2-T(T>t), i.e. the transmission data a' is not in the current time window, the terminal does not record the data ID of the data a, i.e. the data a is not counted in the number of received pieces.
S204: and obtaining the current network environment level according to the corresponding relation between the preset data transmission achievement rate and the network environment level and the data transmission achievement rate.
That is, the preset correlation between the network environment level and the data transmission condition is the corresponding relationship between the preset data transmission achievement rate and the network environment level. The corresponding relation can be stored in the local terminal in the form of a chart and the like. For example, referring to table one, 5 network environment levels are set, and the corresponding network environment level can be obtained according to which range the calculated data transmission achievement rate falls into. In fact, the detection of the terminal to the level without the network can also be obtained by detecting whether the terminal opens wifi and flow, and if the wifi and flow are not opened, the data transmission achievement rate does not need to be counted and calculated.
Watch 1
Data transfer achievement rate range | Network environment level |
The data transmission achievement rate is 0 | Non-network |
The achievement rate of data transmission is more than 0 and less than 30 percent | Very poor |
The achievement rate of data transmission is more than or equal to 30% and less than 80% | Poor network |
The achievement rate of data transmission is more than or equal to 80% and less than 99% | Network good |
The achievement rate of data transmission is more than or equal to 99 percent | Is unobstructed |
In this embodiment, in order to better reflect the changing and unusual network environment, the monitoring strength of the network environment is strengthened or weakened according to the changing situation of the network environment, and the achievement rate statistical period and the time length of the time window can be adjusted. Specifically, the time length of the achievement rate statistic period and the time window may be adjusted according to the variation trend between the data transmission achievement rates calculated by the adjacent statistic periods.
For example, after calculating the data transmission achievement rate in the time window corresponding to the current achievement rate statistical period, the difference between the data transmission achievement rate in the time window corresponding to the current achievement rate statistical period and the data transmission achievement rate in the time window corresponding to the previous achievement rate statistical period may be calculated.
At this time, if the difference is greater than or equal to the preset first threshold, the time length of the achievement rate statistic period and the time window is reduced. For example, if the first threshold is set to 20%, the time length of the achievement rate statistic period and the time window is reduced when the difference is greater than or equal to 20%.
And if the difference is smaller than the first threshold and larger than or equal to the second threshold, controlling the achievement rate statistical period and the time length of the time window to be unchanged. For example, if the first threshold is set to 20% and the second threshold is set to 10%, the time length of the achievement rate statistic period and the time window is kept unchanged when the difference is less than 20% and greater than or equal to 10%.
If the difference is less than the second threshold, the time length of the achievement rate statistics period and the time window is adjusted to be larger. For example, if the second threshold is set to 10%, the time length of the achievement rate statistic period and the time window is increased when the difference is less than 10%.
It should be understood that the above-mentioned adjusting method only provides a specific implementation manner for adjusting the time lengths of the achievement rate statistics period and the time window in the present embodiment, and in fact, there are many specific implementation manners for adjusting the time lengths of the achievement rate statistics period and the time window according to the variation trend between the data transmission achievement rates calculated by adjacent statistics periods, for example, the time lengths of the achievement rate statistics period and the time window can also be adjusted by determining the slope of the variation curve of the data transmission achievement rate.
It should be noted that, in the embodiment, there is no inevitable size relationship between the time length of the time window and the achievement rate statistical period, that is, the time length of the time window may be smaller than the achievement rate statistical period, or may be greater than or equal to the achievement rate statistical period.
In this embodiment, the adjustment of the achievement rate statistic period and the time length of the time window may be an adjustment conforming to the change of an exponential curve, for example, the achievement rate statistic period is adjusted to be smaller by 100ms for the first time, 50ms for the second time, and 25ms for the third time, …; it is also possible to adapt to linear changes, for example, to reduce the achievement rate statistics period by 100ms each time.
In this embodiment, the adjustment of the time length of the achievement rate statistic period and the time window has a maximum value and a minimum value, that is, after the time length of the achievement rate statistic period or the time window is already the maximum value, the time length of the achievement rate statistic period or the time window cannot be increased; after the time length of the achievement rate statistics period or time window has been the minimum value, the time length of the achievement rate statistics period or time window cannot be adjusted down any more.
It should be understood that the maximum and minimum values of the time lengths of the achievement rate statistics period and the time window are related to the current network environment, the data transmission rate, the terminal usage, the terminal configuration factor, and the like, in engineering applications, a large amount of actual or simulation tests are often performed to obtain a large amount of test data, and screening and comparing are performed to determine a better maximum value and a better minimum value of the time lengths of the achievement rate statistics period and the time window, respectively.
It should also be understood that in engineering applications, the initial achievement rate statistics period value and the time length value of the initial time window are also typically determined by the above-described method.
It is noted that, in order to save the storage space of the terminal, in the embodiment, when the duration of the recorded data transmission situation exceeds the maximum value of the time length of the maximum time window, the recorded data transmission situation may be deleted.
In this embodiment, if the current network environment level is always low, that is, the current network environment is always poor, in order to ensure the receiving effectiveness of the important data, control data with a high priority may be generated to inform the server to perform the selection processing on the data according to the preset data processing policy, so that the server only performs processing feedback on the important data, thereby releasing valuable network resources. Meanwhile, after the network environment is restored to a good state, recovery control data with a high priority can be generated to inform the server to recover processing of all data.
Specifically, the terminal may be configured to send the control data to the server when the network environment levels detected at N (N > 2) consecutive statistical time points do not meet the preset network environment level requirement, and send the recovery control data to the server when the network environment levels detected at M (M > 2) consecutive statistical time points all meet the preset network environment level requirement.
For example, when the network environment levels detected at 10 continuous statistical time points are not optimal, control data is sent to the server; and when the network environment levels detected at the continuous 10 statistical time points are all optimal, sending recovery control data to the server.
In this embodiment, when the server performs the selective processing on the data according to the preset data processing policy, the server may not process the data with the priority lower than a certain limit value, and only process the data with the priority greater than or equal to the limit value. For example, the data with the lowest priority is not processed.
In this embodiment, after the priority is selected based on the current network environment level, the sending proportion of each piece of data to be sent with different priorities in the current network environment level may be determined based on the current network environment level and a preset policy. And then, the terminal sends each data to be sent with different priorities according to the sending proportion.
It should be understood that the preset policy includes a corresponding relationship between the network environment level and the sending proportion of each data to be sent with different priorities, and the sending proportion of each data to be sent with different priorities can be determined according to the corresponding relationship through the current network environment level. The corresponding relation may be stored locally in the terminal in the form of a graph or the like, for example, see table two.
In table two, there are 5 priority levels, and here, for convenience of description, the priority levels are divided into priority levels 1 to 5 in order from high to low. When the network environment level is very poor, three data to be sent with the priority levels of 1-3 are sent (namely, the selected priority level is 1-3), and in one sending period, the data to be sent are sent according to the proportion of the data quantity of 10:3: 1. For example, in one transmission cycle, 10 pieces of data with priority 1 are transmitted first, then 3 pieces of data with priority 2 are transmitted, and finally 1 piece of data with priority 3 is transmitted; or sequentially taking out 10 pieces of data with the priority of 1, 3 pieces of data with the priority of 2 and 1 piece of data with the priority of 3 from all the data according to the time sequence (namely the sequence of data generation), and then sequentially sending the 14 pieces of data according to the time sequence.
It should be understood that, in the above example, the transmission ratio of the data to be transmitted with the priority levels of 1 to 5 is actually 10:3:1:0:0, that is, when the ratio of the data to be transmitted with a certain priority level is 0, it means that the priority level is not selected.
It should be noted that, in one transmission period, the specific amount of data to be transmitted of different priorities is determined according to the transmission ratio and the preset number base, for example, the preset number base is 1 in the above example.
Watch two
Network environment level | Sending proportion of each data to be sent from high priority to low priority |
Non-network | Not transmitting data |
Very poor | 10:3:1 |
Poor network | 20:10:5:1 |
Network good | 20:16:12:8:1 |
Is unobstructed | 1:1:1:1:1 |
It should be noted that, in this embodiment, if the data to be transmitted of a certain priority is less than the determined transmittable amount in one transmission period, the data amount is considered to be satisfied without waiting. That is, after the data to be sent of the priority is sent, the data to be sent of the next priority can be directly sent. In the above example, if there are only 5 and less than 10 pieces of data with priority 1 in one transmission cycle, the 9 pieces of data (there are 3 pieces of data with priority 2 and 1 piece of data with priority 3) are transmitted without waiting for 10 pieces of data with priority 1 to be transmitted.
It should be understood that, in this embodiment, in a case where the network environment is very good, the existing manner of transmitting data in time sequence may be adopted. Taking table two as an example, when the network level is clear, all the data to be sent can be sent according to the time sequence of the data.
The data transmission method provided in this embodiment divides a network environment into a plurality of different levels, and a terminal may detect which level the current network environment is in according to a data transmission condition, select a priority according to a predetermined correspondence relationship according to the current network environment level, and transmit data to be transmitted with the selected priority in a priority order or a time order according to a certain quantity ratio. Therefore, when data transmission is carried out, priority transmission of important data can be realized only by defining the important data as high-priority data, the transmission effectiveness of the important data is effectively guaranteed, the user experience is improved, the benefit of a service provider is guaranteed, and the win-win effect of a user and the service provider is achieved.
Example two:
referring to fig. 3, fig. 3 is a schematic structural diagram of a terminal provided in this embodiment, including: a network detection module 31, a priority determination module 32, and a data transmission module 33. Wherein,
the network detection module 31 is configured to detect a current network environment level based on a data transmission condition.
It should be understood that, in the present embodiment, in order to define the quality of the network environment, the network environment is divided into a plurality of different levels. And a preset incidence relation exists between the network environment level and the data sending condition, and the incidence relation enables the current network environment level to be determined according to the data sending condition.
In this embodiment, the current network environment level may be detected periodically, and the current network environment level may be detected once every other period of time.
The priority determination module 32 is used to select a priority based on the current network environment level.
In this embodiment, the data to be transmitted generated by the terminal is prioritized according to the importance of the data and a predefined partitioning rule. It should be noted that the division of the data priority can be performed according to the actual requirement, and the more the number of the divided priorities is, the finer the control of the data to be transmitted can be realized.
In this embodiment, the selection of the priority is to select which priority data to be transmitted can be transmitted, and specifically, only the data to be transmitted with the selected priority is transmitted.
The data sending module 33 is configured to send the data to be sent with the priority selected by the priority determining module.
In this embodiment, when data to be sent corresponding to a selected priority is sent, data to be sent with a high priority can be sent preferentially according to the order of the priorities; and the data to be sent can be sent according to the time sequence of the data to be sent.
In this embodiment, the network detection module 31 may refer to fig. 4, and includes: a data transmission record sub-module 311, a processing sub-module 312, a data transmission achievement rate calculation sub-module 313, and a network environment determination sub-module 314. Wherein,
the data sending recording sub-module 311 is configured to record the data sending condition in the preset time period at regular time according to the preset time period.
Specifically, after every other preset time period, the data transmission condition in the time period is automatically detected once, and the data transmission condition in the time period is recorded. In a certain extreme case in this embodiment, the preset duration may be set to be infinite, and at this time, the terminal records the data transmission condition at every moment. That is, after the terminal sends a piece of data to be sent or receives a piece of data fed back by the server, the terminal records sending a piece of data or receiving a piece of data.
The processing sub-module 312 is configured to determine a achievement rate statistics period and a time length of a current time window, determine a statistics time point according to the achievement rate statistics period, and determine the current time window according to the statistics time point and the time length.
In this embodiment, the detection of the current network environment level is performed periodically, wherein the statistical time point of this time can be determined by adding the current achievement rate statistical period to the last statistical time point.
In this embodiment, the time window refers to a time period in which the time length before the statistical time point is the time length of the time window.
The data transfer achievement rate calculation sub-module 313 is configured to calculate a data transfer achievement rate in the current time window according to the data transmission condition recorded in the current time window. The data transmission condition mainly comprises the following steps: and in the current time window, the total number of data transmission pieces of the terminal and the number of data fed back by the server received by the terminal.
To realize the calculation of the data transmission achievement rate, the data transmission achievement rate calculation sub-module 313 may refer to fig. 5, and includes:
a number-of-transmission acquiring unit 3131, configured to acquire the number of data transmissions of the terminal in the current time window.
A feedback number obtaining unit 3132, configured to obtain the number of data pieces that the terminal receives the server feedback within the current time window.
A calculating unit 3133, configured to calculate a ratio of the number of data received by the terminal from the server feedback to the number of data sent by the terminal in the current time window. At this time, the ratio is the data transmission achievement rate in the current time window.
In fact, in order to ensure the number of data transmission pieces of the terminal in the current time window and the accuracy of the number of data pieces of the terminal receiving the feedback from the server in the current time window, the terminal records the data ID of the transmitted data each time the terminal transmits the data; each time data fed back by the server is received, the data ID of the received data is also recorded. In this way, the transmitting number acquiring unit 3131 may count the number of data IDs of data transmitted in the time period represented by the time window according to the time window, and the feedback number acquiring unit 3132 may count and record the number of data IDs of data received in the time period represented by the time window according to the time window.
It should be understood that, in this embodiment, the data of the server received by the terminal is necessarily feedback of a certain piece of transmission data of the terminal, that is, the data fed back by the server necessarily has a piece of data transmitted by the corresponding terminal.
In a specific implementation manner of this embodiment, when the data transfer achievement rate calculation sub-module 313 calculates the data transfer achievement rate in a time window, only when the corresponding terminal sending data and the data fed back by the server are both in the same time window, the feedback number obtaining unit 3132 counts the data fed back by the server into the number of data fed back by the terminal received by the server, that is, when the data fed back by the server and the corresponding terminal sending data are not in the same time window, the feedback number obtaining unit 3132 does not count the data ID of the data fed back by the server in the number, that is, does not record the data fed back by the server, and the data fed back by the server is not used for calculating the data transfer achievement rate.
The network environment determining sub-module 314 is configured to obtain a current network environment level according to a corresponding relationship between a preset data transmission achievement rate and a network environment level and the data transmission achievement rate.
That is, the preset correlation between the network environment level and the data transmission condition is the corresponding relationship between the preset data transmission achievement rate and the network environment level. The corresponding relation can be stored in the local terminal in the form of a chart and the like.
In this embodiment, in order to better reflect the changing and unusual network environment, the monitoring strength of the network environment may be enhanced or weakened according to the change condition of the network environment, and for this reason, the network detection module 31 further includes an adjusting sub-module 315, see fig. 6.
The adjusting sub-module 315 is used for adjusting the time length of the achievement rate statistic period and the time window according to the variation trend between the data transmission achievement rates calculated by the adjacent statistic periods.
In a specific implementation manner of this embodiment, the adjusting sub-module 315 further includes: a current data transfer achievement rate calculation unit 3151, a data transfer achievement rate difference calculation unit 3152, a down-regulation unit 3153, a holding unit 3154, and an up-regulation unit 3155, see fig. 7. Wherein,
the current data transmission achievement rate calculating unit 3151 is configured to calculate a data transmission achievement rate within a time window corresponding to the current achievement rate statistic period;
the data transfer achievement rate difference calculation unit 3152 is used for calculating the difference between the data transfer achievement rate in the time window corresponding to the current achievement rate statistic period and the data transfer achievement rate in the time window corresponding to the previous achievement rate statistic period according to the calculation result of the current data transfer achievement rate calculation unit 3151.
The down-regulation unit 3153 is configured to reduce the time length of the achievement rate statistic period and the time window when the difference calculated by the data transfer achievement rate difference calculation unit 3152 is greater than or equal to the first threshold.
The holding unit 3154 is configured to control the achievement rate statistic period and the time length of the time window to remain unchanged when the difference calculated by the data transfer achievement rate difference calculation unit 3152 is smaller than the first threshold and greater than or equal to the second threshold.
The up-regulation unit 3155 is configured to increase the time length of the achievement rate statistic period and the time window when the difference calculated by the data transfer achievement rate difference calculation unit 3152 is smaller than the second threshold.
It should be noted that, in the embodiment, there is no inevitable size relationship between the time length of the time window and the achievement rate statistical period, that is, the time length of the time window may be smaller than the achievement rate statistical period, or may be greater than or equal to the achievement rate statistical period.
In this embodiment, the adjustment of the achievement rate statistic period and the time length of the time window may be an adjustment conforming to an exponential curve change, an adjustment conforming to a linear change, or a combination thereof.
In this embodiment, the adjusting submodule 315 has a maximum value and a minimum value for adjusting the time length of the achievement rate statistic period and the time window, and when the time length of the achievement rate statistic period or the time window is already the maximum value, the up-adjusting unit 3155 cannot increase the time length of the achievement rate statistic period or the time window; after the time length of the achievement rate statistics period or time window has been the minimum value, the down-regulation unit 3153 can no longer regulate the time length of the achievement rate statistics period or time window down.
It should be understood that the maximum and minimum values of the time lengths of the achievement rate statistics period and the time window are related to the current network environment, the data transmission rate, the terminal usage, the terminal configuration factor, and the like, in engineering applications, a large amount of actual or simulation tests are often performed to obtain a large amount of test data, and screening and comparing are performed to determine a better maximum value and a better minimum value of the time lengths of the achievement rate statistics period and the time window, respectively.
It should also be understood that in engineering applications, the initial achievement rate statistics period value and the time length value of the initial time window are also typically determined by the above-described method.
It is to be noted that, in order to save the storage space of the terminal, in the present embodiment, when the duration of the data transmission condition recorded by the data transmission recording sub-module 311 exceeds the maximum value of the time length of the maximum time window, the recorded data transmission condition may be deleted.
In this embodiment, if the current network environment level detected by the network detection module 31 is always low, that is, the current network environment is always poor, in order to ensure the receiving effectiveness of the terminal on the important data, the terminal may generate control data with a high priority to inform the server to perform the selective processing on the data according to the preset data processing policy, so that the server only performs processing feedback on the important data, thereby releasing precious network resources. Meanwhile, after the network environment is restored to a good state, the terminal can regenerate a recovery control data with a high priority to inform the server to recover the processing of all data.
Specifically, there may be provided: when the network environment level detected by the network detection module 31 at N (N > 2) continuous statistical time points does not meet the preset network environment level requirement, the data transmission module 33 transmits control data to the server; when the network environment levels detected by the network detection module 31 at M (M > 2) continuous statistical time points all meet the preset network environment level requirement, the data transmission module 33 transmits recovery control data to the server.
In this embodiment, when the server performs the selective processing on the data according to the preset data processing policy, the server may not process the data with the priority lower than a certain limit value, and only process the data with the priority greater than or equal to the limit value.
In this embodiment, the terminal further includes a data ratio determining module 34, see fig. 8. The data proportion determining module 34 may determine, based on the current network environment level and a preset policy, a sending proportion of each piece of data to be sent having different priorities in the current network environment level. Thereafter, the data sending module 33 sends each data to be sent with different priorities in a priority order or a time order according to the sending ratio.
It should be understood that the preset policy includes a corresponding relationship between the network environment level and the sending proportion of each data to be sent with different priorities, and the sending proportion of each data to be sent with different priorities can be determined according to the corresponding relationship through the current network environment level. The corresponding relation can be stored locally in the terminal in the form of a chart or the like.
It should be noted that, in this embodiment, if the data to be transmitted of a certain priority is less than the determined transmittable amount in one transmission period, the data amount is considered to be satisfied without waiting.
It should be understood that, in this embodiment, in a case where the network environment is very good, the data sending module 33 may send data in an existing manner according to the time sequence of the data.
Fig. 9 is a schematic diagram of an alternative terminal structure, which includes a processor 91 and a storage device 92, where the storage device 92 stores a plurality of instructions to implement a data transmission method, and the processor 91 executes the plurality of instructions to implement: detecting the current network environment level based on the data sending condition; selecting a priority based on a current network environment level; and sending the data to be sent with the selected priority.
When the terminal provided by the embodiment is used for data transmission, only important data is defined as high-priority data, and selective transmission of the data and preferential transmission of the important data can be realized according to the current network environment, so that the transmission effectiveness of the important data is effectively ensured, the user experience satisfaction is improved, the benefit of a service provider is also ensured, and the win-win effect of a user and the service provider is achieved.
Example three:
in this embodiment, on the basis of the second embodiment, a data processing system is provided, and referring to fig. 10, the data processing system includes the terminal and the server in the second embodiment.
The server receives the data sent by the terminal, processes the received data according to a preset processing strategy, and feeds back the processed result data to the terminal.
It should be noted that, in this embodiment, the result data fed back by the server is the data corresponding to the received data, which is generated or called by the server after being processed according to the received data. For example, the data received by the server is a request for loading basic data of an application scenario, and at this time, the server calls the basic data of the application scenario and sends the basic data to the terminal.
In this embodiment, the result data sent to the terminal includes a data header and a data content, where the data header includes information such as a response result of the server, a sending message ID corresponding to the response message (i.e., which message sent by the terminal before the response to the message is indicated), and whether the response includes the data content. The data content then contains the actual data.
It is noted that for some special result data, the data content may not be included. For example, similar to the data such as the user chat information transmitted by the terminal, the server separately transmits the response data after processing, which indicates that the transmitted data server has received, and for such separate response data, only the data header is included, and the data content is not included.
It should be understood that, in the second embodiment, the terminal further includes a receiving module, and the receiving module analyzes the received result data and determines whether data content exists in the result data except for the data header. And if so, transmitting the data content to the corresponding application.
It should be noted that, after receiving the result data, the receiving module sends the data to the network monitoring module, and specifically, sends the sending message ID corresponding to the response message to the feedback number obtaining unit of the network monitoring module, so as to count the number of the received feedback.
It should be understood that, in this embodiment, a specific setting manner of the server may be: and setting one server for each priority according to the number of the data priorities, wherein one server only correspondingly processes data of one priority. At this time, the preset processing policy may be: and each server processes the data according to the received time sequence.
In this embodiment, another specific setting manner of the server may be as follows: only one server is set to handle all priority data.
At this time, the preset processing policy may be: carrying out priority processing on the received data with the priority higher than the preset priority; and sequentially processing the received other data according to the preset quantity proportion of the data with different priorities.
For example, if the data priority is set to have 1 to 5 levels from high to low, and the preset priority is set to be 2, when the data with the priority of 1 is received, the server processes the data with the priority of 1 immediately after the data currently being processed is processed. For data with priority 2-5, the data is processed according to a certain quantity ratio in one processing cycle, for example, according to 10 pieces: 6, the method comprises the following steps: 3, cutting: the ratio of 1 strip was processed.
It should be understood that, in this embodiment, data with a priority not higher than a preset priority may be processed in a priority order in one processing cycle. Still in the above example, in one processing cycle, the server processes 10 pieces of data with priority 2, then processes 6 pieces of data with priority 3, then processes 3 pieces of data with priority 4, then processes 1 piece of data with priority 5, and after one processing cycle is completed, enters the next processing cycle. It should be understood that when certain priority data is not full, processing may be performed according to the priority data being full.
It should be understood that, in this embodiment, data with a priority not higher than a preset priority in one processing cycle may be processed in chronological order of the data. Also for the above example, in one processing cycle, according to 10: 6, the method comprises the following steps: 3, cutting: 1 piece of data with the priority of 2-5 is selected, and the data are sequentially processed according to the time sequence of the data.
In this embodiment, when the server processes data, it may set a processing queue for the data to be processed according to different priorities, and when processing, take out the data to be processed from the queue according to a time sequence for processing.
It should be understood that, in this embodiment, the preset processing policy further includes an adjustment mechanism for the preset quantity ratio of different priority level data. The adjustment mechanism may specifically be:
and when the unprocessed data of a certain priority exceeds a preset third threshold, increasing the proportion of the data quantity of the priority.
Still in the above example, the preset third threshold values for the priorities 2, 3, 4 and 5 are 20, 25, 30 and 35 respectively, and when the server finds that the data with the priority 4 exceeds 30, the server changes the ratio of the number of the data with the priorities 2-5 from 10 in the next processing cycle: 6, the method comprises the following steps: 3, cutting: 1 adjustment is 10: 6, the method comprises the following steps: 4, the method comprises the following steps: 1 strip.
And when the unprocessed data of a certain priority is lower than a preset fourth threshold, reducing the proportion of the data quantity of the priority.
Also for the above example, the preset fourth threshold values for priorities 2, 3, 4, 5, i.e. the ratio of their current data amount, respectively, are set, i.e. 10, 6, 3 and 1, respectively. When the server finds that the data with the priority of 3 in the period is less than 6, in the next processing period, the server changes the proportion of the number of the data with the priority of 2-5 from 10: 6, the method comprises the following steps: 3, cutting: 1 adjustment is 10: 5, strip by strip: 4, the method comprises the following steps: 1 strip.
In this embodiment, the preset processing policy further includes a preset data processing policy, where the preset data processing policy includes:
when the server receives control data sent by the terminal, the data with the priority lower than the preset priority is not processed; and when the server receives the recovery control data sent by the terminal, recovering the processing of the data with the priority lower than the preset priority.
Still in the above example, if the preset priority is 4, the server does not process the data with priority 5 after receiving the control data sent by the terminal; and when the server receives the recovery control data sent by the terminal, the server resumes the processing of the data with the priority of 5.
Specifically, to ensure the effectiveness of data processing, after the server receives the control data sent by the terminal, when processing the data with different priorities according to the processing sequence, the data with the priority lower than the preset priority is discarded.
Still in the above example, if the preset priority is set to 4, after receiving the control data sent by the terminal, the server still processes the data with priorities of 1-5 according to the processing order, and when the data with priority of 5 is processed, discards the data with priority of 5. It will be appreciated that this avoids the need to heap up and reprocess the unwanted data, since the processing is time-efficient for the data received by the server, and it is likely that data that previously needed to be processed will no longer need to be processed after some time.
For the above process, a specific implementation manner of this embodiment is: when the server receives the control data, a flag bit is set in the received data with the priority lower than the preset priority, and the data with the priority lower than the preset priority, which is received after the flag bit, is not processed.
Fig. 11 is a schematic diagram of an alternative server structure, which includes a processor 111 and a storage device 112, where the storage device 112 stores a plurality of instructions to implement a data transmission method, and the processor 111 executes the plurality of instructions to implement: and receiving the data sent by the terminal, processing the received data according to a preset processing strategy, and sending the processed result data to the terminal.
The data processing system provided by the embodiment performs differentiated processing on the data on the server, and particularly performs priority processing on the data with the priority higher than the preset priority, so that the priority transmission and processing of important data between the terminal and the server are ensured, and the user experience satisfaction is improved.
Example four:
the present embodiment further describes the present invention by taking game data transmission as an example on the basis of the first, second and third embodiments.
In this embodiment, the game data is divided into 5 priority levels according to different importance degrees, and the priority levels are respectively recorded as priority levels 1 to 5, wherein the priority levels are sequentially decreased from the importance levels 1 to 5.
Specifically, the data with priority 1 includes: the data comprises in-game paid purchase data (which is important because the data can bring income to games), account behavior data such as login and logout of user accounts and data for sending some control commands to a server. The data of priority 2 includes: downloading basic data of a game scene, loading basic data of a player and the like, wherein the main logic of the game is difficult to operate without the data. The data is mainly downlink data. The data with priority 3 includes: player's operation data, etc. The data with priority 4 includes: chat messages in the game, action expressions of the player and other interactive data. The data with priority 5 includes: and downloading data such as skin, scene decoration and the like in the game.
Setting 5 network environment grades which are respectively 1-5, and sequentially and respectively corresponding to 5 network environment conditions of no network, very poor network environment, good network environment and unobstructed network.
Firstly, the terminal can detect whether wifi or flow is opened, and if wifi or flow is not opened, data transmission is not carried out.
When the terminal opens wifi or flow, the terminal will automatically start to count the number of sent data IDs within 100ms and the number of received result data fed back by the server every 100 ms. It should be understood that the statistics of the number of pieces of result data fed back by the server by the terminal is based on the corresponding transmission data ID contained in the header.
Meanwhile, the terminal obtains a statistical time point for carrying out data transmission achievement rate statistics for the first time according to the initial achievement rate statistical period, and determines an initial time window according to the time length of the initial time window, thereby carrying out data transmission achievement rate calculation for the first time, and obtaining the current network environment level according to the network environment level and the corresponding relation of the data transmission achievement rate. The network environment level and the achievement rate corresponding to the data transmission are shown in table three.
Watch III
Data transfer achievement rate range | Network environment level |
The data transmission achievement rate is 0 | 1 |
The achievement rate of data transmission is more than 0 and less than 30 percent | 2 |
Data transfer is achievedThe ratio is more than or equal to 30 percent and less than 80 percent | 3 |
The achievement rate of data transmission is more than or equal to 80% and less than 99% | 4 |
The achievement rate of data transmission is more than or equal to 99 percent | 5 |
And then, continuously obtaining a statistical time point and a time window for carrying out data transmission achievement rate statistics for the second time according to the achievement rate statistical period and the time length of the time window, and carrying out data transmission achievement rate calculation for the second time to obtain a new current network environment level. At this time, subtracting the first data transmission achievement rate from the second data transmission achievement rate to obtain a difference value, judging the size relation between the difference value and 20% and 10%, and reducing the time length of the achievement rate statistical period and the time window when the difference value is more than or equal to 20%; when the difference is less than 20% and more than or equal to 10%, keeping the time length of the achievement rate statistical period and the time window unchanged; when the difference is less than 10%, the time length of the achievement rate statistical period and the time window is increased. Therefore, the statistical time point for carrying out the data transmission achievement rate statistics for the third time is obtained according to the adjusted achievement rate statistical period, and the time window for carrying out the data transmission achievement rate statistics for the third time is obtained according to the time length of the time window obtained by adjustment.
For example, referring to fig. 12, assuming that the statistics performed at t +200ms for the first time is 48% of the data transmission achievement rate, the first time axis in fig. 12 reflects the case of performing statistics for the second time, it can be seen that the statistics for the second time is performed at t +300ms, and the time window is the time period from t to t +300, which is calculated according to the data transmission achievement rate calculation method: and (3 +11+ 6)/(10 +16+ 11) ≈ 54%, and the current network grade is 3. If the difference between the achievement rate of the data transmission at this time and the achievement rate of the data transmission at the last time is 6%, the achievement rate statistical period is adjusted to 200ms, and the time length of the time window is adjusted to 400 ms.
Referring to the second time axis in fig. 12, a third time of statistics is performed at t +500ms, and the time window is a time period from t +100 to t +500, which is calculated according to the data transmission achievement rate calculation method, so that: (11 +6+3+ 1)/(16 +11+16+ 18) ≈ 34%, giving a current network class of 3. The difference between the achievement rate of the data transmission at this time and the last time is 20%, the time length of the achievement rate statistical period and the time window is adjusted to be small, the achievement rate statistical period is adjusted to be 100ms, and the time length of the time window is adjusted to be 300 ms.
In this embodiment, when the network environment level is 2, the achievement rate statistic period and the time length of the time window are adjusted by using an adjustment mode conforming to the exponential curve change. When the network environment level is 3, the adjustment mode of linear variation of the coincidence number is adopted to adjust the achievement rate statistical period and the time length of the time window.
In this embodiment, after the terminal determines the network environment level, the game data is sent according to the current network environment level. Specifically, when the network environment is level 1, data transmitted by the game are not received; when the network environment is level 2, respectively taking out 10 pieces of data with the priority of 1, 3 pieces of data with the priority of 2 and 1 piece of data with the priority of 3 from all data transmitted by the game, and then sequentially transmitting the 14 pieces of data according to the time sequence of the 14 pieces of data; when the network environment is level 3, respectively taking out 20 pieces of data with the priority of 1, 10 pieces of data with the priority of 2, 5 pieces of data with the priority of 3 and 1 piece of data with the priority of 4 from all the data transmitted by the game, and then sequentially transmitting the 36 pieces of data according to the time sequence of the 36 pieces of data; when the network environment is level 4, respectively taking out 20 pieces of data with the priority of 1, 16 pieces of data with the priority of 2, 12 pieces of data with the priority of 3, 8 pieces of data with the priority of 4 and 1 piece of data with the priority of 5 from all data transmitted by the game, and then sequentially transmitting the 57 pieces of data according to the time sequence of the 57 pieces of data; and when the network environment level is 5, all data transmitted from the game are sequentially transmitted according to the time sequence.
In this embodiment, after the game transmits data, the terminal may put the data into different queues according to different priorities, specifically, each data may be put in a triple form (data time, data ID, data object) when putting the data into the queue. Meanwhile, each queue is provided with a variable for storing the first data time of the queue, the variable can extract the data time of the first data of the queue, and when the first data of the queue changes, the time represented by the variable also changes. The transmission according to the time sequence can be realized through comparison between the variables of different queues.
It should be understood that the terminal may transmit data in the form of quadruplets (data priority, data time, data ID, data object) when transmitting data.
In this embodiment, after receiving the data sent by the terminal, the server preferentially processes the data with the priority level of 1, and for the data with the priority level of 1, the server does not need to wait in a queue for processing. For data with the priority levels of 2, 3, 4 and 5, the server adds the data into four queues corresponding to different priority levels according to the proportion of 10, 6, 3 and 1, and then takes out the data according to the time sequence for processing.
When the accumulation of data of a certain priority exceeds a threshold value, the server correspondingly increases the processing proportion of the data. For example, if the number of pieces of data with priority 4 exceeds the threshold value of 30 pieces of unprocessed data, the server performs processing on the data with priorities of 2, 3, 4, and 5 at a ratio of 10 pieces, 6 pieces, 4 pieces, and 1 piece in the next processing cycle.
When the data accumulation of a certain priority is less and less than the current processing proportion, the processing proportion of the data is reduced. For example, for data with priorities of 2, 3, 4, and 5, the current processing ratio is 10, 6, 4, and 1, and if the priority of data with 3 is less than 6, the processing ratio in the next processing cycle becomes 10, 5, 4, and 1.
In this embodiment, when the level of the environment of 10 continuous monitoring networks is not 5, the terminal sends control data not loading data with priority 5 to the server; when 10 consecutive monitored network environment levels are all 5, recovery control data for recovering data with the processing priority of 5 is sent to the server.
After receiving the control data, the server sets a flag bit, and discards the data with the priority of 5 after the flag bit. After receiving the recovery control data, the server resumes processing of the data with priority 5.
In this embodiment, the server will feed back result data only including a header to data sent by the terminal, such as chat information, indicating that the sent data has been received by the server.
After receiving the result data, the terminal analyzes the data head, counts the received feedback information according to the data head information, and specifically determines the data transmission achievement rate through the corresponding sending data ID in the data head.
It should be noted that the feedback data is counted only if the corresponding transmission data ID in the header exists within the current time window.
The data processing system provided by the embodiment classifies the priority of game data, defines account behavior data such as payment purchase data in a game, login and logout of a user account and the like and data for sending some control commands to a server as the highest priority, so that the data are sent preferentially on a terminal and processed preferentially on a server, normal operation of the game and accurate operation of the user purchase behavior under the condition of poor network are ensured, preferential transmission and processing of important data between the terminal and the server are ensured, user experience is improved, meanwhile, benefits of game operators are ensured, and a win-win effect is achieved.
It will be apparent to those skilled in the art that the modules or steps of the above-described embodiments may be implemented in a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and alternatively, they may be implemented in program code executable by a computing device, such that they may be stored on a computer storage medium (ROM/RAM, magnetic disk, optical disk) and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The foregoing is a more detailed description of the present invention that is presented in conjunction with specific embodiments, and the practice of the invention is not to be considered limited to those descriptions. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.
Claims (9)
1. A data transmission method, comprising:
detecting the current network environment level based on the data transmission condition, comprising the following steps: recording the data transmission condition in the preset time period according to the preset time period; determining an achievement rate statistical period and the time length of a current time window, determining a statistical time point according to the achievement rate statistical period, and determining the current time window according to the statistical time point and the time length; calculating the data transmission achievement rate in the current time window according to the data transmission condition recorded in the current time window; obtaining a current network environment grade according to a corresponding relation between a preset data transmission achievement rate and a network environment grade and the data transmission achievement rate; wherein the calculating the data transmission achievement rate in the current time window comprises: acquiring the number of data transmission pieces of a terminal in a current time window; acquiring the number of data which are received by the terminal and fed back by the server in a current time window; taking the ratio of the number of data pieces received by the terminal in the current time window and fed back by the server to the number of data sending pieces of the terminal in the current time window as the data transmission achievement rate;
selecting a priority based on the current network environment level;
sending the data to be sent with the selected priority;
and adjusting the time length of the achievement rate statistical period and the time window according to the change trend between the data transmission achievement rates calculated by the adjacent statistical periods.
2. The data transmission method as claimed in claim 1, wherein the adjusting the time length of the achievement rate statistic period and the time window according to the variation trend between the data transmission achievement rates calculated by the adjacent statistic periods comprises:
calculating the data transmission achievement rate in a time window corresponding to the current achievement rate statistical period;
calculating the difference between the data transmission achievement rate in the time window corresponding to the current achievement rate statistical period and the data transmission achievement rate in the time window corresponding to the previous achievement rate statistical period;
if the difference is larger than or equal to a first threshold value, reducing the time length of the achievement rate statistical period and the time window;
if the difference value is smaller than the first threshold value and larger than or equal to the second threshold value, controlling the time length of the achievement rate statistical period and the time window to be unchanged;
and if the difference value is smaller than a second threshold value, increasing the time length of the achievement rate statistical period and the time window.
3. The data transmission method of claim 1, further comprising:
when the network environment grades detected at the continuous N statistical time points do not meet the requirement of the preset network environment grade, sending control data to a server; the control data is used for informing the server to select and process data according to a preset data processing strategy; wherein said N > 2;
when the network environment grades detected at the continuous M statistical time points all meet the requirement of a preset network environment grade, sending recovery control data to the server; the recovery control data is used for informing the server to recover the processing of all the data; wherein M > 2.
4. The data transmission method of any one of claims 1-3, further comprising, after said selecting a priority based on the current network environment level:
determining the sending proportion of each data to be sent with different priorities under the current network environment level based on the current network environment level and a preset strategy;
and transmitting each data to be transmitted based on the transmission proportion and the priority of each data to be transmitted.
5. A terminal, comprising:
the network detection module is used for detecting the current network environment level based on the data sending condition;
a priority determination module for selecting a priority based on the current network environment level;
the data sending module is used for sending the data to be sent with the selected priority;
wherein the network detection module comprises:
the data sending recording submodule is used for regularly recording the data sending condition in the preset time period according to the preset time length;
the processing submodule is used for determining an achievement rate statistical period and the time length of a current time window, determining a statistical time point according to the achievement rate statistical period, and determining the current time window according to the statistical time point and the time length;
the data transmission achievement rate calculating submodule is used for calculating the data transmission achievement rate in the current time window according to the data sending condition recorded in the current time window; the calculating the data transmission achievement rate in the current time window comprises: acquiring the number of data transmission pieces of a terminal in a current time window; acquiring the number of data which are received by the terminal and fed back by the server in a current time window; taking the ratio of the number of data pieces received by the terminal in the current time window and fed back by the server to the number of data sending pieces of the terminal in the current time window as the data transmission achievement rate;
the network environment judgment submodule is used for obtaining the current network environment level according to the corresponding relation between the preset data transmission achievement rate and the network environment level and the data transmission achievement rate;
and the adjusting submodule is used for adjusting the time length of the achievement rate statistical period and the time window according to the change trend between the data transmission achievement rates calculated by the adjacent statistical periods.
6. The terminal of claim 5, further comprising:
the data proportion determining module is used for determining the sending proportion of each piece of data to be sent with different priorities under the current network environment level based on the current network environment level and a preset strategy;
and the data sending module is further used for sending each data to be sent based on the sending proportion and the priority of each data to be sent.
7. A data processing system, comprising: a server and a terminal according to claim 5 or 6;
the server receives data sent by the terminal; processing the received data according to a preset processing strategy; and sending the processed result data to the terminal.
8. The data processing system of claim 7, wherein the predetermined processing policy comprises:
carrying out priority processing on the received data with the priority higher than the preset priority;
and sequentially processing the received other data according to the preset quantity proportion of the data with different priorities.
9. The data processing system of claim 8, wherein the pre-set processing policy further comprises:
when unprocessed data of a certain priority exceeds a preset third threshold, increasing the proportion of the number of the data of the priority;
when unprocessed data of a certain priority is lower than a preset fourth threshold, reducing the proportion of the number of the data of the priority;
wherein the third threshold is greater than the fourth threshold.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710108545.8A CN107070811B (en) | 2017-02-27 | 2017-02-27 | Data sending method, terminal and data processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710108545.8A CN107070811B (en) | 2017-02-27 | 2017-02-27 | Data sending method, terminal and data processing system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107070811A CN107070811A (en) | 2017-08-18 |
CN107070811B true CN107070811B (en) | 2021-03-09 |
Family
ID=59622251
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710108545.8A Active CN107070811B (en) | 2017-02-27 | 2017-02-27 | Data sending method, terminal and data processing system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107070811B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108011745B (en) * | 2017-09-30 | 2021-05-14 | 北京车和家信息技术有限公司 | Data transmission method and device |
CN112580084A (en) * | 2021-02-01 | 2021-03-30 | 开封大学 | New energy data anomaly detection method based on low-carbon economy |
CN113613201A (en) * | 2021-08-02 | 2021-11-05 | 腾讯科技(深圳)有限公司 | Data sharing method, device and medium applied to vehicles and electronic equipment |
CN116170385A (en) * | 2023-04-21 | 2023-05-26 | 四川汉科计算机信息技术有限公司 | Gateway information forwarding system, method, equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1402143A (en) * | 2002-09-29 | 2003-03-12 | 清华大学 | Flow control method based on feedback of client terminal |
CN104113467A (en) * | 2013-04-17 | 2014-10-22 | 安徽盈科智能科技有限公司 | Virtual desktop system and message data transmitting method thereof |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100481758C (en) * | 2005-09-09 | 2009-04-22 | 乐金电子(昆山)电脑有限公司 | Data package transmission rate determination method in TCP transmission control |
CN103139104B (en) * | 2011-12-05 | 2017-02-08 | 深圳迈瑞生物医疗电子股份有限公司 | Network transmission service class adjustment method, data terminal and network server |
CN103124432A (en) * | 2013-01-23 | 2013-05-29 | 中兴通讯股份有限公司 | Wireless message transmitting device and method |
CN104185201B (en) * | 2013-05-21 | 2019-06-11 | 中兴通讯股份有限公司 | A kind of self-adapting regulation method and device in nearby region measurement period |
CN104202774A (en) * | 2014-09-18 | 2014-12-10 | 东南大学 | Reliable and real-time industrial wireless local area network transmission method |
CN105516018B (en) * | 2014-09-23 | 2018-12-18 | 博雅网络游戏开发(深圳)有限公司 | network data transmission method and device |
CN105577401A (en) * | 2014-10-10 | 2016-05-11 | 中兴通讯股份有限公司 | Network device alarm reporting method and network device |
-
2017
- 2017-02-27 CN CN201710108545.8A patent/CN107070811B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1402143A (en) * | 2002-09-29 | 2003-03-12 | 清华大学 | Flow control method based on feedback of client terminal |
CN104113467A (en) * | 2013-04-17 | 2014-10-22 | 安徽盈科智能科技有限公司 | Virtual desktop system and message data transmitting method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN107070811A (en) | 2017-08-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10897406B2 (en) | Scheduling method for content delivery network, and device | |
CN107070811B (en) | Data sending method, terminal and data processing system | |
CN108513271B (en) | Short message distribution method and device based on multiple short message channels | |
US20120033612A1 (en) | Methods and apparatus for reducing data transmission overhead | |
CN101547159B (en) | Method and device for preventing network congestion | |
CN104126285A (en) | Method and apparatus for rapid disaster recovery preparation in a cloud network | |
CN107819797B (en) | Access request processing method and device | |
CN110830964B (en) | Information scheduling method, internet of things platform and computer readable storage medium | |
CN108874324B (en) | Access request processing method, device, equipment and readable storage medium | |
CN113032233A (en) | Distributed service cluster runtime parameter adaptive processing method, device and system | |
EP3989597A1 (en) | Optical network unit (onu) power down alarm method and apparatus, device and storage medium | |
CN115277577A (en) | Data processing method, data processing device, computer equipment and computer readable storage medium | |
CN114338534A (en) | Message routing method and device | |
US12052607B2 (en) | Communication apparatus, communication method, and program | |
US20170013083A1 (en) | Data processing method and apparatus used for terminal application | |
CN111858099B (en) | Message subscription method and device | |
CN112764919A (en) | Distributed service self-adaptive load balancing method and device | |
CN117202117B (en) | System and method for fusing and degrading short message channel | |
CN114390006B (en) | Data packet transmission method, device, equipment and storage medium | |
CN114979250B (en) | Message pushing method, device and equipment | |
CN114827033B (en) | Data flow control method, device, equipment and computer readable storage medium | |
CN109361620B (en) | Data sending method, device, equipment and storage medium | |
CN110636013B (en) | Dynamic scheduling method and device for message queue | |
CN117354252A (en) | Data transmission processing method and device, storage medium and electronic device | |
CN110868304B (en) | PCC strategy issuing method and system |
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 |