CN110781150A - Data transmission method and device and electronic equipment - Google Patents

Data transmission method and device and electronic equipment Download PDF

Info

Publication number
CN110781150A
CN110781150A CN201910962703.5A CN201910962703A CN110781150A CN 110781150 A CN110781150 A CN 110781150A CN 201910962703 A CN201910962703 A CN 201910962703A CN 110781150 A CN110781150 A CN 110781150A
Authority
CN
China
Prior art keywords
network
compression ratio
network state
transmission rate
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910962703.5A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Infinite Light Field Technology Co Ltd
Original Assignee
Beijing Infinite Light Field Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Infinite Light Field Technology Co Ltd filed Critical Beijing Infinite Light Field Technology Co Ltd
Priority to CN201910962703.5A priority Critical patent/CN110781150A/en
Publication of CN110781150A publication Critical patent/CN110781150A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the disclosure discloses a data transmission method, a device and an electronic device, wherein the data transmission method comprises the following steps: acquiring a network state parameter at the current moment, wherein the network state parameter comprises a network transmission rate; determining a compression ratio corresponding to the current moment according to the network state parameters and a pre-established network state-compression ratio mapping relation, wherein the network state-compression ratio mapping relation is used for determining a data compression ratio according to the network state parameters; and compressing the data to be transmitted of the transmission object at the current moment according to the compression ratio, and transmitting the compressed data to be transmitted. The method and the device can ensure that the transmission object has higher fidelity on the basis of successfully sending the transmission object when the network state is better; and when the network state is poor, the transmission object can be ensured to be successfully transmitted at a higher speed, and the user experience is effectively improved.

Description

