Interactive Task Assignment Model for Internet of Things Devices

delays the delivery of the task result. Experimental results show the efficiency of the proposed method. The variance of real response time was limited within a small interval as the number of devices was increased.


Introduction
In network communication, the intelligent communication system has been used as a mature technical service for many years. It can be used to assist network communication packets to intelligently find routes for communication transmission. The collision detection technology of the communication packets and the traffic service quality management algorithm can smoothly transmit the digital data in the packets to the destination end, ensuring that the data transmission packets are not lost.
In the Internet of Things (IoT) technology, if a remote operation is required, the device or robot can assist the user in the task. In addition, when a large number of devices must operate at the same time, the agent can be used to centrally manage the operating system using a single platform to operate a large number of devices. Take the current smart home system as an example. When smart homes operate smart curtains, lights, TVs, refrigerators, and washing machines through a single remote control, they will be connected via the Internet. The user sets up the service serial script through a single remote control and rapidly links the entire communication service script through a push-button operating device. Therefore, the user's demand for multidevice operation can be further completed.
However, this mode is limited to the passive operation of the device, and it is impossible to perform a two-way active response operation. The data response operation between the detailed devices cannot often be obtained or responded to by the server for subsequent operations. At present, it has been developed in automation technology for many years, especially the IoT technology. However, in the IoT technology, there is no good communication design service architecture. In most IoT models, the active one-to-one operation of hardware device system services is mainly performed by humans. Particularly when service applications must be implemented through IoT, it is necessary to expand to a large number of device operations, such that it is impossible to operate at the same time.
Therefore, an intelligent computing task model algorithm is proposed in this study, which allows the automation of a single application architecture for management, corresponding to a unified communication platform, and the establishment of all object devices that can automatically communicate with the platform. When the demand side issues an operation command to the platform, and all the objects automatically communicate with the platform, the assigned task results are processed separately.
To solve the above problems, in this study, an innovative IoT service intermediary communication station that can provide fast communication between devices is proposed. Through the proposed MQTT server platform, (1,2) the design establishes a set of innovative wisdom logic based on the communication between the devices. This will let the device know what role it is assigned to and what it will do throughout the IoT environment. After the device receives the task dispatched by the MQTT server, it can remotely accept the update script and service job software. This will allow different devices to contact the platform to understand what they should do. At the same time, the installation kit required for the task is dispatched to help establish a new type of communication service architecture in the IoT environment.
In this study, the following two important breakthrough technologies were successfully proposed: 1. verifiable communication platform mechanisms and methods, including how to enable hardware devices to communicate with the platform, establish an innovative automated communication feature model, and flexibly exchange the communication model with the transfer method and exchange the data content (Response to the event service can be effectively carried out through the network) and 2. a technology platform for software management and a software design method to assign the task assignment work to the hardware device through the platform. By using decentralized objects for data processing and calculation, the mode can reduce the speed and performance of high-speed computers under centralized management.
Through the establishment of a new IoT platform, IoT and cloud fog architecture, and a system performance simulation test, we can accelerate the speed of distributed data processing and reduce network transmission costs.
In Sect. 2, we explain the current developments in related technologies. In Sect. 3, we provide a description of the research structure. In Sect. 4, we show experimental results. Conclusions are provided in Sect. 5.

Background
The basic three-layer architecture of the IoT system includes an application layer, a network layer, and a sensing layer. At present, the sensing layer has been developed for many different sensing components, including those for many daily necessities, such as smart bracelets, Bluetooth weight scales, and Bluetooth sphygmomanometers, all of which have reached the consumer goods commodity stage. In the network and application layers, devices are independent individuals, lacking an effective integrated management platform, including devices communicating with each other, and actively analyzing feedback suggestions between devices (4) as shown in Fig. 1.
IoT-based applications are included in various IoT applications such as smart cities, homes, and hospitals. Their outputs from data collection and analysis results help improve some unobserved environmental information. In IoT applications, a large number of hardware devices are required to receive data and perform network connection communication applications. The large number of incoming data streams generated by many IoT devices will cause severe network congestion and high overloading of the server. This results in communication delay and performance degradation. Some fields use IoT services, because the last network communication is as yet underdeveloped. The data could not be returned efficiently. (3) On the basis of the three-layer structure, many related digital sensing elements have been developed in the current research of the sensing layer. This structure is used to receive data related to the IoT environment. The communication and application of the network layer focus on how to make the data transmission from endpoint devices more flexible and efficient under the existing communication network. When the required detection event occurs, the value change information is transmitted to the server by using the network delivery algorithm, which facilitates the instant analysis and processing of the data.
Our research team published an improved transfer calculation algorithm for network communication processing and applied it to the IoT system. This algorithm is used to calculate the time of waiting for the response to the machine-to-machine (M2M) message, and the calculation result is used as a criterion. (5)(6)(7) When the server delivers a task to all external IoT devices, the endpoint device performs event processing and returns the event processing result after receiving the task. If the result response average is higher than the assumed standard time criterion, the frequency and number of times the device is required to return the data gradually decrease. After the successful application of the research, a creative IoT platform will wait for the data to be returned for system quantitative management and gradually reduce the cost of requesting a fast and immediate data transmission.
In this study, we continue the previous M2M result of the research team and develop an enhanced marker regression calculation algorithm. Through the OM2M model, the machine learns the environment, strengthens the correction in the communication logic design, dispatches the task and software service script, and provides a timer synchronization scheme to calculate the wait mark on the server side. When the endpoint device fails to give back the obtained task information after time expiration, the endpoint device is forced to return the currently analyzed result first and the computing service script is restarted. This calculation model can overcome the difficulty in collecting any subsequent data information when the endpoint device is overdue from the previous result.

