# International Import and Export Trade Forecasting Algorithm Based on Heterogeneous Dynamic Edge Computing System

Authors: Yingfei Yang
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

As a new computing model, how to use edge computing to forecast import and export trade has become an issue of concern. This research mainly discusses the prediction algorithm of international import and export trade based on heterogeneous dynamic edge computing system. The dynamic task migration system studied in this paper mainly includes four parts: edge computing environment simulator, task generator, resource predictor, and migration decision maker. These four parts are not independent modules in the working process; they will interact with each other in the edge computing environment. In the data processing offloading strategy, the customs business personnel transfer the trade data that need to be predicted to the edge device cluster through the mobile terminal. After receiving the data transmitted by the business personnel, the edge device cluster uses data processing technology to process the data. After the data processing operation is completed, the processed data is directly used for prediction work. After the prediction work is completed, the data and results are uploaded to the central server. Finally, after the prediction work is completed, the edge device will feed back the prediction result to the mobile terminal and display the result on the user interface through the mobile terminal so that business personnel can understand the trade risk status. From August 2018 data application period, the monthly data of the import and export trade volume for the subsequent time span of ten years were regularly forecasted, and the correlation coefficient was still over 83%, and the RMSE also dropped significantly. The system designed in this study can effectively predict the annual estimated value of various economic indicators of international import and export trade.


---

## Body

## 1. Introduction

The long-term formation of sunk costs has largely affected the economic behavior of import and export manufacturers. From a dynamic point of view, in the presence of sunk costs, manufacturers will compare the present value of current profits with future profits before making a decision [1]. And, under normal circumstances, when the general environment is unstable, manufacturers will not easily react to changes in the exchange rate, forming a “stagnation” effect, which will lastingly affect import prices.In the current situation of increasingly severe import and export trade forms, studying the elasticity of national import and export commodities will help us to propose corresponding policies through price and income elasticity to effectively adjust and optimize the current import and export structure of commodities [2], so as to achieve a moderate maintenance of the number of imports and exports of some products which will ultimately achieve the goal of promoting economic growth and development on the one hand and alleviating the trade friction between countries on the other and reducing the impact of external economies on a country’s economy.The proliferation of the Internet of Things and the success of rich cloud services have promoted the development of a new computing paradigm-edge computing [3], which requires data processing at the edge of the network. Shi W introduced the definition of edge computing and then conducted some case studies, from cloud offloading to smart homes and cities, and collaborative edge to realize the concept of edge computing. Although his research can attract the attention of the community and stimulate more research in this direction, the research process lacks innovation [4, 5]. Jiang et al. proposed an improved multiobjective gray wolf optimizer algorithm (IMOGWO) to solve this problem. They use an elite learning strategy based on Gaussian perturbation to avoid local optima. The algorithm he proposed was tested on twelve multiobjective benchmark problems selected from the CEC2009 test cases and compared with two popular heuristic optimization algorithms. His proposed IMOGWO effectively solves the problem of subordinate task scheduling in edge computing, but the research process lacks data [6]. Wang et al. believe that, as a key intelligent transportation service, the public vehicle system aims to improve transportation efficiency and vehicle occupancy by inducing travelers to share rides with others. They proposed the ECPV system to improve traffic efficiency and vehicle occupancy by arranging ride sharing between travelers and to reduce decision-making delays by using edge computing. They formalized the public vehicle-scheduling problem as an optimization problem, with the goal of maximizing traveler satisfaction, in order to reduce travel time and improve traffic efficiency [7]. Although the method he proposed can reduce the delay in decision-making, the research results lack concrete practice [8]. Chen believes that low latency/latency is one of the most critical requirements for in-vehicle network applications. He solved the curse of the dimensionality problem in MDP by characterizing the temporal and spatial correlation of vehicle mobility [9]. On this basis, he also provided specific results for highways, two-dimensional streets, and real-data scenarios. Although his research considers the transition probability is usually uncertain, incorrect sample data and complex path environment, the research process lacks comparative data [10].The dynamic task migration system studied in this paper mainly includes four parts: edge computing environment simulator, task generator, resource predictor, and migration decision maker. These four parts are not independent modules in the working process; they will interact with each other in the edge computing environment. In the data processing offloading strategy, the customs business personnel transfer the trade data that needs to be predicted to the edge device cluster through the mobile terminal. After receiving the data transmitted by the business personnel, the edge device cluster uses data processing technology to process the data. After the data processing operation is completed, the processed data is directly used for prediction work. After the prediction work is completed, the data and results are uploaded to the central server. Finally, after completing the prediction work, the edge device will feed back the prediction result to the mobile terminal and display the result on the user interface through the mobile terminal so that business personnel can understand the trade risk status.


## 2. Heterogeneous Dynamic Edge Computing

### 2.1. Edge Cluster

When the data reaches the edge device cluster [11], the data distribution should be reasonably performed so that each edge device in the cluster can complete the prediction work in the same time as possible [12, 13]. At this time, the main things that need to be paid attention to are the same indicators of CPU, memory, and hard disk read and write speed [14]. The calculation formula is as follows:(1)Pei=a1Cei+a2Mei+a3Lei.Among them,Cei represents the product of the number of CPUs of the edge device i and its frequency [10, 15]. Similarly, if the amount of data is too large, the load of the edge device will be too heavy, which will affect the forecasting work. Therefore, when data is allocated, the load of the current time node needs to be considered, that is, CPU, memory, and the usage of disk to read and write [16]. Use these items to calculate the idle status Oeit of the edge device at the current moment, and the calculation formula is as follows:(2)Oeit=b11−Cti+b21−Mti+b31−Lti,where Lti represents the hard disk read and write usage rate of the edge device at the current moment [17, 18]. The idle value Fei of the performance of the edge device i at the current moment can be obtained.(3)Feit=Pei×Oeit.Assuming that there are 1 center andn edge devices in the edge device cluster, in the center of the edge device cluster, the idle value of each edge device in the cluster can be accumulated at the current moment to obtain the total idle value of the cluster performance at the current moment Fet, and its formula is as follows:(4)Fet=∑i=1nFeit.Then, the performance idle rateFPejof edge device i at the current moment can be obtained, and the formula is(5)FPej=FeitFet.Assuming that the amount of data unloaded from the central server to the cluster isdn, the amount of data allocated to i by the edge device dni is(6)dni=dn×FPei.


