An asynchronous consistency algorithm in smart manufacturing cloud data centers

In the smart manufacturing factory, the fresh real-time datas and multiple replications are important for numerically-controlled machine tools. The production datas are stored in distributed cloud data centers (CDCs), so the communication latencies produced by data synchronization may impair the machining performance. In this paper, an asynchronous consistency algorithm (ACA) which is inspired by the nearest infection is proposed to reduce the communication latencies between nodes. The experimental results demonstrate that the proposed algorithm can support lower client-side latencies and increase data stability, thereby improving the production efficiency.


Introduction
In a smart factory, the IoT (Internet of things) is applied to capture the datas generated by the production facility, so big data technology is used to store and analyse data in real-time [1]. For this data-driven machine manufacturing, system control and management are supported by the datas from the production workshop [2]. Cloud data centers (CDCs) provide the data storage and computing platform to smart factories. However, they will also face some new challenges, where the data management of latency-sensitive applications is one of them, such as data reading in numerical control, machining tools test, and interactive drawing editing. Different from other application scenarios, datas in machine manufacturing are expensive. Thus more replicas are necessary and they should be placed in geo-distributed data centers (DCs) to collect the global datas for predicted models. To avoid clients' latencies, weak consistency scheme is the best solution. Some existing works focused on the optimization of the replicas synchronization and consistency scheme. In [3], a machine learning-based predictive framework is present, which can select client-centric consistency methods under the limit of latency and staleness thresholds. In [4], the notion of almost strong consistency as an option for the consistency/latency tradeoff is discussed, and the deterministically bounded staleness of data versions is demonstrated. In [5], the authors point out that weaker consistency models could be maintained when scalable services are deployed in partitionable systems. In [6], an adaptive scheme for consistency level at run-time according to the application requirements is proposed to achieve high data availability. In [7], a cross-area node selection algorithm is proposed to minimize the 2 communication latency, and the tradeoff between reliability and synchronization time is discussed. In [8], the eventually consistent services are discussed when data-centric consistency models are not implicitly convergent. In [9], a replicas allocation algorithm is raised to preserve the server consistency in data-intensive CDCs, but the performances of clients are not considered.
In this paper, when the input datas come from several local nodes, we study to reduce the clientside latencies in CDCs for smart manufacturing. The major contributions of this paper are summarized as follows. The proposed ACA is not to completely control the number of replicas, so more replicas will be supported in some specific works. Based on ACA, the purpose is to guarantee the manufacturing under the limitation of the latency threshold. With asynchronous, we present an infectious consistency scheme, where the storage node selecting method is considered to reduce the latencies and guarantee the data safety.

