Communication device, communication method, and communication program
By identifying data blocks in the communication device and controlling the storage and discarding of data packets in units of data blocks, the problem of data loss in the prior art is solved and efficient data transmission is achieved.
Patent Information
- Application Number
- CN202280090750.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-02-03
- Filing Date
- 2022-11-18
- Publication Date
- 2024-09-13
AI Technical Summary
The existing technology can easily cause data defects when storing and discarding data packets, affecting efficient data transmission.
By introducing a data packet identification unit and a buffer control unit into the communication device, data blocks are identified and the storage and discarding of data packets are controlled in units of data blocks to ensure the integrity and order of data packets.
It reduces the possibility of data defects and achieves efficient data transmission, especially when the buffer capacity is saturated, data packets are effectively utilized to avoid data waste.
Smart Images

Figure CN118648274A
Abstract
Description
[0001] Cross-references of related applications
[0002] This application is based on Japanese Patent Application No. 2022-015863 filed on February 3, 2022, and the contents described therein are incorporated herein by reference. Technical Field
[0003] The present application relates to a communication device, a communication method and a communication program having a buffer for storing received data packets. Background Art
[0004] When a communication device receives a data packet, the received data packet is stored in a buffer, and when sending, the data packet is read from the buffer and sent. However, due to the capacity of the buffer, it is necessary to control the storage of the received data packet in the buffer or the discarding of the data packet from the buffer.
[0005] Patent document 1 discloses the following: a queue is provided for temporarily storing transmitted data packets, and when the sum of the lengths of the data packets entering the queue, i.e., the queue length, is less than a predetermined threshold, the data packets are sequentially entered into the queue; when the sum of the lengths of the data packets entering the queue, i.e., the queue length, is greater than the predetermined threshold, the position of the stored queue is changed according to the degree of data packet discard.
[0006] Patent Document 2 describes that, when the queue length is greater than the maximum queue length, a data packet is discarded.
[0007] Prior art literature
[0008] Patent Literature
[0009] Patent Document 1: Japanese Patent Application Publication No. 2003-179633
[0010] Patent Document 2: Japanese Patent Application Publication No. 2006-115197
[0011] Here, as a result of detailed studies by the inventors of the present application, they have discovered the following technical problems.
[0012] When data is stored in a buffer and discarded from a buffer in units of packets as in Patent Documents 1 and 2, data required by an upper layer may be lost. In this case, the transmitted data may not be usable, which hinders efficient data transmission. Summary of the invention
[0013] Therefore, an object of the present invention is to realize a communication device or the like that can efficiently transmit data by reducing the possibility of occurrence of data loss.
[0014] A communication device according to one embodiment of the present invention comprises: a receiving unit, which receives a data packet from a first device; a data packet identification unit, which identifies a data block to which the data packet belongs, wherein the data block is a data unit in an upper layer; a buffer, which stores the data packet; a buffer control unit, which controls the storage of the data packet in the buffer and the discarding of the data packet from the buffer in units of the data block; and a sending unit, which reads the data packet from the buffer and sends it to a second device.
[0015] According to another aspect of the communication method of the present invention, a communication device is executed to receive a data packet from a first device, identify a data block to which the data packet belongs, the data block being a data unit in an upper layer, control the storage of the data packet in a buffer and the discarding of the data packet from the buffer based on the data block, store the data packet in the buffer, read the data packet from the buffer and send it to a second device.
[0016] According to another mode of the communication program of the present invention, the communication program can be executed by a communication device, receives a data packet from a first device, identifies a data block to which the data packet belongs, the data block being a data unit in an upper layer, controls the storage of the data packet in a buffer and the discarding of the data packet from the buffer based on the data block, stores the data packet in the buffer, reads the data packet from the buffer and sends it to a second device.
[0017] In addition, the symbols in parentheses attached to the scope of claims indicate the correspondence between the present invention and the embodiments described later, and are not intended to limit the present invention.
[0018] Effects of the Invention
[0019] According to the above-described configuration, the communication device and the like of the present invention can reduce the possibility of data loss and perform efficient data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a structural diagram showing the structure of a communication device according to Embodiment 1,
[0021] Figure 2 is an explanatory diagram showing packet information stored in a packet information storage unit of a communication device according to Embodiment 1,
[0022] Figure 3 is an explanatory diagram showing a specific operation example 1 of the packet identification unit of the communication device according to the first embodiment,
[0023] Figure 4 is an explanatory diagram showing a specific operation example 2 of the packet identification unit of the communication device according to the first embodiment,
[0024] Figure 5 is an explanatory diagram showing a specific operation example 3 of the packet identification unit of the communication device according to the first embodiment,
[0025] Figure 6 is an explanatory diagram showing a specific operation example 1 of the buffer control unit of the communication device according to the first embodiment,
[0026] Figure 7 is an explanatory diagram showing a specific operation example 2 of the buffer control unit of the communication device according to the first embodiment,
[0027] Figure 8 is an explanatory diagram showing a specific operation example 3 of the buffer control unit of the communication device according to the first embodiment,
[0028] Fig. 9 is a flowchart showing the operation of the communication device according to Embodiment 1.
[0029] Fig.10 is a structural diagram showing the structure of a communication device according to Embodiment 2,
[0030] Fig.11 is an explanatory diagram showing a specific operation example of the packet identification unit of the communication device according to the second embodiment,
[0031] Fig.12 is an explanatory diagram showing packet information stored in a packet information storage unit of a communication device according to Embodiment 2,
[0032] Fig.13 This is an explanatory diagram showing a specific example of a combination of a sending source terminal device, a communication device according to Embodiment 1 or 2, and a destination terminal device. DETAILED DESCRIPTION
[0033] Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0034] The present invention described below refers to the invention described in the scope of claims and is not limited to the following embodiments. In addition, at least the words and phrases in double quotation marks mean the words and phrases described in the scope of claims and are not limited to the following embodiments.
[0035] The structure and method recorded in the dependent item of the scope claimed for protection is any structure and method in the invention of the independent item recorded in the scope claimed for protection. The structure and method of the embodiment corresponding to the structure and method recorded in the dependent item, and the structure and method not recorded in the scope claimed for protection but only recorded in the embodiment are any structure and method in the present invention. In the case where the description of the scope claimed for protection is wider than the description of the embodiment, the structure and method recorded in the embodiment is also any structure and method in the present invention in the sense of being an illustration of the structure and method of the present invention. In either case, the structure and method that becomes necessary for the present invention by being recorded in the independent item of the scope claimed for protection.
[0036] The effects described in the embodiments are effects when the configuration of the embodiments is provided as examples of the present invention, and are not necessarily effects provided by the present invention.
[0037] In the case of multiple embodiments, the structures disclosed in each embodiment are not limited to each embodiment, and can also be combined across embodiments. For example, the structure disclosed in one embodiment can be combined with other embodiments. In addition, the structures disclosed in multiple embodiments can also be combined collectively.
[0038] The technical problem described in the present invention is not a publicly known technical problem, but a technical problem known to the inventor alone, and together with the structure and method of the present invention, it is a fact that confirms the creativity of the invention.
[0039] 1. Implementation Method 1
[0040] (1) Overall Configuration of Communication Device 100 of This Embodiment
[0041] use Figure 1 , the structure of the communication device 100 according to Embodiment 1 is described. The communication device 100 includes a receiving unit 101 , a packet identifying unit 102 , a packet information storing unit 103 , a buffer 104 , a buffer control unit 105 , and a transmitting unit 106 .
[0042] The communication device 100 can be composed of a general-purpose CPU (Central Processing Unit), a volatile memory such as RAM, a non-volatile memory such as ROM, flash memory, or a hard disk, various interfaces, and an internal bus connecting them. And it is configured so that software can be executed on these hardware to perform Figure 1 The functions of each functional data block are described in.
[0043] Of course, the communication device 100 may also be implemented by dedicated hardware such as LSI.
[0044] The above situation is also the same in the communication devices of other embodiments.
[0045] In this embodiment, the communication device 100 is assumed to be in the form of an electronic control unit (ECU (Electric Control Unit), hereinafter referred to as ECU) as a semi-finished product, but is not limited to this. For example, as a part, a semiconductor circuit and a semiconductor component can be listed, as a semi-finished product, an electronic control device, an electronic control unit, and a system board can be listed, and as a finished product, a server, a workstation, a personal computer (PC), a tablet computer, a mobile router, a smart phone, a mobile phone, and a navigation system can be listed.
[0046] In addition, the communication device 100 may be composed of a plurality of ECUs instead of a single ECU.
[0047] The above situation is also the same in the communication devices of other embodiments.
[0048] The receiving unit 101 receives a "data packet" generated by the transmission source terminal device 10 (corresponding to the "first device") from the transmission source terminal device 10. The data packet is data generated in, for example, a transmission source application executed by the transmission source terminal device 10, divided into a plurality of data packets by grouping or fragmentation performed by a control unit (not shown) of the transmission source terminal device 10, and then transmitted.
[0049] Here, the "packet" refers to a pile of data that is a transmission unit in information communication, and refers to not only a packet in a narrow sense but also a frame, a segment, etc., regardless of their names.
[0050] The source application is any application that generates data. For example, an image transmission application can be cited, which compresses image data captured by a camera connected to the source terminal device 10 into I-frame, P-frame, and B-frame data based on, for example, the H.264 / MPEG4 AVC format, and sends it to the destination application of the destination terminal device 20. At this time, each compressed frame data is fragmented by the network card (NIC: Network Interface Card) of the source terminal device 10 and divided into data packets of the MTU (Maximum Transmission Unit: Maximum Transmission Unit) size of the NIC and sent.
[0051] The transmission source terminal device 10 and the communication device 100 are connected via a communication line.
[0052] The communication line may be any one of a wireless communication line and a wired communication line.
[0053] As an example of a wireless communication line, a communication line based on a mobile communication system can be cited, for example, a communication line formed by a wireless communication method such as W-CDMA (Wideband Code Division Multiple Access), HSPA (High Speed Packet Access), LTE (Long Term Evolution), LTE-A (Long Term Evolution Advanced), 4G, or 5G can be used. In addition, for example, a communication line formed by a wireless communication method such as IEEE802.11 (Wi-Fi (registered trademark)), IEEE802.16 (WiMAX (registered trademark)), Bluetooth (registered trademark), UWB (Ultra Wide Band), or DSRC (Dedicated Short Range Communication) can be used.
[0054] Examples of wired communication lines include LAN (Local Area Network) such as Ethernet (registered trademark), optical lines, or fixed telephone lines. In the case of an in-vehicle device, for example, CAN (Controller Area Network) or LIN (Local Interconnect Network) as an in-vehicle network can be used.
[0055] Alternatively, a communication line may be a combination of a wireless communication line and a wired communication line.
[0056] The transmission source terminal device 10 may be in the form of a component, a semi-finished product, or a finished product, similarly to the communication device 100. The specific form of the transmission source terminal device 10 will be described later.
[0057] The packet identification unit 102 collects packet information, which is information related to the packet, by analyzing the packet received by the reception unit 101 , and stores the collected packet information in the packet information storage unit 103 .
[0058] In particular, in this embodiment, the packet identification unit 102 identifies a data block described in the packet received by the receiving unit 101. A data block refers to a data unit in an upper layer. For example, when a packet is used in communication at the network layer (layer 3) of the OSI reference model, the upper layer refers to the transport layer (layer 4) or above.
[0059] As an example of the data block, when the transmission source application of the transmission source terminal device 10 is a video transmission application, compressed frame data (I frame, P frame, or B frame) can be listed.
[0060] Furthermore, in the present embodiment, the packet identification unit 102 collects the packet size, data block size, and importance information of the received data packets by analyzing the data packets.
[0061] The specific method of identifying data blocks and the method of assigning data block numbers performed by the packet identifying unit 102 will be described later.
[0062] The packet information storage unit 103 stores the packet information collected by the packet identification unit 102. Specifically, the packet information input from the packet identification unit 102 is stored in the order in which it is input. The packet information storage unit 103 can be composed of either a nonvolatile memory or a volatile memory.
[0063] Figure 2 Indicates the packet information stored in the packet information storage unit 103.
[0064] The packet number is a sequence number assigned by the packet identification unit 102 to each packet received by the reception unit 101 in the order in which the packet is received by the reception unit 101 .
[0065] The data block number is a sequence number for identifying the data block to which each data packet assigned by the packet identification unit 102 belongs by analyzing each data packet received by the reception unit 101 .
[0066] The packet size is the size of the packet collected by the packet identification unit 102 for each packet received by the receiving unit 101. When the packet size is recorded in identification information such as an IP header, it is sufficient to record the identification information. In the case of a fixed-length packet, it is sufficient to record the predetermined fixed-length packet size.
[0067] The data block size is the size of the data block identified by the packet identification unit 102. The data block size can be obtained by, for example, adding up the packet sizes of packets assigned the same number. Specifically, the data block size is obtained as follows.
[0068] exist Figure 2 In the example, at the time when data packet #1 (data block number #1) is input, since there is only one data packet assigned data block number #1, 1500B, which is the same as the data packet size, is recorded in the data block size of data packet #1.
[0069] Next, at the point in time when data packet #2 (data block number #1) is input, since there are two data packets assigned data block number #1, the data packet size of data packet #2 (1500B) plus the previous data block size of 1500B (3000B) is recorded as the data block size of data packet #1 and data packet #2.
[0070] Furthermore, at the time point when data packet #3 (data block number #1) is input, since the number of data packets assigned data block number #1 becomes three, the data packet size of data packet #3 (1150B) plus the previous data block size of 3000B (4150B) is recorded as the data block size from data packet #1 to data packet #3.
[0071] At the time when data packet #4 (data block number #2) is input, since the data block number of data packet #4 is different from the data block numbers of previously received data packets #1 to #3, 1500B, which is the same as the data packet size, is recorded as the data block size of data packet #4.
[0072] Hereinafter, each time a data packet is input through the same calculation, the data block size is recorded.
[0073] Importance information is information indicating the importance of a data packet. Specifically, it is information assigned to each data packet by the source terminal device 10 and information of the analysis result assigned to the data packet by the data packet identification unit 102 based on the content of the payload data of the data packet. The importance of a data packet can be defined according to the purpose of the source application and the purpose of setting the communication device 100. For example, in the case where the data packet is image data of a video, if the I frame is missing, the P frame and the B frame cannot be decoded. Therefore, the importance of the data packet constituting the I frame can be set higher than the importance of the data packet constituting other types of frames. Alternatively, in the case where the communication device 100 constitutes an on-board device mounted on an automobile, the importance of information directly indicating the driving state, such as speed and acceleration, can also be set higher than the importance of other information. Figure 2 In the present case, the importance information is represented by two values, namely flags, but it can also be defined by more than three levels.
[0074] The packet information stored in the packet information storage unit 103 is updated in accordance with the packet stored in the buffer 104 described later. For example, when a packet is stored in the buffer 104, the packet information of the stored packet is recorded in the packet information storage unit 103. When a packet is discarded from the buffer 104, the packet information of the discarded packet is deleted from the packet information storage unit 103. When the transmission unit 106 reads a packet from the buffer 104 and transmits it, the packet information of the read packet is deleted from the packet information storage unit 103.
[0075] The buffer 104 is a "buffer" for storing data packets received by the receiving unit 101 and identified as data blocks by the data packet identification unit 102. Specifically, the data packets received by the receiving unit 101 are stored in the order of reception except for the discarded data packets. The buffer 104 can also be composed of either a non-volatile memory or a volatile memory, similarly to the data packet information storage unit 103.
[0076] Here, "buffer" refers to the area where data packets are stored. The order of storage and reading is arbitrary. In addition, the buffer also includes queues and stacks.
[0077] In this embodiment, the buffer 104 is based on FIFO (First In First Out) operation, which stores data in the order of input and outputs data in the order of input, and is also called a queue. However, in this embodiment, the output order may not necessarily be the input order.
[0078] The buffer control unit 105 controls storage of packets in the buffer 104 and discarding of packets from the buffer 104. Specifically, based on the packet information stored in the packet information storage unit 103, the buffer control unit 105 controls storage and discarding of packets “in units of data blocks”.
[0079] Here, "in units of data blocks" means that storage into the buffer and discarding from the buffer can be done in units of data blocks. When storing into the buffer, it is not necessary to store all the data packets belonging to the same data block at the same time. Also, when discarding from the buffer, it is not necessary to discard all the data packets belonging to the same data block at the same time.
[0080] The specific method of storing and discarding packets executed by the buffer control unit 105 will be described later. The transmission unit 106 reads packets from the buffer 104 and transmits them to the destination terminal device 20 (equivalent to the "second device"). The order of reading packets is the same as the order of inputting the buffer 104, but in this embodiment, it is not necessarily the order of inputting. The transmitted packets are used in the destination application of the destination terminal device 20.
[0081] The destination application is an application that utilizes the data stored in the data packet, and an example thereof may be image playback software that decodes and plays compressed image data.
[0082] The communication device 100 and the destination terminal device 20 are connected via a communication line.
[0083] The communication line may be any one of a wireless communication line and a wired communication line. The examples of the wireless communication line and the wired communication line are the same as those described as the example of the communication line between the source terminal device 10 and the communication device 100. In addition, a communication line that combines a wireless communication line and a wired communication line may also be used. For example, when the destination terminal device 20 is a server device connected to the Internet, a 4G or 5G wireless communication method can be used between the communication device 100 and the base device, and a wired communication method composed of an optical line can be used between the base device and the destination terminal device 20.
[0084] The destination terminal device 20 may be in the form of a component, a semi-finished product, or a finished product, similarly to the communication device 100. The specific form of the destination terminal device 20 will be described later.
[0085] (2) Details of the Packet Identification Unit 102 of the Communication Device 100 of the Present Embodiment
[0086] use Figure 3 to Figure 5 , an example of a specific method of identifying a data block and a method of assigning a data block number performed by the data packet identification unit 102 is described.
[0087] (a) Example of identifying data blocks based on the interval between packets received
[0088] use Figure 3 , illustrating an example of identifying data blocks based on the reception interval of data packets.
[0089] The packet identification unit 102 identifies a data block based on a reception interval of the data packet received by the reception unit 101 .
[0090] For example, when a video transmission application of the transmission source terminal device 10 compresses an image and transmits a frame, as shown in FIG. Figure 3 In this way, each frame is divided into a single or multiple data packets and sent. If the frame rate is 30FPS (Frames PerSecond: frames / second), each frame is divided into multiple data packets and sent every 1 / 30s=33ms. The data packets in a frame are sent continuously in bursts, so the sending interval between data packets is extremely small. In contrast, in the case of cross-frames, a certain degree of sending interval is generated from the time (Δx) from the last data packet of the previous frame to the time when the first data packet of the next frame is sent. The amount of data in an I frame is larger than that of a P frame or a B frame, so the sending interval between an I frame and other frames and the sending interval when I frames are continuous become smaller.
[0091] Therefore, in order to correctly judge when I frames are continuous, for example, based on 5ms, if Δx is less than 5ms, it can be judged as a data packet belonging to the same frame, and if Δx is greater than 5ms, it can be judged as a data packet belonging to different frames. Then, each frame is identified as a data block, and a data block number is assigned to each frame in an incremental manner. Figure 3 In the example of , #1, #2, ... #m are assigned as data block numbers in the order of reception. The data block number can be used to identify which data block a data packet belongs to.
[0092] Here, video compression using the H.264 / MPEG4 AVC format is used as an example, but the same is true for still image compression (for example, JPEG format).
[0093] (b) Example of identifying data blocks based on the IP header of the packet
[0094] use Figure 4 , illustrating an example of identifying data blocks based on the IP header of the data packet.
[0095] The packet identification unit 102 identifies a data block based on an identifier included in an IP header of the data packet.
[0096] exist Figure 4 The IP header shown stores information related to the data packet. Here, the focus is on the identifier of the IP header. For example, when the source terminal device 10 sends frame data through one data packet, the NIC generates fragments and the frame data is divided into multiple data packets. At this time, the same identifier is given to each data packet from the same frame.
[0097] That is, when a frame transmitted by the transmission source terminal device 10 is defined as a data block, it is possible to identify which data block a data packet belongs to based on the identifier of the IP header. In the present embodiment, a data block number is incrementally assigned for each identifier of the IP header.
[0098] (c) Example of identifying data blocks based on the payload data of a packet
[0099] use Figure 5 , illustrating an example of identifying data blocks based on the TCP / UDP payload of a data packet.
[0100] The packet identification unit 102 identifies a data block based on identification information included in the TCP / UDP payload of the packet.
[0101] When a transmission source application divides large data into small data packets, the transmission source application stores identification information indicating the data before division at the beginning of the TCP / UDP payload.
[0102] That is, when the data transmitted by the transmission source terminal device 10 is defined as a data block, the identification information of the TCP / UDP payload can be used to identify which data block the data packet belongs to. In this embodiment, the data block number is incrementally assigned to each TCP / UDP payload identification information.
[0103] (d) Examples of identifying other data blocks
[0104] In addition, the data block may also be identified based on the timestamp when it is stored in the buffer 104 .
[0105] Alternatively, in the case of video compression, that is, when information of I frames, P frames, and B frames is recorded in data packets, data blocks can also be identified based on this information.
[0106] (3) Details of the Buffer Control Unit 105 of the Communication Device 100 of the Present Embodiment
[0107] use Figures 6 to 8 , an example of a specific method for storing and discarding data packets executed by the buffer control unit 105 is described.
[0108] (a) Example of storing new data blocks and discarding old data blocks (Example 1)
[0109] use Figure 6 , illustrating an example in which data packets belonging to a new data block are stored in the buffer 104 and data packets belonging to an old data block are discarded from the buffer 104.
[0110] In this embodiment, when a data packet cannot be stored in the buffer 104 because the capacity of the buffer 104 is exceeded, the buffer control unit 105 discards from the buffer 104 a stored data packet that belongs to a data block different from the data block to which the data packet belongs and that was stored in the buffer 104 before the data packet.
[0111] Figure 6 (a) is an example of storage and discarding of data packets in a conventional example. In addition, in the past, data packets were not stored or discarded from the perspective of data blocks, but in order to illustrate the effect of this embodiment by comparison with this embodiment, the word data block is also used in the conventional example.
[0112] At time t1, data packets corresponding to data block 1 (C1 in the figure, the same below) and data block 2 are already stored in buffer 104. Then, assume that five data packets corresponding to a new data block 3 are stored in buffer 104.
[0113] At time t2 and t3, the data packets corresponding to data block 3 are sequentially stored in the free area of buffer 104. However, at time t4, the capacity of buffer 104 is saturated, and the third data packet of data block 3 cannot be stored in buffer 104 and is discarded. Similarly, at time t5 and t6, the fourth and fifth data packets are discarded.
[0114] As a result, at time t6, part of the data packets corresponding to data block 3 are discarded, and all the data packets corresponding to data block 3 become incomplete. As a result, even if the data packets corresponding to data block 3 remaining in buffer 104 are sent to destination terminal device 20, they cannot be used by the destination application of destination terminal device 20, and the transmission of the data packets belonging to data block 3 is wasted, and efficient data transmission cannot be performed.
[0115] Figure 6 (b) is an example of storage and discarding of data packets in this embodiment.
[0116] In this embodiment, the processing from time t1 to time t3 is the same as that of the prior art, but at time t4, when the data packet cannot be stored in the buffer 104 because the capacity of the buffer 104 is exceeded, the data packet belonging to the data block different from the data block 3, that is, the data packet already stored in the buffer 104 ("stored data packet") is discarded from the buffer 104. Figure 6 In the case of (b), the data packet belonging to the data block 1 stored earliest in the buffer 104 is discarded. As a result, the third data packet of the data block 3 is also stored in the buffer 104. Similarly, at time t5 and t6, the fourth and fifth data packets are also stored in the buffer 104.
[0117] At time t6, all data packets belonging to data block 1 are discarded, but data packets belonging to data block 2 and data block 3 are stored intact. As a result, data packets that cannot be used by the destination application of the destination terminal device 20 are not sent, and efficient data transmission can be performed. In addition, since the data packets that are not sent to the destination terminal device 20 are data packets belonging to data blocks that are older in time than the existing example in this embodiment, data closer to the current state can be used. This is particularly effective when the destination application is an application that emphasizes real-time performance.
[0118] In addition, Figure 6In the embodiment, when a part of the data packet belonging to the data block 1 has been read from the transmission unit 106 and has been transmitted at time t4, the buffer control unit 105 may discard the data packet belonging to the data block 2 instead of discarding the data packet belonging to the data block 1. According to this process, the transmitted data packet is not wasted. In addition, in the case where the importance of the data block 1 is higher than that of the data block 2, the data packet belonging to the data block 2 may be discarded instead of discarding the data packet belonging to the data block 1. The same is true in the second embodiment described later.
[0119] Alternatively, when the number of data packets belonging to the data block 1 remaining in the buffer 104 (equivalent to the "stored data packets") at time t4 exceeds the "predetermined ratio" relative to all data packets belonging to the data block 1 including the data packets belonging to the data block 1 that have been sent, the data block 1 remaining in the buffer 104 may be discarded from the buffer 104. The predetermined ratio can be set to 1 / 2, 2 / 3, or 3 / 4, for example. According to this processing, the waste of communication resources can be minimized, and the minimum real-time performance can be maintained. The same is true in the second embodiment described later.
[0120] Here,
[0121] The “predetermined ratio” may be a variable value that changes according to conditions, in addition to being a fixed value determined in advance.
[0122] “Exceeds” may mean including a prescribed ratio, that is, being above a prescribed ratio.
[0123] As in the latter example, when a data packet that is part of a data block is discarded from the buffer 104, the discarded data packet will of course not be sent from the sending unit 106. However, when the data packet has been read from the buffer 104 but has not yet been sent, the sending unit 106 can also terminate the sending.
[0124] Furthermore, at time t4 in the present embodiment, the data packet of data block 1 stored earliest in the buffer 104 is discarded. However, if the data packet belonging to data block 1 "exceeds" the "predetermined importance", the buffer control unit 105 may not discard the data packet belonging to data block 1 from the buffer 104. In this case, the data packet belonging to data block 2 stored earlier in the buffer 104 may also be discarded. Whether the importance exceeds the prescribed importance can be determined as follows. Figure 2 As shown, the judgment is made based on the importance information recorded in the packet information storage unit 103. The same is true in the second embodiment described later.
[0125] However, when the data packets belonging to the newly stored data block 3 exceed the predetermined importance, the buffer control unit 105 may discard the data packets belonging to the data block 1 from the buffer 104 even if the data packets belonging to the data block 1 exceed the predetermined importance.
[0126] Here,
[0127] The “predetermined importance” may be a case where the importance is determined in advance or the importance may be changed according to conditions.
[0128] “Exceeds” may include a case where a predetermined importance level is reached, that is, the importance level is higher than a predetermined importance level.
[0129] (b) Example of storing new data blocks and discarding old data blocks (Example 2)
[0130] use Figure 7 , illustrating another example of storing data packets belonging to new data blocks in the buffer 104 and discarding data packets belonging to old data blocks from the buffer 104.
[0131] In the first embodiment, the stored data packets belonging to the old data block are discarded from the buffer 104 because the capacity of the buffer 104 is exceeded. In the present embodiment, the stored data packets belonging to the old data block are discarded from the buffer 104 because the new data block is stored in the buffer 104.
[0132] In this embodiment, when a data packet is stored in the buffer 104 , the buffer control unit 105 discards from the buffer 104 a data packet that belongs to a data block different from the data block to which the data packet belongs and that has been stored in the buffer 104 before the data packet.
[0133] Figure 7 This is an example of storing and discarding data packets in this embodiment.
[0134] At time t1 , data packets belonging to data block 1 and data block 2 are already stored in buffer 104 , and some data packets of data block 1 have already been transmitted.
[0135] At time t2, the data packet belonging to data block 3 is stored in the free area of buffer 104. In this case, the data packet (equivalent to the "stored data packet") stored in buffer 104 and belonging to a data block different from data block 3, i.e., data block 1 or data block 2 is discarded from buffer 104. Figure 7 In the case of , packets exceeding a predetermined ratio remain in the buffer 104, and packets belonging to the data block 2 stored earliest in the buffer 104 are discarded.
[0136] At time t3 to t6 , the second to fifth data packets are sequentially stored in the buffer 104 .
[0137] At time t6, all data packets belonging to data block 2 are discarded, but unsent data packets belonging to data block 1 and data packets belonging to data block 3 are completely stored. As a result, data packets that cannot be used by the destination application of the destination terminal device 20 are not sent, and efficient data transmission can be performed. Moreover, since the data packets that are not sent to the destination terminal device 20 are data packets belonging to a data block that is older in time than the existing example in this embodiment, data closer to the current state can be used. This is particularly effective when the destination application is an application that emphasizes real-time performance.
[0138] (c) Example of discarding new data blocks and maintaining old data blocks (Example 3)
[0139] use Figure 8 , illustrating an example in which data packets belonging to a new data block are discarded from the buffer 104 and data packets belonging to an old data block are left in the buffer 104 .
[0140] In the first embodiment, the stored data packets belonging to the old data block are discarded from the buffer 104 because the capacity of the buffer 104 is exceeded. In the present embodiment, the stored data packets belonging to the new data block are discarded from the buffer 104 because the capacity of the buffer 104 is exceeded.
[0141] In this embodiment, when a data packet cannot be stored in the buffer 104 because the capacity of the buffer 104 is exceeded, the buffer control unit 105 discards the stored data packet that belongs to the same data block as the data packet and is stored in the buffer 104 before the data packet from the buffer 104.
[0142] Figure 8 This is an example of storing and discarding data packets in this embodiment.
[0143] At time t1, data packets belonging to data block 1 and data block 2 are already stored in buffer 104. It is assumed that five data packets belonging to a new data block 3 are stored in buffer 104.
[0144] At time t2 and t3, the data packets belonging to data block 3 are sequentially stored in the free area of buffer 104. However, at time t4, the capacity of buffer 104 is saturated, and the third data packet of data block 3 cannot be stored in buffer 104 and is discarded. In this case, the data packets belonging to the same data block as data block 3, i.e., data block 3, which are already stored in buffer 104 (equivalent to "stored data packets") are discarded from buffer 104. Figure 7In this case, at time t4, the first and second stored data packets belonging to data block 3 are discarded.
[0145] At time t5 and t6, the data packets belonging to the data block 3 are also not stored in the buffer 104 and are discarded.
[0146] At time t6, all packets belonging to data block 3 are discarded, but packets belonging to data block 1 and data block 2 are stored intact. As a result, packets that cannot be used by the destination application of the destination terminal device 20 are not sent, and efficient data transmission can be performed. In addition, since the packets that are not sent to the destination terminal device 20 are packets belonging to new data blocks, data with time sequence maintained can be used. This is particularly effective when the destination application is an application that needs to play data in sequence, such as audio-visual of video content.
[0147] In addition, although the data packet belonging to data block 3 is temporarily discarded, when the data packets belonging to data block 1 and data block 2 are sent to the destination terminal device 20 in sequence and there is surplus in the buffer 104, by making a retransmission request from the communication device 100 to the sending source terminal device 10, the data packet belonging to data block 3 can be re-received from the sending source terminal device 10 and can be sent to the destination terminal device 20.
[0148] (4) Operation of the Communication Device 100 of the Present Embodiment
[0149] use Fig. 9 , the operation of the communication device 100 of this embodiment is described.
[0150] In addition, the following operations not only represent the communication method of the communication device 100, but also represent the processing steps of the communication program executed by the communication device 100. Moreover, these processes are not limited to Fig. 9 That is, as long as there is no restriction such as the relationship of using the result of the previous step in a certain step, the order can be changed.
[0151] The above is the same not only in this embodiment but also in other embodiments.
[0152] The receiving unit 101 of the communication device 100 receives a “packet” generated by the transmission source terminal device 10 from the transmission source terminal device 10 (corresponding to the “first device”) ( S101 ).
[0153] The packet identification unit 102 of the communication device 100 identifies the data block to which the packet received by the reception unit 101 belongs (S102).
[0154] The buffer control unit 105 of the communication device 100 controls storage and discarding of data packets “in units of data blocks” based on the data packet information stored in the data packet information storage unit 103 ( S103 ).
[0155] The buffer 104 of the communication device 100 stores the data packet received by the receiving unit 101 according to the control result of the buffer control unit 105 (S104).
[0156] The transmission unit 106 of the communication device 100 reads the data packet from the buffer 104 and transmits it to the destination terminal device 20 (corresponding to the “second device”) ( S105 ).
[0157] As described above, according to this embodiment, since the storage and discarding of data packets in the buffer are controlled in units of data blocks, which are data units in the upper layer, the possibility of data loss can be reduced, thereby enabling efficient data transmission.
[0158] 2. Implementation Method 2
[0159] (1) Overall Configuration of Communication Device 200 of the Present Embodiment
[0160] In the first embodiment, the connected source terminal device 10 and destination terminal device 20 are not distinguished, or the source application and destination application installed in each device are distinguished, but the data block is identified. However, when multiple source terminal devices 10 and destination terminal devices 20 are connected, each data block needs to be treated as a different data block even when the same software is used. In addition, when the source terminal device 10 and the destination terminal device 20 execute multiple source applications and multiple destination applications, it is also necessary to distinguish the data block for each application.
[0161] Therefore, in this embodiment, using Fig.10 , the following describes a case where there are multiple source terminal devices 10 and destination terminal devices 20 connected, or a case where there are multiple source applications and destination applications installed in each device.
[0162] In addition, in the case of the same function as in the first embodiment, the same Figure 1 The same figure numbers refer to the description of Implementation 1.
[0163] use Fig.10 The configuration of the communication device 200 according to Embodiment 2 will be described. The communication device 200 includes a receiving unit 101 , a packet identifying unit 202 , a packet information storing unit 203 , a buffer 104 , a buffer control unit 205 , and a transmitting unit 106 .
[0164] The communication device 200 is connected to a plurality of transmission source terminal devices, namely, a transmission source terminal device A and a transmission source terminal device B. In addition, the communication device 200 is connected to a plurality of destination terminal devices, namely, a destination terminal device P and a destination terminal device Q.
[0165] The transmission source terminal device A carries and executes the transmission source application a. The transmission source terminal device B carries and executes the transmission source application b and the transmission source application c. The destination terminal device P carries and executes the destination application p and the destination application q. The destination terminal device Q carries and executes the destination application r.
[0166] Furthermore, three or more source terminal devices and destination terminal devices may be connected. Furthermore, one device may be equipped with and execute three or more source applications and destination applications.
[0167] In addition to identifying the data block described in the first embodiment, the packet identification unit 202 also identifies the communication flow to which the packet belongs based on the transmission source and / or destination of the packet.
[0168] The communication flow can be expressed by information specifying a transmission source and information specifying a destination, for example. For example, when a packet is transmitted from a transmission source application a of a transmission source terminal device A to a destination application q of a destination terminal device P, the communication flow can be expressed as AaPq.
[0169] When one of the source terminal device and the destination terminal device connected to the communication device 200 is a single device, the information specifying the source terminal device or the destination terminal device can be omitted. For example, if the only source terminal device connected to the communication device 200 is the source terminal device B, when a data packet is sent from the source application b of the source terminal device B to the destination application q of the destination terminal device P, the communication flow can be expressed as bPq.
[0170] In the case where one of the source application installed on the source terminal device and the destination application installed on the destination terminal device is one, the information specifying the source application or the destination application can be omitted. For example, if the only source terminal device connected to the communication device 200 is the source terminal device A, and the only source application installed on the source terminal device A is the source application a, then when a data packet is sent from the source application a of the source terminal device A to the destination application q of the destination terminal device P, the communication flow can be expressed as Pq.
[0171] In order to specify the transmission source and destination, information stored in the IP header or the TCP / UDP header can be used.
[0172] like Figure 4 As shown, the IP header stores the source address and the destination address, so the source terminal device and the destination terminal device can be specified based on them. In addition, the IP header stores the protocol, so the source application and the destination application can be specified based on the protocol.
[0173] like Fig.11 As shown, the sending destination port and the destination port are stored in the TCP header and the UDP header, so the sending source application and the destination application can be specified based on them.
[0174] Fig.12 Indicates the packet information stored in the packet information storage unit 203.
[0175] like Fig.12 As shown, the packet information storage unit 203 stores communication flow information in addition to the packet information described in Embodiment 1. The method of expressing the communication flow is as described above.
[0176] The data packet information storage unit 203 stores Fig.12 In addition to the information shown, in order to further identify the data blocks of each flow based on the reception interval of the data packets, the final reception time of the data packets may be stored for each flow.
[0177] The buffer control unit 205 controls the storage of data packets in the buffer 104 and the discarding of data packets from the buffer 104 in units of data blocks for each communication flow. Fig.12 In the embodiment, even if the communication flow AaPq and the communication flow BbQr have the same data block number 1, the storage and discard of data packets are controlled independently as different data blocks. In this embodiment, when performing the control described in Example 1 and Example 2 of Implementation 1, the data blocks to be deleted are selected from the same flow.
[0178] As described above, according to the present embodiment, based on the structure of embodiment 1, the storage and discarding of data packets to the buffer are controlled in units of data blocks according to each communication flow. Therefore, even when the communication device executes multiple sending source terminal devices, destination terminal devices or multiple sending source applications, destination applications, the possibility of data defects used in each device or application can be reduced, thereby enabling efficient data transmission.
[0179] 3. Specific example of combination of transmission source terminal device, communication device, and destination terminal device
[0180] Several examples of specific combinations of the transmission source terminal device 10, the communication device 100 (200), and the destination terminal device 20 are listed.
[0181] like Fig.13 As in (a), when a video shot by a smartphone is sent to a router via Wi-Fi and uploaded from the router to a server device using a 4G / 5G line, the smartphone becomes the sending source terminal device 10 (equivalent to the "first device"), the router becomes the communication device 100 (200), and the server device becomes the destination terminal device 20 (equivalent to the "second device").
[0182] In contrast, when downloading a video from a server device via a router using a 4G / 5G line, the server device becomes the sending source terminal device 10 (equivalent to the "first device"), the router becomes the communication device 100 (200), and the smartphone becomes the destination terminal device 20 (equivalent to the "second device").
[0183] The communication device 100 (200) may be “mounted” on a “mobile object”.
[0184] like Fig.13 As in (b), when data from the ECU and various sensors connected to the vehicle network are sent to the data center via the communication ECU through wireless communication, the navigation ECU, the vehicle-mounted ECU and the various sensors become the sending source terminal device 10 (equivalent to the "first device"), the communication ECU becomes the communication device 100 (200), and the data center becomes the destination terminal device 20 (equivalent to the "second device").
[0185] Or, if Fig.13 As in (c), when data from various sensors connected to the vehicle network are sent to the data center through wireless communication via the communication function of the integrated ECU, the various sensors become the sending source terminal device 10 (equivalent to the "first device"), the integrated ECU becomes the communication device 100 (200), and the data center becomes the destination terminal device 20 (equivalent to the "second device").
[0186] Here,
[0187] "Mobile body" refers to an object that can move, and the moving speed is arbitrary. In addition, of course, it also includes the case where the mobile body is stationary. For example, it includes but is not limited to cars, motorcycles, bicycles, pedestrians, ships, airplanes and objects carried on them.
[0188] “Carried” means not only the case where the item is directly fixed to the moving body, but also the case where the item moves with the moving body although it is not fixed to the moving body. Examples include the case where the item is held by a person riding the moving body, and the case where the item is carried on cargo on the moving body.
[0189] 4. Summary
[0190] The features of the communication device and the like in each embodiment of the present invention have been described above.
[0191] Since the terms used in each embodiment are for illustrative purposes, they may be replaced with synonymous terms or terms having synonymous functions.
[0192] The block diagram used in the description of the embodiment is a block diagram that classifies and organizes the structure of the device by function. The blocks representing each function are implemented by any combination of hardware or software. In addition, since it is a block diagram showing the function, the block diagram can also be understood as a disclosure of the invention of the method and the invention of the program that implements the method.
[0193] The blocks that can be understood as the processing, flow, and method described in each embodiment may be changed in order as long as there is no restriction such as a relationship in which one step utilizes the result of another step in the previous stage.
[0194] The communication device of the present invention may be used for vehicles, except for cases specifically limited in the scope of claims, and may include dedicated or general-purpose communication devices other than vehicle use.
[0195] In addition, examples of the form of the communication device of the present invention include semiconductor elements, electronic circuits, modules, and microcomputers.
[0196] Examples of semi-finished products include electronic control units (ECU (Electric Control Unit)) and system boards.
[0197] Examples of the finished product include a mobile router, a mobile phone, a smartphone, a tablet computer, a personal computer (PC), a workstation, and a server.
[0198] Furthermore, it also includes devices having a communication function, for example, a car navigation system.
[0199] It is assumed that the communication device of the present invention is used for the purpose of providing various services. Along with the provision of the services, the communication device of the present invention is used, the method of the present invention is used, and / or the program of the present invention is executed.
[0200] In addition, the present invention can be implemented not only by dedicated hardware having the structure and function described in each embodiment, but also as a combination of a program for implementing the present invention recorded on a recording medium such as a memory or a hard disk, and general hardware having a dedicated or general-purpose CPU and memory capable of executing the program.
[0201] The program used for the communication device of the present invention is stored in a non-transient physical recording medium (e.g., an external recording device (hard disk, USB memory, CD / BD, etc.) or an internal recording device (RAM, ROM, etc.)) of dedicated or general-purpose hardware, and can be provided from a server to the dedicated or general-purpose hardware via a communication line via the recording medium or without the recording medium. Thus, the latest functions can be always provided by upgrading the program.
[0202] Possibility of Industrial Application
[0203] The communication device of the present invention can be used for both vehicle-mounted and non-vehicle-mounted applications, and can also be applied to a relay device.
Claims
1. A communication device (100), characterized in that: have: A receiving unit (101) receiving a data packet from a first device (10); A data packet identification unit (102) for identifying a data block to which the data packet belongs, the data block being a data unit in an upper layer; A buffer (104) storing the data packet; a buffer control unit (105) for controlling storage of the data packets in the buffer and discarding of the data packets from the buffer in units of the data blocks; and A sending unit (106) reads the data packet from the buffer and sends the data packet to the second device (20).
2. The communication device according to claim 1, characterized in that The packet identification unit identifies the data block based on a reception interval of the data packet received by the receiving unit.
3. The communication device according to claim 2, characterized in that: The data blocks are frames generated by compressing the video.
4. The communication device according to claim 1, characterized in that: The packet identification unit identifies the data block based on an identifier included in an IP header of the packet.
5. The communication device according to claim 1, characterized in that: The packet identification unit identifies the data block based on identification information included in a TCP / UDP payload of the packet.
6. The communication device according to claim 1, characterized in that: When the data packet cannot be stored in the buffer due to exceeding the capacity of the buffer, the buffer control unit discards from the buffer a data packet that belongs to a data block different from the data block to which the data packet belongs and that has been stored in the buffer before the data packet.
7. The communication device according to claim 1, characterized in that: When the data packet cannot be stored in the buffer due to exceeding the capacity of the buffer, the buffer control unit discards from the buffer a stored data packet that belongs to a data block different from the data block to which the data packet belongs and that was stored in the buffer earliest in terms of time.
8. The communication device according to claim 1, characterized in that: When the data packet is stored in the buffer, the buffer control unit discards, from the buffer, a data packet that belongs to a data block different from the data block to which the data packet belongs and that has been stored in the buffer before the data packet.
9. The communication device according to claim 1, characterized in that: When the data packet is stored in the buffer, the buffer control unit discards from the buffer a stored data packet that belongs to a data block different from the data block to which the data packet belongs and that was stored in the buffer earliest in terms of time.
10. The communication device according to any one of claims 6 to 9, characterized in that: When the stored data packets belonging to the other data block exceed a predetermined ratio with respect to all data packets belonging to the other data block, the buffer control unit discards the stored data packets from the buffer.
11. The communication device according to claim 10, characterized in that: The sending unit stops sending the stored data packet.
12. The communication device according to any one of claims 6 to 9, characterized in that: When the stored data packets belonging to the other data block exceed a predetermined importance, the buffer control unit does not discard the stored data packets from the buffer.
13. The communication device according to claim 12, characterized in that: When the data packet belonging to the data block exceeds a predetermined importance, the buffer control unit discards the stored data packet belonging to the other data block from the buffer.
14. The communication device according to claim 1, characterized in that: When the data packet cannot be stored in the buffer due to exceeding the capacity of the buffer, the buffer control unit discards from the buffer an already stored data packet that belongs to the same data block as the data packet and is stored in the buffer before the data packet.
15. The communication device (200) according to any one of claims 2, 4 and 5, characterized in that: The packet identification unit further identifies the communication flow to which the packet belongs based on the transmission source and / or destination of the packet. The buffer control unit controls storage of the data packets in the buffer and discarding of the data packets from the buffer in units of the data blocks for each of the communication flows.
16. The communication device according to any one of claims 1 to 15, characterized in that: The communication device is mounted on a mobile object.
17. A communication method, performed by a communication device, characterized in that: receiving a data packet from a first device (S101), identifying a data block to which the data packet belongs, the data block being a data unit in an upper layer (S102), Controlling the storage of the data packets in the buffer and the discarding of the data packets from the buffer in units of the data blocks (S103), storing the data packet in the buffer (S104), The data packet is read out from the buffer and sent to the second device (S105).
18. A communication program, executable by a communication device, characterized in that: receiving a data packet from a first device (S101), identifying a data block to which the data packet belongs, the data block being a data unit in an upper layer (S102), Controlling the storage of the data packets in the buffer and the discarding of the data packets from the buffer in units of the data blocks (S103), storing the data packet in the buffer (S104), The data packet is read out from the buffer and sent to the second device (S105).