### 2.2. Risk Prediction of Import and Export Trade

For the data offloading model, during its execution, letdi be the amount of data transferred from the edge device cluster to the central server and d0 be the amount of data transferred from the central server to the edge device cluster. The time overhead in the prediction phase is as follows:(7)tc=1−λcd1Cε+λcdfwuc+dlCc+d0wdc.After data unloading, the total time cost of the entire risk prediction is as follows:(8)T=te+tc=dfwue+diCe+d0wdu+1−λCdiCe+λCdfwuc+diCc+d0wdc.Whenλ is set to different values, the amount of data processed by the edge device cluster and the central server also changes [19]. If the user sets the value of λ to 0, the total time overhead(9)T=te+tc=diw+djCe+d0wdu+diCe.If the user sets the value ofλto 0.5, it means that all predicted requests will be handed over to the edge device cluster for processing, and the central server only performs resource storage and model training. At this time, the total time overhead:(10)T=te+tc=diw+djCe+d0wdu+di2Ce+12diwuc+djCe+d0wdc.The data processing task offloading framework in the edge cluster process is shown in Figure1 [20, 21].Figure 1
Data processing task offloading framework in the edge cluster process.S1 in Figure 1 represents nonhomogeneous data integration tasks, S2 represents data feature extraction tasks, and S3 represents risk prediction tasks. Among them, S1 and S2 are executed on edge devices and S3 is executed on a central server [22].


### 2.3. Forecast of Resources in the Short Term

The resource requirements of tasks deployed in the actual edge computing platform are usually constantly changing, which also leads to the constantly changing state of the server resources on the edge computing platform [23, 24]. The efficient migration algorithm proposed in this paper is mainly to discover hotspot nodes with high resource utilization and cold spot nodes with low resource utilization in the edge computing platform and select tasks among them for migration mechanism [25]. When judging the resource utilization, if the server resource usage reaches the upper or lower threshold and it is identified as a hot spot node or cold spot node that needs to be processed [2], the dynamic nature of the task is ignored, which will result in a large number of servers. They are all judged as hot spot nodes, which will also bring a lot of meaningless task migration, cause a large degree of waste of resources, and seriously affect the service performance of the entire edge computing platform [26, 27]. Based on the above reasons, the algorithm studied in this paper introduces a resource prediction algorithm to work with the migration decision algorithm when performing dynamic task migration to improve the quality of service of the entire system [28]. The premise of the realization of the resource prediction algorithm is that the deployment tasks in the edge computing system are dynamically changing [29]. The main realization idea is to predict the future-period resource usage of server nodes whose current resource utilization reaches the upper or lower limit [30, 31]. If the sum of the resource requirements of tasks on the server for a period of time still makes the server in an “overloaded” or “underloaded” state, then this node can be regarded as a hot spot node or a cold spot node, and then, this node can be processed. Start the corresponding task migration operation [32].In the efficient task migration algorithm based on trade forecasts studied in this paper, each data center will provide corresponding computing resources for each task according to its needs [33, 34]. Therefore, the resource usage of the server is mainly determined by the resource demand of the tasks deployed on the server, so in the resource forecasting, the resource demand of the task can be quantified by predicting the resource usage of the server [35]. The CPU resource amount of task ti is(11)UPss=∑t∈tasksrcput+wsccpus.Therefore, the purpose of the resource predictor is to use the resource usage data of the previousn moments to predict the resource usage at time t + 1. Out of this consideration, we use linear regression models to characterize and describe the relationship between input variables and output variables [36]. In scenarios where large-scale tasks and servers exist, compared to other resource prediction methods, this method has obvious advantages in time complexity, which is conducive to quickly determining hotspot nodes and cold spot nodes and more conducive to rapid and accurate make migration decisions [37]. The resource usage at t time is(12)UPs=1,UPt+1−ms,…,UPtsT.The specific linear prediction function is(13)UPt+1s=β0+∑i=1mβi⋅UPs.Among them,m is the size of the regression in the prediction model. The (m + 1)-dimensional vector β can be determined by the least square method:(14)β←XTX−1XTy.


### 2.4. Trade Structure

Import prices and import quantities are also the result of equilibrium of supply and demand. Therefore, using equilibrium variables to estimate a single import demand equation will also cause doubts related to endogenous issues. Similarly, we need to consider the import supply curve and use the simultaneous equation method to estimate, or only when the import demand curve is basically stable, and the import supply curve is shifted. A single equation can be used to estimate the equilibrium price and quantity. Based on this consideration, we not only need to fit the overall but also need to add up the trade products of China which are subdivided to a certain extent to examine the import trade elasticity of different types of characteristic products.In terms of estimation strategy, the quantity and price of export demand are jointly determined by demand and supply. It is the result of a market equilibrium. The export price and export quantity appear on the supply curve and the demand curve at the same time, so they are in equilibrium. The single estimate of price and quantity data is that the export demand equation is generally biased, which will cause serious endogenous problems. Only when the price elasticity of the export supply curve is far greater than the price elasticity of demand, or the demand curve can remain stable when the supply curve changes, can a single equation be used to estimate. In other words, in the former, it means that the price is determined by the supply curve, while in the demand curve, it is an exogenous variable. In the latter, it can be understood that the equilibrium price and quantity is the result of the shift of the supply curve on the demand curve. It can be found that, in the latter, the stability of the demand curve is very important. The method that can be taken is to consider more influencing factors in the demand curve, increase exogenous variables, or subdivide the aggregated trade products to a certain extent. Examine the export trade elasticity of different types of characteristic products.


## 2.1. Edge Cluster