Materials and Methods
Because the manufacturing factory may generate a massive amount of datas, so the storage system is a large-scale CDC with nodes, racks, and data centers. The set of nodes, racks, and DCs is described as , , ⋯ , , , , ⋯ , , and , , ⋯ , respectively. The input data items are stored in the local nodes, and the replicas are sent to the remote ones. The data center framework is shown in Fig.1, in which the modules are deployed in the public and private cloud. The private cloud is the local DC in an enterprise, and the public cloud means the remote nodes. The layered architecture can increase the data collecting and processing efficiency. We assume that the default replicas number is set as , and the weak consistency factor is denoted as . When a data input request comes to the system in time , the server-side latency is defined as (1) We present the whole CDC as an undirected graph , , where , , ⋯ is the set of nodes. The degree of dispersion of the replicas is defined as , and is the adjacent matrix of vertex set . The elements in are the transmission distance of the data replicas. Similar to Hadoop, the distances between nodes are mapped to different levels: two programs in the same node, two nodes on the same rack, two nodes on different racks in the same DC, and nodes in different DCs, where the 3 corresponding distances are denoted as set 0, 2 , 4 , 6 . We define the data storage matrix , in which each element in is the distance between nodes. The degree of dispersion is described as The optimization objectives of replicas storage are the minimum latency, consistency, and reliability. The consistency means the clients can get the fresh data when the system is available and the reliability performance is evaluated by . During the transmission of data package, round trip time (RTT) means the total transmission time for data sending and reception, which is constrained by network distances. When there are equipments, the total transmission delay [10] is 1 In equation (3), is the packet size, and is the channel capacity. is transmission speed and is the difference between link and physical distance. The random dynamic noise is , and is a fixed value. Based on the topology of backbone optical fibers, the network path distance between remote routers is not deviated from the actual physical distance. The relation between delay and distance is linear. Therefore, the latencies generated by replicas in distributed DCs are formulated as . . 0 ∈ 0, 2 , 4 , 6 (4) According to equation (3), the latencies can be replaced by the normalization factor , which is denoted as (5) Equation (4) illustrates the best replicas storage scheme with the minimum dispersion degree. When the data item is written into the local DC, the intuitional storage scheme is to choose the adjacent nodes. Meanwhile, data safety should be guaranteed by dispersive replicas. But the optimization problem is NP-hard. As a result, we present a heuristic asynchronous consistency algorithm, whose advantage is reducing the latency by synchronous process, and getting the system consistency by the asynchronous storage in remote nodes. According to the weak consistency requirement, the node selection sequence is from data center to nodes. The proposed replicas storage scheme is demonstrated in Alg.1 and Alg.2.
Based on equation (4), the replica should be stored into the nearest node, and then it will infect other ones. We focus on the infection in the adjacent nodes and dispersion in the remote DCs, which is proceeded asynchronously. In general, the local DC may first obtain the consistency requirement. As a result, the proposed ACA includes two write procedures. In Algorithm 1, step 1 acts as a proxy node to receive the data write requirement. Corresponding to the minimum latency target, except the weak consistency setting, the remaining replicas are sent to nodes in other DCs and the receipt is not  (4)(5)(6)(7)(8)(9), the nodes in remote DCs are selected to store the replicas in terms of Alg.2.

Algorithm 1 Asynchronous consistency algorithm
Input: The information of nodes in the whole data center, including the set of nodes , racks , and DCs . Output: The replicas' write information.
1: if a client start a write request. then 2: Calculate the weak consistency guarantee replicas number and one local node is selected as the initial storage node. 3: Send the remaining replicas to the remote nodes. 4: while The number of written replicas is less than the set value. do 5: Select nodes randomly in set by Alg.2. 6: if The replicas are written to the nodes completely. then 7: Notify the master node that the data update process is finished. 8: else 9: Perform the replicas update again. 10: Update the set , , and . 11: return result Algorithm 2 Infectious node selection algorithm Input: The information of nodes in the whole data center, including the set of nodes , racks , and DCs . Output: The candidate node set .
1: Calculate the eligible DCs according to the degree of dispersity and store them in set . 2: for all the DCs in do 3: for all the DCs in do 4: Get the adjacent nodes. 5: return nodes set .
In step (1), the DC selection is restricted by , and the distances are considered in DCs. Then the nearest node is obtained by the infectious scheme in each rack of the decided DC in parallel (2)(3)(4). In step (5), the candidate node is returned for replicas writing in set .

Test Results and Discussions
In our experiments, results display the advantage of performance in the degree of dispersity and latencies of the proposed ACA. The OS is centos 7, and the host IP is 192.168.100.0/24. The server number is 16, which is virtualized by docker containers. After testing, the communication time loss of containers is about 20%.
means the node number. The simulation is implemented with 10 and 100 in a cloud computing environment, which provides production datas for manufacturing. Data write testing of the dispersity degree is shown in Fig.2. The latency threshold is set as 110 ms, so the dispersity is satisfied to the greatest extension. In the traditional database such as Cassandra or HDFS, the adjacent nodes are selected first. Because the replicas order of the proposed ACA starts with the DC, the dispersity performance is better. Meanwhile, when the number of nodes increases to 100, the fixed replications cannot promote dispersity.
The measuring of the average latency is shown in Fig.3. The replications of the manufacturing in factories are precious, so more storage content is allowed. Compared with the traditional scheme, the proposed ACA reduces the latency down to 39.1%. Besides, as the replications number increases, the