System for M2M Fog Computing Design
The communication technology discussed in the IoT system has historically can only complete data transmission through the Internet, and there is still no effective system for information collection and application. When the cloud computing mode is performed, devices can be shared by dynamically configured calculations. If the IoT device can expand the I/O device to the sensing layer, the data detected by the device can be integrated with the cloud. This allows the sensing device at the fog end to complete information gathering and real-time operations. Therefore, it is possible to provide more types of changes in the timely dynamic management and intelligent analysis of various items in the IoT. (8) Guinard et al. combined cloud computing technology with IoT's EPCglobal Network technology architecture to build an EPC cloud and apply it to electronic goods security systems. (8) Connected via the cloud platform, the IoT system attempts to systematically implement the SaaS system through the cloud technology of the IoT device and successfully solves and overcomes the difficulties encountered in remote management.
In this study, we use the M2M communication structure developed by OSGi to construct the message server as a task dispatch server. All endpoint devices are end nodes. When the service we design is delivered to the endpoint through the message server, the device itself wakes up the data exchange and task assignment services. According to the order of assignment, the information of the task script and the result of the script execution are synchronized. When the device has program update or data exchange requirements, it can be dispatched by M2M, and its service scope can be more extensive. Therefore, in this study, we explore an IoT technology that can be used to improve the communication management of a large number of devices. All terminal IoT devices are built with the "Fog" platform computing model and provide a layer of fog between the terminal device and the cloud data center. As with the current construction of many memory card storage or small servers or routers, some data that do not need to be placed in the cloud are directly processed and stored at this layer. This can greatly reduce the computing and storage load of the cloud, improve efficiency, increase transmission rate, and reduce latency analysis time.
The conventional Internet protocol is designed for transmission modes that do not need to be permanently connected and have few connections, but have a large amount of data. For consistency, IoT is just the opposite and must maintain the connection status frequently, and the number of connections is extremely large, far exceeding the number that existing telecommunication equipment can handle, and the amount of data is relatively small. Therefore, under the state of different transmission modes, the devices used in telecommunications or the Internet in the past cannot support the needs of the IoT era. For example, when using IoT as an access control system for an office, you need a service that can continuously maintain network connectivity and communicate any time. Although it is not a conventional highspeed computing network environment, this system cannot tolerate a short-time network disconnection, because it will cause problems with the normal opening and closing of the office door.