When the data reaches the edge device cluster [11], the data distribution should be reasonably performed so that each edge device in the cluster can complete the prediction work in the same time as possible [12, 13]. At this time, the main things that need to be paid attention to are the same indicators of CPU, memory, and hard disk read and write speed [14]. The calculation formula is as follows:(1)Pei=a1Cei+a2Mei+a3Lei.Among them,Cei represents the product of the number of CPUs of the edge device i and its frequency [10, 15]. Similarly, if the amount of data is too large, the load of the edge device will be too heavy, which will affect the forecasting work. Therefore, when data is allocated, the load of the current time node needs to be considered, that is, CPU, memory, and the usage of disk to read and write [16]. Use these items to calculate the idle status Oeit of the edge device at the current moment, and the calculation formula is as follows:(2)Oeit=b11−Cti+b21−Mti+b31−Lti,where Lti represents the hard disk read and write usage rate of the edge device at the current moment [17, 18]. The idle value Fei of the performance of the edge device i at the current moment can be obtained.(3)Feit=Pei×Oeit.Assuming that there are 1 center andn edge devices in the edge device cluster, in the center of the edge device cluster, the idle value of each edge device in the cluster can be accumulated at the current moment to obtain the total idle value of the cluster performance at the current moment Fet, and its formula is as follows:(4)Fet=∑i=1nFeit.Then, the performance idle rateFPejof edge device i at the current moment can be obtained, and the formula is(5)FPej=FeitFet.Assuming that the amount of data unloaded from the central server to the cluster isdn, the amount of data allocated to i by the edge device dni is(6)dni=dn×FPei.


## 2.2. Risk Prediction of Import and Export Trade

For the data offloading model, during its execution, letdi be the amount of data transferred from the edge device cluster to the central server and d0 be the amount of data transferred from the central server to the edge device cluster. The time overhead in the prediction phase is as follows:(7)tc=1−λcd1Cε+λcdfwuc+dlCc+d0wdc.After data unloading, the total time cost of the entire risk prediction is as follows:(8)T=te+tc=dfwue+diCe+d0wdu+1−λCdiCe+λCdfwuc+diCc+d0wdc.Whenλ is set to different values, the amount of data processed by the edge device cluster and the central server also changes [19]. If the user sets the value of λ to 0, the total time overhead(9)T=te+tc=diw+djCe+d0wdu+diCe.If the user sets the value ofλto 0.5, it means that all predicted requests will be handed over to the edge device cluster for processing, and the central server only performs resource storage and model training. At this time, the total time overhead:(10)T=te+tc=diw+djCe+d0wdu+di2Ce+12diwuc+djCe+d0wdc.The data processing task offloading framework in the edge cluster process is shown in Figure1 [20, 21].Figure 1
Data processing task offloading framework in the edge cluster process.S1 in Figure 1 represents nonhomogeneous data integration tasks, S2 represents data feature extraction tasks, and S3 represents risk prediction tasks. Among them, S1 and S2 are executed on edge devices and S3 is executed on a central server [22].


## 2.3. Forecast of Resources in the Short Term

The resource requirements of tasks deployed in the actual edge computing platform are usually constantly changing, which also leads to the constantly changing state of the server resources on the edge computing platform [23, 24]. The efficient migration algorithm proposed in this paper is mainly to discover hotspot nodes with high resource utilization and cold spot nodes with low resource utilization in the edge computing platform and select tasks among them for migration mechanism [25]. When judging the resource utilization, if the server resource usage reaches the upper or lower threshold and it is identified as a hot spot node or cold spot node that needs to be processed [2], the dynamic nature of the task is ignored, which will result in a large number of servers. They are all judged as hot spot nodes, which will also bring a lot of meaningless task migration, cause a large degree of waste of resources, and seriously affect the service performance of the entire edge computing platform [26, 27]. Based on the above reasons, the algorithm studied in this paper introduces a resource prediction algorithm to work with the migration decision algorithm when performing dynamic task migration to improve the quality of service of the entire system [28]. The premise of the realization of the resource prediction algorithm is that the deployment tasks in the edge computing system are dynamically changing [29]. The main realization idea is to predict the future-period resource usage of server nodes whose current resource utilization reaches the upper or lower limit [30, 31]. If the sum of the resource requirements of tasks on the server for a period of time still makes the server in an “overloaded” or “underloaded” state, then this node can be regarded as a hot spot node or a cold spot node, and then, this node can be processed. Start the corresponding task migration operation [32].In the efficient task migration algorithm based on trade forecasts studied in this paper, each data center will provide corresponding computing resources for each task according to its needs [33, 34]. Therefore, the resource usage of the server is mainly determined by the resource demand of the tasks deployed on the server, so in the resource forecasting, the resource demand of the task can be quantified by predicting the resource usage of the server [35]. The CPU resource amount of task ti is(11)UPss=∑t∈tasksrcput+wsccpus.Therefore, the purpose of the resource predictor is to use the resource usage data of the previousn moments to predict the resource usage at time t + 1. Out of this consideration, we use linear regression models to characterize and describe the relationship between input variables and output variables [36]. In scenarios where large-scale tasks and servers exist, compared to other resource prediction methods, this method has obvious advantages in time complexity, which is conducive to quickly determining hotspot nodes and cold spot nodes and more conducive to rapid and accurate make migration decisions [37]. The resource usage at t time is(12)UPs=1,UPt+1−ms,…,UPtsT.The specific linear prediction function is(13)UPt+1s=β0+∑i=1mβi⋅UPs.Among them,m is the size of the regression in the prediction model. The (m + 1)-dimensional vector β can be determined by the least square method:(14)β←XTX−1XTy.


## 2.4. Trade Structure

Import prices and import quantities are also the result of equilibrium of supply and demand. Therefore, using equilibrium variables to estimate a single import demand equation will also cause doubts related to endogenous issues. Similarly, we need to consider the import supply curve and use the simultaneous equation method to estimate, or only when the import demand curve is basically stable, and the import supply curve is shifted. A single equation can be used to estimate the equilibrium price and quantity. Based on this consideration, we not only need to fit the overall but also need to add up the trade products of China which are subdivided to a certain extent to examine the import trade elasticity of different types of characteristic products.In terms of estimation strategy, the quantity and price of export demand are jointly determined by demand and supply. It is the result of a market equilibrium. The export price and export quantity appear on the supply curve and the demand curve at the same time, so they are in equilibrium. The single estimate of price and quantity data is that the export demand equation is generally biased, which will cause serious endogenous problems. Only when the price elasticity of the export supply curve is far greater than the price elasticity of demand, or the demand curve can remain stable when the supply curve changes, can a single equation be used to estimate. In other words, in the former, it means that the price is determined by the supply curve, while in the demand curve, it is an exogenous variable. In the latter, it can be understood that the equilibrium price and quantity is the result of the shift of the supply curve on the demand curve. It can be found that, in the latter, the stability of the demand curve is very important. The method that can be taken is to consider more influencing factors in the demand curve, increase exogenous variables, or subdivide the aggregated trade products to a certain extent. Examine the export trade elasticity of different types of characteristic products.


