Edge Computing Resource Allocation Method for Mining 5G Communication System

In the actual production of coal mines, the transmission needs of existing underground applications cannot be met due to a lack of strategies and customized equipment for underground 5G application scenarios, which causes increased underground data processing delay and low transmission efficiency. To solve the problem above, the mobile edge computing (MEC) technology based on the 5G wireless base station is studied, and underground 5G communication capability is improved by edge caching and dynamic resource allocation according to the actual situation of coal mines. The experimental result shows that under the premise of maintaining the rated power and transmit power of the existing base station, the average delay of executing tasks is 15 ms, which is 50% lower than the average delay of all local execution methods. The average delay is 37.5% lower than all MEC execution methods. At the same time, the uplink rate of a single base station can reach 1 Gbps and the downlink rate can reach 1.5 Gbps. Our method can significantly improve the reliability of mining 5G communication systems and the rational allocation of resources.


I. INTRODUCTION
Intelligent coal mining is a guarantee of high-quality development of the coal industry. However, our country is still in the primary stage of development of coal mine intelligence, faced with the problems of difficult perception, the unreliable synchronous transmission of multiple types of data, poor real-time remote control, and low efficiency of intelligent decision-making based on big data integration [1]. With its advantages of large bandwidth, low delay, and wide connection, 5G technology opens up a channel for efficient information interaction among different application scenarios, which is conducive to reshaping the development of the traditional coal industry, facilitating the digital transformation of the coal industry, promoting the deep integration of cloud computing, big data, Internet of Things, artificial intelligence and mobile The associate editor coordinating the review of this manuscript and approving it for publication was Tiago Cruz . applications, and innovating applications and services [2], [3], [4]. Therefore, applying 5G communication technology to intelligent coal mining is the only way to develop coal mining in the future. The process of intelligent coal mining will be effectively promoted and the way of ''network communication'' will be built to turn a new page of intelligent coal mining.
Compared with 4G communication, the working power and RF energy of the 5G base station in the mine have greatly improved its application underground. The general requirement for equipment is that total RF threshold power shall be ≤ 6W . Therefore, for 5G technology in mine, not only explosion-proof and indigenous safety design but also the safety of RF threshold power should be ensured in practice. Normal MIMO technology and the high-gain antenna of 5G technology are not suitable for underground conditions, so the advantages of 5G technology are not fully played in the application of coal mines. With the increasing demand for 5G communication technology in the intelligent construction of coal mines, it is necessary to explore how to maximize the bandwidth utilization rate of 5G communication base stations in mines under the condition of limited resources, so as to meet the requirements of low-delay, large-bandwidth and high-speed communication for main system data in intelligent coal mines [5].
As shown in Figure 1, the current 5G network deployment architecture diagram of coal mines shows that the core network is installed in the ground central machine room, with BBU, RHUB, and RRU installed underground. BBU is connected to RHUB through an optical fiber, and RHUB is connected to pRRU+ directional antenna through optical cable to achieve 5G signal coverage [6], [7]. All 5G network communication in underground coal mines relies on small stations. In order to prevent gas explosions caused by high-power wireless emission, the RF threshold power (the product of effective output power of wireless emission equipment and antenna gain) of wireless emission equipment in underground coal mines shall not be greater than 6W. Switching the upstream and downstream time slot ratio is commonly used to increase the uplink bandwidth. After modification, the uplink rate can reach 450Mbps [8], [9], [10]. With the construction of intelligent coal mining, the application scenarios of 5G network technology in coal mines are increasing day by day. Chen et al. [11] developed a traffic-flow prediction algorithm which is based on long short-term memory (LSTM) with an attention mechanism to train mobile-traffic data in single-site mode. Zhang et al. [12] designed an energy-efficient computation offloading (EECO) scheme, which jointly optimizes offloading and radio resource allocation to obtain the minimal energy consumption under the latency constraints. Liu et al. [13] proposed a new system design, where probabilistic and statistical constraints were imposed on task queue lengths, by applying extreme value theory, which make users reassociated to MEC servers in order to offload tasks using higher rates or accessing proximal servers. However, no strategy or customized equipment is suitable for these underground scenarios in actual production. Even after adjusting the existing parameters, the advantages of 5G technology cannot be brought into play and the transmission requirements of existing underground applications cannot be met [14], [15]. At present, the mine 5G system submitted for approval in safety certification does not have relevant technology for the special needs, which carries out explosion-proof transformation on the ground 5G flameproof products, with large volume and weight. This raises the following questions: • Contrary to the ground 5G products focusing on downlink rate, the performance advantages of existing mine 5G system can not be fully played in the underground application scenarios, resulting in a waste of most of bandwidth and performance resources [16].
• At present, there is no optimization strategy for underground application scenarios, such as dynamic resource allocation strategy, underground edge computing, edge cache, etc., which leads to the increase of underground data processing delay and low transmission efficiency [17], [18].
• The volume and weight of flameproof equipment are too large to install conveniently, which cannot meet the application requirements of all underground scenarios.
To solve the problems above, an edge computing resource allocation method for the mining 5G communication system is proposed. Based on the mobile edge computing (MEC) technology of 5G wireless base station and the actual situation of coal mines, the underground 5G communication capability is improved by edge caching and dynamic resource allocation. Under the premise of maintaining the rated power and transmitting power of the existing base station, the uplink rate of a single base station can reach 1 Gbps and the downlink rate can reach 10 Gbps by using edge caching and dynamic resource allocation technology.

