Abstract:To solve the problem of high-communication latency consumption when sensor data during the round trip to the server application layer in the military IoT(Internet of Things), an in-network collaborative computing method for multiple devices with low-latency task demands was proposed. This method relied on a network architecture with P4 switches as the core and employed a data-plane programming strategy based on the P4 program to complete the packet processing within the switch. A task mapping strategy was designed to map the task set to a switch network topology, thus realizing a collaborative operation mode in which tasks were computed while being transferred on the network topology path. After that, a latency optimization model was built to find the best mapping result, and the task was further optimally scheduled through the heterogeneous earliest finish time algorithm. Experimental results show that when the data size of a single packet is 1 000 Byte, the output latency of this method is reduced by about 54.2% and 72.1% compared with the local service and cloud service, respectively. Therefore, the proposed method effectively reduces latency, offering a practical solution to meet the low-latency demands of tasks.