## 3. International Import and Export Trade Forecast Experiment

### 3.1. Dynamic Task Migration System Design

The dynamic task migration system studied in this paper mainly includes four parts: edge computing environment simulator, task generator, resource predictor, and migration decision maker. Among them, the realization of resource predictor and migration decision maker should rely on the edge computing environment simulator [38]. The edge computing environment simulator is mainly responsible for simulating the communication relationship between edge servers, cloud center servers, and data centers; the task generator is mainly responsible for the generation and deployment of tasks in the edge computing environment; the resource predictor is mainly for dynamic task migration issues which are responsible for predicting the dynamic trend of task resource requests in the short term; the migration decision maker is mainly responsible for implementing task migration algorithms, making specific migration decisions, and realizing the redeployment of some tasks in the edge computing environment.These four parts are not independent modules in the working process; they will interact with each other in the edge computing environment. First of all, the edge computing environment simulator should simulate the real edge computing environment and the resource manager (RM) will record and save the resource situation of each server in the entire environment; then, it will be generated by the task generator, and the series of tasks will be generated by the task generator. After the task resolver is parsed, it is deployed in the cloud center server node and edge server node of each data center, and then, the resource update controller (RRC) needs to update the remaining resource amount of each server node in the entire edge computing environment; in the above, after the preparation of the basic environment is completed, since the resource request amount of each task is dynamically changing, the resource predictor will cooperate with the migration algorithm to perform the task migration work in the platform to achieve a certain amount of energy saving, while the tasks are divided among the server nodes, and improve the service performance of the entire edge computing platform.


### 3.2. Edge Computing Environment Simulator

(1)
Preprocessing module: the main function of the preprocessing module is to identify and analyze the tasks created in the edge environment task generator. It mainly identifies two types of tasks: cloudopt and edgeopt. The former can only be deployed on the cloud center server Cloud_Task and the latter belongs to Edge_Task, which is first deployed on the edge server. After the preprocessing module, the task will be parsed, converted into corresponding task commands, and stored in the task queue. For a task created in an edge computing environment task generator, only the task number task_id of the recorder, task type task_type, task state task_state, task resource demand task_request, and task running time task_time are required. Therefore, this article specifies the task command parsed by the preprocessing module(2)
Control module: the control module is the control unit of the entire dynamic task migration system, which supervises and controls the resources and tasks in the entire system. Due to the dynamic changes of tasks, the RRC in the resource manager will update the remaining resources of each server in real time; RM will monitor the resource usage of each server in the entire system in real time. Once the resource utilization is “excessive” or in case “too low,” corresponding to the appearance of hotspot nodes and cold spot nodes, the task migration unit will select the migration tasks and make migration decisions, and the corresponding task deployment unit will redeploy the migrated tasks. The implementation process of the migration algorithm has been introduced in detail in Section3; the task deployment of the control module does not involve the determination of the deployment plan because the corresponding target server has been selected in the migration decision; therefore, this section mainly introduces resource management design and implementation of the processor.(3)
Operation module: the operation module can not only receive and parse the instructions sent by the upper-level control but also implement specific operations based on the parsed instructions, so as to rationalize the resource and attribute information of the task entity and the underlying server entity configuration and management. The operation module is mainly composed of task management submodule and server management submodule. The task management submodule is responsible for task-related operations, including task generation and status changes, task migration, and task deployment. The server management submodule is responsible for the related operations of the server, including the opening and closing of the server and resource update operations.(4)
Resource module: it is the public resource of the entire dynamic task migration system and is mainly responsible for storing tasks and cloud-side server entities. When server storage is performed, block storage is performed according to the data center where it is located. In each data center, edge servers and cloud center servers must be distinguished and processed; when task storage is performed, the task is mainly divided into several task sets and is stored on different servers in different data centers. The control module will monitor this module in real time, and the operation module will perform specific operations on the server and tasks of this module.


### 3.3. Data Processing Offload Strategy

In the traditional risk prediction platform, since the data processing function and prediction function are provided by the central server, in this case, the user’s service experience is largely related to the user’s connection quality with the closely related central server:(1)
The user transmits the data that need to be predicted to the edge device through the mobile terminal(2)
After receiving the data transmitted by the user, the edge device uses related data processing technology to process the data(3)
After the data processing operation is completed, the edge device transmits the processed data to the edge center, and the edge center collects and transmits it to the central server(4)
After the central server receives the data transmitted by the edge device cluster, it stores the data in the database and uses the prediction model to perform prediction work(5)
After completing the prediction work, the central server returns the result to the edge center, and the edge center transmits the data to the corresponding edge device(6)
Finally, the edge device sends the received result to the mobile terminal and displays it on the user interface


### 3.4. Data Unloading Process

The specific process is roughly as follows:(a)
Customs business personnel transfer the trade data that need to be predicted to the edge device cluster through the mobile terminal.(b)
After receiving the data transmitted by the business personnel, the edge device cluster uses related data processing technology to process the data.(c)
After the data processing operation is completed, directly use the processed data for forecasting work, and after completing the forecasting work, upload the data and results to the central server.(d)
Finally, after the prediction is completed, the edge device will feed back the predicted result to the mobile terminal and display the result on the user interface through the mobile terminal so that the business personnel can understand the trade risk status. The data unloading process is shown in Figure2.Figure 2
Task uninstall process.


## 3.1. Dynamic Task Migration System Design