Designed communication framework
The task of the network layer is not only to integrate and transmit data, but also to have a certain degree of information processing capability. It can handle emergencies immediately or respond to simpler system requirements on its own. It works like a human's "reflex nerve" and can respond to specific conditions on its own, without having to pass all the data to the brain (i.e., the IoT data center) for interpretation. In this manner, not only can the correct response be made in the first place, but also the computing burden of the overall network and data center can be reduced. For example, if a node on the power network detects that the device is abnormal and may be dangerous, it can stop the power supply by itself and send the related information up to the data center of the smart power network for subsequent processing.
From the past IoT device remote operation technology, although the device serial connection is integrated into a single platform system, and multiple device connection control is performed on a single platform, the device autonomous computing and communication capability is still lacking. The concept of device autonomic computing originates from the fact that when humans deal with an event, they will automatically perform a number of different tasks processed through the brain, so that the event can be completed rapidly after its initiation. For example, when a person wants to drink hot water, he takes a cup to the water dispenser to get it. If he is accidentally burned by the hot water, the brain's computing power will cause the hand to rapidly drop the cup and makes both hands stay away from the hot water, and the person looks for cold water to cool them.
If the above actions are implemented through the IoT device, this series of actions must have a neural operation function on each end point, such as a network sensor on the finger area of the brain, to achieve this. Since the device can only receive commands in one direction and then provide services, the service information must be centrally managed. There has recently been a significant improvement in service performance management. However, if you want to make the function of each endpoint as the human finger in the service operation, the device should independently reflect the operation and a mechanism for the device to receive the command and process it immediately should then be designed.
In this experiment, the M2M architecture is implemented in the basic communication layer, and communication integration is performed through fog computing, so that task assignments are assigned to all device nodes. Just like the operation of the human hand and foot via the nervous system, all the scattered device systems can instantly return the results to the server, which can rapidly disperse the operation and reflect the state of neural reflection. Therefore, in this study, we continue the past experience, applying the feedback time calculation construction to the IoT cloud integration architecture, storing data through the cloud, and using fog for fast distributed computing. At the same time, the intermediary system is used to integrate the cloud system with IoT, and the solution can be provided in all the different devices. The device side can actively analyze and capture information and provide data information for distributed computing and storage management, and the cloud performs synchronous storage management of necessary data to accelerate IoT calculation speed. An example of a fog service with the IoT platform is shown in Fig. 2. On the left of Fig. 2, data collection and analysis services for all devices are gathered to the fog computing storage service and then transmitted to the cloud. Users deploy analytics to the IoT platform through the cloud, which are shown on the right of Fig. 2.

IoT client device monitoring
The network state management information exchange service improves the service performance. If a large amount of data is required to be sent back in time, a more expensive network service is required in the state of the device service. For example, when the video recorded through the monitor system is transmitted back to the server, the required network performance cost is high, especially when the environment of the monitor system is, for example, a wider road monitoring field. Assuming that there are about eight monitors at each road intersection, all the video images are transmitted back to the centralized server management center through the dedicated network and then recorded by the management center computer. The network usage cost is very high. If the proposed research is combined with the decentralized calculation model to create a decentralized cloud monitoring calculation model, all devices can use the platform to send analysis tasks to all IoT devices that communicate with the platform and then through the IoT. The device performs calculations and the analysis results are transmitted back to the platform. This method will reduce the traffic usage of the network.
In addition to reducing the frequency of the flow operation service program, in this study, we further explore how to efficiently establish a response feedback communication module. When the server performs task assignment and waits for a return message, we add a calculation engine to calculate the time of message transmission and gradually postpone the delivery of the task time in response to a good response. In the service state model, data synchronization calculation is performed. This method successfully reduces the time wasted and cost caused by a large number of distributed devices simultaneously returning information. It has been found through research that after the algorithm is executed multiple times, a certain technical obstacle occurs. In a system environment where the performance is poor, the system waits for the first response for a very long time, and the device will not return the execution result because the packet transmission is missing. After the decentralized tasks sent by the system arrive at each node, most nodes complete the response, and some devices with poor performance still have no response after the completion of all tasks, as shown in Fig. 3. It is obvious that the lack of the algorithm should be improved for better performance. Therefore, in this study, we design new calculation methods and adjust them. In addition to the fact that the devices with better performance should be calculated within the average value, a new set of events for time reduction calculation methods is added. When the system detects that the service response time is very long, the system cannot determine whether it can effectively contact the device. An S1 event is defined in the model. When the waiting time exceeds A s, the system sends an S1 event requesting communication detection. The IoT platform actively sends a confirmation service status detection message and waits for a response. If the service message response time is still more than A s, the system writes the service time back to the database for recording, displays the device abnormal signal in the platform, and records the delay frequency as N times. When the event occurs for the second time delay, the system initiates multiple times to send a message detection, performs (N − 1) × A for synchronous message detection calculation, and gradually detects the service status, and records the delay frequency. The flow chart of service detection with delay frequency is shown in Fig. 4. An example of the IoT backward algorithm with a delayed message is shown in Fig. 5 and the response time for IoT is shown in Table 1.  By adding a new backward calculation model, when the average feedback time is lower than the set target value, the system reduces the time in seconds required for the next startup to request the device. Assuming that the device performance processing status is poor, in order to avoid a very long waiting time, the processing request event return frequency is increased. To reduce and avoid the poor processing speed of the device, all IoT devices transmit data at the same time.
In this study, we summarize the different monitoring construction environments into oneto-many and one-to-one situations, as shown in Fig. 6. In a one-to-many environment, only one monitoring program (thread) is used throughout the system to monitor all applications. The advantage of this architecture is that the monitoring program consumes less system resources and has less impact on the application. However, as the number of applications that must be monitored increases, the accuracy and immediacy of monitoring will be relatively low. An overworked monitoring program cannot collect and provide immediate monitoring information. In addition, a one-to-many architecture system requires constant switching and exchange of information between monitoring programs and different monitoring targets, which also greatly increases the workload of the system. However, in a one-to-one architecture, each application is monitored by a monitoring program; in this case, the immediacy and accuracy of monitoring can be guaranteed, but a large number of monitoring programs will also cause the system to spend numerous calculation resources. Figure 6 shows the one-to-many and one-to-one threads.
Therefore, multiple executions are synchronized. When the IoT device monitors the performance, the delay request feedback response time decreases, and the analysis and calculation event processing frequency also decrease. Conversely, in a device with poor performance, the frequency gradually increases, the feedback time for data analysis shortens, and the analysis of the feedback result accelerates.

