Data transmission method and related devices
By blocking the data of IoT terminal devices, the low data transmission efficiency and data overflow caused by limited resources of terminal devices are solved, and efficient data transmission is achieved.
Patent Information
- Application Number
- CN202210106749.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2042-01-28
AI Technical Summary
Due to limited resources, IoT terminal devices may not be able to undergo a conventional compression and decompression process, resulting in low data transmission efficiency and possible data overflow problems.
By chunking the data, it is ensured that the size of each data block meets the processing capabilities of the terminal device. The specific steps include determining the target data, extracting the data block, compressing the data block, checking whether the compressed data block size meets the threshold, and adjusting the data block size according to the device information of the terminal device.
On the premise of reducing the total amount of data transmitted, ensure that the amount of data meets the decompression requirements of the terminal equipment, improves data transmission efficiency, and avoids data overflow problems.
Smart Images

Figure CN114520918B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet of Things technology, and in particular, to a data transmission method and related devices. Background Art
[0002] In an Internet of Things system, generally, an Internet of Things terminal can receive data from a server through a gateway device. For an Internet of Things terminal, its resources are limited, and sometimes it may not be able to perform a conventional compression and decompression process. Summary of the Invention
[0003] In view of this, the present disclosure provides a data transmission method and related devices to solve or partially solve the above problems.
[0004] In a first aspect of the present disclosure, a data transmission method is provided, including:
[0005] Determine target data;
[0006] Extract a first data block from the target data according to extraction parameters;
[0007] Compress the first data block to obtain a second data block, where the data volume of the second data block is less than or equal to a data volume threshold;
[0008] Determine whether a multiple relationship between the data volume of the second data block and a data volume reference value conforms to a preset multiple relationship; and
[0009] In response to determining that the multiple relationship between the data volume of the second data block and the data volume reference value conforms to the preset multiple relationship, determine the second data block as a target data block and transmit the target data block.
[0010] In a second aspect of the present disclosure, a computer device is provided, including:
[0011] One or more processors, a memory; and
[0012] One or more programs;
[0013] Wherein, the one or more programs are stored in the memory and are executed by the one or more processors, and the programs include instructions for executing the method according to the first aspect.
[0014] In a third aspect of the present disclosure, an Internet of Things system is provided, including:
[0015] A server;
[0016] At least one terminal device; and
[0017] The computer device described in the second aspect is configured to: receive the target data sent by the server, determine the target terminal device among the at least one terminal device, and send a target data block obtained based on the target data to the target terminal device.
[0018] In the fourth aspect of the present disclosure, there is provided a non-volatile computer-readable storage medium containing a computer program, which, when executed by one or more processors, causes the processors to execute the method described in the first aspect.
[0019] In the fifth aspect of the present disclosure, there is provided a computer program product including computer program instructions, which, when running on a computer, cause the computer to execute the method described in the first aspect.
[0020] The data transmission method and related devices provided by the present disclosure, by performing block compression on the data, while reducing the total amount of data to be transmitted, ensure that the amount of data meets the requirements of the terminal device for decompressing the data, and at the same time, improve the data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] To more clearly illustrate the technical solutions in the present disclosure or related technologies, the following will briefly introduce the drawings required for use in the embodiments or related technology descriptions. Obviously, the drawings in the following description are only the embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0022] Figure 1 It is a schematic diagram of an exemplary system provided by an embodiment of the present disclosure.
[0023] Figure 2A It is a schematic flowchart of an exemplary method provided by an embodiment of the present disclosure.
[0024] Figure 2B It is a schematic diagram of an exemplary data according to an embodiment of the present disclosure.
[0025] Figure 2C It is a schematic diagram of another exemplary data according to an embodiment of the present disclosure.
[0026] Figure 2D It is a schematic diagram of yet another exemplary data according to an embodiment of the present disclosure.
[0027] Figure 3 It is a schematic flowchart of yet another exemplary method provided by an embodiment of the present disclosure.
[0028] Figure 4 It is a schematic diagram of the hardware structure of an exemplary device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] To make the objectives, technical solutions, and advantages of the present disclosure clearer and more understandable, the present disclosure will be further described in detail below with reference to specific embodiments and the accompanying drawings.
[0030] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the ordinary meanings understood by those of ordinary skill in the field to which the present disclosure belongs. The terms "first", "second", and similar terms used in the embodiments of the present disclosure do not denote any order, quantity, or importance, but are only used to distinguish different components. The terms such as "including" or "comprising" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. The terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left", and "right" are only used to represent relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0031] Figure 1 A schematic diagram of an exemplary system 100 provided by an embodiment of the present disclosure is shown.
[0032] As Figure 1 shown, the system 100 may include multiple terminal devices (e.g., terminal devices 200a to 200n), a gateway device 300, and a server 400. In some embodiments, the system 100 may be an Internet of Things system, the terminal devices 200a to 200n may be Internet of Things devices, and the gateway device 300 may be an Internet of Things gateway.
[0033] The terminal devices 200a to 200n may be connected to the gateway device 300 wirelessly (e.g., via Bluetooth), and the gateway device 300 may be connected to the server 400 via a network (e.g., WLAN / LAN).
[0034] Generally, the server 400 may issue tasks to the terminal devices 200a to 200n through the gateway device 300. For example, the server 400 may send a display task to the terminal devices 200a to 200n. In the display task, the gateway device 300 may receive picture data from the server 400 and then forward the picture data to the corresponding terminal device, such as the terminal device 200a. Since the amount of data of the picture data is relatively large, when the terminal device 200a receives the picture data, it needs to perform wireless interactions with the gateway device 300 for a long time, which is both time-consuming and power-consuming, and also occupies the channel.
[0035] One processing method is to compress the picture data to be transmitted and then transmit it, so as to reduce the amount of data to be transmitted. However, for conventional compression / decompression methods, due to the limited processor resources of the terminal device, the conventional compression and decompression processes may not be possible. In particular, when the terminal device uses a microcontroller unit (MCU) as the processor, due to the limited resources of the MCU, data overflow may occur when decompressing the received data, and then problems such as data errors may occur.
[0036] In view of this, the embodiments of the present disclosure provide an Internet of Things system, which can be used for data transmission. By block-compressing the data, on the premise of reducing the total amount of transmitted data, it is ensured that the amount of data meets the requirements of the terminal device for decompressing the data, and at the same time, the data transmission efficiency is improved.
[0037] Figure 2A The flowchart of the exemplary method 500 provided by the embodiments of the present disclosure is shown. As Figure 2A shown, the method 500 can be applied to the system 100 and can further include the following steps.
[0038] In step S502, the server 400 can send the target data to the gateway device 300. In some embodiments, the target data can be picture data. When sending the target data, the server 400 can also send to the gateway device 300 the information about which target terminal device the target data needs to be sent to. For example, in this embodiment, the information includes the relevant information of the terminal device 200a, so that the gateway device 300 can determine the corresponding target terminal device as the terminal device 200a according to this information. In some embodiments, the information can include information such as the device ID and MAC address of the target terminal device that can be used to determine the target terminal device.
[0039] After receiving the target data and the corresponding information of the target terminal device, the gateway device 300 can start to prepare to transmit the target data to the target terminal device (for example, the terminal device 200a). It can be understood that in this embodiment, the gateway device 300 can be the host computer of the terminal device 200a.
[0040] In some embodiments, in step S504, the gateway device 300 can first send the data information of the target data to the terminal device 200a. For example, taking the target data as picture data, the data information can include basic information such as the total length of the picture data and the check information of the picture data.
[0041] In some embodiments, at step S506, after the terminal device 200a receives the data information of the target data to be received, it may return the device information of the terminal device 200a to the gateway device 300. In some embodiments, the device information may include the size of the maximum storage space of the terminal device 200a for decompressing data (e.g., the size M of the maximum random access memory (RAM) available for decompression), the size of the maximum storage space for receiving data (e.g., the size N of the maximum buffer (BUF) available for receiving data), and the size of the maximum storage space for receiving data once (e.g., the size W of the buffer available for receiving data once).
[0042] Among them, the size M of the maximum random access memory (RAM) available for decompression may refer to the maximum data space that the RAM of the MCU of the terminal device 200a can use when completing the decompression process. BUF may refer to a piece of memory space reserved by the developer in the MCU of the terminal device 200a when writing the program. The size N of the maximum buffer (BUF) available for receiving data may refer to the maximum data space that the BUF of the terminal device 200a can use when receiving data. The size W of the buffer available for receiving data once may refer to the data volume size of the terminal device 200a receiving data once. In some cases, when the gateway device 300 sends data to the terminal device 200a in a packet transmission manner, the size W of the buffer available for receiving data once may be the data volume of a data packet.
[0043] After the gateway device 300 receives the device information returned by the terminal device 200a, it may determine extraction parameters according to the device information. The extraction parameters are used to guide the gateway device 300 to extract data blocks from the target data. In some embodiments, the data block may be a data unit when the gateway device 300 sends data to the terminal device 200a, and the terminal device 200a may process the data based on the data unit. To ensure that there is no data overflow problem when the terminal device 200a decompresses after receiving a data block, the extraction parameter may be the size of the maximum random access memory available for decompression of the terminal device 200a. In this way, when the terminal device 200a decompresses the received data to obtain the corresponding data block, there will be no data overflow problem.
[0044] After determining the extraction parameters, the gateway device 300 may enter the specific data distribution process and may perform block compression on the target data. At step S508, the gateway device 300 may extract a first data block from the target data according to the extraction parameter.
[0045] Figure 2B The schematic diagram of the exemplary data 302 according to the embodiments of the present disclosure is shown. As Figure 2BAs shown, in some embodiments, the gateway device 300 may extract the first data block 3022 from the start position (pos0) of the target data, and the size of the first data block 3022 may be the size of the extraction parameter. For example, it is equal to M.
[0046] Then, in step S510, the gateway device 300 may compress the first data block 3022 to further obtain a second data block, so as to try to ensure that the data block to be sent meets the data volume requirement of the terminal device 200a when receiving data. In some embodiments, when compressing the first data block 3022, it is necessary to consider that the data volume of the compressed data does not exceed the data volume threshold. In some embodiments, in order to ensure that the data block to be sent meets the data volume requirement of the terminal device 200a (for example, does not exceed the size of the maximum storage space for receiving data of the terminal device 200a), the gateway device 300 may determine the data volume threshold according to the device information of the terminal device 200a. For example, the data volume threshold may be the size N of the maximum cache available for receiving data of the terminal device 200a.
[0047] Next, as Figure 2B shown, the gateway device 300 may compress the first data block 3022 to obtain an intermediate data block 3024, and then determine whether the data volume of the intermediate data block 3024 is less than the data volume threshold (for example, N). If the data volume of the intermediate data block 3024 is less than or equal to the data volume threshold, the gateway device 300 may determine the intermediate data block 3024 as the second data block.
[0048] In some embodiments, if the data volume of the intermediate data block 3024 is greater than the data volume threshold, the intermediate data block 3024 cannot be used as the second data block. At this time, the gateway device 300 may reduce the data volume of the first data block 3022 to obtain a new first data block 3022', as Figure 2C shown. Then, re-compress based on the new first data block 3022' to obtain a new intermediate data block 3026. At this time, if the data volume of the new intermediate data block 3026 is less than or equal to the data volume threshold, the gateway device 300 may determine the new intermediate data block 3026 as the second data block. If the data volume of the new intermediate data block 3026 is still greater than the data volume threshold, continue to reduce the data volume of the first data block 3022', and then re-compress. Repeat this step until the data volume of the obtained intermediate data block is less than or equal to the data volume threshold, so as to obtain a second data block less than or equal to the data volume threshold. It can be understood that when reducing the data volume of the first data block, the reduced data volume can be set according to actual needs and may not be specifically limited. For example, it can be selected to reduce 1 byte or 100 bytes, as long as the final data transmission can be completed efficiently and accurately.
[0049] After obtaining the second data block, in some embodiments, at step S512, the gateway device 300 may directly send the second data block as the target data block to the terminal device 200a. Then, from the new position of the target data 302 (e.g., Figure 2B the position pos1), a new first data block is extracted again, and the new first data block is compressed according to the foregoing method to obtain a new second data block and then transmitted. This process is repeated until the target data is completely transmitted. It can be seen that since the data volume of the second data block is less than or equal to the data volume threshold, when the data volume threshold is less than or equal to the size of the maximum storage space of the terminal device 200a for receiving data, there will be no data overflow when the terminal device 200a receives the second data block. Also, since the data volume of the first data block is based on the extraction parameter, when the extraction parameter is less than or equal to the size of the maximum storage space of the terminal device 200a for decompressing data, there will be no data overflow when the terminal device 200a decompresses the second data block into the first data block.
[0050] In some embodiments, to improve the data transmission efficiency, the second data block may be packetized before transmission. In this way, if packet loss or other problems occur due to certain reasons, only the lost packet data needs to be retransmitted, rather than the entire target data block being retransmitted.
[0051] In some embodiments, when transmitting data blocks in a data packetization manner, in addition to the data corresponding to the packet, the transmitted data packet may also include a marker of the compression algorithm (so that the terminal device 200a knows which algorithm to use for decompression), the sequence number of the packet in the target data block, the total number of packets into which the target data block is packetized, the sequence number of the target data block, and so on.
[0052] In some embodiments, to improve the channel utilization rate, the gateway device 300 may further process the second data block to determine the final target data block for transmission. For example, the data volume of the second data block may be compared with a data volume reference value to determine whether the multiple relationship between the data volume of the second data block and the data volume reference value conforms to a preset multiple relationship. In some embodiments, the data volume reference value may be the data volume of transmitting one data packet during packetized transmission. In this way, when the multiple relationship between the data volume of the second data block and the data volume reference value is approximately an integer multiple relationship (e.g., 2 times), the channel utilization rate is relatively high because the target data block can be transmitted by transmitting the second data block in two data packets, and the channel is fully utilized each time a data packet is transmitted.
[0053] Next, if the multiple relationship between the data volume of the second data block and the data volume reference value conforms to a preset multiple relationship, the gateway device 300 may determine the second data block as the target data block and transmit the target data block, and the channel utilization rate is relatively high at this time.
[0054] If the multiple relationship between the data volume of the second data block and the data volume reference value does not conform to the preset multiple relationship, the gateway device 300 does not transmit the second data block as the target data block, but may further reduce the data volume of the first data block to a new first data block 3022” and then recompress it to obtain a third data block 3028, as Figure 2D shown.
[0055] Then, the gateway device 300 may determine whether the multiple relationship between the data volume of the third data block 3028 and the data volume reference value conforms to the preset multiple relationship. If the multiple relationship between the data volume of the third data block 3028 and the data volume reference value conforms to the preset multiple relationship, the gateway device 300 may determine the third data block 3028 as the target data block and transmit the target data block. If the multiple relationship between the data volume of the third data block 3028 and the data volume reference value still does not conform to the preset multiple relationship, the gateway device may reduce the first data block again and then recompress it until the multiple relationship between the data volume of the data block and the data volume reference value conforms to the preset multiple relationship.
[0056] It can be understood that the preset multiple relationship may not be an integer multiple relationship, but may be a range close to an integer multiple relationship. For example, the decimal part remaining after taking the integer is greater than or equal to a preset decimal (for example, 0.5, 0.8, etc.). Taking the data volume reference value of 250 bytes as an example, assuming that the data volume of the compressed data block is 260 bytes, in this way, after taking the integer of the multiple of the data volume of the compressed data block and the data volume reference value, the remaining decimal is 10 / 250 = 0.004. Assuming that the preset multiple relationship requires that this decimal needs to be greater than 0.5, then 0.004 is much less than 0.5, and it can be considered that it does not conform to the preset multiple relationship. It can be seen from this example that the compressed data needs to be sent in two parts, and the second data sub-packet only has 10 bytes of valid data, and it can be considered that the channel utilization rate is low at this time. Another example is that taking the data volume reference value of 100 bytes as an example, assuming that the data volume of the compressed data block is 260 bytes, in this way, after taking the integer of the multiple of the data volume of the compressed data block and the data volume reference value, the remaining decimal is 60 / 100 = 0.6. Assuming that the preset multiple relationship requires that this decimal needs to be greater than 0.5, then 0.6 is greater than 0.5, and it can be considered that it conforms to the preset multiple relationship and the channel utilization rate is high at this time.
[0057] It can be seen that the method of reducing the data volume of the first data block to make the multiple relationship between the data volume of the third data block and the data volume reference value meet the preset multiple relationship is mainly to improve the channel utilization rate. Therefore, when performing the data volume reduction process, it is advisable to select a relatively small amount of data to be reduced. For example, the amount of data to be reduced can be within the range of 1% to 10% of the data volume reference value, which can avoid the situation where the data volume that meets the preset multiple relationship cannot be obtained due to reducing too much data.
[0058] In some embodiments, in order to meet the requirements of the terminal device 200a while ensuring the channel utilization rate, the data volume reference value can be determined according to the device information of the terminal device 200a. For example, the data volume reference value can be the size W of the cache available for single - time data reception of the terminal device 200a.
[0059] It can be seen from the above embodiments that the processing of data before transmission needs to meet the requirements of three parameters. During this process, due to the data differences in different parts of the target data, some data blocks may be repeatedly reduced and then recompressed. Therefore, the sizes of the data blocks formed by finally dividing the target data can be different. For example, for a picture, compared with the colored area of the foreground part, the background part has relatively less information because it is white or black. Therefore, after the data block corresponding to the background part is compressed, its data volume is usually small and generally meets the requirements of the data volume threshold. After the data block corresponding to the colored area of the foreground part is compressed, its data volume is usually large and may need to be repeatedly reduced and then recompressed. In this way, the sizes of the multiple data blocks (the first data blocks) obtained by dividing the original target data may be different.
[0060] It can be understood that when transmitting the target data block, packetized transmission can be performed. The gateway device 300 divides the target data block into multiple data packets according to the data volume reference amount and then sequentially transmits these data packets. In addition to the data corresponding to the packet, the transmitted data packet may also include a marker of the compression algorithm (so that the terminal device 200a knows which algorithm to use for decompression), the sequence number of the packet in the target data block, the total number of packets into which the target data block is divided, the sequence number of the target data block, and so on. Therefore, in some embodiments, after receiving each data packet, the terminal device 200a can perform verification based on information such as the sequence number of the packet in the target data block, the total number of packets into which the target data block is divided, and the sequence number of the target data block in the data packet. If the verification passes, the terminal device 200a feeds back verification passed information (for example, an Acknowledge character (ACK)) to the gateway device 300. After receiving the verification passed information, the gateway device 300 continues to send another data packet until all the data packets of the target data block are sent. Then the gateway device 300 can start to extract and compress the next data block and then send the next data block until all the target data is sent.
[0061] In step S514, for each data block, the terminal device 200a can complete the decompression process of the data block according to the received data packet corresponding to the data block and store it. After receiving all the data blocks of the target data 302, the terminal device 200a completes the reception of the target data 302, and can perform a re-verification based on the verification information of the target data 302. If the verification passes, the terminal device 200a can update the local data according to the target data 302.
[0062] In some embodiments, if the terminal device 200a fails to pass the verification of a certain data packet, the terminal device 200a can feed back information indicating that the verification fails to the gateway device 300 (or the gateway device 300 does not receive an ACK within a certain period of time). Then the gateway device 300 determines that a data packet loss or transmission timeout has occurred, and can determine the problematic data packet based on the information indicating that the verification fails and then send it to the terminal device 200a again.
[0063] So far, the processing and transmission of the target data 302 have been completed. It can be seen that the system 100 provided by the embodiments of the present disclosure negotiates between the terminal device and the gateway device, enabling the gateway device to perform block compression on the data based on the device information of the terminal device obtained through negotiation, thereby reducing the total amount of data to be sent, solving the problems of time-consuming, power-consuming, and long-term occupation of the channel when a large amount of data is sent.
[0064] In particular, when the MCU resources of the wireless terminal are limited, conventional compression and decompression may not be possible. Therefore, the wireless terminal reports its own resource situation to the gateway device, and the gateway device determines the block size for compression and performs variable-length block compression on the data before sending it, thereby reducing the total amount of data sent and improving the efficiency of channel occupancy.
[0065] In some embodiments, the terminal device may be a name card terminal with an electronic ink screen (EPD). The name card terminal is a low-power device that uses the EPD for display. The EPD only needs to be powered during refreshing, and the power is cut off after refreshing while the displayed content remains unchanged. The name card terminal can communicate with the server 400 wirelessly through the gateway device 300, and the server 400 can send the EPD content to be displayed to the name card terminal through the gateway device 300.
[0066] However, generally, due to its small size and compact structure, the circuit board design of the EPD name card terminal adopts a streamlined mode, and its processor generally uses an MCU. However, the MCU resources are limited, and problems such as inability to perform compression and decompression are likely to occur. Therefore, the gateway device determines the block size for compression and performs variable-length block compression on the data before sending it, thereby reducing the total amount of data sent, improving the efficiency of channel occupancy, and meeting the MCU resource requirements of the EPD name card terminal at the same time.
[0067] The embodiments of the present disclosure also provide a data transmission method. Figure 3 The flowchart of the exemplary method 600 provided by the embodiments of the present disclosure is shown. The method 600 can be applied to Figure 1 the gateway device 300. As Figure 3 shown, the method 600 may include the following steps.
[0068] In step 602, target data (e.g., Figure 2B data 302) can be determined.
[0069] In some embodiments, after determining the target data, it further includes: sending data information of the target data to the target terminal device (e.g., Figure 2A the terminal device 200a); receiving device information of the target terminal device returned by the target terminal device; and determining at least one of the extraction parameter, the data volume threshold, and the data volume reference value according to the device information of the target terminal device.
[0070] In some embodiments, the extraction parameter is less than or equal to the size of the maximum storage space of the target terminal device for decompressing data.
[0071] In some embodiments, the data volume threshold is less than or equal to the size of the maximum storage space of the target terminal device for receiving data.
[0072] In some embodiments, the data volume reference value is less than or equal to the size of the maximum storage space of the target terminal device for receiving data at one time.
[0073] In step 604, according to the extraction parameter, a first data block (e.g., Figure 2B data block 3022) is extracted from the target data.
[0074] In step 606, the first data block is compressed to obtain a second data block, and the data volume of the second data block is less than or equal to the data volume threshold.
[0075] In some embodiments, compressing the first data block to obtain a second data block includes: compressing the first data block to obtain an intermediate data block (e.g., Figure 2B data block 3024); determining whether the data volume of the intermediate data block is less than the data volume threshold; and in response to determining that the data volume of the intermediate data block is less than or equal to the data volume threshold, determining the intermediate data block as the second data block.
[0076] In some embodiments, further compressing the first data block to obtain a target data block further includes: in response to determining that the data volume of the intermediate data block is greater than the data volume threshold, reducing the data volume of the first data block and then recompressing to obtain the second data block (e.g., Figure 2C data block 3026).
[0077] In step 608, it is determined whether the multiple relationship between the data volume of the second data block and the data volume reference value conforms to a preset multiple relationship.
[0078] In step 610, in response to determining that the multiple relationship between the data volume of the second data block and the data volume reference value conforms to the preset multiple relationship, the second data block is determined as the target data block and the target data block is transmitted.
[0079] In some embodiments, the method further includes: in response to determining that the multiple relationship between the data volume of the second data block and the data volume reference value does not conform to the preset multiple relationship, reducing the data volume of the first data block and then recompressing to obtain a third data block (e.g., Figure 2D data block 3028).
[0080] In some embodiments, after reducing the data volume of the first data block and recompressing it to obtain a third data block, the method further includes: determining whether the multiple relationship between the data volume of the third data block and a data volume reference value conforms to a preset multiple relationship; in response to determining that the multiple relationship between the data volume of the third data block and the data volume reference value conforms to the preset multiple relationship, determining the third data block as the target data block and transmitting the target data block.
[0081] In some embodiments, transmitting the target data block includes: transmitting the target data block in a sub-packet transmission manner.
[0082] In some embodiments, the data volume reference value is the data volume of a sub-packet for sub-packet transmission.
[0083] It should be noted that the method of the embodiments of the present disclosure can be executed by a single device, such as a computer or a server. The method of this embodiment can also be applied to a distributed scenario, and multiple devices cooperate with each other to complete it. In such a distributed scenario, one of the multiple devices can only execute one or more steps of the method of the embodiments of the present disclosure, and these multiple devices will interact with each other to complete the described method.
[0084] It should be noted that some embodiments of the present disclosure have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the above embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0085] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the method 500 or 600 described in any of the above embodiments.
[0086] Figure 4 The hardware structure diagram of a more specific electronic device 700 provided in this embodiment is shown. This device 700 can be used to implement Figure 1System 100, terminal devices 200a to 200n, gateway device 300, and server 400, and may further include: a processor 702, a memory 704, an input / output interface 706, a communication interface 708, and a bus 710. Among them, the processor 702, the memory 704, the input / output interface 706, and the communication interface 708 are communicatively connected to each other inside the device through the bus 710.
[0087] The processor 702 may be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification. In some embodiments, when the device 700 is implemented as the terminal devices 200a to 200n, the processor 702 may be an MCU, and the MCU may further include a CPU, a radio module, and a real-time clock (RTC) module.
[0088] The memory 704 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 704 may store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 704 and are called and executed by the processor 702. In some embodiments, when the device 700 is implemented as the terminal devices 200a to 200n, the memory 704 may further include a flash memory.
[0089] The input / output interface 706 is used to connect to an input / output module to implement information input and output. The input / output module may be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Among them, the input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display (for example, an electronic ink screen EPD), a speaker, a vibrator, an indicator light (for example, an LED), a key (KEY), etc.
[0090] The communication interface 708 is used to connect to a communication module (not shown in the figure) to implement communication and interaction between this device and other devices. Among them, the communication module may implement communication in a wired manner (such as USB, network cable, etc.) or in a wireless manner (such as mobile network, WIFI, Bluetooth, etc.).
[0091] The bus 710 includes a path for transmitting information among various components of the device, such as the processor 702, the memory 704, the input / output interface 706, and the communication interface 708.
[0092] It should be noted that although the above device only shows the processor 702, the memory 704, the input / output interface 706, the communication interface 708, and the bus 710, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solution of the embodiments of this specification, and do not necessarily include all the components shown in the figure.
[0093] The electronic device of the above embodiment is used to implement the corresponding method 500 or 600 in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0094] Based on the same inventive concept, corresponding to the method in any of the above embodiments, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the method 500 or 600 described in any of the foregoing embodiments.
[0095] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage, or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.
[0096] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the method 500 or 600 described in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0097] Based on the same inventive concept, corresponding to the method 500 or 600 of any of the above embodiments, the present disclosure also provides a computer program product, which includes a computer program. In some embodiments, the computer program is executable by one or more processors to cause the processors to execute the method 500 or 600. Corresponding to the execution subjects of the respective steps in the embodiments of the method 500 or 600, the processors executing the corresponding steps may belong to the corresponding execution subjects.
[0098] The computer program product of the above embodiments is used to cause a processor to execute the method 500 or 600 described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0099] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is only exemplary, and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; under the concept of the present disclosure, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present disclosure as described above, and they are not provided in detail for the sake of brevity.
[0100] In addition, for the sake of simplicity of description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. In addition, the devices may be shown in block diagram form in order to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (that is, these details should be fully within the understanding of those skilled in the art). In the case where specific details (such as circuits) are set forth to describe the exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the embodiments of the present disclosure may be implemented without these specific details or with variations of these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0101] Although the present disclosure has been described in connection with specific embodiments of the present disclosure, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. For example, other memory architectures (such as dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0102] Embodiments of the present disclosure are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure shall be included within the protection scope of the present disclosure.
Claims
1. A data transmission method, comprising: Determine the target data; Extract a first data block from the target data according to an extraction parameter, where the extraction parameter is less than or equal to the size of the maximum storage space of the target terminal device for decompressing data; Compress the first data block to obtain a second data block, where the data volume of the second data block is less than or equal to a data volume threshold, and the data volume threshold is less than or equal to the size of the maximum storage space of the target terminal device for receiving data; Determine whether the multiple relationship between the data volume of the second data block and a data volume reference value conforms to a preset multiple relationship, where the data volume reference value is less than or equal to the size of the maximum storage space of the target terminal device for receiving data at one time; And In response to determining that the multiple relationship between the data volume of the second data block and the data volume reference value conforms to the preset multiple relationship, determine the second data block as the target data block and transmit the target data block.
2. The method according to claim 1, wherein, Compressing the first data block to obtain a second data block includes: Compress the first data block to obtain an intermediate data block; Determine whether the data volume of the intermediate data block is less than or equal to the data volume threshold; and In response to determining that the data volume of the intermediate data block is less than or equal to the data volume threshold, determine the intermediate data block as the second data block.
3. The method according to claim 2, wherein, Compressing the first data block to obtain a target data block further includes: In response to determining that the data volume of the intermediate data block is greater than the data volume threshold, reduce the data volume of the first data block and recompress it to obtain the second data block.
4. The method according to claim 1, further comprising: In response to determining that the multiple relationship between the data volume of the second data block and the data volume reference value does not conform to the preset multiple relationship, reduce the data volume of the first data block and recompress it to obtain a third data block.
5. The method according to claim 4, wherein, After reducing the data volume of the first data block and recompressing it to obtain a third data block, it further includes: Determine whether the multiple relationship between the data volume of the third data block and the data volume reference value conforms to the preset multiple relationship; In response to determining that the multiple relationship between the data volume of the third data block and the data volume reference value conforms to the preset multiple relationship, determine the third data block as the target data block and transmit the target data block.
6. The method according to claim 1 or 5, wherein, Transmitting the target data block includes: Transmit the target data block in a sub-packet transmission manner.
7. The method according to claim 6, wherein, The data volume reference value is the sub-packet data volume for sub-packet transmission.
8. The method according to any one of claims 1-5, wherein, After determining the target data, it further includes: Send the data information of the target data to the target terminal device; Receive the device information of the target terminal device returned by the target terminal device; and Determine at least one of the extraction parameter, the data volume threshold, and the data volume reference value according to the device information of the target terminal device.
9. A computer device, comprising: One or more processors, memories; And One or more programs; Wherein, the one or more programs are stored in the memory and executed by the one or more processors, and the programs include instructions for executing the method according to any one of claims 1-8.
10. An Internet of Things system, comprising: Server; At least one terminal device; And The computer device according to claim 9 is configured to: receive the target data sent by the server, determine the target terminal device among the at least one terminal device, and send a target data block obtained based on the target data to the target terminal device.
11. The Internet of Things system according to claim 10, wherein, The terminal device is a display device.
12. The Internet of Things system according to claim 10, wherein, The terminal device is an electronic ink screen.
13. A non-volatile computer-readable storage medium containing a computer program, which, when executed by one or more processors, causes the processors to execute the method according to any one of claims 1-8.
14. A computer program product comprising computer program instructions, which, when run on a computer, cause the computer to execute the method according to any one of claims 1-8.
Citation Information
Patent Citations
File compression and decompression method and device
CN109582653A
Data transmission method and communication equipment
CN109981218A