The dynamic task migration system studied in this paper mainly includes four parts: edge computing environment simulator, task generator, resource predictor, and migration decision maker. Among them, the realization of resource predictor and migration decision maker should rely on the edge computing environment simulator [38]. The edge computing environment simulator is mainly responsible for simulating the communication relationship between edge servers, cloud center servers, and data centers; the task generator is mainly responsible for the generation and deployment of tasks in the edge computing environment; the resource predictor is mainly for dynamic task migration issues which are responsible for predicting the dynamic trend of task resource requests in the short term; the migration decision maker is mainly responsible for implementing task migration algorithms, making specific migration decisions, and realizing the redeployment of some tasks in the edge computing environment.These four parts are not independent modules in the working process; they will interact with each other in the edge computing environment. First of all, the edge computing environment simulator should simulate the real edge computing environment and the resource manager (RM) will record and save the resource situation of each server in the entire environment; then, it will be generated by the task generator, and the series of tasks will be generated by the task generator. After the task resolver is parsed, it is deployed in the cloud center server node and edge server node of each data center, and then, the resource update controller (RRC) needs to update the remaining resource amount of each server node in the entire edge computing environment; in the above, after the preparation of the basic environment is completed, since the resource request amount of each task is dynamically changing, the resource predictor will cooperate with the migration algorithm to perform the task migration work in the platform to achieve a certain amount of energy saving, while the tasks are divided among the server nodes, and improve the service performance of the entire edge computing platform.


## 3.2. Edge Computing Environment Simulator

(1)
Preprocessing module: the main function of the preprocessing module is to identify and analyze the tasks created in the edge environment task generator. It mainly identifies two types of tasks: cloudopt and edgeopt. The former can only be deployed on the cloud center server Cloud_Task and the latter belongs to Edge_Task, which is first deployed on the edge server. After the preprocessing module, the task will be parsed, converted into corresponding task commands, and stored in the task queue. For a task created in an edge computing environment task generator, only the task number task_id of the recorder, task type task_type, task state task_state, task resource demand task_request, and task running time task_time are required. Therefore, this article specifies the task command parsed by the preprocessing module(2)
Control module: the control module is the control unit of the entire dynamic task migration system, which supervises and controls the resources and tasks in the entire system. Due to the dynamic changes of tasks, the RRC in the resource manager will update the remaining resources of each server in real time; RM will monitor the resource usage of each server in the entire system in real time. Once the resource utilization is “excessive” or in case “too low,” corresponding to the appearance of hotspot nodes and cold spot nodes, the task migration unit will select the migration tasks and make migration decisions, and the corresponding task deployment unit will redeploy the migrated tasks. The implementation process of the migration algorithm has been introduced in detail in Section3; the task deployment of the control module does not involve the determination of the deployment plan because the corresponding target server has been selected in the migration decision; therefore, this section mainly introduces resource management design and implementation of the processor.(3)
Operation module: the operation module can not only receive and parse the instructions sent by the upper-level control but also implement specific operations based on the parsed instructions, so as to rationalize the resource and attribute information of the task entity and the underlying server entity configuration and management. The operation module is mainly composed of task management submodule and server management submodule. The task management submodule is responsible for task-related operations, including task generation and status changes, task migration, and task deployment. The server management submodule is responsible for the related operations of the server, including the opening and closing of the server and resource update operations.(4)
Resource module: it is the public resource of the entire dynamic task migration system and is mainly responsible for storing tasks and cloud-side server entities. When server storage is performed, block storage is performed according to the data center where it is located. In each data center, edge servers and cloud center servers must be distinguished and processed; when task storage is performed, the task is mainly divided into several task sets and is stored on different servers in different data centers. The control module will monitor this module in real time, and the operation module will perform specific operations on the server and tasks of this module.


## 3.3. Data Processing Offload Strategy

In the traditional risk prediction platform, since the data processing function and prediction function are provided by the central server, in this case, the user’s service experience is largely related to the user’s connection quality with the closely related central server:(1)
The user transmits the data that need to be predicted to the edge device through the mobile terminal(2)
After receiving the data transmitted by the user, the edge device uses related data processing technology to process the data(3)
After the data processing operation is completed, the edge device transmits the processed data to the edge center, and the edge center collects and transmits it to the central server(4)
After the central server receives the data transmitted by the edge device cluster, it stores the data in the database and uses the prediction model to perform prediction work(5)
After completing the prediction work, the central server returns the result to the edge center, and the edge center transmits the data to the corresponding edge device(6)
Finally, the edge device sends the received result to the mobile terminal and displays it on the user interface


## 3.4. Data Unloading Process

The specific process is roughly as follows:(a)
Customs business personnel transfer the trade data that need to be predicted to the edge device cluster through the mobile terminal.(b)
After receiving the data transmitted by the business personnel, the edge device cluster uses related data processing technology to process the data.(c)
After the data processing operation is completed, directly use the processed data for forecasting work, and after completing the forecasting work, upload the data and results to the central server.(d)
Finally, after the prediction is completed, the edge device will feed back the predicted result to the mobile terminal and display the result on the user interface through the mobile terminal so that the business personnel can understand the trade risk status. The data unloading process is shown in Figure2.Figure 2
Task uninstall process.


## 4. Forecast and Analysis of International Import and Export Trade

### 4.1. Task Migration Analysis