II. SYSTEM MODEL CONSTRUCTION
MEC technology is a way to reduce the delay of network operation and service delivery, by providing an IT service environment and cloud computing capability at the edge of a mobile network, where the industrial control scenario with ultra-low delay and the transmission demand of large bandwidth are better met. The sensing, interaction, and control between things are better realized [19], [20]. The overall framework of the edge computing resource allocation method of mining 5G communication system is shown in Figure 2.

A. TERMINAL MODEL
In the application scenario of multi-server users corresponding to the MEC environment in the coal mine, assume that there are M sets of mobile device terminals Di, and the set is expressed as device Di has randomly distributed in 5G application scenario in the coal mine. In the MEC environment underground, the task unloading ratio of the mobile device terminal Di is 1], and f i is the computing frequency of the mobile terminal. Therefore, the local execution time when the task is uninstalled is: where B i indicates the task data volume of the mobile device terminal Di, and q i indicates the constant of the complexity of the computing task. Let p i,l represents the power of the mobile device terminal Di, then it can be expressed as: where k i,l is a constant determined by the terminal chip architecture, thus the corresponding product of energy consumption power of terminal and time is:

B. COMMUNICATION MODEL
Generally speaking, in the process of mobile communication transmission underground, the transmission speed of downlink is much higher than that of uplink, and the transmission volume of downlink data is often smaller than that of uplink data. Therefore, ignoring the transmission time of downlink, the transmission speed of uplink data can be expressed as: where W represents the bandwidth of the mobile communication uplink; σ 2 represents the channel noise power; d i represents the distance between the mobile terminal Di and the edge server; v represents the path loss index; h represents cyclic symmetric complex Gaussian random variable; p i,t r represents the transmission power of mobile terminal Di, and the maximum transmission power of mobile terminal Di is defined as p max i , and S represents the number of channels, where: 0 < p i,t r ≤ p max i,t r .µ i represents the proportion of the uplink bandwidth of mobile terminal Di, where N i=1 µ i = 1. If the data with the size B i x i of mobile terminal Di is unloaded to the edge server for execution, the data transmission time T i is T i,t r (x i ) = B i x i R i , and the transmission power consumption of mobile terminal Di is: Considering that the edge server is directly powered by the power grid and has sufficient electric energy in practical applications, the energy consumption of the edge server will not be considered. The execution time of the computing task when the mobile terminal Di is unloaded to the edge server is as follows: where f es is the counting frequency (period) of the edge server, assuming that it is fixed in the process of data processing. k i represents the computing resource allocation ratio of the mobile terminal Di. Considering that the task is executed in parallel between the terminal and the edge server, the data transmission time of the mobile terminal should be combined with the processing time of the edge server. Thus the total execution time of the terminal computing task on the edge server is: In the actual production of underground coal mines, there are a lot of latency-sensitive applications, such as video-based target detection and pedestrian recognition. Therefore, the problem of task processing delay minimization is proposed, which optimizes spectrum resources, edge service computing resources and terminal data offloading ratio. Decision variables x i , µ i , k i ∈ [0, 1]. Since the task is parallel between the terminal and the edge server, the total delay to complete a task is: Then the total delay of task processing in the MEC system can be described as:

D. RESOURCE ALLOCATION ALGORITHM
After the task unloading ratio is given, the communication spectrum resources and edge server computing resources are allocated for each terminal. The sub-problem of resource allocation can be expressed as: MEC resource allocation is a convex function of variable sum µ i and k i , so the Lagrangian function of MEC to deal with the total delay problem can be expressed as: where θ 1 , θ 2 = [θ 21 , θ 22 · · · θ 2n ] T , β 1 , β 2 = [β 21 , β 22 · · · β 2n ] T are Lagrange multipliers. If this equation has an optimal solution k * i , µ * i , it needs to meet the conditions that as follows: By solving the equation above, the optimal configuration of spectrum and computing resources can be obtained as follows:

III. CACHE ALLOCATION
If there is an information file in the underground storage node in the current situation, definite the file as F = {a 1 , a 2 , a 3 · · · a k }, where a k is the subfile of each part of the file. The information in the overall information file F needs to be sent to different devices and users, so the file needs to be divided into sub-files and stored in different cache nodes. Not all the information in the file is needed by the underground users and terminals, so it is necessary to divide the popularity and interest degree of each subfile, and the Shannon entropy method [21] is used to calculate the popularity division [22].
Currently, there are n information files {F 1 , F 2 , F 3 , · · · F n }, and each file is divided into k subfiles. That is F n = {a 1 , a 2 , a 3 · · · a k }. For any subfile a k , its feature vector should be calculated to represent the attributes of the subfile. For files in image format, each frame image or picture is assigned the name of the image as a label to construct the feature vector. For files in document format, IF-IDF method is used to calculate the feature vector of the document file. Finally, for each subfile a k in the file F n , it is expressed in the way of attribute feature vector, that is a k = {c 1 , c 2 , c 3 , . . . , c n }.
Shannon entropy, also known as information entropy, describes the relationship between information and probability mainly through mathematical formulas in informatics. Its principle mapped to the resource cache is to calculate the probability of the occurrence of each attribute value in the collection where the user has generated behaviors on the file. If the probability value is high, it means the information is very large. If the probability value is low, it means the information is small. By calculating the probability of the attribute value, we can judge the distinguishing ability of the attribute. The calculation formula of Shannon entropy is described as: In the subfile a k , calculate its probability of all attributes occurring: where, p n denotes the occurrence probability of the attribute value c n , and num( c n ) denotes the total number of subfiles in the attribute set whose attribute value is c n , and m denotes the total number of files. By calculating the Shannon entropy of each attribute in the file, the Shannon entropy of the subfile a k can be obtained by the following formula: The size of the Shannon entropy represents the prevalence of the subfile. The larger the Shannon entropy is, the higher the popularity will be. The first n subfiles of each file F are selected according to the Shannon entropy and stored in each cache node according to random rules. When users and terminal devices obtain file information, they are sent through each node in parallel, which relieves the pressure on cache nodes and improves the transmission speed.

IV. BANDWIDTH ALLOCATION
Due to the limitations of the special networking mode and base station design in coal mines, the transmission bandwidth allocation between storage nodes and devices is more strict and complex. A user-based collaborative filtering algorithm is adopted. User-based collaborative filtering algorithm is a recommendation algorithm. The content that a user is interested in will be recommended to another one based on the user's similarity. Through the user-based collaborative filtering algorithm, the underground bandwidth is reasonably allocated to ensure communication and stability between the underground cache node and the equipment.
In the user-based collaborative filtering algorithm, the underground equipment is taken as the user and the bandwidth is taken as the item. In the aspect of calculating the similarity between the equipment, it is mainly necessary to extract the features of each device to form the feature vector for similarity calculation. The characteristics of the devices are divided into five categories, namely device type, data type, transmission bandwidth requirement, operation state, and device location. The five feature vectors of the device are constituted into the device feature matrix. Specific examples are described in Table 1 below: Next, the features in the table are quantified and the devices are marked with numbers instead. The corresponding quantitative results of the table above are shown in Table 2. For one device, its form of feature vector should be:Q u (p 1 , p 2 , p 3 , p 4 , p 5 ).For example, Device 1: Q u (1, 1, 4, 1, 7). p in the formula represents the feature type of device u. The bandwidth for device u is recommended by calculating the similarity between device u and device v. The similarity calculation formula is as follows: where min Q i u , Q i v is the one whose eigenvalue is smaller than that of user u and user v. max Q i u , Q i v is the one whose eigenvalue is larger. Sim(u, v) is a value between 0 and 1. By calculating the similarity of two devices, the bandwidth required by unknown devices can be estimated and allocated. The allocation mechanism meets the following formula:  where L(v), L(u) is the bandwidth required by the device u and v in current state. µ is the compensation factor. By the neural network framework in deep learning, the operation state of the underground Device is predicted and corrected, and the optimal solution of compensation factor µ is trained to improve the accuracy of bandwidth allocation of underground equipment [23], [24].
The model is modified by deep Q-network (DQN). The structure of DQN consists of a full-connected layer and a convolution layer. Each convolution layer is followed by a non-linear activation function. After multi-layer convolution and full-connected layer, the input data can get the Q value of all the actions in the front state as the output. CNN is used to obtain the interrelationship between (s, a) and value function Q(s, a). s, and a is the vector of state and action, respectively. Q(s, a). s means cumulative discount rewards when performing action a under state s.
where λ represents discounted parameter, r s, a, s ′ indicates the rewards obtained by performing the action a. The offline structure requires the accumulation of sufficient value estimation for the sample (s, a), and memory is played back to make the training process smooth. The offline DNN (Deep Neural Networks) needs to construct a sufficient value of the sample and (s, a) to make the DNN accurate enough. The CNN is mainly composed of the input layer, hidden layer, and output layer. The input layer is responsible for receiving the original high-dimensional data. The hidden layer contains the convolution layer, the pooling layer, and the full-connected layer. The convolution layer is responsible for extracting the features from the input data, and then the generated feature diagram is passed on to the next pooling layer. After completing the feature selection and information filtering The feature diagram is extended to the vector from the full-connected layer and passed to the next layer. After the full-connected layer, the output layer is responsible for all the outputs of a. The status s is obtained from the environment, and is as the input to the current Q network at the same time. In the current Q network, the Q value of all the actions that should be calculated and selected the argmax a Q(s, a; θ) of the biggest Q value. Then the action is executed in the environment, and the action is a, the status s, the next state s ′ and the reward r are stored together in the memory pool as a set of state conversion. When the number of samples in the memory pool reaches a certain number, a batch of status conversion s, a, r, s ′ will be sampled from the memory pool. the loss function will be calculated, and the current Q network will be updated based on the loss function. and then the target Q network will be updated every time. The DQN will keep training until it reaches the state of convergence.