Data transmission method and device and electronic equipment
Technical Field
The present disclosure relates to the field of communications, and in particular, to a data transmission method and apparatus, and an electronic device.
Background
In the prior art, before data (including picture data, video data, and the like) is transmitted, a data transmitting end compresses the data at a fixed compression rate and then transmits the compressed data to a data receiving end, and the data receiving end decompresses a compressed object to restore the transmitted data.
Disclosure of Invention
This disclosure is provided to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The technical problem that this disclosure will solve is: in the prior art, the compression ratio of a compression transmission object is fixed, and the compression ratio of the object cannot be dynamically adjusted according to network state parameters, so that the transmission object has the problems of low fidelity when the network state is good, unsuccessful transmission when the network state is poor, and the like, and the user experience is reduced.
In order to solve the technical problem, the present disclosure provides a data transmission method, an apparatus and an electronic device.
In a first aspect, an embodiment of the present disclosure provides a data transmission method, where the method includes: acquiring a network state parameter at the current moment, wherein the network state parameter comprises a network transmission rate; determining a compression ratio corresponding to the current moment according to the network state parameters and a pre-established network state-compression ratio mapping relation, wherein the network state-compression ratio mapping relation is used for determining a data compression ratio according to the network state parameters; and compressing the data to be transmitted of the transmission object at the current moment according to the compression ratio, and transmitting the compressed data to be transmitted.
In a second aspect, an embodiment of the present disclosure provides a data transmission apparatus, including: the system comprises an acquisition module, a transmission module and a processing module, wherein the acquisition module is used for acquiring network state parameters at the current moment, and the network state parameters comprise network transmission rate; the determining module is used for determining a compression ratio corresponding to the current moment according to the network state parameter and a pre-established network state-compression ratio mapping relation, wherein the network state-compression ratio mapping relation is used for determining a data compression ratio according to the network state parameter; and the compression module is used for compressing the data to be transmitted of the transmission object at the current moment according to the compression rate and transmitting the compressed data to be transmitted.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement the data transmission method of the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements the steps of the data transmission method according to the first aspect.
According to the data transmission method, the data transmission device and the electronic equipment, the compression ratio corresponding to the current moment is determined according to the network state parameter of the current moment and the pre-established network state-compression ratio mapping relation, the data to be transmitted of the transmission object at the current moment are compressed, and the compressed data to be transmitted are transmitted, so that when the network state is good, the transmission object can have high fidelity on the basis of ensuring that the transmission object is successfully transmitted; and when the network state is poor, the transmission object can be ensured to be successfully transmitted at a higher speed, and the user experience is effectively improved.
In some optional embodiments, the network state parameter is associated with a discrete compression rate, that is, a network transmission rate interval corresponding to the network transmission rate at the current time is determined; and searching a preset compression ratio corresponding to the network transmission rate interval from the network state-compression ratio mapping relation, and determining the preset compression ratio as the compression ratio corresponding to the current moment, so that the network transmission rates in the same network state all correspond to one compression ratio, and in the object transmission process, the compression ratio fluctuation range is small, and the distortion degree difference of each part of the transmission object is small.
In some optional embodiments, the network state parameters are corresponding to continuous compression ratio values, that is, the compression ratio corresponding to the current time is determined through the preset function and the network state parameters at the current time, then for each network state parameter, a unique compression ratio corresponds to the compression ratio, the compression ratio is changed along with the network state parameters changed in real time, and the transmission efficiency of the transmission object is high.
In some optional embodiments, the network state-compression ratio mapping relationship is adjusted according to the transmission delay of the compressed data to be transmitted, and the corresponding relationship between the network state parameter and the compression ratio is continuously optimized by continuously adjusting the network state-compression ratio mapping relationship, so as to obtain the compression ratio most matched with the current network state.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is a flow diagram of one embodiment of a data transmission method according to the present disclosure;
FIG. 2 is a schematic flow chart of obtaining a current network transmission rate to which the present disclosure relates;
FIG. 3 is a schematic flow chart of determining a compression ratio corresponding to a current time instant to which the present disclosure relates;
FIG. 4 is a schematic block diagram of one embodiment of a data transmission device according to the present disclosure;
FIG. 5 is an exemplary system architecture to which the data transmission method of one embodiment of the present disclosure may be applied;
fig. 6 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, a flow chart of an embodiment of a data transmission method according to the disclosure is shown, as shown in fig. 1, the data transmission method includes the following steps:
step S101, obtaining the network state parameter of the current moment, wherein the network state parameter comprises the network transmission rate.
The network status parameters of the used network can be obtained in real time. The network used herein may be a wired network and a wireless network. The wireless network may include, but is not limited to, a 2G network, a 3G network, a 4G network, and a 5G network.
The network state parameters are used for characterizing the network state of the used network. Here, the network status parameters may include, for example: network transmission rate, data transmission delay, etc.
The network transmission rate may be obtained based on the flow shown in step S1011 to step S1012 in fig. 2.
In step S1011, the transmission data amount in the preset time period before the current time and adjacent to the current time is obtained.
The preset time period may include, but is not limited to, 30 seconds, 1 minute, 2 minutes, 5 minutes.
Here, when the transmission data amount in the preset time period is acquired, timing may be started from the time when the transmission data amount starts to be acquired according to the duration of the preset time period, and the acquisition operation may be ended at the corresponding termination time after the duration, that is, the transmission data amount in the preset time period may be counted.
Step S1012, obtaining the network transmission rate of the preset time period based on the transmission data amount and the duration of the preset time period, and taking the network transmission rate of the preset time period as the current network transmission rate.
Specifically, the network transmission rate may be obtained by taking the quotient of the transmission data amount and the duration of the preset time period. The duration of the preset time period may be set to be relatively short, for example, 30 seconds or 20 seconds, so that the network transmission rate obtained according to the data amount transmitted in the previous preset time period may be regarded as the real-time network transmission rate at the current time.
And step S102, determining a compression ratio corresponding to the current moment according to the network state parameters and a pre-established network state-compression ratio mapping relation, wherein the network state-compression ratio mapping relation is used for determining the data compression ratio according to the network state parameters.
In some application scenarios, different network state parameters may be mapped to several preset compression rates through a network state-compression rate mapping relationship. Specifically, the network state-compression ratio mapping relationship includes a plurality of network transmission rate intervals and preset compression ratios corresponding to the plurality of network transmission intervals, and the preset compression ratios corresponding to different network transmission intervals are different.
Referring to fig. 3, which shows a schematic flowchart of determining a compression rate corresponding to a current time according to the present disclosure, as shown in fig. 3, the above step S102 includes the following steps S1021 to S1022.
Step S1021, determining a network transmission rate interval corresponding to the network transmission rate at the current time.
Step S1022, a preset compression ratio corresponding to the network transmission rate interval is searched from the network state-compression ratio mapping relationship, and the preset compression ratio is determined as the compression ratio corresponding to the current time.
It should be appreciated that the plurality of network transmission rate intervals included in the network state-compression ratio mapping relationship may be preset. In the network state-compression ratio mapping relationship, the preset compression ratios corresponding to different network transmission intervals are different. Taking the example that the network utterance intervals include a first network transmission rate interval and a second network transmission rate interval, a first preset compression rate corresponding to the first network transmission rate interval is greater than a second preset compression rate corresponding to the second network transmission rate interval. Wherein any network transmission rate in the first network transmission rate interval is greater than any network transmission rate in the second network transmission rate interval.
For example, when the network state corresponding to the first network transmission rate interval is the 2G network state, in the network state-compression ratio mapping relationship, the preset compression ratio in the 2G network state is 40%; when the network state corresponding to the second network transmission rate interval is the 3G network state, in the network state-compression ratio mapping relationship, the preset compression ratio in the 3G network state is 60%. That is, in the 2G network state, a plurality of different first network transmission rates are included, and each of the plurality of first network transmission rates corresponds to a compression rate (i.e. 40%); in the 3G network state, a plurality of different second network transmission rates are included, and the plurality of second network transmission rates all correspond to a compression rate (i.e. 60%), so that the network transmission rates in the same network state all correspond to a compression rate, the fluctuation range of the compression rate is small in the object transmission process, and the distortion degree difference of each part of the transmission object is small. For example, when the first network transmission rate interval is 10-15 Kbit/s, in the network state-compression ratio mapping relationship, the preset compression ratio corresponding to the first network transmission rate interval is 35%; when the second network transmission rate interval is 15-20 Kbit/s, in the network state-compression ratio mapping relationship, the preset compression ratio corresponding to the second network transmission rate interval is 45%, each network transmission rate in the first network transmission rate interval corresponds to a compression ratio (i.e. 35%), each network transmission rate in the second network transmission rate interval corresponds to a compression ratio (i.e. 45%), and the purpose of small distortion difference of each part of transmission data can be achieved.
Furthermore, the preset compression ratios corresponding to different intervals are different, and the value range of the compression ratio corresponding to each interval is 25% -1, so that the transmission object can be matched with the corresponding compression ratio in different network states, and the problem of excessive distortion of the transmission object can be avoided.
When the network transmission rate at the current moment is obtained, the network transmission rate interval corresponding to the network transmission rate at the current moment can be determined according to the network state-compression ratio mapping relation.
It should be noted that, when setting the preset compression rate corresponding to each network transmission rate interval, the set compression rate is preferably used, and the transmission object can be transmitted to the receiving end through the network. On the premise of ensuring that the transmission object can be transmitted to the receiving end through the network, the fidelity of the data is met as much as possible. For example, when the transmission object is a picture, when a preset compression rate corresponding to a network rate transmission interval is set, and when the network rate transmission in the interval is used, the picture compressed according to the preset compression rate can be transmitted to a receiving end firstly, and then the picture compressed according to the preset compression rate can obtain higher fidelity after being decompressed by the receiving end.
And S103, compressing the data to be transmitted of the transmission object at the current moment according to the compression rate, and transmitting the compressed data to be transmitted.
For the same transmission object, in the transmission process, if the network state parameters at different times are different, the compression rates corresponding to the data to be transmitted at the different times are also different. Accordingly, the fidelity of the transmission object received by the receiving end is also different.
In the prior art, the compression ratio of data to be transmitted is fixed, and the compression ratio cannot be adjusted according to network state parameters. Thus, when the network transmission rate is poor, the data may not be successfully transmitted, and when the network transmission rate is good, the fidelity of the transmission object may be low, both of which may reduce the user experience.
According to the embodiment, the compression ratio corresponding to the current moment is determined according to the network state parameter of the current moment and the pre-established network state-compression ratio mapping relation, so that the data to be transmitted of the transmission object at the current moment is compressed, and the compressed data to be transmitted is transmitted, so that the transmission object has high fidelity on the basis of ensuring the transmission object is successfully transmitted when the network state is good; and when the network state is poor, the transmission object can be ensured to be successfully transmitted at a higher speed, and the user experience is effectively improved.
In some optional implementations of this embodiment, the network state-compression ratio mapping relationship includes a preset function that maps different network state parameters to different compression ratios. In these optional implementation manners, the determining, according to the network state parameter and the pre-established network state-compression ratio mapping relationship in step S102, a compression ratio corresponding to the current time may include: and determining the compression rate corresponding to the current moment according to the preset function and the network state parameter of the current moment.
The network state-compression ratio mapping relationship may be constructed according to historical compression ratios corresponding to a plurality of historical network transmission rates and a plurality of historical network transmission rates, respectively. The historical compression rate can ensure that the transmission object is successfully transmitted, and the transmitted object has higher fidelity.
In these alternative implementations, for each network state parameter, there may be a compression rate corresponding to it, the compression rate being transformed with the real-time transformed network state parameter. At any time, the data to be transmitted can be transmitted by using the network transmission rate at the time. Thus, the data transmission efficiency can be improved.
In some optional implementation manners of this embodiment, the data transmission method further includes step S104, and in step S104, the network state-compression ratio mapping relationship is adjusted according to the transmission delay of the compressed data to be transmitted.
And optimizing the corresponding relation between the network state parameters and the compression ratio by continuously adjusting the network state-compression ratio mapping relation to obtain the compression ratio which is most matched with the current network state.
Specifically, step 104 includes the following steps S1041 to S1042.
Step S1041, if the transmission delay is smaller than the preset delay threshold, adjusting the network state-compression ratio mapping relationship to increase the compression ratio corresponding to the data to be transmitted.
Step S1042, if the transmission delay is greater than the preset delay threshold, adjusting the network state-compression ratio mapping relationship to reduce the compression ratio corresponding to the data to be transmitted.
Further, the transmission delay is the time from the beginning of the transmission of the data to be transmitted to the completion of the data transmission; the preset time delay threshold is a preset time length from the beginning to the end of transmission of the data to be transmitted, and can be 5-30s, 1-3 minutes and the like; the compression ratio is the ratio of the size of the file after compression to the size of the file before compression, for example: the file of 100MB was compressed to 90MB, with a compression ratio of 90/100 × 100% to 90%.
That is, when a certain data is transmitted, when the time length from the start of the transmission of the data to the completion of the transmission of the data is shorter than the time length set in advance, the compression ratio corresponding to the data to be transmitted in the network state-compression ratio mapping relationship needs to be increased.
When a certain data is transmitted, when the time length from the beginning of the transmission of the data to the completion of the data transmission is longer than the time length set in advance, the compression ratio corresponding to the data to be transmitted in the network state-compression ratio mapping relationship needs to be reduced.
In the transmission process, if there is a case that the compression ratio is small but the transmission is still unsuccessful (the transmission delay is greater than the preset delay threshold), in the network state-compression ratio mapping relationship, for the same compression ratio, the compression ratio needs to be corresponding to a larger network transmission rate; there are also situations where the compression rate is large but the transmission is successful within a short time period (the transmission delay is smaller than the preset delay threshold), and for the same compression rate, the compression rate needs to be corresponding to a smaller network transmission rate.
Referring to fig. 4, a schematic structural diagram of an embodiment of a data transmission device according to the present disclosure is shown. As shown in fig. 4, the data transmission apparatus includes: an acquisition module 401, a determination module 402 and a compression module 403. The acquiring module 401 is configured to acquire a network state parameter at a current time, where the network state parameter includes a network transmission rate;
a determining module 402, configured to determine a compression ratio corresponding to a current time according to the network state parameter and a pre-established network state-compression ratio mapping relationship, where the network state-compression ratio mapping relationship is used to determine a data compression ratio according to the network state parameter;
the compression module 403 is configured to compress the data to be transmitted of the transmission object at the current time according to the compression rate, and transmit the compressed data to be transmitted.
It should be noted that, for specific processing of the obtaining module 401, the determining module 402, and the compressing module 403 of the data transmission apparatus and the technical effects thereof, reference may be made to the related descriptions of step 101, step 102, and step 103 in the corresponding embodiment of fig. 1, which is not described herein again.
In some optional implementation manners of this embodiment, the network state-compression ratio mapping relationship includes a plurality of network transmission rate intervals and preset compression ratios respectively corresponding to the plurality of network transmission rate intervals, and different network transmission rate intervals correspond to different preset compression ratios; and the determining module 402 is further configured to: determining a network transmission rate interval corresponding to the network transmission rate at the current moment; searching a preset compression ratio corresponding to the network transmission rate interval from the network state-compression ratio mapping relation, and determining the preset compression ratio as a compression ratio corresponding to the current moment; the network transmission method comprises the steps that a first preset compression rate corresponding to a first network transmission rate interval is larger than a second preset compression rate corresponding to a second network transmission rate interval, any network transmission rate in the first network transmission rate interval is larger than any network transmission rate in the second network transmission rate interval, and the first network transmission rate and the second network transmission rate belong to a plurality of network transmission rate intervals.
In some optional implementations of this embodiment, the obtaining module 401 is further configured to: acquiring the transmission data volume before the current time and in a preset time period adjacent to the current time; and obtaining the network transmission rate of the last preset time period based on the transmission data volume and the duration of the preset time period, and taking the network transmission rate of the last preset time period as the current network transmission rate.
In some optional implementations of this embodiment, the apparatus further includes an adjusting module 404, where the adjusting module 404 is configured to: and adjusting the network state-compression ratio mapping relation according to the transmission delay of the compressed data to be transmitted.
In some optional implementations of this embodiment, the adjusting module 404 is further configured to: if the transmission delay is smaller than a preset delay threshold, adjusting the network state-compression ratio mapping relation to increase the compression ratio corresponding to the data to be transmitted;
and if the transmission delay is larger than a preset delay threshold, adjusting the network state-compression ratio mapping relation to reduce the compression ratio corresponding to the data to be transmitted.
The operation of the data transmission device is described below by way of a specific example.
In a pre-established network state-compression ratio mapping relationship, a preset compression ratio corresponding to a 5G network state is 100%, a preset compression ratio corresponding to a 4G network state is 80%, a preset compression ratio corresponding to a 3G network state is 60%, a preset compression ratio corresponding to a 2G network state is 40%, in a state lower than a network transmission rate in the 2G network state, the preset compression ratio corresponding to the state is 25%, the minimum value in preset time delay threshold values is 5s, and the maximum value is 30 s.
When a user wants to send a picture, first, the obtaining module 401 of the device obtains the transmission data volume in the preset time period before and adjacent to the current time, and obtains the current network transmission rate based on the transmission data volume and the duration of the preset time period.
Next, the determining module 402 determines a network transmission rate interval corresponding to the current network transmission rate, if the network state corresponding to the determined network transmission rate interval is a 5G network state, the current compression rate is 100% (that is, compression is not needed), after the picture is compressed by the 100% compression rate and transmits a certain amount of data, the compressing module 403 obtains a change in the current network transmission rate currently obtained by the module 401, if the determining module 402 determines again that the network state corresponding to the network transmission rate interval corresponding to the current network transmission rate is a 4G network state, the current compression rate is 80%, and the compressing module 103 compresses the data to be transmitted at the current time at the 80% compression rate.
When the device compresses the picture at a compression rate of 40% in a 2G network state, the obtained current network transmission rate changes, and if the network state corresponding to the network transmission rate interval corresponding to the current network transmission rate is determined to be a 3G network state again, the current compression rate is changed to 60%.
And by analogy, if the current network transmission rate is changed and the network state needs to be changed, obtaining a preset compression rate corresponding to the current network state based on the changed network state and the network state-compression rate mapping relation, and compressing the data to be transmitted of the picture at the current moment according to the preset compression rate.
Then, if the current network transmission rate is in the 4G network state, but the picture is found to have been successfully sent after a duration of less than 5s, the adjusting module 404 adjusts the current network state-compression ratio mapping relationship, and increases the preset compression ratio in the network state-compression ratio mapping relationship, so that the picture has a greater fidelity; if the current network transmission rate is in the 3G network state, and the picture is still not successfully sent after 30s, the preset compression rate in the network state-compression rate mapping relation is reduced, so that the picture can be successfully sent as soon as possible, and the user experience is improved.
Finally, the compression module 403 compresses the data to be transmitted at the current moment of the picture at the current compression rate until the compressed data to be transmitted is completely transmitted.
In some optional implementations of this embodiment, the network state-compression ratio mapping relationship includes a preset function that maps different network state parameters to different compression ratios; and the determining module 402 is further configured to: and determining the compression rate corresponding to the current moment according to the preset function and the network state parameter of the current moment.
Similarly, the operation of the data transmission device will be described below by way of a specific example.
In the pre-established network state-compression ratio mapping relationship, the network state and the compression ratio are in a functional relationship A1, the minimum value in the preset time delay threshold value is 5s, and the maximum value is 30 s.
When a user wants to send a picture, first, the obtaining module 401 of the device obtains the current network status parameter N1.
Next, the determining module 402 obtains a compression ratio M1 corresponding to the current network state parameter N1 based on the current network state parameter N1 and a preset function a1, the compressing module 403 compresses the data to be transmitted at the current time with the compression ratio M1, after certain data is transmitted, the obtaining module 401 obtains the current network state N2 and obtains the compression ratio M2 corresponding to the current network state parameter N2 based on a preset function a1, and the compressing module 403 compresses the data to be transmitted at the current time with the compression ratio M2.
By analogy, if the current network state parameter changes, the preset compression rate corresponding to the current network state parameter is obtained based on the current network state parameter and the preset function a1, and the data to be transmitted of the picture at the current moment is compressed according to the preset compression rate.
Then, if the picture is successfully sent within a time length of less than 5 seconds under the current network state parameter, the adjusting module 404 adjusts the current preset function a1 to be the function a2, and the function a2 increases the preset compression rate in the network state-compression rate mapping relationship, so that the picture has a higher fidelity; if the picture is not successfully sent after 30 seconds under the current network state parameter, the adjusting module 404 adjusts the current preset function a1 to be the function A3, and the preset compression rate in the network state-compression rate mapping relationship is reduced in the function A3, so that the picture can be successfully sent as soon as possible, and the user experience is improved.
Finally, the compression module 403 compresses the data to be transmitted at the current moment of the picture at the current compression rate until the compressed data to be transmitted is completely transmitted.
Referring to fig. 5, fig. 5 illustrates an exemplary system architecture to which the data transmission method of one embodiment of the present disclosure may be applied.
As shown in fig. 5, the system architecture may include terminal devices 501, 502, 503, networks 504, 505, a first server 506, and a second server 507. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the first server 506. The network 505 serves as a medium for providing a communication link between the first server 506 and the second server 507. The networks 504, 505 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 501, 502, 503 may interact with the first server 505 over the network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have various client applications installed thereon, such as a web browser application, a search-type application, and a news-information-type application.
The terminal devices 501, 502, 503 may be various electronic devices having a display screen, including, but not limited to, devices such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like.
The first server 506 may be an on-site server, such as a server to which a search engine service platform belongs. The first server 506 may provide various services, for example, receive information acquisition requests sent by the terminal devices 501, 502, and 503, acquire links corresponding to search results corresponding to the information acquisition requests through various information acquisition manners according to the information acquisition requests, for example, acquire links corresponding to the search results from the second server 507.
The second server 507 may be an off-site server. The second server 507 may be various servers, for example, receive the information acquisition request of the first server 506, perform matching from the information stored in the corresponding data pants according to the information acquisition request, and send the link of the information that is successfully matched to the first server 506.
It should be noted that the data transmission method provided by the embodiment of the disclosure is generally executed by the first server 506, and accordingly, the data transmission apparatus is generally disposed in the first server 506.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to fig. 6, a schematic diagram of an electronic device (e.g., the first server of fig. 5) suitable for implementing embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device may include a processing means (e.g., a central processing unit, a graphic processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 606 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 606 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 606, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a network state parameter at the current moment, wherein the network state parameter comprises a network transmission rate; determining a compression ratio corresponding to the current moment according to the network state parameters and a pre-established network state-compression ratio mapping relation, wherein the network state-compression ratio mapping relation is used for determining a data compression ratio according to the network state parameters; and compressing the data to be transmitted of the transmission object at the current moment according to the compression ratio, and transmitting the compressed data to be transmitted.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of the module does not in some cases form a limitation on the module itself, for example, the obtaining module may also be described as a module for obtaining the network state parameter at the current time, where the network state parameter includes the network transmission rate.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (14)

1. A method of data transmission, comprising:
acquiring a network state parameter at the current moment, wherein the network state parameter comprises a network transmission rate;
determining a compression ratio corresponding to the current moment according to the network state parameters and a pre-established network state-compression ratio mapping relation, wherein the network state-compression ratio mapping relation is used for determining a data compression ratio according to the network state parameters;
and compressing the data to be transmitted of the transmission object at the current moment according to the compression ratio, and transmitting the compressed data to be transmitted.
2. The method of claim 1, wherein the network status-compression ratio mapping relationship comprises a plurality of network transmission rate intervals and a plurality of preset compression ratios corresponding to the network transmission intervals, and the preset compression ratios corresponding to different network transmission intervals are different; and
the determining the compression ratio corresponding to the current moment according to the network state parameter and the pre-established network state-compression ratio mapping relationship comprises:
determining a network transmission rate interval corresponding to the network transmission rate at the current moment;
searching a preset compression ratio corresponding to the network transmission rate interval from the network state-compression ratio mapping relation, and determining the preset compression ratio as a compression ratio corresponding to the current moment; wherein
A first preset compression rate corresponding to a first network transmission rate interval is greater than a second preset compression rate corresponding to a second network transmission rate interval, any network transmission rate in the first network transmission rate interval is greater than any network transmission rate in the second network transmission rate interval, and the first network transmission rate and the second network transmission rate belong to the plurality of network transmission rate intervals.
3. The method of claim 1, wherein the network state-compression ratio mapping relationship comprises a preset function mapping different network state parameters to different compression ratios; and
the determining the compression ratio corresponding to the current moment according to the network state parameter and the pre-established network state-compression ratio mapping relationship comprises:
and determining the compression rate corresponding to the current moment according to the preset function and the network state parameter of the current moment.
4. The method of claim 1, wherein the obtaining the network state parameter at the current time comprises:
acquiring the transmission data volume before the current time and in a preset time period adjacent to the current time;
and obtaining the network transmission rate of the last preset time period based on the transmission data volume and the duration of the preset time period, and taking the network transmission rate of the last preset time period as the current network transmission rate.
5. The method of claim 1, further comprising:
and adjusting the network state-compression ratio mapping relation according to the transmission delay of the compressed data to be transmitted.
6. The method according to claim 5, wherein the adjusting the network state-compression ratio mapping relationship according to the transmission delay of the compressed data to be transmitted comprises:
if the transmission delay is smaller than a preset delay threshold, adjusting the network state-compression ratio mapping relation to increase the compression ratio corresponding to the data to be transmitted;
and if the transmission delay is larger than a preset delay threshold, adjusting the network state-compression ratio mapping relation to reduce the compression ratio corresponding to the data to be transmitted.
7. A data transmission apparatus, comprising:
the system comprises an acquisition module, a transmission module and a processing module, wherein the acquisition module is used for acquiring network state parameters at the current moment, and the network state parameters comprise network transmission rate;
the determining module is used for determining a compression ratio corresponding to the current moment according to the network state parameter and a pre-established network state-compression ratio mapping relation, wherein the network state-compression ratio mapping relation is used for determining a data compression ratio according to the network state parameter;
and the compression module is used for compressing the data to be transmitted of the transmission object at the current moment according to the compression rate and transmitting the compressed data to be transmitted.
8. The apparatus of claim 7, wherein the network status-compression ratio mapping relationship comprises a plurality of network transmission rate intervals and preset compression ratios respectively corresponding to the network transmission rate intervals, and different network transmission rate intervals correspond to different preset compression ratios; and
the determination module is further to:
determining a network transmission rate interval corresponding to the network transmission rate at the current moment;
searching a preset compression ratio corresponding to the network transmission rate interval from the network state-compression ratio mapping relation, and determining the preset compression ratio as a compression ratio corresponding to the current moment; wherein
A first preset compression rate corresponding to a first network transmission rate interval is greater than a second preset compression rate corresponding to a second network transmission rate interval, any network transmission rate in the first network transmission rate interval is greater than any network transmission rate in the second network transmission rate interval, and the first network transmission rate and the second network transmission rate belong to the plurality of network transmission rate intervals.
9. The apparatus of claim 7, wherein: the network state-compression ratio mapping relation comprises preset functions for mapping different network state parameters into different compression ratios; and
the determination module is further to:
and determining the compression rate corresponding to the current moment according to the preset function and the network state parameter of the current moment.
10. The apparatus of claim 7, wherein the obtaining module is further configured to:
acquiring the transmission data volume before the current time and in a preset time period adjacent to the current time;
and obtaining the network transmission rate of the last preset time period based on the transmission data volume and the duration of the preset time period, and taking the network transmission rate of the last preset time period as the current network transmission rate.
11. The apparatus of claim 7, further comprising an adjustment module to:
and adjusting the network state-compression ratio mapping relation according to the transmission delay of the compressed data to be transmitted.
12. The apparatus of claim 11, wherein the adjustment module is further configured to:
if the transmission delay is smaller than a preset delay threshold, adjusting the network state-compression ratio mapping relation to increase the compression ratio corresponding to the data to be transmitted;
and if the transmission delay is larger than a preset delay threshold, adjusting the network state-compression ratio mapping relation to reduce the compression ratio corresponding to the data to be transmitted.
13. An electronic device, comprising:
one or more processors;
storage means having one or more programs stored thereon which, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-6.
14. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN201910962703.5A 2019-10-10 2019-10-10 Data transmission method and device and electronic equipment Pending CN110781150A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910962703.5A CN110781150A (en) 2019-10-10 2019-10-10 Data transmission method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910962703.5A CN110781150A (en) 2019-10-10 2019-10-10 Data transmission method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN110781150A true CN110781150A (en) 2020-02-11

Family

ID=69385087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910962703.5A Pending CN110781150A (en) 2019-10-10 2019-10-10 Data transmission method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110781150A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111372240A (en) * 2020-03-05 2020-07-03 江苏苏宁物流有限公司 Picture uploading method and device, computer equipment and storage medium
CN112887429A (en) * 2021-03-08 2021-06-01 深圳市车宝信息科技有限公司 Data transmission method and device, electronic equipment and storage medium
CN113825116A (en) * 2021-02-05 2021-12-21 深圳信息职业技术学院 Heterogeneous data transmission method and device, computer equipment and storage medium
CN115174075A (en) * 2022-07-22 2022-10-11 武汉卓诺世环电子商务有限公司 Data transmission method, data transmission equipment and computer storage medium
CN115767627A (en) * 2022-11-08 2023-03-07 创启科技(广州)有限公司 5G communication data transmission system and transmission method and storage medium thereof
CN116760935A (en) * 2023-08-21 2023-09-15 湖南马栏山视频先进技术研究院有限公司 Data fence system based on image data transmission

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103957389A (en) * 2014-05-13 2014-07-30 重庆大学 3G video transmission method and system based on compression sensing
CN104394486A (en) * 2014-11-26 2015-03-04 中标软件有限公司 Method and device for processing video stream based on cloud desktop
CN107046606A (en) * 2016-02-06 2017-08-15 株式会社理光 Picture transmitter device, image real-time display system and image real-time display method
CN108696649A (en) * 2017-04-06 2018-10-23 百度在线网络技术(北京)有限公司 Image processing method, device, equipment and computer readable storage medium
CN109194647A (en) * 2018-08-30 2019-01-11 北京金山安全软件有限公司 Data transmission method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103957389A (en) * 2014-05-13 2014-07-30 重庆大学 3G video transmission method and system based on compression sensing
CN104394486A (en) * 2014-11-26 2015-03-04 中标软件有限公司 Method and device for processing video stream based on cloud desktop
CN107046606A (en) * 2016-02-06 2017-08-15 株式会社理光 Picture transmitter device, image real-time display system and image real-time display method
CN108696649A (en) * 2017-04-06 2018-10-23 百度在线网络技术(北京)有限公司 Image processing method, device, equipment and computer readable storage medium
CN109194647A (en) * 2018-08-30 2019-01-11 北京金山安全软件有限公司 Data transmission method and device, electronic equipment and storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111372240A (en) * 2020-03-05 2020-07-03 江苏苏宁物流有限公司 Picture uploading method and device, computer equipment and storage medium
CN113825116A (en) * 2021-02-05 2021-12-21 深圳信息职业技术学院 Heterogeneous data transmission method and device, computer equipment and storage medium
CN112887429A (en) * 2021-03-08 2021-06-01 深圳市车宝信息科技有限公司 Data transmission method and device, electronic equipment and storage medium
CN115174075A (en) * 2022-07-22 2022-10-11 武汉卓诺世环电子商务有限公司 Data transmission method, data transmission equipment and computer storage medium
CN115767627A (en) * 2022-11-08 2023-03-07 创启科技(广州)有限公司 5G communication data transmission system and transmission method and storage medium thereof
CN116760935A (en) * 2023-08-21 2023-09-15 湖南马栏山视频先进技术研究院有限公司 Data fence system based on image data transmission
CN116760935B (en) * 2023-08-21 2023-10-17 湖南马栏山视频先进技术研究院有限公司 Data fence system based on image data transmission

Similar Documents

Publication Publication Date Title
CN110781150A (en) Data transmission method and device and electronic equipment
CN111246228B (en) Method, device, medium and electronic equipment for updating gift resources of live broadcast room
CN111314439A (en) Data sending method and device and electronic equipment
CN112954354B (en) Video transcoding method, device, equipment and medium
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN111263220B (en) Video processing method and device, electronic equipment and computer readable storage medium
CN110910469A (en) Method, device, medium and electronic equipment for drawing handwriting
CN112256733A (en) Data caching method and device, electronic equipment and computer readable storage medium
CN110768861B (en) Method, device, medium and electronic equipment for obtaining overtime threshold
CN112965673A (en) Content printing method, device, equipment and storage medium
CN113542856B (en) Method, device, equipment and computer readable medium for reverse playing of online video
CN114039926A (en) Transmission control protocol determining method and device, readable medium and electronic equipment
CN111478916B (en) Data transmission method, device and storage medium based on video stream
CN112929240A (en) Method, device, terminal and non-transitory storage medium for acquiring communication delay time
CN112346661B (en) Data processing method and device and electronic equipment
CN111444457B (en) Data release method and device, storage medium and electronic equipment
CN114785770A (en) Mirror layer file sending method and device, electronic equipment and computer readable medium
CN112543228A (en) Data transmission method and device, electronic equipment and computer readable medium
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN116361254B (en) Image storage method, apparatus, electronic device, and computer-readable medium
CN110007894B (en) Method and device for transmitting audio information
CN112948108B (en) Request processing method and device and electronic equipment
CN111246229B (en) Method, device, medium and electronic equipment for updating gift resources of live broadcast room
CN111274296B (en) Image data acquisition method and device, terminal and storage medium
CN112685455B (en) Real-time data classification display method and device, electronic equipment and readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200211

RJ01 Rejection of invention patent application after publication