The high-efficiency task migration algorithm based on import and export trade studied in this paper includes the process of resource prediction. The effect of resource prediction will directly affect the performance of the processing task of the entire dynamic task migration system. Therefore, the GC-ETM algorithm will be first used in the experimental process. The resource prediction algorithm is compared with the prediction method in the VMCUP-M algorithm. In the comparison process, in order to ensure that the experimental configuration is the same, the prediction process proposed in this paper will also predict the resources for a period of time in the future 6 times, that is,k = 6. In order to illustrate the versatility of the GC-ETM method for task migration problems, that is, it is commonly used in task migration in both dynamic and static situations; at the same time, the GC-ETM method has more advantages in the dynamic task migration process of various scales. For good results, three scale experiments will be carried out, respectively. Therefore, during the experiment, small-scale dynamic task migration experiments, medium-scale dynamic task migration experiments, large-scale dynamic task migration experiments, and static task migration experiments will be carried out, respectively. In the implementation of the migration algorithm, the parameters involved mainly include the lower and upper limits n1 and n2 of each server’s CPU resource utilization. In the study of this article, both CPU resources and memory resources need to be considered in the formulation of migration strategies; in the performance evaluation process, the main parameters involved are the parameters a and β of the order of magnitude. The parameter values are shown in Table 1.Table 1
Parameter values.
Parameter nameParameter valuen10.2n20.8a60β15In the experiment of small-scale task migration, the number of task entity nodes changed from 100 to 900, and the number of tasks in each group increased by 100. In the small-scale experiment, two experiments of dynamic and static task migration will be carried out, and the task migration based on graph coloring proposed in this paper will be carried out from five aspects: energy consumption, communication cost, migration cost, average migration cost, and total cost. The algorithm is compared with the comparison algorithm. The static task migration performance is compared with the BGM-BLA, AVMM, and VMCUP-M methods, and the dynamic task migration performance is compared with the VMCUP-M algorithm and AVMM methods. The range of CPU resources requested by different numbers of tasks is [6, 10], and the resource requirements of memory resources and storage resources are evenly distributed in the ranges of [60,100] and [120,200], respectively. When performing dynamic task migration, the probability Pc, Pu, Pr, and Pp of the operation module to change the task state are 0.2, 0.5, 0.2, and 0.1, respectively. The small-scale task migration research is shown in Table2.Table 2
Small-scale task migration research.
ParameterParameter rangeCPU resources[6, 10]Memory resource[60, 100]Storage resources[120, 200]Pc0.2Pu0.5P0.2Pk0.1Correspondingly, during the small-scale experiment, the total number of servers is 50. CPUc and CPUe, respectively, correspond to the amount of CPU resources of cloud center servers and edge servers; Memc and Meme, respectively, correspond to the amount of memory resources of cloud center servers and edge servers; Stoc and Stoe, respectively, correspond to the amount of storage resources of cloud center servers and edge servers; cloud center link bandwidth between servers, cloud edges, and edge servers correspond to cc, ce, and ee, respectively. The amount of storage resources is shown in Table3.Table 3
Storage resources.
ParameterParameter rangeCPUc[800, 1000]CPUe[80, 220]Memc[8000, 10000]Meme[800, 2000]Stoc[12000, 20000]Stoe[1600, 4000]C-C[15, 20]C-e[10, 15]e-e[8, 12]


### 4.2. Task Offloading Strategy

The communication overhead result of each algorithm in the small-scale static task migration experiment is shown in Figure3. It can be seen from the experimental results that when the number of tasks is greater than 300, the GC-ETM algorithm proposed in this paper has better performance in reducing communication overhead. The main reason is that compared with other algorithms, this paper prioritizes the tasks with the highest CPU usage during task processing, which can reduce more SLA conflicts, thereby reducing communication overhead.Figure 3
Communication overhead results of each algorithm in the small-scale static task migration experiment.Compared with the VMCUP-M algorithm, the GC-ETM method proposed in this paper has significantly smaller communication overhead. When the number of tasks is 100–700, its communication overhead is close to that of the AVMM algorithm, and when the number of tasks increases, it is slightly higher than the AVMM algorithm. The main reason is that the first two algorithms have a resource prediction process and SLA conflict processing. Relatively not timely enough, on the other hand, it is mainly because the AVMM algorithm prioritizes the migration of tasks with greater communication requirements, so there will be less communication overhead, but the gap between the GC-ETM method and the AVMM algorithm is relatively small. The algorithm comparison result is shown in Figure4.Figure 4
Algorithm comparison results.The impact of different dynamic environments on the task completion time is shown in Figure5. Among them, the dynamics of the system become stronger with the increase of the change factor μ. When the system tends to be static (μ < 10−5), accurate prediction information makes the performance of the algorithms with almost no gap. With the increase of μ, the prediction information becomes inaccurate, and the gap between ADCO and the comparison algorithm quickly widens. When μ = 10−3, the performance gap between ADCO and the control strategy reaches the maximum. The above results strongly prove that ADCO has good dynamic adaptability. At the same time, observing the experimental results of EFSF and EFSF-R and ADCO and ADCO-NR strategies, it is not difficult to find that the repeated offloading strategy of tasks is indeed beneficial to the dynamic adaptive ability of the offloading algorithm.Figure 5
The impact of different dynamic environments on task completion time.


### 4.3. MEC Prediction Model

Figure6 shows the stability test of the monthly data series of China-ASEAN imports and exports from August 2018 to December 2019. It can be seen from Figure 6 that the changes in the volume of trade show a similar trend of ups and downs in a certain period of time, and on the whole, it is continuously increasing. The forecasting model based on the time series MEC is to predict the trend and seasonality of the original trade volume data series and eliminate the predicted trend and seasonality to obtain a stable data series. If a data series produces a certain behavior over time, it is considered that it will produce such behavior in the future with a high probability, so it is to convert the data series of China-ASEAN import and export trade volume into a stable series. For prerequisites for forecasting using the MEC forecasting model based on time series, the results of the stability test show that the data sequence of China-ASEAN import and export trade volume is not stable. The reasons may be as follows. With economic development and global integration, ASEAN is the country's third largest trading partner, and the import and export trade volume is constantly increasing. As a result, different average values are generated over time; in different periods, due to policies or other reasons such as the global economic downturn, the volume of import and export trade with ASEAN has declined to a certain extent; comparing different periods of import and export trade with ASEAN Ete presents a certain cyclical or seasonal change. Table 4 shows the import and export income and price elasticity of my country’s primary products, products in processing, and industrial finished products.Figure 6
Stability detection of monthly data series.Table 4
Import and export income and price elasticity of my country’s primary products, products in process, and industrial finished products.
PriceProductPrimary productReprocessed productsManufactured goodsImport price elasticity−1.09−1.83−1.03(−2.21)(−2. 89)(−4.42)Export price elasticity−0.49−0.56−2.35(−2.00)(−2.03)(−2.3)Export income elasticity1.001.772.10(5.35)(5.1 7)(21.10)Import income elasticity0.112.1 32.73(1.69)(2.09)(7.54)The result of the smoothing method is shown in Figure7. In order to stabilize the data series of import and export trade volume, it is necessary to eliminate the aforementioned causes of instability. First, eliminate the trend. In order to eliminate the trend, the smoothing method of weighted rolling average is generally adopted, which is the average of continuous K values. In terms of the frequency of the trade volume data series, this article uses the average of the past year, that is, the average of the past 12 months. After smoothing, the sequence data processed in Figure 6 is more stable than the data in Figure 7, and the test statistics of the sequence are shown in Table 5.Figure 7
Smoothing method processing results.Table 5
Comparison of test statistics of sequences.
ValueSequenceData sequence 1Data sequence 2Test statistics−0.510621−3.521207Less than 1% critical value−3. 484667−3.490131Less than 5% critical value−2.88534−2.887712Less than 10% critical value−2. 579463−2.58073The time series model based on the moving edge algorithm is used to fit the monthly data of China-ASEAN import and export trade volume. The total import and export volume of August 2018 is the earliest data at a given time. The fitting result is shown in Figure8. Table 5 shows the evaluation results of the prediction model of China-ASEAN import and export trade volume based on the time series MEC. The China-ASEAN import and export trade volume prediction model is based on the time series MEC although the predicted MAPE and correlation coefficients are not as good as the linear regression-based prediction model, but the time series model is better than the need to determine the value of other indicator factors. The import and export volume can be predicted in the future, and when the prediction is based on the time series MEC model fitting process, it is applied from the data of August 2018 after learning the internal time law of the monthly import and export trade volume The monthly data of the import and export trade volume of the subsequent ten years of time span are still predicted in time and fitted, and the correlation coefficient is still more than 83%, and the RMSE has also decreased significantly, indicating that there is a certain gap between the predicted value and the actual value, but the predicted trend is still a strong correlation. The monthly data forecast of import and export trade volume is shown in Table 6.Figure 8
Fitting results of total import and export.Table 6
Monthly data forecast of import and export trade volume.
Root mean square error RMSEMean absolute error (MAE)Mean absolute percentage error (MAPE) (%)Correlation coefficientR (%)62.925150.564816.948683.8687


