Data transmission method and apparatus, electronic device, and computer storage medium
By using an unencrypted transmission channel to transmit data when the data length reaches a threshold, the inefficiency caused by multiple rounds of encryption and decryption is solved, achieving more efficient data transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ECOFLOW INC
- Filing Date
- 2025-07-07
- Publication Date
- 2026-05-29
AI Technical Summary
In existing data exchange processes, large files need to be transmitted in multiple data frames, which requires multiple rounds of encryption and decryption, severely impacting data transmission efficiency and speed.
If the length of the data to be transmitted is greater than or equal to a preset length threshold, an unencrypted transmission channel is created with the receiving end, and the data is transmitted directly through the unencrypted transmission channel, reducing the number of encryption and decryption operations.
Transmitting data through an unencrypted transmission channel saves multiple rounds of encryption and decryption steps, significantly improving data transmission efficiency and speed.
Smart Images

Figure CN122120259A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data processing technology, and in particular relates to a data transmission method, apparatus, electronic device, and computer storage medium. Background Technology
[0002] With the development of technology, many electronic devices have communication capabilities and can interact with other electronic devices.
[0003] In some scenarios, to ensure communication security, encrypted transmission channels are established between electronic devices. In these channels, data is encrypted using methods such as session keys and private communication protocols.
[0004] In this way, even if the transmitted data is eavesdropped on, the eavesdropper will find it difficult to identify the specific content being transmitted, thus ensuring data security. However, when transmitting large files, it is usually necessary to divide the large file into several data frames for transmission. The two parties exchanging data need to perform multiple rounds of encryption and decryption, which seriously affects the efficiency of data transmission and results in low data transmission speed. Summary of the Invention
[0005] This application provides a data transmission method, apparatus, electronic device, and computer storage medium, aiming to solve the problem that multiple rounds of encryption and decryption in existing data interaction affect the efficiency of data transmission and result in low data transmission speed.
[0006] In a first aspect, embodiments of this application provide a data transmission method, the method being applied at a sending end, wherein an encrypted transmission channel is established between the sending end and the receiving end, the method comprising:
[0007] Get the data to be transmitted;
[0008] If the length of the data to be transmitted is greater than or equal to a preset length threshold, an unencrypted transmission channel for communication with the receiving end is created.
[0009] The data to be transmitted is transmitted to the receiving end through the unencrypted transmission channel.
[0010] In one possible implementation of the first aspect above, transmitting the data to be transmitted to the receiving end via the unencrypted transmission channel includes:
[0011] The data to be transmitted is divided into multiple data frames, and each data frame is transmitted to the receiving end through the unencrypted transmission channel.
[0012] After transmitting each data frame to the receiving end through the unencrypted transmission channel, the method further includes:
[0013] Receive the data transmission results fed back by the receiving end.
[0014] In one possible implementation of the first aspect above, after receiving the data transmission result fed back by the receiving end, the method further includes:
[0015] If the data transmission result includes packet loss information, the data frame corresponding to the packet loss information will be transmitted to the receiving end through the unencrypted transmission channel.
[0016] In one possible implementation of the first aspect above, dividing the data to be transmitted into multiple data frames and transmitting each data frame to the receiving end through the unencrypted transmission channel includes:
[0017] The data transmission parameters transmitted by the receiving end are obtained through the encrypted transmission channel; wherein, the data transmission parameters include the transmission frequency and the data frame length;
[0018] The data to be transmitted is divided into multiple data frames according to the data frame length.
[0019] According to the transmission frequency, the data frames are transmitted frame by frame to the receiving end through the unencrypted transmission channel.
[0020] In one possible implementation of the first aspect described above, the method further includes:
[0021] During the process of transmitting the data to be transmitted to the receiving end through an unencrypted transmission channel, when a breakpoint reconnection event is triggered, the transmission progress information is obtained.
[0022] The data frame corresponding to the transmission progress information is transmitted to the receiving end through the unencrypted transmission channel.
[0023] In one possible implementation of the first aspect above, transmitting the data to be transmitted to the receiving end via the unencrypted transmission channel includes:
[0024] When the data to be transmitted is unencrypted, the data to be transmitted is encrypted.
[0025] The encrypted data to be transmitted is transmitted to the receiving end through the unencrypted transmission channel.
[0026] In one possible implementation of the first aspect described above, the method further includes:
[0027] If the length of the data to be transmitted is less than the length threshold, the data to be transmitted is transmitted to the receiving end through the encrypted transmission channel.
[0028] Secondly, this application provides a data transmission apparatus, which is applied to a transmitting end, wherein an encrypted transmission channel is established between the transmitting end and the receiving end, and the apparatus includes:
[0029] The acquisition module is used to acquire the data to be transmitted.
[0030] A creation module is used to create an unencrypted transmission channel for communication with the receiving end when the length of the data to be transmitted is greater than or equal to a preset length threshold.
[0031] A transmission module is used to transmit the data to be transmitted to the receiving end through the unencrypted transmission channel.
[0032] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data transmission method as described in the first aspect above.
[0033] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when run on a computer, causes the computer to execute the data transmission method provided in the first aspect.
[0034] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the data transmission method described in the first aspect above.
[0035] The beneficial effects of the embodiments in this application compared with the prior art are:
[0036] In this embodiment, by acquiring the data to be transmitted, and if the length of the data to be transmitted is greater than or equal to a preset length threshold, an unencrypted transmission channel for communication with the receiving end is created. Then, the data to be transmitted is transmitted to the receiving end through the unencrypted transmission channel. Since the unencrypted transmission channel is a data transmission channel that does not require encryption of the transmitted data, the data to be transmitted can be transmitted directly through the unencrypted transmission channel. This saves the steps of encrypting and decrypting the data in multiple rounds, greatly reduces the number of times the communicating parties need to encrypt and decrypt during data interaction, effectively reduces the time spent on data transmission, and improves the efficiency and speed of data transmission. Attached Figure Description
[0037] Figure 1 This is a flowchart illustrating the steps of a data transmission method according to an embodiment of this application;
[0038] Figure 2This is a flowchart of another data transmission method provided in an embodiment of this application;
[0039] Figure 3 This is a schematic flowchart of a data transmission method based on packet loss provided in an embodiment of this application;
[0040] Figure 4 This is a schematic flowchart of a data transmission method provided in an embodiment of this application;
[0041] Figure 5 This is a flowchart illustrating a data transmission method based on a breakpoint reconnection event according to an embodiment of this application;
[0042] Figure 6 This is a schematic flowchart of another data transmission method provided in an embodiment of this application;
[0043] Figure 7 This is a flowchart illustrating a data transmission method in an upgrade scenario provided by an embodiment of this application;
[0044] Figure 8 This is a schematic diagram of the structure of a data transmission device according to an embodiment of this application;
[0045] Figure 9 This is a structural block diagram of an electronic device provided in one embodiment of this application. Detailed Implementation
[0046] To make the technical problems, technical solutions, and beneficial effects to be solved by this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this application.
[0047] With the development of technology, many electronic devices have communication capabilities and can interact with other electronic devices. In some scenarios, to ensure communication security, encrypted transmission channels are established between electronic devices, and the transmitted data is encrypted using methods such as session keys and private communication protocols.
[0048] In this way, even if the transmitted data is eavesdropped on, the eavesdropper will find it difficult to identify the specific content being transmitted, thus ensuring data security.
[0049] However, when transmitting large files, it is usually necessary to divide the large file into several data frames for transmission. The two parties exchanging data need to perform multiple rounds of encryption and decryption. Specifically, each time a data frame is transmitted, the sending end needs to encrypt the data frame to be transmitted and send the encrypted data frame to the receiving end. After receiving the transmitted data frame, the receiving end needs to decrypt the received data frame. Therefore, when transmitting multiple data frames, each data frame needs to be encrypted and decrypted separately. The multiple rounds of encryption and decryption seriously affect the efficiency of data transmission, resulting in low data transmission speed.
[0050] Based on this, this application provides a data transmission method, apparatus, electronic device, and computer storage medium. By acquiring the data to be transmitted, and when the length of the data to be transmitted is greater than or equal to a preset length threshold, an unencrypted transmission channel for communication with the receiving end is created. Then, the data to be transmitted is transmitted to the receiving end through the unencrypted transmission channel. Since the unencrypted transmission channel is a data transmission channel that does not require encryption of the transmitted data, the data to be transmitted can be transmitted directly through the unencrypted transmission channel, thereby saving the steps of multiple rounds of encryption and decryption of the data, greatly reducing the number of encryption and decryption operations during data interaction, thereby reducing the time consumption of data transmission and effectively improving the efficiency and speed of data transmission.
[0051] See Figure 1 , Figure 1 This illustration shows a flowchart of a data transmission method according to an embodiment of this application. The method is applied at a sending end, and an encrypted transmission channel is established between the sending end and the receiving end. The sending end can be a device used to send data during communication, and the receiving end can be a device used to receive data during communication. The devices used to send or receive data can be communication-enabled devices, such as clients, terminal devices, servers, cloud platforms, etc. The encrypted transmission channel is a channel between the sending end and the receiving end used to encrypt and transmit the data to be transmitted. The encrypted transmission channel can be established based on the communication addresses of the sending end and the receiving end, which can be allocated based on a preset communication protocol.
[0052] Specifically, the method may include the following steps:
[0053] S101, Obtain the data to be transmitted.
[0054] The data to be transmitted can be the data that needs to be transmitted during the communication process. Specifically, the data to be transmitted can be different in different scenarios. For example, in the scenario of device upgrade, the data to be transmitted can be the firmware data used for the upgrade, while in the scenario of playing video, the data to be transmitted can be the video data used for playback.
[0055] When communication is required, the sending end can use different communication technologies to connect with the receiving end, such as wired communication technology, wireless communication technology, etc.
[0056] Furthermore, during communication, the sending and receiving ends can encrypt and decrypt the transmitted content based on a negotiated encryption method, thereby obtaining an encrypted transmission channel for data transmission. For example, the sending and receiving ends can encrypt and decrypt data transmitted in the encrypted transmission channel using a pre-agreed session key and a specific communication protocol.
[0057] After an encrypted transmission channel is created, the sending end can obtain the data to be transmitted in the current communication based on any one of the following factors: user operation, pre-set trigger conditions, or request instructions sent by the receiving end.
[0058] For example, different scenarios can correspond to different task requirements. In different scenarios, the receiving end can generate corresponding request instructions based on the task requirements of that scenario, and send the generated request instructions to the sending end.
[0059] As an example, the receiving end can be a terminal device with multiple applications installed, and the sending end can be a server. When the receiving end detects that any application needs to undergo version iteration, it can determine that the corresponding task requirement in this scenario is to iterate the version of the application on the receiving end. Based on this task requirement, the receiving end can generate a request instruction to obtain the latest version of firmware data and send this request instruction to the sending end. Upon receiving the request instruction, the sending end can respond by retrieving the latest version of firmware data from the server's database, which is the data to be transmitted. The latest version of firmware data can be the data used for application version iteration.
[0060] As another example, the sending end can be a cloud platform, and the receiving end can be a terminal device capable of playing video. When the receiving end needs to play video A, it can be determined that the task requirement corresponding to this scenario is the task requirement of playing video A. Then, the receiving end can generate a request instruction to obtain video data related to video A, and request the cloud platform to obtain video data related to video A based on the request instruction. Then, the cloud platform can retrieve the pre-stored video data related to video A from the server database. The video data related to video A is the aforementioned data to be transmitted.
[0061] In one embodiment of this application, during the communication connection between the transmitting end and the receiving end, the transmitting end can also detect the signal strength of the communication connection with the receiving end. If the signal strength is lower than a preset strength threshold, a signal abnormality prompt is generated to alert the user that the signal strength is too low. The signal abnormality prompt alerts the user that the signal strength detected at the current location is low, prompting the user to perform operations that can improve the signal strength, such as changing the location of the transmitting end or removing obstructions. This can reduce the occurrence of communication disconnection between the transmitting end and the receiving end due to low signal strength, and avoid the impact of low signal strength on data transmission efficiency, thereby improving the success rate and efficiency of data transmission.
[0062] S102, if the length of the data to be transmitted is greater than or equal to a preset length threshold, an unencrypted transmission channel for communication with the receiving end is created.
[0063] The aforementioned data length refers to the file size of the data to be transmitted. The preset length threshold can be set according to the needs of the actual scenario, and this application does not impose any restrictions on it. For example, the preset length threshold can be user-defined, derived from experience, determined based on the data transmission capability of the sending end, the data reception capability of the receiving end, or the data processing capability of the receiving end for processing the data to be transmitted, etc.
[0064] The aforementioned unencrypted transmission channel can be a channel used to transmit data between the sending end and the receiving end, and there is no need to encrypt the data to be transmitted when transmitting data through the unencrypted transmission channel.
[0065] After obtaining the data to be transmitted, the length of the data to be transmitted can be determined and compared with a preset length threshold. Then, if the length of the data to be transmitted is greater than or equal to the preset length threshold, an unencrypted transmission channel for communication with the receiving end can be created to speed up data transmission.
[0066] If the length of the data to be transmitted is less than a preset length threshold, the data to be transmitted is transmitted to the receiving end through an encrypted transmission channel.
[0067] It is important to understand that when the length of the data to be transmitted is greater than or equal to a preset length threshold, it can be determined that the data to be transmitted needs to be divided into several data frames for transmission when transmitting the data to the receiving end. If an encrypted transmission channel is used to transmit each data frame, each data frame needs to be encrypted before transmission, and the receiving end needs to decrypt each data frame after receiving it. That is, using an encrypted transmission channel to transmit the data to be transmitted requires multiple rounds of encryption and decryption, which reduces the efficiency of data transmission and results in low data transmission speed.
[0068] Based on this, when the length of the data to be transmitted is greater than or equal to a preset length threshold, an unencrypted transmission channel can be created to communicate with the receiving end without encrypting the data to be transmitted. The data to be transmitted is then transmitted through this unencrypted transmission channel. Since the data to be transmitted does not need to be encrypted and decrypted multiple times when using the unencrypted transmission channel, a large number of encryption and decryption steps can be saved, greatly reducing the number of encryption and decryption operations during data interaction. This effectively reduces the time consumed by data transmission and improves the efficiency and speed of data transmission.
[0069] In practical applications, after creating an encrypted transmission channel for transmitting data, the sending end can communicate with the receiving end. When the data to be transmitted is obtained and its length is greater than or equal to a preset length threshold, the sending end and the receiving end can jointly create an unencrypted transmission channel, enabling the sending end to transmit the data to be transmitted to the receiving end through the unencrypted transmission channel.
[0070] S103 transmits the data to be transmitted to the receiving end through an unencrypted transmission channel.
[0071] After creating an unencrypted transmission channel, the data to be transmitted can be sent to the receiving end through the unencrypted transmission channel.
[0072] In practical applications, the data to be transmitted can be divided into several data frames, and the corresponding data frames can be transmitted to the receiving end through an unencrypted transmission channel.
[0073] In one embodiment of this application, S103 may include S1031 to S1032:
[0074] S1031, when the data to be transmitted is unencrypted, encrypt the data to be transmitted.
[0075] Unencrypted data refers to data that has not been encrypted, such as data that exists in plaintext.
[0076] After creating an unencrypted transmission channel, it can be determined whether the data to be transmitted is unencrypted. If the data to be transmitted is not unencrypted, it is directly transmitted to the receiving end through the unencrypted transmission channel. If the data to be transmitted is unencrypted, it is encrypted.
[0077] It is important to understand that even if an unencrypted transmission channel is a data channel that does not require encryption of the data to be transmitted, meaning that when transmitting data through an unencrypted transmission channel, there is no need to encrypt the data to be transmitted, in order to improve the security of transmitting data through an unencrypted transmission channel, after determining that the data to be transmitted is unencrypted, data encryption technology can be used to encrypt the file itself of the data to be transmitted, resulting in encrypted data to be transmitted.
[0078] For example, a specified key can be used to encrypt the data to be transmitted, and the key can be transmitted to the receiving end through an encrypted transmission channel so that the receiving end can decrypt the encrypted data to be transmitted based on the key; alternatively, the receiving end's public key can be used to encrypt the data to be transmitted so that the receiving end can decrypt the encrypted data to be transmitted based on the private key stored on its own end.
[0079] In practical applications, an unencrypted transmission channel can be created when the length of the data to be transmitted is greater than or equal to a preset length threshold. Before transmitting the data to be transmitted through the unencrypted transmission channel, the unencrypted data is identified and encrypted to obtain the encrypted data to be transmitted. Then, the encrypted data is divided into multiple data frames and transmitted through the unencrypted transmission channel, eliminating the need to encrypt each data frame again. The receiving end decrypts all data frames upon receipt to obtain the desired data to be transmitted. This single encryption and decryption step, compared to transmitting each data frame through an encrypted transmission channel, saves the steps of multiple rounds of encryption and decryption during data exchange, significantly reducing the number of encryption and decryption operations required, effectively reducing data transmission time, and improving data transmission efficiency and speed.
[0080] S1032 transmits the encrypted data to be transmitted to the receiving end through an unencrypted transmission channel.
[0081] After obtaining the encrypted data to be transmitted, the encrypted data can be transmitted to the receiving end through an unencrypted transmission channel.
[0082] In this embodiment, by acquiring the data to be transmitted, and if the length of the data to be transmitted is greater than or equal to a preset length threshold, an unencrypted transmission channel for communication with the receiving end is created. Then, the data to be transmitted is transmitted to the receiving end through the unencrypted transmission channel. Since the unencrypted transmission channel is a data transmission channel that does not require encryption of the transmitted data, the data to be transmitted can be transmitted directly through the unencrypted transmission channel. This saves the steps of encrypting and decrypting the data in multiple rounds, greatly reduces the number of times encryption and decryption are required during data interaction, effectively reduces the time consumed by data transmission, and improves the efficiency and speed of data transmission.
[0083] See Figure 2 , Figure 2 This invention illustrates a flowchart of another data transmission method according to an embodiment of the present application. The method is applied at a sending end, and an encrypted transmission channel is established between the sending end and the receiving end. Specifically, it may include the following steps:
[0084] S201, Obtain the data to be transmitted.
[0085] S202, if the length of the data to be transmitted is greater than or equal to a preset length threshold, an unencrypted transmission channel for communication with the receiving end is created.
[0086] S203, divide the data to be transmitted into multiple data frames, and transmit each data frame to the receiving end through an unencrypted transmission channel.
[0087] If the length of the data to be transmitted is greater than or equal to a preset length threshold, the data to be transmitted can be divided into multiple data frames, and each data frame can be transmitted to the receiving end through an unencrypted transmission channel.
[0088] In one embodiment of this application, S203 may include S2031 to S2033:
[0089] S2031, obtain the data transmission parameters transmitted by the receiving end through the encrypted transmission channel.
[0090] The data transmission parameters can be parameters used to instruct the sending end to transmit the data to be transmitted. These parameters can include one or more parameters such as transmission frequency and data frame length. Specifically, the transmission frequency can be the frequency at which the sending end is expected to transmit each data frame to the receiving end, and the data frame length can be the data length of the data frames that the sending end is expected to divide.
[0091] After establishing an unencrypted transmission channel, the receiving end can generate a first retrieval command and transmit it to the sending end via an encrypted transmission channel. Upon receiving the first retrieval command, the sending end can transmit the attribute information of the data to be transmitted to the receiving end via the unencrypted transmission channel. This attribute information may include one or more of the following: the data length of the data to be transmitted (i.e., the file size of the data to be transmitted), the number of sub-modules contained in the data to be transmitted, and the data length of each sub-module.
[0092] After receiving the attribute information of the data to be transmitted, the receiving end can determine the data transmission parameters based on its own device operating status information, and then transmit the data transmission parameters to the sending end through an encrypted transmission channel. The sending end can then obtain the data transmission parameters transmitted by the receiving end through the encrypted transmission channel. The receiving end's device operating status information may include one or more of the following: data receiving capability, data processing capability, and data processing method.
[0093] Specifically, the first acquisition instruction can be an instruction to acquire attribute information of the data to be transmitted, or an instruction to acquire fields that include attribute information describing the data to be transmitted.
[0094] As an example, assuming that the data describing the attribute information of the data to be transmitted is located in the first 1KB, the receiving end can generate a first acquisition instruction. This first acquisition instruction can be an instruction to acquire data including the attribute information of the data to be transmitted, that is, the first acquisition instruction is an instruction to acquire the first 1KB of data of the data to be transmitted. The first 1KB of data of the data to be transmitted includes data describing the attribute information. Then, the sending end can transmit the first 1KB of data of the data to be transmitted to the receiving end. After receiving the first 1KB of data of the data to be transmitted, the receiving end can parse the first 1KB of data of the data to be transmitted to determine the attribute information of the data to be transmitted.
[0095] In practical applications, after receiving the attribute information of the data to be transmitted, the receiving end can determine the data transmission parameters based on the device's operating status information. For example, the receiving end can determine the expected data length of each data frame based on its receiving capability, thus obtaining the data frame length. At the same time, the receiving end can also determine the processing time for each data frame based on its data processing capability. Then, based on the determined time, it can determine the frequency at which the sending end is expected to transmit each data frame to the receiving end, thus obtaining the transmission frequency.
[0096] In one embodiment of this application, the receiving end may include a communication module and at least one functional module. The communication module may be used to receive data transmitted by the sending end and distribute the received data to the corresponding functional module as needed. The functional module may be a module capable of performing one or more specific tasks, such as a power management system for controlling battery charging and discharging, an energy management system for managing energy scheduling, etc.
[0097] In practical applications, the communication module in the receiving end can receive data transmitted by the sending end. After receiving the length of the data to be transmitted, it can determine the distribution strategy for distributing the data to be transmitted to the corresponding functional modules based on the length of the data to be transmitted. Then, after receiving the data frame, the communication module can distribute the data frame to the corresponding functional modules based on the predetermined distribution strategy.
[0098] Specifically, the distribution strategy may include a first distribution strategy where each received data frame is directly distributed to the corresponding functional module; a second distribution strategy where all data frames corresponding to a functional module are received before being distributed to the corresponding functional module; and a third distribution strategy where all data frames of the data to be transmitted are received before being distributed to the corresponding functional modules in sequence. The first and second distribution strategies can be applied when the buffer capacity of the communication module is less than the length of the data to be transmitted, while the third distribution strategy is applied when the buffer capacity of the communication module is greater than or equal to the length of the data to be transmitted. The buffer capacity of the communication module can be used to temporarily store the received data frames.
[0099] S2032, divide the data to be transmitted into multiple data frames according to the data frame length.
[0100] After obtaining the data transmission parameters transmitted by the receiving end, the data to be transmitted can be divided into multiple data frames based on the data frame length in the data transmission parameters, and the data length of each data frame after division is less than or equal to the data frame length.
[0101] It's important to understand that when the length and frequency of data frames transmitted by the sending end exceed the receiving end's receiving capacity, the receiving end may not receive complete data frames or may miss some data, leading to data loss. In other words, packet loss may occur when the data transmission parameters of the sending end's data frames do not match the receiving end's receiving capacity. Therefore, the receiving end can obtain the attribute information of the data to be transmitted before acquiring it, and based on this attribute information and its device operating conditions, determine the desired data transmission parameters, such as the desired length and transmission frequency of each data frame after division. The sending end can then divide the data to be transmitted into multiple data frames based on these determined data transmission parameters and transmit the data frames to the receiving end according to these parameters, reducing data loss at the receiving end and improving the data transmission success rate.
[0102] S2033, according to the transmission frequency, transmit data frames to the receiving end frame by frame through the unencrypted transmission channel.
[0103] After obtaining multiple data frames, the data frames can be transmitted to the receiving end frame by frame through an unencrypted transmission channel according to the data transmission parameters, such as the transmission frequency in the data transmission parameters.
[0104] It is important to understand that when the frequency of data frames transmitted by the sending end exceeds the processing capacity of the receiving end, there may be situations where the receiving end receives the next data frame before it has been processed, which can lead to data congestion or even packet loss.
[0105] When the frequency of data frames transmitted by the sending end is less than the processing capacity of the receiving end, the receiving end will be idle most of the time, wasting its processing capacity.
[0106] Based on this, the receiving end can obtain the attribute information of the data to be transmitted before acquiring the data to be transmitted. Based on the attribute information of the data to be transmitted and its data processing capabilities, it can determine the frequency at which the sending end is expected to transmit each data frame to the receiving end, obtain the transmission efficiency, and feed it back to the sending end. This enables the sending end to transmit each data frame to the receiving end according to the determined transmission frequency, making reasonable use of the receiving end's processing capabilities, reducing data blocking or even packet loss, and improving the success rate of data transmission.
[0107] Furthermore, since the sending and receiving ends are different devices, and these devices may have performance differences, such as different processing speeds, if the sending end determines the data transmission parameters solely based on its own device's operating information, parameter mismatch may lead to the receiving end being idle for most of the time or experiencing packet loss. Therefore, the sending end delegates the initiative in determining the data transmission parameters to the receiving end. By obtaining the data transmission parameters fed back by the receiving end, the sending end adjusts its transmission mode, such as the frequency of data transmission and the data length of each data frame in the data to be transmitted. This allows the sending end to achieve high transmission efficiency when communicating with devices of different performance levels, improving compatibility.
[0108] S204, Receive the data transmission result fed back by the receiving end.
[0109] The data transmission result can be used to describe the data frames received by the receiving end. The data transmission result can be generated by the receiving end after receiving the last data frame, or when no data frames have been received within a preset first time period. The preset first time period can be user-defined or determined based on experience; this application does not limit it in this regard.
[0110] After each data frame is transmitted to the receiving end, the sending end can receive the data transmission result fed back by the receiving end. This data transmission result can be used to indicate successful data transmission, data transmission failure, retransmission of some or all data frames, etc., and this application does not limit this.
[0111] In practical applications, after receiving the last data frame or if no data frame is received within a preset first time period, the receiving end generates a data transmission result based on the received data frame and transmits the data transmission result to the sending end through an encrypted transmission channel.
[0112] It should be understood that each data frame may include the identification data of that data frame. The receiving end can then determine whether the currently received data frame is the last data frame based on the identification data in the currently received data frame. If it is determined to be the last data frame, a data transmission result is generated. If no data frame is received within the first time period, a data transmission result is also generated. That is, a data transmission result is generated based on the identification data of each received data frame.
[0113] Specifically, the identification data can be used to identify the data frame, and different data frames can be identified by different identification data.
[0114] S205, if the data transmission result includes packet loss information, the data frame corresponding to the packet loss information is transmitted to the receiving end through an unencrypted transmission channel.
[0115] Among them, packet loss information can be information indicating that packet loss has occurred at the receiving end. Packet loss can be the phenomenon that data received by the receiving end is lost. Packet loss information can include the identification data of the lost data frames.
[0116] After receiving the data transmission result from the receiving end, the data transmission result can be parsed. If the parsed result includes packet loss information, the data frame corresponding to the lost data frame in the packet loss information can be transmitted to the receiving end through an unencrypted transmission channel according to the identification data of the lost data frame. This allows the receiving end to obtain the complete data to be transmitted, reduces packet loss, and further improves the success rate of data transmission.
[0117] See Figure 3 , Figure 3 The illustration shows a flowchart of a data transmission method based on packet loss according to an embodiment of this application, which specifically includes the following steps:
[0118] S301, the sending end sends the data frames from the first frame to the Nth frame to the receiving end through the unencrypted transmission channel respectively;
[0119] Specifically, N is a positive integer, and N is greater than 1.
[0120] S302, When the receiving end receives any data frame, it records the identification data of the received data frame;
[0121] S303, when the receiving end receives the Nth data frame, or when it does not receive any data frame within the first time period, it determines whether there is a lost data frame based on the identification data of all received data frames.
[0122] S304, when the receiving end determines that there is a lost data frame, it determines that a packet loss has occurred and generates packet loss information based on the identification data corresponding to the lost data frame;
[0123] S305, when the receiving end determines that there is a lost data frame, it generates a data transmission result based on the packet loss information and transmits the data transmission result to the sending end through an encrypted transmission channel; wherein, the data transmission result includes packet loss information, which is used to instruct the sending end to send a command to retrieve the lost data frame;
[0124] S306 After receiving the data transmission result, the sending end determines the corresponding data frame based on the packet loss information in the data transmission result, and responds to the acquisition instruction in the data transmission result by sending the data frame corresponding to the packet loss information to the receiving end through the unencrypted transmission channel.
[0125] S307: After receiving the data frame corresponding to the packet loss information, the receiving end checks whether the data frames from the first frame to the Nth frame have been received, and if the check passes, completes the data transmission of the data frames from the first frame to the Nth frame.
[0126] In practical applications, when data frames from the first frame to the Nth frame are detected to be received, the verification is determined to be successful. However, when any data frame from the first frame to the Nth frame is detected to be unreceived, the verification is determined to be unsuccessful and packet loss is determined to have occurred. S304 is executed repeatedly until data frames from the first frame to the Nth frame are received, or the number of packet loss events exceeds a preset number, at which point the data transmission of data frames from the first frame to the Nth frame ends.
[0127] See Figure 4 , Figure 4 The illustration shows a flowchart of a data transmission method according to an embodiment of this application, which specifically includes the following steps:
[0128] S401, when the length of the data to be transmitted is greater than or equal to a preset length threshold, the receiving end generates a first acquisition instruction and sends the first acquisition instruction to the sending end through an encrypted transmission channel.
[0129] S402, after receiving the first acquisition instruction, the sending end sends the attribute information of the data to be transmitted to the receiving end through an unencrypted transmission channel;
[0130] S403, after receiving the attribute information of the data to be transmitted, the receiving end generates data transmission parameters based on the attribute information of the data to be transmitted, and sends the data transmission parameters to the sending end through the encrypted transmission channel;
[0131] S404 After receiving the data transmission parameters, the transmitting end divides the data to be transmitted into multiple data frames according to the data frame length in the data transmission parameters, and sends each data frame to the receiving end in sequence through the unencrypted transmission channel according to the transmission frequency in the data transmission parameters.
[0132] S405, when the receiving end receives the last data frame or does not receive any data frame within the first time period, it detects whether packet loss has occurred, and if packet loss has occurred, it generates a data transmission result including packet loss information and sends the data transmission result to the sending end through an encrypted transmission channel.
[0133] S406, after receiving the data transmission result, the sending end sends the data frame corresponding to the packet loss information in the data transmission result to the receiving end through an unencrypted transmission channel;
[0134] S407 After receiving the attribute information of the data to be transmitted, the receiving end determines the distribution strategy for distributing the data to be transmitted to the corresponding functional modules based on the attribute information of the data to be transmitted, and distributes the data frame to the corresponding functional modules according to the distribution strategy.
[0135] In one embodiment of this application, the method may further include the following steps:
[0136] During the process of transmitting data to the receiving end through an unencrypted transmission channel, when a breakpoint reconnection event is triggered, the transmission progress information is obtained, and the data frame corresponding to the transmission progress information is transmitted to the receiving end through the unencrypted transmission channel.
[0137] The breakpoint reconnection event can be an event in which the sending end and the receiving end re-establish a communication connection within a preset second time period after the communication connection is broken. The second time period can be the duration during which the sending end and the receiving end are allowed to re-establish a communication connection after the communication connection is broken, and its specific duration can be set according to the needs of the actual scenario. This application does not limit it in this regard. The transmission progress information can be used to indicate the progress of transmitting the data to be transmitted to the receiving end. For example, the receiving end can determine the transmission progress information based on the identification data of the last data frame received when the breakpoint reconnection event is triggered.
[0138] During the process of transmitting data to the receiving end through an unencrypted transmission channel, it is possible to detect in real time whether a breakpoint reconnection event is triggered. That is, during the transmission of data to the receiving end, it is possible to detect whether the communication connection between the sending end and the receiving end has been broken, and whether the communication connection has been re-established within a second time period after the breakpoint. If so, it can be determined that a breakpoint reconnection event has been triggered. If not, it can only be determined that the communication connection between the sending end and the receiving end has been broken, and the transmission of the data to be transmitted has been interrupted. Data transmission has failed, and the data to be transmitted needs to be retrieved again in the next communication connection.
[0139] When a breakpoint reconnection event is triggered, the receiving end can generate transmission progress information based on the identifier data of the last data frame received when the breakpoint reconnection event is triggered, and transmit the transmission progress information to the sending end through an encrypted transmission channel. In this way, the sending end can obtain the transmission progress information transmitted by the receiving end.
[0140] After obtaining the transmission progress information, the last data frame received by the receiving end when the breakpoint reconnection event is triggered can be determined based on the transmission progress information. Subsequent data frames can then be transmitted to the receiving end through an unencrypted transmission channel. In other words, the data frame following the last data frame received by the receiving end is determined to be the data frame corresponding to the transmission progress information.
[0141] For example, the sending end needs to transmit 49 data frames to the receiving end, and during the transmission, a reconnection event is triggered. When the reconnection event is triggered, the receiving end can determine the identifier data of the last data frame received at the time of the reconnection event, and based on this identifier data, determine that the last received data frame is the 34th data frame. The receiving end can then generate transmission progress information up to the 34th data frame and transmit this progress information to the sending end through an encrypted transmission channel. After receiving the transmission progress information from the receiving end, the sending end can determine that the data frames after the 34th data frame are the data frames corresponding to the transmission progress information. Therefore, it can determine that the 35th to 49th data frames are the subsequent data frames, and then transmit the 35th to 49th data frames sequentially to the receiving end through an unencrypted transmission channel.
[0142] See Figure 5 , Figure 5 The diagram illustrates a data transmission method based on a breakpoint reconnection event according to an embodiment of this application, which specifically includes the following steps:
[0143] When the sending end and the receiving end lose communication connection, the receiving end attempts to reconnect with the sending end within a second time period. If the receiving end successfully reconnects with the sending end within the second time period, a breakpoint reconnection event is determined to be triggered.
[0144] In the event of triggering a breakpoint reconnection event, the receiving end generates transmission progress information based on the last received data frame and transmits the transmission progress information to the sending end through an encrypted transmission channel.
[0145] After receiving the transmission progress information, the sending end determines the data frame corresponding to the transmission progress information and transmits the data frame corresponding to the transmission progress information to the receiving end in sequence through the unencrypted transmission channel.
[0146] By acquiring the data to be transmitted, and if the data length is greater than or equal to a preset length threshold, an unencrypted transmission channel for communication with the receiving end is created. The data to be transmitted is divided into multiple data frames, and each data frame is transmitted to the receiving end through the unencrypted transmission channel. Since the unencrypted transmission channel is a data transmission channel that does not require encryption of the transmitted data, the data to be transmitted can be transmitted directly through the unencrypted transmission channel, thus saving the steps of multiple rounds of encryption and decryption of the data. This greatly reduces the number of encryption and decryption operations required during data interaction, effectively reducing the time consumption of data transmission and improving the efficiency and speed of data transmission. Furthermore, when receiving the data transmission results from the receiving end, and if the data transmission results include packet loss information, the data frame corresponding to the packet loss information is transmitted to the receiving end through the unencrypted transmission channel, enabling the receiving end to obtain the complete data to be transmitted, reducing packet loss, and further improving the success rate of data transmission.
[0147] See Figure 6 , Figure 6 The illustration shows a flowchart of another data transmission method provided in an embodiment of this application, which may specifically include the following steps:
[0148] S601, the sending end communicates with the receiving end through an encrypted transmission channel, and creates an unencrypted transmission channel when the sending end needs to send the data to be transmitted to the receiving end;
[0149] S602, after creating an unencrypted transmission channel, the receiving end generates a first acquisition instruction and sends the first acquisition instruction to the sending end through an encrypted transmission channel;
[0150] S603, after receiving the first acquisition instruction, the sending end responds to the first acquisition instruction and sends the attribute information of the data to be transmitted to the receiving end through the unencrypted transmission channel;
[0151] S604 After receiving the attribute information of the data to be transmitted, the receiving end determines the data transmission parameters based on the attribute information of the data to be transmitted, and sends the data transmission parameters to the sending end through the encrypted transmission channel.
[0152] S605, after receiving the data transmission parameters, the sending end divides the data to be transmitted into multiple data frames based on the data frame length in the data transmission parameters, and sends each data frame to the receiving end through the unencrypted transmission channel in sequence according to the transmission frequency in the data transmission parameters.
[0153] In practical applications, the first to Nth data frames can be transmitted sequentially to the receiving end through an unencrypted transmission channel.
[0154] S606, after receiving the last data frame or if no data frame is received within a preset first time period, the receiving end generates a data transmission result based on the received data frame and sends the data transmission result to the sending end through an encrypted transmission channel.
[0155] S607 After receiving the data transmission result from the receiver, and after parsing that the data transmission result includes packet loss information, the sending end sends the data frame corresponding to the packet loss information to the receiving end through the unencrypted transmission channel, so that the receiving end can obtain the complete data to be transmitted.
[0156] See Figure 7 , Figure 7 The illustration shows a flowchart of a data transmission method in an upgrade scenario according to an embodiment of this application, which may specifically include the following steps:
[0157] S701: The sending end communicates with the receiving end through an encrypted transmission channel and obtains the version information of the receiving end;
[0158] The version information may include the system version information of the receiving end, the version information of any functional module in the receiving end, etc.
[0159] S702: The sending end obtains the latest version information from the cloud platform, and if the latest version information is different from the version information of the receiving end, it obtains the firmware data corresponding to the latest version information from the cloud platform and determines it as the data to be transmitted.
[0160] S703: After acquiring the data to be transmitted, the sending end generates an upgrade command and sends the upgrade command to the receiving end through an encrypted transmission channel.
[0161] The upgrade command is used to instruct the receiving end to enter upgrade mode, which can be a mode to upgrade the operating system or a mode to upgrade the functional modules in the receiving end.
[0162] S704: After receiving the upgrade command, the receiving end responds to the upgrade command, generates an upgrade feedback result based on the current operating status, and sends the upgrade feedback result to the sending end through an encrypted transmission channel;
[0163] The running status describes the state of the receiving end during runtime, specifically including usage status and idle status. Usage status indicates that any functional module in the receiving end is running, while idle status indicates that no functional module in the receiving end is executing any task. The upgrade feedback result describes whether the receiving end is allowed to enter upgrade mode, specifically including results indicating that entry into upgrade mode is allowed or prohibited.
[0164] For example, when the receiver is in use, it can be determined that the receiver is prohibited from entering the upgrade mode at the current moment, and an upgrade feedback result of prohibiting entry into the upgrade mode can be generated; when the receiver is in an idle state, it can be determined that the receiver is allowed to enter the upgrade mode at the current moment, and an upgrade feedback result of allowing entry into the upgrade mode can be generated.
[0165] S705, when the receiving end generates an upgrade feedback result, and the upgrade feedback result is a result that allows entry into upgrade mode, the receiving end generates a first acquisition command and sends the first acquisition command to the sending end through an encrypted transmission channel;
[0166] S706, when the sending end receives the upgrade feedback result and the upgrade feedback result is a result that allows entry into the upgrade mode, it determines the data length of the data to be transmitted, and when the data length of the data to be transmitted is greater than or equal to the preset length threshold, it creates an unencrypted transmission channel with the receiving end.
[0167] S707, after receiving the first acquisition instruction, the sending end responds to the first acquisition instruction and sends the attribute information of the data to be transmitted to the receiving end through the unencrypted transmission channel;
[0168] S708: After receiving the attribute information of the data to be transmitted, the receiving end generates data transmission parameters based on the attribute information of the data to be transmitted, and sends the data transmission parameters to the sending end through the encrypted transmission channel.
[0169] S709: After receiving the data transmission parameters, the transmitting end divides the data to be transmitted into multiple data frames according to the data frame length in the data transmission parameters, and sends each data frame to the receiving end sequentially through the unencrypted transmission channel according to the transmission frequency in the data transmission parameters.
[0170] In the S710, the receiver performs an upgrade based on all data frames after receiving them, until the upgrade is complete.
[0171] Reference Figure 8 , Figure 8 This illustration shows a schematic diagram of a data transmission device according to an embodiment of this application. The device is applied at the transmitting end, and an encrypted transmission channel is established between the transmitting end and the receiving end. Specifically, it may include the following modules:
[0172] Acquisition module 801 is used to acquire data to be transmitted;
[0173] Module 802 is used to create an unencrypted transmission channel for communication with the receiving end when the length of the data to be transmitted is greater than or equal to a preset length threshold.
[0174] The transmission module 803 is used to transmit data to the receiving end through an unencrypted transmission channel.
[0175] In one implementation, the transmission module 803 is further configured to:
[0176] The data to be transmitted is divided into multiple data frames, and each data frame is transmitted to the receiving end through an unencrypted transmission channel;
[0177] In one implementation, the acquisition module 801 is further used for:
[0178] After each data frame is transmitted to the receiving end through an unencrypted transmission channel, the receiving end sends back the data transmission result.
[0179] In one implementation, the transmission module 803 is further configured to:
[0180] After receiving the data transmission result from the receiving end, and if the data transmission result includes packet loss information, the data frame corresponding to the packet loss information is transmitted to the receiving end through an unencrypted transmission channel.
[0181] In one implementation, the transmission module 803 is further configured to:
[0182] The data transmission parameters transmitted by the receiving end are obtained through an encrypted transmission channel; these parameters include the transmission frequency and the data frame length.
[0183] The data to be transmitted is divided into multiple data frames based on the data frame length.
[0184] Data frames are transmitted to the receiving end frame by frame through an unencrypted transmission channel according to the transmission frequency.
[0185] In one implementation, the transmission module 803 is further configured to:
[0186] During the process of transmitting data to the receiving end through an unencrypted transmission channel, when a breakpoint reconnection event is triggered, the transmission progress information is obtained; the data frame corresponding to the transmission progress information is then transmitted to the receiving end through the unencrypted transmission channel.
[0187] In one implementation, the transmission module 803 is further configured to:
[0188] When the data to be transmitted is unencrypted, encrypt the data to be transmitted.
[0189] The encrypted data to be transmitted is transmitted to the receiving end through an unencrypted transmission channel.
[0190] In one implementation, the transmission module 803 is further configured to:
[0191] If the length of the data to be transmitted is less than the length threshold, the data to be transmitted is transmitted to the receiving end through an encrypted transmission channel.
[0192] In this embodiment, by acquiring the data to be transmitted, and if the length of the data to be transmitted is greater than or equal to a preset length threshold, an unencrypted transmission channel for communication with the receiving end is created. Then, the data to be transmitted is transmitted to the receiving end through the unencrypted transmission channel. Since the unencrypted transmission channel is a data transmission channel that does not require encryption of the transmitted data, the data to be transmitted can be transmitted directly through the unencrypted transmission channel, thereby saving the step of encrypting the data, reducing the number of encryption and decryption operations required during data interaction, reducing the time consumed by data transmission, and improving the efficiency and speed of data transmission.
[0193] It should be noted that the information interaction and execution process between the above-mentioned devices are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0194] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0195] Reference Figure 9 , Figure 9 This application provides a structural block diagram of an electronic device according to an embodiment of the present application, as shown below. Figure 9 As shown, this application embodiment also provides an electronic device 91, which includes: at least one processor 911, a memory 912, and a computer program 9121 stored in the memory 912 and executable on the at least one processor 911. When the processor 911 executes the computer program 9121, it implements the steps in any of the above-described method embodiments.
[0196] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in any of the above method embodiments.
[0197] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the various method embodiments.
[0198] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / computer equipment, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium.
[0199] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A data transmission method, characterized in that, The method is applied at the sending end, where an encrypted transmission channel is established between the sending end and the receiving end. The method includes: Get the data to be transmitted; If the length of the data to be transmitted is greater than or equal to a preset length threshold, an unencrypted transmission channel for communication with the receiving end is created. The data to be transmitted is transmitted to the receiving end through the unencrypted transmission channel.
2. The data transmission method as described in claim 1, characterized in that, The step of transmitting the data to be transmitted to the receiving end through the unencrypted transmission channel includes: The data to be transmitted is divided into multiple data frames, and each data frame is transmitted to the receiving end through the unencrypted transmission channel. After transmitting each data frame to the receiving end through the unencrypted transmission channel, the method further includes: Receive the data transmission results fed back by the receiving end.
3. The data transmission method as described in claim 2, characterized in that, After receiving the data transmission result fed back by the receiving end, the method further includes: If the data transmission result includes packet loss information, the data frame corresponding to the packet loss information will be transmitted to the receiving end through the unencrypted transmission channel.
4. The data transmission method as described in claim 2 or 3, characterized in that, The step of dividing the data to be transmitted into multiple data frames and transmitting each data frame to the receiving end through the unencrypted transmission channel includes: The data transmission parameters transmitted by the receiving end are obtained through the encrypted transmission channel; wherein, the data transmission parameters include the transmission frequency and the data frame length; The data to be transmitted is divided into multiple data frames according to the data frame length. According to the transmission frequency, the data frames are transmitted frame by frame to the receiving end through the unencrypted transmission channel.
5. The data transmission method as described in claim 4, characterized in that, The method further includes: During the process of transmitting the data to be transmitted to the receiving end through an unencrypted transmission channel, when a breakpoint reconnection event is triggered, the transmission progress information is obtained. The data frame corresponding to the transmission progress information is transmitted to the receiving end through the unencrypted transmission channel.
6. The data transmission method as described in claim 1, characterized in that, The step of transmitting the data to be transmitted to the receiving end through the unencrypted transmission channel includes: When the data to be transmitted is unencrypted, the data to be transmitted is encrypted. The encrypted data to be transmitted is transmitted to the receiving end through the unencrypted transmission channel.
7. The data transmission method as described in claim 1, characterized in that, The method further includes: If the length of the data to be transmitted is less than the length threshold, the data to be transmitted is transmitted to the receiving end through the encrypted transmission channel.
8. A data transmission device, characterized in that, The device is applied at the transmitting end, and an encrypted transmission channel is established between the transmitting end and the receiving end. The device includes: The acquisition module is used to acquire the data to be transmitted. A creation module is used to create an unencrypted transmission channel for communication with the receiving end when the length of the data to be transmitted is greater than or equal to a preset length threshold. A transmission module is used to transmit the data to be transmitted to the receiving end through the unencrypted transmission channel.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the data transmission method as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the method as described in any one of claims 1 to 7.