A data transmission method, device and apparatus based on NB-IoT
By converting and sharding NB-IoT data in format and using NB-IoT network to transmit big data, the problem of additional networking is solved, and cost reduction and network simplification is achieved.
Patent Information
- Application Number
- CN202111640782.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-12-29
AI Technical Summary
The existing NB-IoT technology requires additional networking when transmitting big data, resulting in high costs and complex networking.
By converting and sharding the data to be transmitted, shard data carrying offsets are generated, and these shard data are sent using the NB-IoT network, so that the receiver can reorganize according to the offsets, realizing effective transmission of big data.
NB-IoT can transmit larger data without additional networking, reducing transmission costs and simplifying the networking process.
Smart Images

Figure CN114390096B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication technologies, and in particular to a data transmission method, device and apparatus based on NB-IoT. Background Art
[0002] The Internet of Things is an extension and expansion of the Internet. It connects any object to the Internet through information sensing devices. Narrow Band Internet of Things (NB-IoT) is one of the commonly used IoT technologies. It is built on cellular networks and has the characteristics of wide coverage, massive connections, low power consumption, and low cost. It has good application prospects in scenarios such as smart monitoring and smart homes.
[0003] Due to the low power consumption and low network transmission rate of NB-IoT, it can achieve efficient transmission for small data such as sensor values, but it cannot support effective transmission for large files such as pictures. Usually, the maximum length of data transmitted by NB-IoT chip at a time is 512 bytes, and even a picture with a resolution of only 160*120 is about 5KB to 20KB, which is much larger than the single transmission limit of NB-IoT. At present, when large files such as pictures need to be transmitted in NB-IoT scenarios, it is often necessary to build a mobile hotspot (Wireless Fidelity, WIFI) or 4G network, and the networking process is complicated and costly. Summary of the invention
[0004] The present invention provides a data transmission method, equipment and device based on NB-IoT, so as to solve the problem in the prior art that additional networking is required for transmitting big data via NB-IoT.
[0005] The method of the present invention comprises:
[0006] In a first aspect, an embodiment of the present invention provides a data transmission method based on a narrowband Internet of Things (NB-IoT), which is applied to a sending end. The method includes:
[0007] Convert the format of the data to be transmitted and generate a character string;
[0008] Slice the string according to the maximum transmission unit and the preset length of the NB-IoT to generate a plurality of slice data;
[0009] For each shard data, determining an offset corresponding to the shard data according to a position of the shard data in the data to be transmitted;
[0010] Through the NB-IoT, the multiple fragmented data carrying the offset are sent to the receiving end, so that the receiving end reorganizes the multiple fragmented data according to the offset carried in each fragmented data.
[0011] In a possible implementation manner, before converting the format of the data to be transmitted to generate a character string, the method further includes:
[0012] An identifier is allocated to the data to be transmitted.
[0013] In a possible implementation manner, the preset length includes the length of the identifier, the length of the flag, and the length of the offset;
[0014] The segmenting the character string according to the maximum transmission unit and the preset length of the NB-IoT to generate a plurality of segmented data includes:
[0015] The difference between the maximum transmission unit of the NB-IoT and the length of the identifier, the length of the flag, and the length of the offset is used as the length of the fragmented data;
[0016] The character string is segmented based on the length of the segmented data to generate a plurality of the segmented data.
[0017] In a possible implementation, after slicing the string according to the maximum transmission unit and the preset length of the NB-IoT to generate a plurality of slicing data, before sending the slicing data to the receiving end based on the NB-IoT, the method further includes:
[0018] For each of the fragmented data, using the identifier of the data to be transmitted corresponding to the fragmented data as the identifier of the fragmented data;
[0019] Determine a flag of the slice data according to a position of the slice data in the character string;
[0020] Encapsulating the identifier, the flag, the offset, and the fragmented data to obtain encapsulated data;
[0021] The sending of the fragmented data to the receiving end based on NB-IoT includes:
[0022] Based on the NB-IoT, the encapsulated data is sent to the receiving end.
[0023] In a possible implementation, for each piece of data, determining the offset corresponding to the piece of data according to the position of the piece of data in the string includes:
[0024] Taking the length of the slice data as a unit offset;
[0025] The offset is determined according to the flag of the slice data and the unit offset.
[0026] In a second aspect, an embodiment of the present invention provides a data transmission method based on NB-IoT, which is applied to a receiving end, and the method includes:
[0027] Receiving, through the NB-IoT, a plurality of fragmented data sent by a transmitting end;
[0028] According to the offset in each shard data, a plurality of shard data are reassembled to generate data to be restored, wherein the offset is determined by the sending end according to the position of the shard data in the data to be transmitted;
[0029] The format of the data to be restored is converted to generate target data.
[0030] In a possible implementation, the reorganizing the plurality of shard data according to a preset reorganization strategy to generate data to be restored includes:
[0031] According to the identifier and flag in each shard data, determining that the shard data transmission of the same identifier is completed;
[0032] For each fragment data of the same identifier, determine the arrangement order of the multiple fragment data of the same identifier according to the offset in each fragment data, and delete the identifier, flag and offset in each fragment data to obtain multiple target fragment data;
[0033] The plurality of target shard data are reorganized according to the arrangement order to generate the data to be restored.
[0034] In the third aspect, an embodiment of the present invention provides a NB-IoT-based data transmission device, which is applied to a sending end, and includes a processor, a memory, and a program stored in the memory and capable of running on the processor. When the processor executes the program, it can implement any method described in the first aspect.
[0035] In a fourth aspect, an embodiment of the present invention provides a NB-IoT-based data transmission device, which is applied to a receiving end, and includes a processor, a memory, and a program stored in the memory and capable of running on the processor. When the processor executes the program, it can implement the method described in the second aspect.
[0036] In a fifth aspect, an embodiment of the present invention provides a data transmission device based on NB-IoT, which is applied to a transmitting end, including:
[0037] A first conversion module, used for converting the format of the data to be transmitted to generate a character string;
[0038] A sharding module, used to slice the string according to a preset sharding strategy to generate multiple sharding data;
[0039] The sending module is used to send the fragmented data to the receiving end based on NB-IoT, so that the receiving end can reassemble the multiple fragmented data.
[0040] In a sixth aspect, an embodiment of the present invention provides a data transmission device based on NB-IoT, which is applied to a transmitting end, including:
[0041] The receiving module is used to receive multiple fragmented data sent by the sending end based on NB-IoT;
[0042] A reorganization module, used to reorganize the plurality of shard data according to a preset reorganization strategy to generate data to be restored;
[0043] The second conversion module is used to convert the format of the data to be restored.
[0044] In the seventh aspect, the present application also provides a computer-readable storage medium, which is used to store computer programs or instructions. When the computer-readable storage medium is executed, the data transmission method based on NB-IoT in the above aspects is implemented.
[0045] In an eighth aspect, the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the methods described in the above aspects to be implemented.
[0046] The beneficial effects of the present invention are as follows:
[0047] The present invention discloses a data transmission method, equipment and device based on NB-IoT, which is used to solve the problem that additional networking is required for transmitting large data through NB-IoT. First, the data to be transmitted is formatted and a character string is generated; secondly, the character string is fragmented according to the maximum transmission unit and preset length of NB-IoT to generate multiple fragmented data; thirdly, for each fragmented data, the offset corresponding to the fragmented data is determined according to the position of the fragmented data in the data to be transmitted; finally, multiple fragmented data carrying the offset are sent to the receiving end through NB-IoT, so that the receiving end reorganizes the multiple fragmented data according to the offset carried in each fragmented data. The above method can divide a large data file into data that can be directly transmitted by NB-IoT, so that when transmitting large data through NB-IoT, no additional networking is required, reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0049] Figure 1 A flowchart of a data transmission method based on NB-IoT provided in an embodiment of the present invention;
[0050] Figure 2 A flowchart of another NB-IoT-based data transmission method provided in an embodiment of the present invention;
[0051] Figure 3 A schematic diagram of a specific process of a data transmission method based on NB-IoT provided in an embodiment of the present invention;
[0052] Figure 4 A schematic diagram of the structure of a data transmission device based on NB-IoT provided in an embodiment of the present invention;
[0053] Figure 5 A schematic diagram of the structure of another NB-IoT-based data transmission device provided in an embodiment of the present invention;
[0054] Figure 6 A schematic diagram of the structure of a data transmission device based on NB-IoT provided in an embodiment of the present invention;
[0055] Figure 7 A schematic diagram of the structure of another NB-IoT-based data transmission device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] The Internet of Things is a product that extends and expands on the basis of the Internet. Through information sensing devices, any object is connected to the Internet. NB-IoT is one of the commonly used Internet of Things technologies. It is built on a cellular network and has the characteristics of wide coverage, massive connections, low power consumption, and low cost. It has good application prospects in scenarios such as smart monitoring and smart homes.
[0058] Due to the low power consumption and low network transmission rate of NB-IoT, it can efficiently transmit small data such as sensor values, but cannot effectively transmit large files such as pictures. If you need to transmit large files such as pictures in the NB-IoT scenario, you often need to build another WIFI or 4G network, which makes the networking process complicated and costly.
[0059] Based on the above problems, the embodiments of the present invention provide a data transmission method, device and apparatus based on NB-IoT, so as to solve the problem in the prior art that additional networking is required for transmitting large amounts of data via NB-IoT.
[0060] The following describes the data transmission method provided by the exemplary embodiment of the present application in combination with the application scenario described above and with reference to the accompanying drawings. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this respect.
[0061] like Figure 1 As shown, a flow chart of a data transmission method based on NB-IoT provided in an embodiment of the present invention is applied to a sending end, and the method includes:
[0062] Step 101, convert the format of the data to be transmitted to generate a character string;
[0063] Step 102: Slice the string according to the maximum transmission unit and preset length of the NB-IoT to generate a plurality of slice data;
[0064] Step 103: for each shard data, determine the offset corresponding to the shard data according to the position of the shard data in the data to be transmitted;
[0065] Step 104: Send the multiple fragmented data carrying the offset to the receiving end through the NB-IoT, so that the receiving end reorganizes the multiple fragmented data according to the offset carried in each fragmented data.
[0066] The present invention discloses a data transmission method based on NB-IoT. First, the format of the data to be transmitted is converted to generate a character string; second, the character string is fragmented according to the maximum transmission unit and preset length of NB-IoT to generate multiple fragmented data; third, for each fragmented data, the offset corresponding to the fragmented data is determined according to the position of the fragmented data in the data to be transmitted; finally, multiple fragmented data carrying the offset are sent to the receiving end through NB-IoT, so that the receiving end reorganizes the multiple fragmented data according to the offset carried in each fragmented data. The above method can divide a large data file into data that can be directly transmitted by NB-IoT, so that when transmitting large data through NB-IoT, no additional networking is required, reducing costs.
[0067] Correspondingly, such as Figure 2 As shown, a flow chart of another NB-IoT-based data transmission method provided in an embodiment of the present invention is applied to a receiving end, and the method includes:
[0068] Step 201: Receive multiple fragmented data sent by a transmitter through NB-IoT;
[0069] Step 202: reorganize the plurality of fragmented data according to the offset in each fragmented data to generate data to be restored, wherein the offset is determined by the transmitting end according to the position of the fragmented data in the data to be transmitted;
[0070] Step 203: convert the format of the data to be restored to generate target data.
[0071] The above-mentioned data transmission method based on NB-IoT is described in detail below:
[0072] like Figure 3 As shown, it is a specific flow chart of a data transmission method based on NB-IoT provided by an embodiment of the present invention, and the method includes:
[0073] Step 301: The transmitting end allocates an identifier for the data to be transmitted;
[0074] Specifically, the sender provides a globally unique or locally unique identifier, denoted as ID, for each file to be transmitted.
[0075] Step 302: The sending end performs format conversion on the data to be transmitted to generate a character string;
[0076] Because the data format of NB-IoT transmission is a hexadecimal string, the transmitted data is converted into a hexadecimal string format. The length of this hexadecimal string can be recorded as
[0077] Step 303: The sender determines the data length of each fragment data And slice the string to generate multiple slice data;
[0078] Specifically, each fragment data may include a header and a data part. The header may include an identifier, a flag and an offset. Optionally, the header may also include a header length, a total length, an identifier, a flag and an offset. The two fields of header length and total length may be retained or deleted according to actual needs.
[0079] According to the maximum transmission data length MTU of the maximum transmission unit and the header length L header The difference between the two is used to obtain the maximum data length of the fragmented data. In order to efficiently utilize the maximum transmission unit of NB-IoT, the data length of the first N-1 fragmented data is set to the maximum data length, that is, According to the length of the hexadecimal string The ratio of the length of the maximum data is used to calculate the number of sliced data N. If the ratio is not an integer, it is rounded up to 1, that is, The data length of the Nth fragment data is
[0080] For example, the total length of the data is 3000 bytes, the fragment data uses a fixed header with a header length of 20 bytes, and the maximum transmission data length of the maximum transmission unit is 512 bytes, so the maximum data length is 492 bytes. The string needs to be divided into 7 fragment data, of which the data length of the first 6 fragment data is 492 bytes and the data length of the last fragment data is 48 bytes.
[0081] The header length is the sum of the length of the identifier, the length of the flag, and the length of the offset, that is, L header =L ID +L Flag +L Offset , where L ID is the length of the identifier, L Flag is the length of the logo, L Offset It is the length of the offset. Since the length of the identifier, the length of the flag and the length of the offset are all preset and fixed lengths, the length of the header is also a preset and fixed length.
[0082] For example, the fragmented data uses a fixed header with a header length of 20 bytes, an identifier length of 10 bytes, a flag length of 5 bytes, and an offset length of 5 bytes.
[0083] In addition, the total length is the sum of the header length and data length of each fragment data, that is, Among them, Li is the total length of the i-th fragment data, The length of the data portion in the i-th fragment data.
[0084] For example, the total data length is 3000 bytes, the fragmented data uses a fixed header with a header length of 20 bytes, the maximum transmission data length of the maximum transmission unit is 512 bytes, so the maximum data length is 492 bytes, the total length of each fragment data in the first 6 fragment data is 512 bytes, and the total length of the 7th fragment data is 68 bytes.
[0085] Step 304: The sending end determines the flag of the fragment data according to the position of the fragment data in the character string;
[0086] In a specific implementation, the flag represents the position of the fragment data in the string. For example, if the string is divided into 7 fragment data, the flag of the fragment data is 1, which means that the fragment data is the first data in the string and is recorded as the first fragment. Similarly, if the flag of the fragment data is 7, it means that the fragment data is the last data in the string and is recorded as the seventh fragment. The flag of the fragment data is 2, which means that the fragment data is the data in the string that is arranged after the first fragment and before the seventh fragment. Specifically, the sending end can send the corresponding relationship between the number of fragment data and the identifier of the fragment data to the receiving end, and the receiving end determines whether the group of data has been transmitted based on the corresponding relationship and the flag in the received fragment data.
[0087] For example, the identifier of the data to be transmitted is A, and the number of fragments is 7. The sending end sends the correspondence between A and 7 to the receiving end. When the receiving end receives the fragmented data, it determines that the fragmented data with identifier A and mark 7 is received, and determines that the transmission of this group of fragmented data is completed; it can also determine that the fragmented data with identifier A and marks 1 and 7 are received, and determine that the transmission of this group of fragmented data is completed.
[0088] That is, the determination that the group of fragmented data transmission is completed may be determined based on whether the last piece of data is received, or may be determined based on whether the first piece of data and the last piece of data are received.
[0089] In one embodiment, the flag can also be represented by start, a number and end, wherein start represents the first slice data, end represents the last slice data, and the numbers represent the slice data between the first slice data and the last slice data.
[0090] Step 305: The sending end determines the offset corresponding to each fragment data according to the position of the fragment data in the character string;
[0091] Specifically, the offset is used to indicate the arrangement order between each shard data. The offset may be the number of bytes of the data portion in the shard data relative to the beginning of the hexadecimal string. The length of the shard data is used as the unit offset. The offset is determined according to the flag of the shard data and the unit offset.
[0092] For example, if there are 7 fragment data in total, and the data length of the fragment data is 492 bytes, then the unit offset is 492 bytes. For the fragment data with the flag 1, its offset is 0×492 bytes, for the fragment data with the flag 2, its offset is 1×492 bytes, for the fragment data with the flag 3, its offset is 2×492 bytes... For the fragment data with the flag 7, its offset is 6×492 bytes;
[0093] In addition, the offset can also be the logical number of the fragment data in all fragments (such as 1, 2, 3, etc.). The specific form of the offset is not limited but cannot be repeated, and the header mark of the fragment data with the smallest offset is required to be the first fragment, and the header mark of the fragment data with the largest offset is the last fragment. The corresponding offset is defined based on the logical order of the fragment data in the string.
[0094] Step 306: The sending end encapsulates the fragmented data and the corresponding header.
[0095] Step 307: The transmitting end sends the encapsulated multiple fragmented data to the receiving end through NB-IoT.
[0096] Step 308: The receiving end receives and stores the fragmented data sent by the sending end.
[0097] Step 309: The receiving end determines that the transmission of the fragmented data with the same identifier is completed according to the identifier and flag in each fragmented data;
[0098] In a specific implementation, the receiving end can scan the stored fragmented data and group the fragmented data with the same identifier ID in the header. If the flag field in the header of this group of data contains both the first flag arranged in the string and the last flag arranged in the string, it is determined that the fragmented data with the same identifier is transmitted. For example, referring to the above step 304 example, the receiving end determines that the received fragmented data contains fragmented data with identifier A and flag 7, and determines that the fragmented data with identifier A is transmitted. It can also determine that the received fragmented data contains fragmented data with identifier A and flags 1 and 7 respectively, and determines that the fragmented data with identifier A is transmitted.
[0099] In another embodiment, the receiving end determines that the received fragmented data with the same identifier includes fragmented data marked as end, and determines that the transmission of this group of fragmented data is completed; it can also determine that the received fragmented data with the same identifier includes fragmented data marked as start and end, and determines that the transmission of this group of fragmented data is completed.
[0100] Step 310: the receiving end determines the arrangement order of multiple fragment data with the same identifier according to the offset in each fragment data, and deletes the identifier, flag and offset in each fragment data to obtain multiple target fragment data;
[0101] Specifically, the same group of fragmented data is sorted according to the offset field in the header, requiring the fragmented data containing the first mark in the string to be arranged at the front, and the fragmented data containing the last mark in the string to be arranged at the end. If the fragmented data is arranged according to the offset without duplication or omission, it is determined that this group of fragmented data meets the reorganization requirements.
[0102] For example, the shard data in the example of step 305 are arranged according to the offset, the shard data with an offset of 60 is arranged in the first position, the shard data with an offset of 120 is arranged in the second position, and so on. The shard data with an offset of 420 is arranged in the seventh position. If the arranged shard data has no duplication and no missing, it is determined that this group of shard data meets the reorganization requirements.
[0103] Step 311: The receiving end reorganizes the multiple target fragment data according to the arrangement order to generate data to be restored.
[0104] Specifically, according to the arrangement order determined in step 311, the target fragment data is concatenated and reorganized to generate a hexadecimal string to be restored.
[0105] Step 312: The receiving end performs format conversion on the data to be restored to generate target data.
[0106] Specifically, the hexadecimal string to be restored is converted and restored to the target data.
[0107] In an embodiment of the present invention, a transmitting end segments data and encapsulates an offset in each segment data, and sends each segment data to a receiving end through NB-IOT. After receiving the segment data, the receiving end reorganizes the segment data according to the offset to obtain data to be restored, and performs format conversion on the data to be restored to obtain target data, thereby realizing a solution for transmitting larger data through NB-IOT without the need for additional networking, thereby reducing transmission costs.
[0108] Based on the same inventive concept, an embodiment of the present invention also provides a data transmission device based on NB-IoT, which is applied to the sending end. The implementation of the device can refer to the implementation of the data transmission method based on NB-IoT, and the repeated parts will not be repeated.
[0109] like Figure 4 As shown, it is a structural schematic diagram of a data transmission device based on NB-IoT provided in an embodiment of the present invention, and the device includes:
[0110] The first conversion module 401 is used to convert the format of the data to be transmitted and generate a character string;
[0111] A sharding module 402 is used to shard the string according to a preset sharding strategy to generate a plurality of sharding data;
[0112] The sending module 403 is used to send the fragmented data to the receiving end based on NB-IoT, so that the receiving end can reassemble the multiple fragmented data.
[0113] Optionally, the device further comprises an allocation module, which performs format conversion on the data to be transmitted before generating a character string, and the allocation module is used to allocate an identifier to the data to be transmitted.
[0114] Optionally, the preset length includes the length of the identifier, the length of the flag, and the length of the offset;
[0115] The fragmentation module 402 is specifically used for:
[0116] The difference between the maximum transmission unit of NB-IoT and the length of the identifier, the length of the flag, and the length of the offset is used as the length of the fragmented data;
[0117] The character string is segmented based on the length of the segmented data to generate a plurality of the segmented data.
[0118] Optionally, the device further comprises:
[0119] The identifier determination module uses, for each shard data, an identifier of the data to be transmitted corresponding to the shard data as an identifier of the shard data;
[0120] A flag determination module, used to determine the flag of the fragment data according to the position of the fragment data in the character string;
[0121] An encapsulation module, used for encapsulating the identifier, the flag, the offset and the fragmentation data to obtain encapsulated data;
[0122] The sending module 403 is specifically used for:
[0123] Based on the NB-IoT, the encapsulated data is sent to the receiving end.
[0124] Optionally, the sharding module 402 is further configured to:
[0125] Use the length of the shard data as the unit offset;
[0126] Determine the offset based on the flag of the shard data and the unit offset.
[0127] Based on the same inventive concept, an embodiment of the present invention also provides a data transmission device based on NB-IoT, which is applied to the receiving end. The implementation of the device can refer to the implementation of the data transmission method based on NB-IoT, and the repeated parts will not be repeated.
[0128] like Figure 5 As shown, it is a structural schematic diagram of another NB-IoT-based data transmission device provided in an embodiment of the present invention, and the device includes:
[0129] The receiving module 501 is used to receive multiple fragmented data sent by the sending end based on NB-IoT;
[0130] The reorganization module 502 is used to reorganize the multiple shard data according to a preset reorganization strategy to generate data to be restored;
[0131] The second conversion module 503 is used to perform format conversion on the data to be restored.
[0132] Optionally, the reorganization module 502 is specifically used for:
[0133] According to the identifier and flag in each shard data, determining that the shard data transmission of the same identifier is completed;
[0134] For each fragment data of the same identifier, determine the arrangement order of the multiple fragment data of the same identifier according to the offset in each fragment data, and delete the identifier, flag and offset in each fragment data to obtain multiple target fragment data;
[0135] The plurality of target shard data are reorganized according to the arrangement order to generate the data to be restored.
[0136] Based on the same inventive concept, the embodiment of the present application also provides a data transmission device based on NB-IoT, which can be applied to the transmitting end. The implementation of the device can refer to the implementation of the data transmission method based on NB-IoT, and the repeated parts will not be repeated.
[0137] like Figure 6As shown, it is a structural diagram of a data transmission device based on NB-IoT provided in an embodiment of the present invention, including a processor 601, a memory 602, and a communication interface 603. When the processor 601 executes the program, it can implement any method applied to the sending end as above.
[0138] The memory 602 is used to store computer programs executed by the processor 601. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0139] The memory 602 may be a volatile memory, such as a random-access memory (RAM); the memory 602 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 602 may be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 602 may be a combination of the above memories.
[0140] The processor 601 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 601 is used to implement any of the above-mentioned NB-IoT-based data transmission methods when calling the computer program stored in the memory 602.
[0141] The communication interface 603 is used to communicate with terminal devices and other servers.
[0142] The specific connection medium between the memory 602, the communication interface 603 and the processor 601 is not limited in the embodiment of the present application. Figure 6 In the embodiment, the memory 602 and the processor 601 are connected via a bus 604. The bus 604 is connected to the processor 601 via a bus 604. Figure 6 The connections between other components are shown in bold lines, which are only for illustration and are not intended to be limiting. Bus 604 can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0143] Specifically, the processor 601 is configured to call the computer program stored in the memory 602 and execute according to the obtained program:
[0144] Convert the format of the data to be transmitted and generate a character string;
[0145] Slice the string according to the maximum transmission unit and the preset length of the NB-IoT to generate a plurality of slice data;
[0146] For each shard data, determining an offset corresponding to the shard data according to a position of the shard data in the data to be transmitted;
[0147] Through the NB-IoT, the multiple fragmented data carrying the offset are sent to the receiving end, so that the receiving end reorganizes the multiple fragmented data according to the offset carried in each fragmented data.
[0148] In an optional implementation manner, the processor 601 is specifically configured to:
[0149] An identifier is allocated to the data to be transmitted.
[0150] In an optional implementation manner, the processor 601 is specifically configured to:
[0151] The difference between the maximum transmission unit of the NB-IoT and the length of the identifier, the length of the flag, and the length of the offset is used as the length of the fragmented data;
[0152] The character string is segmented based on the length of the segmented data to generate a plurality of the segmented data.
[0153] In an optional implementation, after slicing the string according to the maximum transmission unit and the preset length of NB-IoT and generating multiple slicing data, before sending the slicing data to the receiving end based on NB-IoT, the processor 601 is specifically configured to:
[0154] For each of the fragmented data, using the identifier of the data to be transmitted corresponding to the fragmented data as the identifier of the fragmented data;
[0155] Determine a flag of the slice data according to a position of the slice data in the character string;
[0156] Encapsulating the identifier, the flag, the offset and the fragmentation data to obtain encapsulated data;
[0157] Based on NB-IoT, the encapsulated data is sent to the receiving end.
[0158] In an optional implementation manner, the processor 601 is specifically configured to:
[0159] Use the length of the shard data as the unit offset;
[0160] The offset is determined according to the flag of the slice data and the unit offset.
[0161] Based on the same inventive concept, the embodiment of the present application also provides a data transmission device based on NB-IoT, which can be applied to the receiving end. The implementation of the device can refer to the implementation of the data transmission method based on NB-IoT and the implementation of the above-mentioned data transmission device at the sending end, and the repeated parts will not be repeated.
[0162] like Figure 7 As shown, a structural diagram of another NB-IoT-based data transmission device provided in an embodiment of the present invention is applied to the receiving end, including a processor 701, a memory 702, and a communication interface 703. When the processor 701 executes the program, it can implement any method applied to the receiving end as above.
[0163] The memory 702 is used to store computer programs executed by the processor 701. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0164] The memory 702 may be a volatile memory, such as a random-access memory (RAM); the memory 702 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 702 may be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 702 may be a combination of the above memories.
[0165] The processor 701 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 701 is used to implement any of the above-mentioned NB-IoT-based data transmission methods when calling the computer program stored in the memory 702.
[0166] The communication interface 703 is used to communicate with terminal devices and other servers.
[0167] The specific connection medium between the memory 702, the communication interface 703 and the processor 701 is not limited in the embodiment of the present application. Figure 7 In the embodiment, the memory 702 and the processor 701 are connected via a bus 704. The bus 704 is connected to the processor 701 via a bus 704. Figure 7 The connections between other components are shown in bold lines, which are only for illustration and are not intended to be limiting. Bus 704 can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0168] Specifically, the processor 701 is configured to call the computer program stored in the memory 702 and execute according to the obtained program:
[0169] Receive multiple fragmented data sent by the sender through NB-IoT;
[0170] According to the offset in each shard data, multiple shard data are reassembled to generate data to be restored, wherein the offset is determined by the sender according to the position of the shard data in the data to be transmitted;
[0171] Convert the format of the data to be restored to generate target data.
[0172] In an optional implementation manner, the processor 701 is specifically configured to:
[0173] According to the identifier and flag in each shard data, determining that the shard data transmission of the same identifier is completed;
[0174] For each shard data of the same identifier, determine the arrangement order of multiple shard data of the same identifier according to the offset in each shard data, and delete the identifier, flag and offset in each shard data to obtain multiple target shard data;
[0175] The data of multiple target shards are reorganized according to the arrangement order to generate the data to be restored.
[0176] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium.
[0177] Optionally, the computer-readable storage medium has a computer program, and the computer program includes program instructions. When the program instructions are executed by the computer, the computer executes the steps of the above-mentioned NB-IoT-based data transmission method. Since the computer program in this embodiment and the aforementioned NB-IoT-based data transmission method are inventions based on the same concept, those skilled in the art can clearly understand the implementation process of the computer program in this embodiment through the detailed description of the aforementioned method, so for the sake of brevity of the specification, it will not be repeated here.
[0178] Based on the same inventive concept, an embodiment of the present application provides a computer program product. Optionally, the computer program product stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of the above-mentioned NB-IoT-based data transmission method. Since the computer program in this embodiment and the aforementioned NB-IoT-based data transmission method are inventions based on the same concept, through the detailed description of the aforementioned method, those skilled in the art can clearly understand the implementation process of the computer program in this embodiment, so for the sake of brevity of the specification, it will not be repeated here.
[0179] The present invention discloses a data transmission method, device and apparatus based on NB-IoT, which is used to solve the problem that additional networking is required for transmitting big data through NB-IoT. The method includes: allocating an identifier for the data to be transmitted at the sending end; performing format conversion on the data to be transmitted to generate a character string; determining the data length of each fragment data, and fragmenting the character string to generate multiple fragment data; determining the flag of the fragment data according to the position of the fragment data in the character string; determining the offset corresponding to the fragment data according to the position of the fragment data in the character string for each fragment data; encapsulating the fragment data and the corresponding header; and sending the encapsulated multiple fragment data to Receiving end; receiving the sliced data sent by the sending end and storing it; determining that the sliced data transmission of the same identifier is completed according to the identifier and flag in each sliced data; for each sliced data of the same identifier, determining the arrangement order of multiple sliced data of the same identifier according to the offset in each sliced data, and deleting the identifier, flag and offset in each sliced data to obtain multiple target sliced data; performing format conversion on the data to be restored to generate target data. The above data transmission method formulates a data transmission protocol between the slicing of the sending end and the reorganization of the receiving end, and transmits the larger file data after slicing, and the receiving end restores the sliced file data through the reorganization method. In scenarios such as intelligent monitoring based on NB-IoT network, compared with the need to build another set of WIFI or 4G network to transmit large files separately under the existing technical conditions, the present invention uses the original NB-IoT network to realize the transmission of large files such as pictures, avoiding the problem of additional networking, and thus solving the problems of increased costs and complicated networking.
[0180] The present application is described above with reference to the block diagrams and / or flow charts showing the methods, devices (systems) and / or computer program products according to the embodiments of the present application. It should be understood that a block of the block diagram and / or flow chart diagram and a combination of blocks of the block diagram and / or flow chart diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer and / or other programmable data processing device to produce a machine, so that the instructions executed by the computer processor and / or other programmable data processing device create a method for implementing the functions / actions specified in the block diagram and / or flow chart block.
[0181] Accordingly, the present application may also be implemented with hardware and / or software (including firmware, resident software, microcode, etc.). Furthermore, the present application may take the form of a computer program product on a computer-usable or computer-readable storage medium, which has a computer-usable or computer-readable program code implemented in the medium, for use by an instruction execution system or in conjunction with an instruction execution system. In the context of the present application, a computer-usable or computer-readable medium may be any medium that may contain, store, communicate, transmit, or convey a program for use by an instruction execution system, device, or apparatus, or in conjunction with an instruction execution system, device, or apparatus.
[0182] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A data transmission method based on narrowband Internet of Things NB-IoT, applied to a sending end, characterized in that: The method includes: Assigning an identifier to the data to be transmitted, and performing format conversion on the data to be transmitted to generate a character string; The difference between the maximum transmission unit of the NB-IoT and the preset length is used as the length of the fragmented data; based on the length of the fragmented data, the character string is fragmented to generate multiple fragmented data; the preset length includes the length of the identifier, the length of the flag, and the length of the offset; For each shard data, the length of the shard data is used as a unit offset, and the offset corresponding to the shard data is determined according to the flag of the shard data and the unit offset; Through the NB-IoT, the multiple fragmented data carrying the offset are sent to the receiving end, so that the receiving end reorganizes the multiple fragmented data according to the offset carried in each fragmented data.
2. The method according to claim 1, characterized in that After slicing the string based on the length of the slicing data to generate a plurality of slicing data, and before sending the plurality of slicing data carrying offsets to a receiving end through the NB-IoT, the method further includes: For each of the fragmented data, using the identifier of the data to be transmitted corresponding to the fragmented data as the identifier of the fragmented data; Determine a flag of the slice data according to a position of the slice data in the character string; Encapsulating the identifier, the flag, the offset, and the fragmented data to obtain encapsulated data; The sending, through the NB-IoT, the plurality of sliced data carrying the offset to the receiving end includes: Based on the NB-IoT, the encapsulated data is sent to the receiving end.
3. A data transmission method based on NB-IoT, applied to a receiving end, characterized in that: The method includes: Receiving multiple fragmented data sent by the transmitting end through the NB-IoT; wherein the fragmented data is obtained by the transmitting end assigning an identifier to the data to be transmitted, converting the format of the data to be transmitted to generate a character string, and taking the difference between the maximum transmission unit of the NB-IoT and the preset length as the length of the fragmented data; the character string is fragmented based on the length of the fragmented data; the preset length includes the length of the identifier, the length of the flag and the length of the offset; According to the offset in each shard data, a plurality of shard data are reassembled to generate data to be restored, wherein the offset is determined by the sending end according to the flag of the shard data and the unit offset after taking the length of the corresponding shard data as the unit offset; The format of the data to be restored is converted to generate target data.
4. The method according to claim 3, characterized in that The step of reorganizing the plurality of shard data according to the offset in each shard data to generate data to be restored includes: According to the identifier and flag in each shard data, determining that the shard data transmission of the same identifier is completed; For each fragment data of the same identifier, determine the arrangement order of the multiple fragment data of the same identifier according to the offset in each fragment data, and delete the identifier, flag and offset in each fragment data to obtain multiple target fragment data; The plurality of target shard data are reorganized according to the arrangement order to generate the data to be restored.
5. A data transmission device based on NB-IoT, characterized in that: Applied to a sending end, comprising a processor, a memory, and a program stored in the memory and capable of running on the processor, wherein when the processor executes the program, the method according to claim 1 or 2 can be implemented.
6. A data transmission device based on NB-IoT, characterized in that: The device is applied to a receiving end, and comprises a processor, a memory, and a program stored in the memory and capable of running on the processor. When the processor executes the program, the method as claimed in claim 3 or 4 can be implemented.
7. A data transmission device based on NB-IoT, characterized in that: Applied to the sending end, including: A first conversion module, used for allocating an identifier to the data to be transmitted, and performing format conversion on the data to be transmitted to generate a character string; A slicing module, configured to use the difference between the maximum transmission unit of the NB-IoT and a preset length as the length of the slicing data; based on the length of the slicing data, slicing the string to generate a plurality of slicing data; the preset length includes the length of the identifier, the length of the flag, and the length of the offset; For each shard data, the length of the shard data is used as a unit offset, and the offset corresponding to the shard data is determined according to the flag of the shard data and the unit offset; The sending module is used to send the multiple fragmented data carrying the offset to the receiving end through the NB-IoT, so that the receiving end can reorganize the multiple fragmented data according to the offset carried in each fragmented data.
8. A data transmission device based on NB-IoT, characterized in that: Applied to the receiving end, including: A receiving module, configured to receive, through the NB-IoT, a plurality of fragmented data sent by a transmitting end; wherein, the fragmented data is obtained by the transmitting end assigning an identifier to the data to be transmitted, performing format conversion on the data to be transmitted to generate a character string, and taking the difference between the maximum transmission unit of the NB-IoT and a preset length as the length of the fragmented data; the character string is fragmented based on the length of the fragmented data; the preset length includes the length of the identifier, the length of the flag, and the length of the offset; A reorganization module, used to reorganize a plurality of the fragmented data according to the offset in each fragmented data to generate data to be restored; wherein the offset is determined by the sending end according to the flag of the fragmented data and the unit offset after taking the length of the corresponding fragmented data as the unit offset; The second conversion module is used to perform format conversion on the data to be restored to generate target data.