## 4.1. Task Migration Analysis

The high-efficiency task migration algorithm based on import and export trade studied in this paper includes the process of resource prediction. The effect of resource prediction will directly affect the performance of the processing task of the entire dynamic task migration system. Therefore, the GC-ETM algorithm will be first used in the experimental process. The resource prediction algorithm is compared with the prediction method in the VMCUP-M algorithm. In the comparison process, in order to ensure that the experimental configuration is the same, the prediction process proposed in this paper will also predict the resources for a period of time in the future 6 times, that is,k = 6. In order to illustrate the versatility of the GC-ETM method for task migration problems, that is, it is commonly used in task migration in both dynamic and static situations; at the same time, the GC-ETM method has more advantages in the dynamic task migration process of various scales. For good results, three scale experiments will be carried out, respectively. Therefore, during the experiment, small-scale dynamic task migration experiments, medium-scale dynamic task migration experiments, large-scale dynamic task migration experiments, and static task migration experiments will be carried out, respectively. In the implementation of the migration algorithm, the parameters involved mainly include the lower and upper limits n1 and n2 of each server’s CPU resource utilization. In the study of this article, both CPU resources and memory resources need to be considered in the formulation of migration strategies; in the performance evaluation process, the main parameters involved are the parameters a and β of the order of magnitude. The parameter values are shown in Table 1.Table 1
Parameter values.
Parameter nameParameter valuen10.2n20.8a60β15In the experiment of small-scale task migration, the number of task entity nodes changed from 100 to 900, and the number of tasks in each group increased by 100. In the small-scale experiment, two experiments of dynamic and static task migration will be carried out, and the task migration based on graph coloring proposed in this paper will be carried out from five aspects: energy consumption, communication cost, migration cost, average migration cost, and total cost. The algorithm is compared with the comparison algorithm. The static task migration performance is compared with the BGM-BLA, AVMM, and VMCUP-M methods, and the dynamic task migration performance is compared with the VMCUP-M algorithm and AVMM methods. The range of CPU resources requested by different numbers of tasks is [6, 10], and the resource requirements of memory resources and storage resources are evenly distributed in the ranges of [60,100] and [120,200], respectively. When performing dynamic task migration, the probability Pc, Pu, Pr, and Pp of the operation module to change the task state are 0.2, 0.5, 0.2, and 0.1, respectively. The small-scale task migration research is shown in Table2.Table 2
Small-scale task migration research.
ParameterParameter rangeCPU resources[6, 10]Memory resource[60, 100]Storage resources[120, 200]Pc0.2Pu0.5P0.2Pk0.1Correspondingly, during the small-scale experiment, the total number of servers is 50. CPUc and CPUe, respectively, correspond to the amount of CPU resources of cloud center servers and edge servers; Memc and Meme, respectively, correspond to the amount of memory resources of cloud center servers and edge servers; Stoc and Stoe, respectively, correspond to the amount of storage resources of cloud center servers and edge servers; cloud center link bandwidth between servers, cloud edges, and edge servers correspond to cc, ce, and ee, respectively. The amount of storage resources is shown in Table3.Table 3
Storage resources.
ParameterParameter rangeCPUc[800, 1000]CPUe[80, 220]Memc[8000, 10000]Meme[800, 2000]Stoc[12000, 20000]Stoe[1600, 4000]C-C[15, 20]C-e[10, 15]e-e[8, 12]


## 4.2. Task Offloading Strategy

The communication overhead result of each algorithm in the small-scale static task migration experiment is shown in Figure3. It can be seen from the experimental results that when the number of tasks is greater than 300, the GC-ETM algorithm proposed in this paper has better performance in reducing communication overhead. The main reason is that compared with other algorithms, this paper prioritizes the tasks with the highest CPU usage during task processing, which can reduce more SLA conflicts, thereby reducing communication overhead.Figure 3
Communication overhead results of each algorithm in the small-scale static task migration experiment.Compared with the VMCUP-M algorithm, the GC-ETM method proposed in this paper has significantly smaller communication overhead. When the number of tasks is 100–700, its communication overhead is close to that of the AVMM algorithm, and when the number of tasks increases, it is slightly higher than the AVMM algorithm. The main reason is that the first two algorithms have a resource prediction process and SLA conflict processing. Relatively not timely enough, on the other hand, it is mainly because the AVMM algorithm prioritizes the migration of tasks with greater communication requirements, so there will be less communication overhead, but the gap between the GC-ETM method and the AVMM algorithm is relatively small. The algorithm comparison result is shown in Figure4.Figure 4
Algorithm comparison results.The impact of different dynamic environments on the task completion time is shown in Figure5. Among them, the dynamics of the system become stronger with the increase of the change factor μ. When the system tends to be static (μ < 10−5), accurate prediction information makes the performance of the algorithms with almost no gap. With the increase of μ, the prediction information becomes inaccurate, and the gap between ADCO and the comparison algorithm quickly widens. When μ = 10−3, the performance gap between ADCO and the control strategy reaches the maximum. The above results strongly prove that ADCO has good dynamic adaptability. At the same time, observing the experimental results of EFSF and EFSF-R and ADCO and ADCO-NR strategies, it is not difficult to find that the repeated offloading strategy of tasks is indeed beneficial to the dynamic adaptive ability of the offloading algorithm.Figure 5
The impact of different dynamic environments on task completion time.


