Image data transmission method and apparatus, device, and medium
By dividing the image data into sub-data and carrying position information in the bag header, the problem of low image data transmission efficiency in the prior art is solved, and more efficient image data transmission and analysis are achieved.
Patent Information
- Application Number
- PCT/CN2024/099281
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-01
- Filing Date
- 2024-06-14
- Publication Date
- 2025-03-27
AI Technical Summary
The prior art requires adding row marks during image data transmission, resulting in low transmission efficiency.
By dividing the uncompressed image data into multiple sub-data and carrying position information in the header information of each image data stream packet, these sub-data stream packets are directly sent, avoiding the addition of row marks.
This improves the efficiency of image data transmission, reduces the steps and complexity of subcontracting, reduces time-consuming, and enables the receiver to parse and restore image data by row.
Smart Images

Figure CN2024099281_27032025_PF_FP_ABST
Abstract
Description
Image data transmission method, device, equipment and medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on August 1, 2023, with application number 202310963896.2 and invention name “A method, device, equipment and medium for transmitting image data”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of machine vision technology, and in particular to a method, apparatus, device and medium for image data transmission. Background Art
[0003] Image data transmission is necessary in many application scenarios. In existing technologies, during image data transmission, the transmitter needs to add row markers between rows of image data to enable the receiver to distinguish between them. This addition of row markers takes a considerable amount of time, resulting in low image data transmission efficiency.
[0004] Summary of the Invention
[0005] The purpose of the embodiments of the present application is to provide a method, apparatus, device, and medium for image data transmission to improve the efficiency of image data transmission. The specific technical solutions are as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for image data transmission, applied to a sending end, the method comprising:
[0007] Acquire uncompressed first image data, where the first image data includes a plurality of line data;
[0008] Dividing the first image data into a plurality of first sub-data, or dividing the first image data into a plurality of second sub-data, wherein all data in each of the first sub-data belong to row data of the same row, and all data in any row data are located in the same second sub-data;
[0009] respectively encapsulating each of the divided sub-data to obtain a first image data stream packet, wherein the header information of each of the image data stream packets carries position information, and the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the first image data;
[0010] Sending a plurality of the image data stream packets to a receiving end.
[0011] In a possible implementation manner, before sending the plurality of image data stream packets to the receiving end, the method further includes:
[0012] Send the frame header information to the receiving end;
[0013] After sending the plurality of image data stream packets to the receiving end, the method further includes:
[0014] The frame tail information is sent to the receiving end.
[0015] In a possible implementation manner, dividing the first image data into a plurality of first sub-data, or dividing the first image data into a plurality of second sub-data, includes:
[0016] If the amount of the row data is greater than a preset threshold, dividing the first image data into a plurality of first sub-data;
[0017] If the data size of the row data is smaller than the preset threshold, the first image data is divided into a plurality of second sub-data.
[0018] In a possible implementation, dividing the first image data into a plurality of second sub-data includes:
[0019] Determine a maximum integer smaller than a preset ratio as a maximum capacity, wherein the preset ratio is a ratio of the preset threshold to the data amount;
[0020] The first image data is divided into a plurality of second sub-data according to the maximum capacity, wherein each second sub-data contains the maximum capacity of complete line data.
[0021] In one possible implementation, the method further includes:
[0022] acquiring compressed second image data;
[0023] dividing the second image data into a plurality of third sub-data;
[0024] Encapsulating each of the divided sub-data respectively to obtain a second image data stream packet;
[0025] Send the frame header information to the receiving end;
[0026] After the frame header information is sent to the receiving end, the second image data stream packet is sent to the receiving end;
[0027] After sending the second image data stream packet to the receiving end, frame end information is sent to the receiving end.
[0028] In a possible implementation manner, dividing the second image data into a plurality of third sub-data includes:
[0029] The second image data is divided into X third sub-data of a size equal to a preset threshold and one third sub-data of a size Y, wherein X is a quotient of a data volume of the second image data divided by the preset threshold, and Y is a remainder of a data volume divided by the preset threshold.
[0030] In a second aspect, an embodiment of the present application provides a method for image data transmission, applied to a receiving end, the method comprising:
[0031] Receive the first image data stream packet sent by the sender:
[0032] parsing each of the first image data stream packets to obtain position information and sub-data carried in each of the first image data stream packets, wherein the position information is used to indicate a position of the sub-data encapsulated in the image data stream packet in the uncompressed first image data;
[0033] The sub-data is restored according to the position information to obtain the first image data.
[0034] In one possible implementation, the method further includes:
[0035] Receiving frame header information and frame tail information sent by the sending end;
[0036] The parsing of each of the first image data stream packets includes:
[0037] The first image data stream packet received between the frame header information and the frame tail information is parsed.
[0038] In one possible implementation, the method further includes:
[0039] receiving frame header information, a second image data stream packet, and frame tail information sent by the transmitting end;
[0040] parsing the second image data stream packet received between the frame header information and the frame tail information to obtain compressed image data carried in the second image data stream packet;
[0041] The compressed image data obtained by parsing are restored to obtain compressed second image data.
[0042] In a third aspect, an embodiment of the present application provides an image data transmission device, applied to a transmitting end, the device comprising:
[0043] A first image data acquisition module, configured to acquire uncompressed first image data, where the first image data includes a plurality of line data;
[0044] a first image data segmentation module, configured to segment the first image data into a plurality of first sub-data, or segment the first image data into a plurality of second sub-data, wherein all data in each first sub-data belongs to row data of the same row, and all data in any row data is located in the same second sub-data;
[0045] a first image data encapsulation module, configured to respectively encapsulate each of the segmented sub-data to obtain a first image data stream packet, wherein the header information of each of the image data stream packets carries position information, and the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the first image data;
[0046] The first image data sending module is used to send a plurality of image data stream packets to a receiving end.
[0047] In a possible implementation manner, before sending the plurality of image data stream packets to the receiving end, the apparatus further includes:
[0048] A first frame header information sending module, used for sending the frame header information to the receiving end;
[0049] After sending the plurality of image data stream packets to the receiving end, the method further includes:
[0050] A first frame tail information sending module, configured to send the frame tail information to the receiving end;
[0051] The first image data segmentation module includes:
[0052] a first sub-data segmentation submodule, configured to segment the first image data into a plurality of first sub-data if the amount of the row data is greater than a preset threshold;
[0053] a second sub-data segmentation submodule, configured to segment the first image data into a plurality of second sub-data if the amount of the row data is less than the preset threshold;
[0054] The second sub-data segmentation sub-module includes:
[0055] a determining unit, configured to determine a maximum integer smaller than a preset ratio as a maximum capacity, wherein the preset ratio is a ratio of the preset threshold to the data volume;
[0056] a segmentation unit, configured to segment the first image data into a plurality of second sub-data according to the maximum capacity, wherein each second sub-data contains the maximum capacity of complete line data;
[0057] The device further comprises:
[0058] A second image data acquisition module, configured to acquire compressed second image data;
[0059] A second image data segmentation module, configured to segment the second image data into a plurality of third sub-data;
[0060] A second image data encapsulation module is used to encapsulate each of the segmented sub-data to obtain a second image data stream packet;
[0061] A second frame header information sending module, used for sending the frame header information to the receiving end;
[0062] A second image data sending module, configured to send the second image data stream packet to the receiving end after sending the frame header information to the receiving end;
[0063] A second frame end information sending module, configured to send frame end information to the receiving end after sending the second image data stream packet to the receiving end;
[0064] The second image data segmentation module includes:
[0065] The third sub-data segmentation submodule is configured to segment the second image data into X third sub-data of a size equal to a preset threshold and one third sub-data of a size Y, where X is the quotient of the data volume of the second image data divided by the preset threshold, and Y is the remainder of the data volume divided by the preset threshold.
[0066] In a fourth aspect, an embodiment of the present application provides an image data transmission device, applied to a receiving end, the device comprising:
[0067] A first image data receiving module, configured to receive a first image data stream packet sent by a sending end;
[0068] a first image data parsing module, configured to parse each of the first image data stream packets to obtain position information and sub-data carried in each of the first image data stream packets, wherein the position information is used to indicate a position of the sub-data encapsulated in the image data stream packet in the uncompressed first image data;
[0069] The first image data restoration module is configured to restore the sub-data according to the position information to obtain the first image data.
[0070] In a possible implementation, the device further includes:
[0071] A frame header and frame tail information receiving module, configured to receive the frame header and frame tail information sent by the transmitting end;
[0072] The first image data parsing module includes:
[0073] a first image data parsing submodule, configured to parse the first image data stream packet received between the frame header information and the frame tail information;
[0074] The device further comprises:
[0075] An information data stream packet receiving module, configured to receive frame header information, a second image data stream packet, and frame tail information sent by the transmitting end;
[0076] a second image data parsing module, configured to parse the second image data stream packet received between the frame header information and the frame trailer information, and obtain compressed image data carried in the second image data stream packet;
[0077] The second image data restoration module is used to restore the compressed image data obtained by analysis to obtain compressed second image data.
[0078] In a fifth aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0079] Memory for storing computer programs;
[0080] The processor is configured to implement any of the above-mentioned steps of the image data transmission method when executing the program stored in the memory.
[0081] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned image data transmission methods are implemented.
[0082] Beneficial effects of the embodiments of the present application:
[0083] An embodiment of the present application provides an image data transmission method, which obtains uncompressed first image data, where the first image data includes multiple row data; divides the first image data into multiple first sub-data, or divides the first image data into multiple second sub-data, wherein all data in each first sub-data belongs to the same row data, and all data in any row data is located in the same second sub-data; encapsulates each divided sub-data separately to obtain a first image data stream packet, wherein the header information of each image data stream packet carries position information, and the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the first image data; and sends the multiple image data stream packets to a receiving end. By applying the solution of the embodiments of the present application, on the one hand, the image data can be segmented and packaged according to the characteristics of the image rows to obtain image data stream packets. For the first sub-data, an image data stream packet only contains row data of the same row. For the second sub-data, it contains row data of multiple complete rows. Therefore, after receiving the image data stream packet, the receiving end can parse out which row the data contained in the image data stream packet belongs to. Compared with the subpacketization method in the prior art, there is no need to add row tags, which reduces the subpacketization steps, reduces complexity, reduces time consumption, and improves the efficiency of image data transmission.
[0084] On the other hand, the location information of each sub-data encapsulated therein in the image data is added to the header information of each image data stream packet, so that the receiving end can parse and restore the image row by row after receiving the image data. Even if packet loss occurs, it will not affect the subsequent image data storage, which facilitates image processing at the receiving end.
[0085] Of course, it is not necessary to achieve all the advantages described above at the same time when implementing any product or method of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0087] FIG1 is a schematic diagram of a CoaXPress protocol image data stream subpacketization method provided in an embodiment of the present application;
[0088] FIG2 is a first flow chart of an image data transmission method provided in an embodiment of the present application;
[0089] FIG3 is a second flow chart of an image data transmission method provided in an embodiment of the present application;
[0090] FIG4 is a schematic diagram of a first process of segmenting and packaging first image data provided by an embodiment of the present application;
[0091] FIG5 is a schematic diagram of a second process of segmenting and packaging the first image data provided by an embodiment of the present application;
[0092] FIG6 is a third flow chart of an image data transmission method provided in an embodiment of the present application;
[0093] FIG7 is a schematic diagram of a process for segmenting and packaging second image data according to an embodiment of the present application;
[0094] FIG8 is a fourth flow chart of an image data transmission method provided in an embodiment of the present application;
[0095] FIG9 is a fifth flow chart of an image data transmission method provided in an embodiment of the present application;
[0096] FIG10 is a schematic diagram of a first structure of an image data transmission device provided in an embodiment of the present application;
[0097] FIG11 is a schematic diagram of a second structure of an image data transmission device provided in an embodiment of the present application;
[0098] FIG12 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0099] To make the objectives, technical solutions, and advantages of this application more clearly understood, the present application is further described below with reference to the accompanying drawings and examples. It is apparent that the described examples are only a portion of the embodiments of this application, and not all of them. All other embodiments derived by persons of ordinary skill in the art based on the examples in this application are intended to fall within the scope of protection of this application.
[0100] The CoaXPress protocol (an asymmetric, high-speed, point-to-point serial communication digital interface standard transmission protocol) is a commonly used image transmission protocol in the prior art, particularly in the field of machine vision. The CoaXPress protocol's image data stream packetization method is shown in Figure 1, which is a schematic diagram of a CoaXPress protocol image data stream packetization method provided in an embodiment of the present application.
[0101] As shown in Figure 1, the CoaXPress protocol's image data packetization method consists of two steps. The image frame in Figure 1 contains five lines: Line 1 (first line), Line 2 (second line), Line 3 (third line), Line 4 (fourth line), and Line 5 (fifth line). In the first step, an Image Header (IH) is inserted at the beginning of each frame, serving as the image header marker. A Line Marker (LM) is inserted at the beginning of each line, serving as the line start marker. The frame header, line marker, and all image data are then considered the entire data stream to be transmitted. In the second step, all data streams obtained in the first step are evenly divided into multiple data stream packets based on a pre-set packet size. The last data stream packet is allowed to be smaller than the others. Furthermore, an SPH (Data Stream Header) and SPT (Data Stream Trailer) are added to the beginning and end of each data stream packet. In the CoaXPress protocol image data stream packetization method, the SPH data stream packet header defines the data stream packet indication, the data stream unique ID (Identity document, Chinese name identity identification number), the data stream packet count under the corresponding ID, and the number of data stream bytes per packet. A CRC (Cyclic Redundancy Check, Chinese name cyclic redundancy check code) check code is added to the SPT data stream packet tail. However, the above data transmission method has the following disadvantages: first, it is necessary to add row markers, which increases the implementation steps and complexity, and also increases the time consumption; second, there is no image frame end information. When transmitting image data with variable frame data volume, such as compressed images, the receiving end cannot determine whether the currently transmitted image data has ended, resulting in the inability to transmit the image data in real time; third, the uncompressed image data stream is not packetized according to the image rows, which is not conducive to the image processing after the receiving end protocol parsing; fourth, when the image data stream packet is lost, the subsequent image data stream packets will be filled into the memory of the current packet loss, resulting in the image data since the packet loss being misplaced and the entire frame image being abnormal, so that the host end cannot parse and restore the image after receiving the image data, affecting the subsequent image data storage.
[0102] Based on this, the present application provides an image data transmission method applied to a sending end. When the image data is uncompressed image data, as shown in FIG2 , FIG2 is a first flow chart of an image data transmission method provided in an embodiment of the present application, including:
[0103] S201 : Acquire uncompressed first image data, where the first image data includes a plurality of line data.
[0104] S202: Divide the first image data into a plurality of first sub-data, or divide the first image data into a plurality of second sub-data.
[0105] All data in each first sub-data belong to row data of the same row, and all data in any row data are located in the same second sub-data.
[0106] S203: Encapsulate each of the divided sub-data respectively to obtain a first image data stream packet.
[0107] The header information of each image data stream packet carries position information, and the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the first image data.
[0108] S204: Send multiple image data stream packets to a receiving end.
[0109] By applying the solution of the embodiment of the present application, on the one hand, the image data can be segmented and packaged according to the characteristics of the image rows to obtain image data stream packets. For the first sub-data, an image data stream packet only contains row data of the same row. For the second sub-data, it contains row data of multiple complete rows. Therefore, after receiving the image data stream packet, the receiving end can parse out which row the data contained in the image data stream packet belongs to. Compared with the subpacketization method in the prior art, there is no need to add row marks, which reduces the subpacketization steps, reduces complexity, reduces time consumption, and improves the efficiency of image data transmission, thus solving the aforementioned problem one.
[0110] On the other hand, the position information of each sub-data encapsulated therein in the image data is added to the packet header information of each image data stream packet, so that the receiving end can parse and restore the image row by row after receiving the image data. Even if packet loss occurs, it will not affect the subsequent image data storage, which makes it easier for the receiving end to perform image processing, thus solving the aforementioned problems three and four.
[0111] The above S201-S204 will be described below respectively:
[0112] In step S201 , the uncompressed first image data includes a plurality of row data, wherein one image data includes a plurality of image rows, and the row data is data of one image row, that is, one image data includes a plurality of row data.
[0113] In step S202, the first sub-data refers to multiple data segments of row data containing data belonging to the same row. The "same" here means that the data contained in the first sub-data all belong to the same row, not that the content contained in the row data is the same. For the convenience of description, it will be referred to as the same row data below. The second sub-data refers to the data contained in the data from different rows, but all are complete data of the row to which they belong. Among them, all data of any row data is located in the same second sub-data means that all data of any row data is located in the same second sub-data when any row data is selected. For example, if the first image data is 10MB, 0KB-5KB is the data of the first row, 6KB-10KB is the data of the second row, 11KB-15KB is the data of the third row, etc., when it is divided into the first sub-data, 0KB-3KB is divided into a first sub-data segment, 4KB-5KB is divided into a first sub-data segment, and so on. When it is divided into the second sub-data, 0KB-15KB is divided into a second sub-data segment, 16KB-30KB is divided into a second sub-data segment, and so on. In this application, different segmentation methods can be selected according to actual needs to divide the first image data into the first sub-data or the second sub-data. This application does not impose any restrictions on this, and the following will provide exemplary explanations of how to segment the first sub-data and the second sub-data, so it will not be repeated here.
[0114] In step S203, header information and trailer information are added to each sub-data that has been segmented to complete the encapsulation of the sub-data and obtain a first image data stream packet. Position information is added to the header information to indicate the position of the sub-data encapsulated in the image data stream packet in the first image data.
[0115] In step S204, the encapsulated multiple image data stream packets are sent to the receiving end, so that after receiving the image data stream packets, the receiving end can parse each image data stream packet to obtain the position information and sub-data carried in each first image data stream packet, and then restore the first image data.
[0116] In the aforementioned step S202, the first image data may be segmented into the first sub-data or the second sub-data according to actual needs. For example, the first image data may be segmented according to a pre-configured segmentation method in response to a user's selection instruction. If the pre-configured segmentation method indicates segmentation into the first sub-data, the first image data is segmented into the first sub-data; if the pre-configured segmentation method indicates segmentation into the second sub-data, the first image data is segmented into the second sub-data.
[0117] In a possible embodiment, the execution subject of the present application may select to divide the first image data into the first sub-data or the second sub-data according to the actual situation and the preset rules. For example, in a possible embodiment, the above step S202 may specifically include the following steps:
[0118] S2021: If the amount of the row data is greater than a preset threshold, the first image data is divided into a plurality of first sub-data.
[0119] S2022: If the amount of the row data is less than a preset threshold, the first image data is divided into a plurality of second sub-data.
[0120] In the above steps S2021 and S2022, the preset threshold may be a value set according to actual needs, and may be a value that reflects the maximum amount of data that a single data stream packet can carry, and is close to the maximum amount of data.
[0121] In a possible embodiment, the preset threshold may be determined according to hardware performance, and examples thereof may be 4 KB, 8 KB, and 16 KB.
[0122] In a special case, when the sub-data obtained by segmentation has only one row of data, and the row of data is complete, it is referred to as the second sub-data in this article.
[0123] By applying the above embodiment, since the preset threshold reflects the maximum amount of data that a single data stream packet can carry and transmit, each sub-data divided out can be as close to the preset threshold as possible according to the above method, thereby making full use of resources and improving the efficiency of image data transmission.
[0124] In a possible embodiment, the first image data can be divided into multiple second sub-data by arbitrarily combining multiple rows of data in the first image data in order according to actual needs. For example, if the first image data contains ten rows of data, L1, L2, L3...L10, L1 and L2 can be divided into one second sub-data, L3, L4, L5, L6 can be divided into one second sub-data, and L7, L8, L9, L10 can be divided into one second sub-data. Alternatively, L1, L2, L3 can be divided into one second sub-data, L4, L5, L6, L7 can be divided into one second sub-data, and L8, L9, L10 can be divided into one second sub-data. Alternatively, L1, L2, L3 can be divided into one second sub-data, L4, L5, L6, L7 can be divided into one second sub-data, and L8, L9, L10 can be divided into one second sub-data. Alternatively, L1, L2, L3, L4 can be divided into one second sub-data, and L5, L6, L7, L8, L9, L10 can be divided into one second sub-data, and so on.
[0125] In another possible embodiment, when the first image data is divided into multiple second sub-data, the multiple second sub-data obtained by the division should be ensured to contain the same number of row data as much as possible. For example, an integer N can be pre-set, and the 1st to Nth row data can be divided into a second sub-data, the N+1th to 2Nth row data can be divided into a second sub-data, and the 2N+1th to 3Nth row data can be divided into a second sub-data. If the first image data only contains 3N+1 row data, the last remaining 3N+1 row data can be used as a separate second sub-data. For example, if the first image data contains ten row data, L1, L2, L3...L10, and the pre-set integer N is 3, L1, L2, L3 can be divided into a second sub-data, L4, L5, L6 can be divided into a second sub-data, L7, L8, L9 can be divided into a second sub-data, and L10 can be divided into a second sub-data.
[0126] In another possible embodiment, the above step S2022, i.e., dividing the first image data into a plurality of second sub-data, may specifically include the following steps:
[0127] S20221, determining a maximum integer smaller than a preset ratio as the maximum capacity, wherein the preset ratio is a ratio of a preset threshold to the data volume.
[0128] S20222: Divide the first image data into a plurality of second sub-data according to the maximum capacity, wherein each second sub-data contains a maximum capacity of complete row data.
[0129] In steps S20221 and S20222, the maximum capacity refers to the maximum integer number of complete row data that can be accommodated in a data packet during subsequent data packet encapsulation.
[0130] For example, referring to the above, the first image data contains ten rows of data, L1, L2, L3...L10. If the maximum capacity is 5, then each second sub-data can accommodate a maximum of 5 rows of complete row data. When the first image data is divided into multiple second sub-data, L1, L2, L3, L4, L5 can be divided into one second sub-data, and L6, L7, L8, L9, L10 can be divided into one second sub-data.
[0131] By applying the above embodiment, since the preset threshold reflects the maximum amount of data that a single data stream packet can carry and transmit, the maximum capacity can be flexibly adjusted according to the preset threshold and the size of the current image data, so that the sum of the data volume of the complete row data contained in the subsequently encapsulated data stream packets is as close as possible to the preset threshold, thereby reducing memory usage, reducing resource waste, and improving the efficiency of image data transmission.
[0132] In a possible embodiment, the frame header information may be bound to the first first image data stream packet and sent to the receiving end before sending other first image data stream packets to the receiving end. The frame tail information may be bound to the last first image data stream packet and sent to the receiving end after sending other first image data stream packets to the receiving end.
[0133] In another possible embodiment, the frame header information and the frame tail information may be sent to the receiving end in the following manner, as shown in FIG3 , which is a second flow chart of an image data transmission method provided in an embodiment of the present application.
[0134] Before sending the plurality of image data stream packets to the receiving end, the method further comprises the following steps:
[0135] S301, sending frame header information to a receiving end.
[0136] After sending the plurality of image data stream packets to the receiving end, the method further includes:
[0137] S302: Send the frame tail information to the receiving end.
[0138] In steps S301 and S302, in one possible embodiment, the frame header information and the frame trailer information are sent to the receiving end in the form of a data stream packet. That is, the frame header information and the frame trailer information are each encapsulated into a data stream packet, so that the receiving end can accurately determine that a new image data transmission has begun upon receiving the data stream packet containing the frame header information, and can accurately determine that the current image data transmission has ended upon receiving the data stream packet containing the frame trailer information. In another possible embodiment, the frame header information and the frame trailer information can also be sent in a manner other than a data stream packet.
[0139] In actual applications, S301, S204 and S302 constitute a sending step, and during the packet sending process, the frame header information, the data stream packet and the frame tail information are sent in sequence.
[0140] By applying the above embodiment, the frame header information and the frame trailer information are each encapsulated into a data stream packet. This allows the receiving end to accurately determine the start of a new image data transmission upon receiving a data stream packet containing the frame header information, and to accurately determine the end of the currently transmitted image data upon receiving a data stream packet containing the frame trailer information. This allows the receiving end to accurately determine the start and end times of the currently transmitted image data, thereby achieving real-time transmission of the image data.
[0141] The following is an exemplary description of how to segment and obtain the first sub-data and encapsulate the segmented first sub-data into an image data stream packet:
[0142] 4 , which is a schematic diagram of a first process of segmenting and packaging first image data provided by an embodiment of the present application, which may specifically include the following steps:
[0143] S401, obtaining first image data, the first image data including two line data, Line 1 and Line 2;
[0144] S402, adding frame header information IL (Image Leader, Chinese name for image frame header) before Line 1, adding frame trailer information IT (Image Trailer, Chinese name for image frame tail) after Line 2, and dividing the first image data with the added frame header information and frame trailer information into six first sub-data Pkt0, Pkt1, Pkt2...Pkt5 respectively;
[0145] S403, encapsulate the six first sub-data obtained in S402. The specific steps are to add header information STLP (Start of Transport Layer Packet, Chinese name transport layer data packet header) and trailer information ETLP (End of Transport Layer Packet, Chinese name transport layer data packet tail) to the first sub-data Pkt0, and encapsulate it into a data stream packet; add header information STLP and trailer information ETLP to the first sub-data Pkt1, and encapsulate it into a data stream packet; and so on, to obtain six data stream packets.
[0146] The following is an exemplary description of how to segment the second sub-data and encapsulate the segmented second sub-data into an image data stream packet:
[0147] 5 , which is a schematic diagram of a second process of segmenting and packaging the first image data provided by an embodiment of the present application, which may specifically include the following steps:
[0148] S501, obtaining first image data, the first image data including four line data, namely Line1, Line2, Line3, and Line4;
[0149] S502: Add header information IL before Line 1 and trailer information IT after Line 4, and divide the first image data with the header and trailer information into four second sub-data: Pkt0, Pkt1, Pkt2, and Pkt3. The header information IL is the second sub-data Pkt0, Lines 1 and 2 are the second sub-data Pkt1, Lines 3 and 4 are the second sub-data Pkt2, and the trailer information IT is the second sub-data Pkt3.
[0150] S503, encapsulate the four second sub-data obtained in S502 to obtain multiple data stream packets. The specific steps are to add header information STLP and trailer information ETLP to the second sub-data Pkt0, and encapsulate it into a data stream packet; add header information STLP and trailer information ETLP to the second sub-data Pkt1, and encapsulate it into a data stream packet; and so on, to obtain four data stream packets.
[0151] In a possible embodiment, when the amount of row data is equal to a preset threshold, any one of the above-mentioned splitting and packaging methods can be adopted.
[0152] When the image data is compressed image data, in a possible embodiment, compressed second image data is obtained, the second image data is divided into a plurality of third sub-data, frame header information is bound to the first second image data stream packet, and the first sub-data is sent to the receiving end before the other second image data stream packets are sent to the receiving end, and frame footer information is bound to the last second image data stream packet, and the last sub-data is sent to the receiving end after the other second image data stream packets are sent to the receiving end.
[0153] In another possible embodiment, the compressed image data may be transmitted in the following manner, as shown in FIG6 , which is a third flow chart of an image data transmission method provided in an embodiment of the present application. The method further includes:
[0154] S601, obtaining compressed second image data;
[0155] S602, dividing the second image data into a plurality of third sub-data;
[0156] S603, encapsulating each of the divided sub-data to obtain a second image data stream packet;
[0157] S604, sending the frame header information to the receiving end;
[0158] S605, after sending the frame header information to the receiving end, sending the second image data stream packet to the receiving end;
[0159] S606: After sending the second image data stream packet to the receiving end, send frame end information to the receiving end.
[0160] By applying the above embodiment, frame header and frame trailer information are added to the compressed image data, and the compressed image data is segmented and encapsulated into multiple image data stream packets. Furthermore, the frame header and frame trailer information are each encapsulated into a separate image data stream packet. This allows the receiving end to accurately determine the start and end times of the currently transmitted compressed image data during data transmission, thereby achieving real-time transmission of the image data. This solves the second aforementioned problem.
[0161] In one possible embodiment, the second image data may be segmented into the third sub-data according to actual needs. For example, the second image data may be segmented according to a pre-configured segmentation method in response to a user's selection instruction. If the pre-configured segmentation method indicates segmentation into the third sub-data, the second image data is segmented into the third sub-data.
[0162] In another possible embodiment, the execution subject of this application may also divide the second image data into third sub-data according to the preset rules based on the actual situation. For example, in one possible embodiment, the above step S602 includes:
[0163] The second image data is divided into X third sub-data of a size equal to a preset threshold and one third sub-data of a size Y, wherein X is the quotient of the data volume of the second image data divided by the preset threshold, and Y is the remainder of the data volume divided by the preset threshold.
[0164] In the above steps, the second image data is divided into a plurality of data stream packets of a preset threshold size, and the data volume of the last data stream packet may be smaller than the preset threshold.
[0165] The following is an exemplary description of how to segment the data to obtain the third sub-data and encapsulate the segmented third sub-data into an image data stream packet:
[0166] 7 , which is a schematic diagram of a process for segmenting and packaging the second image data according to an embodiment of the present application, which can be specifically divided into two steps:
[0167] S701, acquiring second image data, where the second image data is compressed image data;
[0168] S702, adding frame header information IL to the head of the compressed image data, adding frame trailer information IT to the tail of the compressed image data, and dividing the second image data with the added frame header information and frame trailer information into five third sub-data, namely Pkt0, Pkt1, Pkt2, ..., Pkt4;
[0169] S703, encapsulate the five third sub-data obtained in S702. The specific steps are to add header information STLP and trailer information ETLP to the third sub-data Pkt0, and encapsulate it into a data stream packet; add header information STLP and trailer information ETLP to the third sub-data Pkt1, and encapsulate it into a data stream packet; and so on, to obtain five data stream packets.
[0170] The present application provides an image data transmission method applied to a receiving end, as shown in FIG8 , which is a fourth flow chart of an image data transmission method provided in an embodiment of the present application, including:
[0171] S801, receiving a first image data stream packet sent by a transmitting end;
[0172] S802: Parse each first image data stream packet to obtain position information and sub-data carried in each first image data stream packet, wherein the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the uncompressed first image data.
[0173] S803: Restore the sub-data according to the position information to obtain first image data.
[0174] The image data transmission method applied to the receiving end provided in this application corresponds to the aforementioned image data transmission method applied to the sending end. Please refer to the aforementioned relevant description of the image data transmission method applied to the sending end, and no further details will be given here.
[0175] Applying the above embodiment, the first image data stream packet sent by the transmitting end is received; each first image data stream packet is parsed to obtain the position information and sub-data carried in each first image data stream packet, wherein the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the uncompressed first image data; and based on the position information, the sub-data is restored to obtain the first image data. Applying the scheme of the embodiment of the present application, since the transmitting end divides and encapsulates the image data according to the characteristics of the image row to obtain the image data stream packet, for the first sub-data, an image data stream packet only contains row data of the same row, and for the second sub-data, it contains row data of multiple complete rows, so that after receiving the image data stream packet, the receiving end can parse out which row the data contained in the image data stream packet belongs to. Compared with the packetization method in the prior art, there is no need to add row marks, which reduces the steps of packetization, reduces complexity, reduces time consumption, and improves the efficiency of image data transmission, thus solving the aforementioned problem one.
[0176] On the other hand, the sending end adds the position information of each sub-data encapsulated in the image data to the packet header information of each image data stream packet, so that the receiving end can parse and restore the image row by row after receiving the image data. Even if packet loss occurs, it will not affect the subsequent image data storage, which facilitates the receiving end to perform image processing, thereby solving the aforementioned problems three and four.
[0177] In one possible embodiment, a receiving end receives a first first image data stream packet bound to frame header information and a last first image data stream packet bound to frame footer information from a transmitting end, and parses each first image data stream packet, including parsing all first image data stream packets including the first first image data stream packet and the last first image data stream packet.
[0178] In another possible embodiment, the method further includes:
[0179] Receive the frame header and frame trailer information sent by the sender.
[0180] Parsing each first image data stream packet, including:
[0181] The first image data stream packet received between the frame header information and the frame tail information is parsed.
[0182] The image data transmission method applied to the receiving end provided in this application corresponds to the aforementioned image data transmission method applied to the sending end. Please refer to the aforementioned relevant description of the image data transmission method applied to the sending end, which will not be repeated here.
[0183] By applying the above embodiment, since the sending end adds frame header information and frame trailer information to the compressed image data, the compressed image data is divided and encapsulated into multiple image data stream packets, and the frame header information and frame trailer information are each encapsulated into an image data stream packet. This allows the receiving end to accurately determine the start and end time of the currently transmitted compressed image data during the data transmission process, and parse the first image data stream packet, thereby realizing real-time transmission of image data.
[0184] In one possible embodiment, a receiving end receives a first second image data stream packet bound to a frame header, remaining second image data stream packets, and a last second image data stream packet bound to a frame trailer, sent by a transmitting end. The receiving end parses all second image data stream packets, including the first and last second image data stream packets, to obtain compressed image data carried in the second image data stream packets, and then restores the compressed image data to obtain the compressed second image data.
[0185] In another possible embodiment, as shown in FIG9 , which is a fifth flow chart of an image data transmission method provided in an embodiment of the present application, the method further includes:
[0186] S901, receiving frame header information, a second image data stream packet, and frame tail information sent by a transmitting end;
[0187] S902, parsing the second image data stream packet received between the frame header information and the frame trailer information to obtain compressed image data carried in the second image data stream packet;
[0188] S903: Restoring the compressed image data obtained through analysis to obtain compressed second image data.
[0189] The image data transmission method applied to the receiving end provided in this application corresponds to the aforementioned image data transmission method applied to the sending end. Please refer to the aforementioned relevant description of the image data transmission method applied to the sending end, which will not be repeated here.
[0190] By applying the above embodiment, since the sending end adds frame header information and frame trailer information to the compressed image data, the compressed image data is divided and encapsulated into multiple image data stream packets, and the frame header information and frame trailer information are each encapsulated into an image data stream packet. This allows the receiving end to accurately determine the start and end time of the currently transmitted compressed image data during the data transmission process, and parse and restore to obtain the second image data, thereby realizing real-time transmission of image data.
[0191] Corresponding to the above method embodiment, an embodiment of the present application provides an image data transmission device, which is applied to a transmitting end. As shown in FIG10 , FIG10 is a schematic diagram of a first structure of an image data transmission device provided in an embodiment of the present application. The device may include the following modules:
[0192] A first image data acquisition module 1001 is configured to acquire uncompressed first image data, where the first image data includes a plurality of line data;
[0193] A first image data segmentation module 1002 is configured to segment the first image data into a plurality of first sub-data, or segment the first image data into a plurality of second sub-data, wherein all data in each first sub-data belongs to the same row of row data, and all data in any row of row data is located in the same second sub-data;
[0194] a first image data encapsulation module 1003, configured to encapsulate each of the segmented sub-data to obtain a first image data stream packet, wherein the header information of each image data stream packet carries position information, and the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the first image data;
[0195] The first image data sending module 1004 is configured to send a plurality of image data stream packets to a receiving end.
[0196] By using the embodiments of the present application, on the one hand, the image data can be segmented and packaged according to the characteristics of the image rows to obtain image data stream packets. For the first sub-data, an image data stream packet only contains row data of the same row. For the second sub-data, it contains row data of multiple complete rows. This allows the receiving end to parse out which row the data contained in the image data stream packet belongs to after receiving the image data stream packet. Compared with the subpacketization method in the prior art, there is no need to add row tags, which reduces the subpacketization steps, reduces complexity, reduces time consumption, and improves the efficiency of image data transmission, thus solving the aforementioned problem one.
[0197] On the other hand, the position information of each sub-data encapsulated therein in the image data is added to the packet header information of each image data stream packet, so that the receiving end can parse and restore the image row by row after receiving the image data. Even if packet loss occurs, it will not affect the subsequent image data storage, which makes it easier for the receiving end to perform image processing, thus solving the aforementioned problems three and four.
[0198] In a possible embodiment, before sending the plurality of target image data stream packets to the receiving end, the apparatus further includes:
[0199] A first frame header information sending module, used for sending the frame header information to the receiving end;
[0200] After sending the plurality of target image data stream packets to the receiving end, the method further includes:
[0201] A first frame tail information sending module, configured to send the frame tail information to the receiving end;
[0202] The first image data segmentation module includes:
[0203] a first sub-data segmentation submodule, configured to segment the first image data into a plurality of first sub-data if the amount of the row data is greater than a preset threshold;
[0204] a second sub-data segmentation submodule, configured to segment the first image data into a plurality of second sub-data if the amount of the row data is less than the preset threshold;
[0205] The second sub-data segmentation sub-module includes:
[0206] a determining unit, configured to determine a maximum integer smaller than a preset ratio as a maximum capacity, wherein the preset ratio is a ratio of the preset threshold to the data volume;
[0207] a segmentation unit, configured to segment the first image data into a plurality of second sub-data according to the maximum capacity, wherein each second sub-data contains the maximum capacity of complete line data;
[0208] The device further comprises:
[0209] A second image data acquisition module, configured to acquire compressed second image data;
[0210] A second image data segmentation module, configured to segment the second image data into a plurality of third sub-data;
[0211] A second image data encapsulation module is used to encapsulate each of the segmented sub-data to obtain a second image data stream packet;
[0212] A second frame header information sending module, used for sending the frame header information to the receiving end;
[0213] A second image data sending module, configured to send the second image data stream packet to the receiving end after sending the frame header information to the receiving end;
[0214] A second frame end information sending module, configured to send frame end information to the receiving end after sending the second image data stream packet to the receiving end;
[0215] The second image data segmentation module includes:
[0216] The third sub-data segmentation submodule is configured to segment the second image data into X third sub-data of a size equal to a preset threshold and one third sub-data of a size Y, where X is the quotient of the data volume of the second image data divided by the preset threshold, and Y is the remainder of the data volume divided by the preset threshold.
[0217] Corresponding to the above method embodiment, an embodiment of the present application provides an image data transmission device, which is applied to a receiving end, as shown in FIG11 . FIG11 is a schematic diagram of a second structure of an image data transmission device provided in an embodiment of the present application. The device may include the following modules:
[0218] The first image data receiving module 1101 is configured to receive a first image data stream packet sent by a transmitting end;
[0219] a first image data parsing module 1102, configured to parse each of the first image data stream packets to obtain position information and sub-data carried in each of the first image data stream packets, wherein the position information indicates a position of the sub-data encapsulated in the image data stream packet within the uncompressed first image data;
[0220] The first image data restoration module 1103 is configured to restore the sub-data according to the position information to obtain the first image data.
[0221] Applying the above embodiment, a first image data stream packet sent by a transmitting end is received; each of the first image data stream packets is parsed to obtain position information and sub-data carried in each of the first image data stream packets, wherein the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the uncompressed first image data; and based on the position information, the sub-data is restored to obtain the first image data. Applying the solution of the embodiment of the present application, on the one hand, because the transmitting end divides and encapsulates the image data according to the characteristics of the image row to obtain the image data stream packet, for the first sub-data, an image data stream packet only contains row data of the same row, and for the second sub-data, it contains row data of multiple complete rows, so that after receiving the image data stream packet, the receiving end can parse out which row the data contained in the image data stream packet belongs to. Compared with the packetization method in the prior art, there is no need to add row marks, which reduces the number of packetization steps, reduces complexity, reduces time consumption, and improves the efficiency of image data transmission, thus solving the above-mentioned problem one.
[0222] On the other hand, the sending end adds the position information of each sub-data encapsulated in the image data to the packet header information of each image data stream packet, so that the receiving end can parse and restore the image row by row after receiving the image data. Even if packet loss occurs, it will not affect the subsequent image data storage, which facilitates the receiving end to perform image processing, thereby solving the aforementioned problems three and four.
[0223] In a possible embodiment, the device further includes:
[0224] A frame header and frame tail information receiving module, configured to receive the frame header and frame tail information sent by the transmitting end;
[0225] The first image data parsing module includes:
[0226] a first image data parsing submodule, configured to parse the first image data stream packet received between the frame header information and the frame tail information;
[0227] The device further comprises:
[0228] An information data stream packet receiving module, configured to receive frame header information, a second image data stream packet, and frame tail information sent by the transmitting end;
[0229] a second image data parsing module, configured to parse the second image data stream packet received between the frame header information and the frame trailer information, and obtain compressed image data carried in the second image data stream packet;
[0230] The second image data restoration module is used to restore the compressed image data obtained by analysis to obtain compressed second image data.
[0231] Corresponding to the above method embodiment, an embodiment of the present application further provides an electronic device, as shown in FIG12 . FIG12 is a schematic structural diagram of an electronic device provided in an embodiment of the present application, including a memory 1201 and a processor 1202 , wherein the memory 1201 is used to store a computer program; the processor 1202 is used to execute the computer program stored in the memory, and implement the following steps:
[0232] Acquire uncompressed first image data, where the first image data includes a plurality of line data;
[0233] Dividing the first image data into a plurality of first sub-data, or dividing the first image data into a plurality of second sub-data, wherein all data in each of the first sub-data belong to row data of the same row, and all data in any row data are located in the same second sub-data;
[0234] respectively encapsulating each of the divided sub-data to obtain a first image data stream packet, wherein the header information of each of the image data stream packets carries position information, and the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the first image data;
[0235] Sending a plurality of the image data stream packets to a receiving end.
[0236] The memory may include RAM (Random Access Memory) or NVM (Non-volatile Memory), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0237] The above-mentioned processor can be a general-purpose processor, including a CPU (Central Processing Unit), an NP (Network Processor), etc.; it can also be a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0238] In another embodiment provided by the present application, a computer-readable storage medium is further provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any of the above-mentioned image data transmission methods are implemented.
[0239] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the image data transmission methods in the above embodiments.
[0240] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state drive (SSD).
[0241] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0242] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.
[0243] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for transmitting image data, characterized in that: Applied to the sending end, the method includes: Acquire uncompressed first image data, where the first image data includes a plurality of line data; Divide the first image data into a plurality of first sub-data, or divide the first image data into a plurality of second sub-data, wherein all data in each of the first sub-data belong to row data of the same row, and all data of any row data are located in the same second sub-data; respectively encapsulating each of the divided sub-data to obtain a first image data stream packet, wherein the packet header information of each of the image data stream packets carries position information, and the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the first image data; Sending a plurality of the image data stream packets to a receiving end.
2. The method according to claim 1, characterized in that Before sending the plurality of image data stream packets to the receiving end, the method further comprises: Send frame header information to the receiving end; After sending the plurality of image data stream packets to the receiving end, the method further comprises: The frame tail information is sent to the receiving end.
3. The method according to claim 1, characterized in that The step of dividing the first image data into a plurality of first sub-data, or dividing the first image data into a plurality of second sub-data, comprises: If the data amount of the row data is greater than a preset threshold, dividing the first image data into a plurality of first sub-data; If the data amount of the row data is smaller than the preset threshold, the first image data is divided into a plurality of second sub-data.
4. The method according to claim 3, characterized in that The dividing the first image data into a plurality of second sub-data comprises: Determine a maximum integer smaller than a preset ratio as a maximum capacity, wherein the preset ratio is a ratio of the preset threshold to the data amount; The first image data is divided into a plurality of second sub-data according to the maximum capacity, wherein each of the second sub-data contains the maximum capacity of complete line data.
5. The method according to claim 1, characterized in that The method further comprises: Acquire compressed second image data; dividing the second image data into a plurality of third sub-data; respectively encapsulating each of the segmented sub-data to obtain a second image data stream packet; Send frame header information to the receiving end; After the frame header information is sent to the receiving end, the second image data stream packet is sent to the receiving end; After sending the second image data stream packet to the receiving end, frame end information is sent to the receiving end.
6. The method according to claim 5, characterized in that The dividing the second image data into a plurality of third sub-data comprises: The second image data is divided into X third sub-data whose sizes are preset thresholds and 1 third sub-data whose size is Y, wherein X is the quotient of the data volume of the second image data divided by the preset threshold, and Y is the remainder of the data volume divided by the preset threshold.
7. A method for transmitting image data, characterized in that: Applied to the receiving end, the method includes: receiving a first image data stream packet sent by a transmitting end; Parsing each of the first image data stream packets to obtain position information and sub-data carried in each of the first image data stream packets, wherein the position information is used to indicate a position of the sub-data encapsulated in the image data stream packet in the uncompressed first image data; The sub-data is restored according to the position information to obtain the first image data.
8. The method according to claim 7, characterized in that The method further comprises: Receiving frame header information and frame tail information sent by the sending end; The parsing of each of the first image data stream packets comprises: The first image data stream packet received between the frame header information and the frame tail information is parsed.
9. The method according to claim 7, characterized in that: The method further comprises: Receiving frame header information, a second image data stream packet, and frame tail information sent by the transmitting end; Parsing the second image data stream packet received between the frame header information and the frame tail information to obtain compressed image data carried in the second image data stream packet; The compressed image data obtained by the analysis are restored to obtain compressed second image data.
10. An image data transmission device, characterized in that: Applied to a transmitting end, the device comprises: A first image data acquisition module, used to acquire uncompressed first image data, wherein the first image data includes a plurality of line data; A first image data segmentation module, configured to segment the first image data into a plurality of first sub-data, or segment the first image data into a plurality of second sub-data, wherein all data in each of the first sub-data belong to row data of the same row, and all data in any row data are located in the same second sub-data; a first image data encapsulation module, used to respectively encapsulate each of the segmented sub-data to obtain a first image data stream packet, wherein the header information of each of the image data stream packets carries position information, and the position information is used to indicate the position of the sub-data encapsulated in the image data stream packet in the first image data; The first image data sending module is used to send a plurality of image data stream packets to a receiving end.
11. The device according to claim 10, characterized in that Before sending the plurality of image data stream packets to the receiving end, the device further comprises: A first frame header information sending module, used for sending frame header information to a receiving end; After sending the plurality of image data stream packets to the receiving end, the method further includes: A first frame tail information sending module, used for sending frame tail information to the receiving end; The first image data segmentation module comprises: A first sub-data segmentation submodule, configured to segment the first image data into a plurality of first sub-data if the amount of the row data is greater than a preset threshold; A second sub-data segmentation submodule, configured to segment the first image data into a plurality of second sub-data if the amount of the row data is less than the preset threshold; The second sub-data segmentation sub-module includes: a determining unit, configured to determine a maximum integer less than a preset ratio as a maximum capacity, wherein the preset ratio is a ratio of the preset threshold to the data volume; a segmentation unit, configured to segment the first image data into a plurality of second sub-data according to the maximum capacity, wherein each of the second sub-data contains the maximum capacity of complete line data; The device also includes: A second image data acquisition module, used to acquire compressed second image data; A second image data segmentation module, used for segmenting the second image data into a plurality of third sub-data; A second image data encapsulation module is used to encapsulate each of the segmented sub-data to obtain a second image data stream packet; A second frame header information sending module, used for sending the frame header information to the receiving end; A second image data sending module, configured to send the second image data stream packet to the receiving end after the frame header information is sent to the receiving end; A second frame end information sending module, configured to send frame end information to the receiving end after sending the second image data stream packet to the receiving end; The second image data segmentation module comprises: The third sub-data segmentation submodule is used to segment the second image data into X third sub-data of a size equal to a preset threshold and 1 third sub-data of a size Y, wherein X is the quotient of the data volume of the second image data divided by the preset threshold, and Y is the remainder of the data volume divided by the preset threshold.
12. An image data transmission device, characterized in that: Applied to a receiving end, the device comprises: A first image data receiving module, used for receiving a first image data stream packet sent by a sending end; a first image data parsing module, configured to parse each of the first image data stream packets to obtain position information and sub-data carried in each of the first image data stream packets, wherein the position information is used to indicate a position of the sub-data encapsulated in the image data stream packet in the uncompressed first image data; The first image data restoration module is used to restore the sub-data to obtain the first image data according to the position information.
13. The device according to claim 12, characterized in that The device also includes: A frame header and frame tail information receiving module, used to receive the frame header information and frame tail information sent by the sending end; The first image data parsing module comprises: A first image data parsing submodule, configured to parse the first image data stream packet received between the frame header information and the frame tail information; The device also includes: An information data stream packet receiving module, used for receiving frame header information, a second image data stream packet and frame tail information sent by the sending end; A second image data parsing module, configured to parse the second image data stream packet received between the frame header information and the frame tail information, and obtain compressed image data carried in the second image data stream packet; The second image data restoration module is used to restore the compressed image data obtained by analysis to obtain compressed second image data.
14. An electronic device, characterized in that: It includes a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement any method described in claims 1-6 or 7-9.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1-6 or 7-9 is implemented.