A. EXPERIMENTAL SETTINGS
The experiments were conducted at our mining laboratory. Our laboratory has an analog coal mine underground environment, and MATLAB is used as the experimental tool. The resource scheduling of the MEC will be affected by many factors, such as the deployment method, user quantity, and the physical environment of the base station. In order to facilitate verification experimental effects, we assume that other conditions are the same when adjusting the size of the user and the number of base stations. The users of bandwidth are shown in the table 3 including intelligent patrol system, security monitoring system, positioning system, broadcasting system, etc.

B. ANALYSIS OF SYSTEM CONVERGENCE
In the system convergence analysis experiment, the optimal solution of the system method is determined mainly by the number of convergence in this paper, as shown in Figure 4.
In the experiment, the total number of iterations of the edge computing resource allocation system is 200, and the initial delay is about 7.9s. With the increase in the number of iterations, the total delay decreases gradually. Finally, when the number of iterations is about 80, the total delay is at about 6.6s and tends to be stable. The global optimal solution of the number of iterations of the system is obtained, and the optimal model of the system is determined.

C. SYSTEM DELAY TEST
After the optimal system model is determined, the time delay changes of tasks by all local operation, all MEC operation and the method proposed on different amount of terminals are verified. The test result is shown in Figure 5. The test devices increase from 10 to 50, and the average time delay of all locally executed tasks is 30ms when the number of devices reaches 50. The average latency of all MEC tasks is 24ms which is still on the rise, while the average latency of the tasks executed by the method is 15ms. When the number of devices reaches 50, the average delay of the method is reduced by 50% compared with that of the method executed locally and by 37.5% compared with that of all MEC execution methods. Therefore, the task execution delay of the method proposed in this paper has significantly improved effect and lower delay than the other two ways. And with the increase of the number of devices, increment of delay of the method is also the least of all, which proves the superiority of the proposed method.

D. SYSTEM RATE TEST
The stability of the proposed method in network transmission is verified by testing the uplink and downlink rates on different equipment in coal mines, as shown in Figure 6. In order to guarantee the effectiveness of the experiment, 13 different devices were tested in this experiment, and the uplink and downlink rates of each different device were calculated respectively. Through repeated verification of a large amount of data, it can be seen that the uplink rate of the 13 devices ranges from 0.92-1.07 Gbps, and the average uplink bandwidth is 1 Gbps. The downlink rate ranges from 1.44 to 1.55 Gbps, and the average downlink rate is 1.5 Gbps. Therefore, the edge caching and dynamic resource allocation technologies proposed to enable the uplink rate of a single base station to reach 1 Gbps and the downlink rate to reach 1.5 Gbps, which can meet the actual production needs in coal mines effectively.

VI. CONCLUSION
To solve the problems existing in the practical application of mining 5G technology, the resource allocation method based on edge computing is proposed. On the basis of the demand for underground large-bandwidth data transmission, the MEC edge computing technology based on the 5G wireless base station side is studied. Edge caching and dynamic resource allocation are carried out according to the actual situation of coal mines to improve the 5G communication capability underground. Under the premise of maintaining the rated power and transmitting power of the existing base station, the average time delay of tasks executed by the method is 15ms when the number of coal-mine devices reaches 50, with the utilization of edge caching and dynamic resource allocation technology, which is 50% lower than that of the local method and 37.5% lower than that of all MEC execution methods. In terms of transmission, the uplink rate of a single base station can reach 1 Gbps and the downlink rate can reach 1.5 Gbps. The simulation result shows that, compared with the sub-optimal algorithm, the proposed method owned obvious advantages in improving the reliability of mining 5G communication system, reducing the energy consumption of users during task unloading, and improving the algorithm performance under multi-mobile-device conditions.