## 4.3. MEC Prediction Model

Figure6 shows the stability test of the monthly data series of China-ASEAN imports and exports from August 2018 to December 2019. It can be seen from Figure 6 that the changes in the volume of trade show a similar trend of ups and downs in a certain period of time, and on the whole, it is continuously increasing. The forecasting model based on the time series MEC is to predict the trend and seasonality of the original trade volume data series and eliminate the predicted trend and seasonality to obtain a stable data series. If a data series produces a certain behavior over time, it is considered that it will produce such behavior in the future with a high probability, so it is to convert the data series of China-ASEAN import and export trade volume into a stable series. For prerequisites for forecasting using the MEC forecasting model based on time series, the results of the stability test show that the data sequence of China-ASEAN import and export trade volume is not stable. The reasons may be as follows. With economic development and global integration, ASEAN is the country's third largest trading partner, and the import and export trade volume is constantly increasing. As a result, different average values are generated over time; in different periods, due to policies or other reasons such as the global economic downturn, the volume of import and export trade with ASEAN has declined to a certain extent; comparing different periods of import and export trade with ASEAN Ete presents a certain cyclical or seasonal change. Table 4 shows the import and export income and price elasticity of my country’s primary products, products in processing, and industrial finished products.Figure 6
Stability detection of monthly data series.Table 4
Import and export income and price elasticity of my country’s primary products, products in process, and industrial finished products.
PriceProductPrimary productReprocessed productsManufactured goodsImport price elasticity−1.09−1.83−1.03(−2.21)(−2. 89)(−4.42)Export price elasticity−0.49−0.56−2.35(−2.00)(−2.03)(−2.3)Export income elasticity1.001.772.10(5.35)(5.1 7)(21.10)Import income elasticity0.112.1 32.73(1.69)(2.09)(7.54)The result of the smoothing method is shown in Figure7. In order to stabilize the data series of import and export trade volume, it is necessary to eliminate the aforementioned causes of instability. First, eliminate the trend. In order to eliminate the trend, the smoothing method of weighted rolling average is generally adopted, which is the average of continuous K values. In terms of the frequency of the trade volume data series, this article uses the average of the past year, that is, the average of the past 12 months. After smoothing, the sequence data processed in Figure 6 is more stable than the data in Figure 7, and the test statistics of the sequence are shown in Table 5.Figure 7
Smoothing method processing results.Table 5
Comparison of test statistics of sequences.
ValueSequenceData sequence 1Data sequence 2Test statistics−0.510621−3.521207Less than 1% critical value−3. 484667−3.490131Less than 5% critical value−2.88534−2.887712Less than 10% critical value−2. 579463−2.58073The time series model based on the moving edge algorithm is used to fit the monthly data of China-ASEAN import and export trade volume. The total import and export volume of August 2018 is the earliest data at a given time. The fitting result is shown in Figure8. Table 5 shows the evaluation results of the prediction model of China-ASEAN import and export trade volume based on the time series MEC. The China-ASEAN import and export trade volume prediction model is based on the time series MEC although the predicted MAPE and correlation coefficients are not as good as the linear regression-based prediction model, but the time series model is better than the need to determine the value of other indicator factors. The import and export volume can be predicted in the future, and when the prediction is based on the time series MEC model fitting process, it is applied from the data of August 2018 after learning the internal time law of the monthly import and export trade volume The monthly data of the import and export trade volume of the subsequent ten years of time span are still predicted in time and fitted, and the correlation coefficient is still more than 83%, and the RMSE has also decreased significantly, indicating that there is a certain gap between the predicted value and the actual value, but the predicted trend is still a strong correlation. The monthly data forecast of import and export trade volume is shown in Table 6.Figure 8
Fitting results of total import and export.Table 6
Monthly data forecast of import and export trade volume.
Root mean square error RMSEMean absolute error (MAE)Mean absolute percentage error (MAPE) (%)Correlation coefficientR (%)62.925150.564816.948683.8687


## 5. Conclusion

The dynamic task migration system studied in this paper mainly includes four parts: edge computing environment simulator, task generator, resource predictor, and migration decision maker. Among them, the realization of resource predictor and migration decision maker should rely on the edge computing environment simulator. The edge computing environment simulator is mainly responsible for simulating the communication relationship between edge servers, cloud center servers, and data centers; the task generator is mainly responsible for the generation and deployment of tasks in the edge computing environment.The resource predictor is mainly for dynamic task migration problems and is responsible for predicting the dynamic change trend of task resource requests in the short term; the migration decision maker is mainly responsible for implementing task migration algorithms, making specific migration decisions, and implementing some tasks in the edge computing environment redeployment. These four parts are not independent modules in the working process, and they will interact with each other in the edge computing environment. First of all, the edge computing environment simulator should simulate the real edge computing environment, and the resource manager will record and save the resource situation of each server in the entire environment.A series of tasks are generated by the task generator. After being parsed by the task parser, they are deployed in the cloud center server nodes and edge server nodes of each data center. After that, the resource update controller needs to update the remaining server nodes in the entire edge computing environment. The amount of resources is updated; after the preparation of the above basic environment is completed, because the resource request amount of each task is dynamically changing, the resource predictor will cooperate with the migration algorithm to perform the task migration work in the platform, so as to realize that the tasks are equally divided among the server nodes. At the same time, it achieves a certain energy-saving effect and improves the service performance of the entire edge computing platform. The system designed in this study shows good prediction results.



---

*Source: 5536997-2021-03-20.xml*