Experimental Results
In this study, the MQTT server was set up in the Amazon EC2 server to establish a communication intermediary platform and simultaneously construct a creative service platform to simulate the component operation behavior performed by the operator when updating the service event. To meet the communication needs, the IoT device was constructed on a Raspberry Pi to conduct experiments. The Raspberry Pi model B+ V1.2 communication version was used with the Ubuntu operating system, and the M2M service agent is established in the Ubuntu environment. Figure 7 shows the platform of the proposed fog system. Table 1 The response time for IoT in Fig. 5.
After the device starts the service, the system will actively communicate with the MQTT server and assist the task assignment through the message server. We simulate that the device is required to take photos and perform digital image analysis operations to analyze whether someone is in the image. When someone enters the image, the system actively records and waits for the delivery to be sent to the MQTT server, simulating the establishment of a security alert protection network. In this study, several Raspberry Pis were built to simulate the fog unit. Each device is an independent computing entity. In addition to collecting information from the sensing device, it also performs image analysis and calculation, reducing the cost of transmission from all image events back to the system and the new platform. Figure 8 shows the experimental devices used.
In this study, several image indicators were assumed. First, we ran a single-machine test to calculate the average time in seconds to analyze ten digital images in the Raspberry Pi analysis.  After the initial experiment, the average time for a single device to calculate the image was about 50 s. We selected this value as the threshold. When the device synchronization response time was less than 50 s, the return time gradually increased to 50 s. When the response time was longer than 50 s, the request time was reduced by 10 s to send the synchronization message. The corresponding processes for threshold setting and increasing/decreasing the return time and the waking up process are shown in Figs. 9, 10, and 11, respectively.     Experimental results of data analysis, computations, and response time are shown in Figs. 12, 13, and 14, respectively. Images were transmitted within the system to test the delay time and the response of each device. Using the test data, the monitoring system reorganized the task assignments and got the balance of delay time among the devices. The test platform for task assignments was the MQTT server.
From the above experimental results, the system event processing performance is found to affect the MQTT server by making the server send the task time again in the dynamic average calculation time. In addition, we observe that when someone is detected in the image and the event image is returned, the response time of the performance transmission increases. Through the established timeout startup mechanism in this experiment, the device sends the next MQTT event when it responds in time, wakes up the device to start the service, and reduces the transmission result due to the change. The experimental conditions are set to perform the calculation analysis on five sets of devices and perform conventional calculation analysis, and the experimental results are shown in Table 2.
From the experimental data, it can be found that under the limited control state, the backhaul timer can be established through this study, which can gradually reduce the number of dynamic hardware requirements. Adjusting the event processing backhaul performance scattered in different fog devices can gradually postpone the time required to return the data. At the same time, the data processing response time does not change owing to the delay or increase in the frequency of detection responses. Figure 16 shows the reaction time for dynamic data transmission. It is observed that the variance of real response time is limited at an interval of 20 s.

Conclusions and Future Work
In this study, there are two main contributions that are proposed to effectively improve the performance of the entire system by the integration of fog operations and cloud, using IoT to synchronize multiple devices. 1. The dynamic adjustment algorithm for response time is applied to the event processing system for IoT devices. 2. For a multidevice synchronization operation, a mechanism with an improved dynamic operation transmission mode is proposed.
In this experiment, the proposed calculation method is used to increase the frequency of detection events and effectively correct the response time under different conditions and prevent  the loss of a packet due to a long reaction time, which makes it impossible to detect the event processing situation. At the same time, with the combined operational advantages of the fog devices, the dispatched analysis and calculation events are delivered to the fog devices. In this study, we combine device computing performance with network performance. Research on the performance improvement calculation models for high-performance network environments and poor network environments will continue in the future. It includes performing calculations at IoT endpoints, establishing a network performance audit mechanism, improving the M2M communication model in the IoT computing service environment, and continuously integrating the results of cloud research.