# A Cloud Computing-Based Intelligent Forecasting Method for Cross-Border E-Commerce Logistics Costs

Authors: Yanting Li
Journal: Advances in Mathematical Physics
 (2022)

---

## Abstract

Aiming at the problems of poor forecasting effect and low accuracy and low efficiency in current cross-border e-commerce logistics cost prediction methods, a cloud computing-based intelligent method for cross-border e-commerce logistics cost prediction is proposed. Analyze cloud computing concepts, characteristics, and service models, study cloud computing-related technologies, and train BP neural network algorithms based on BP neural network principles. The BP neural network structure is obtained by determining the number of neurons in the input layer, the number of neurons in the hidden layer, the number of neurons in the output layer, and the activation function of the neural network. Normalize the input data samples of the input layer, and select the initial weight, threshold, and learning rate parameters of the BP neural network to determine the momentum coefficient. This paper uses neural network model combined with Spark cloud computing platform to realize the intelligent prediction of cross-border e-commerce logistics cost. This method has good predictive ability. After a large amount of data input and output relationship training, it has obtained the most suitable model for prediction. The experimental results show that the cross-border e-commerce logistics cost prediction effect of the proposed method is good, and it can effectively improve the accuracy and efficiency of cross-border e-commerce logistics cost prediction.


---

## Body

## 1. Introduction

As a new form of foreign trade, cross-border e-commerce shows strong vitality in the environment of relatively weak import and export market [1]. Cross-border e-commerce plays a very important role in the mode of economic growth, taking a new road to industrialization, realizing the optimal allocation of resources, and enhancing international competitiveness. The development of cross-border e-commerce can promote industrialization through informatization, change the mode of economic growth, and take a new road to industrialization. In addition, accelerating the development of cross-border e-commerce is conducive to grasping the development opportunities brought by economic globalization, coping with the challenges brought by economic globalization, and improving international prestige. In the environment of fierce development momentum of cross-border e-commerce industry, cross-border logistics, as an indispensable and important link in the operation of cross-border e-commerce, has attracted much attention [2]. Cross-border logistics transportation is a necessary condition and basic guarantee for the development of cross-border e-commerce enterprises [3]. Therefore, it is very important to effectively control the transportation cost of cross-border e-commerce enterprise logistics. The prediction of cross-border e-commerce logistics cost is helpful to more effectively integrate logistics resources and formulate logistics development planning.At present, scholars in related fields have studied cost prediction and achieved some theoretical results. Reference [4] proposed the difference between cost-benefit results and prediction of road widening. The cost-benefit analysis of road investment involves a model that takes saving travel time as the main cost-benefit. The cost-benefit result of traffic flow road widening predicted using the variable demand model based on SATURN software. Predicting faster traffic speed is the input of an economic model used to compare investment benefits and costs, and the resulting benefit-cost ratio proves the rationality of the investment. This method has certain validity. Reference [5] proposed a research on the logistics cost optimization of the offshore oil service industry based on the offshore oil service cost model. The logistics cost of offshore oil service industry refers to the currency performance of various offshore operations and resources consumed in the space movement or time occupation of offshore engineering equipment. It is the sum of human, material, and financial resources expended in various activities of marine engineering equipment during the physical movement. Based on the characteristics of offshore oil service industry, this paper optimizes the logistics cost of offshore oil service industry from the three aspects of accounting method, system perspective, and macro level. Innovative and basic research has been conducted on the formation mechanism, forecasting, and optimization strategies of CNOOC service logistics costs. This method has certain feasibility. However, the above methods still have the problems of poor prediction effect, accuracy, and efficiency.To solve the above problems, an intelligent prediction method of cross-border e-commerce logistics cost based on cloud computing is proposed. Using BP neural network algorithm, determine the structure of BP neural network, normalize the data samples, select the learning parameters of BP neural network, determine the momentum coefficient, and complete the training of BP neural network. Using cloud computing technology, Spark cloud computing platform and BP neural network algorithm are combined to realize the intelligent prediction of cross-border e-commerce logistics cost. The cross-border e-commerce logistics cost intelligent prediction effect of this method is good and can effectively improve the accuracy and efficiency of cross-border e-commerce logistics cost intelligent prediction.The research innovations of this article are as follows:(1)
An intelligent method for cross-border e-commerce logistics cost prediction based on cloud computing is proposed(2)
Analyze cloud computing concepts, characteristics, and service models, study cloud computing-related technologies, and propose training BP neural network algorithms based on BP neural network principles(3)
This article uses neural network model combined with Spark cloud computing platform to realize the intelligent prediction of cross-border e-commerce logistics costs


## 2. Cloud Computing Technology

### 2.1. Cloud Computing Concepts and Characteristics

Cloud computing is an Internet-based computing method. In this way, shared software and hardware resources and information can be provided to computers and other devices on demand [6]. Cloud computing is a computing mode that integrates large-scale computing, storage, applications, and other decentralized computing resources to work together and provides users with infrastructure, platforms, software, applications, and other services through the Internet. The characteristics of cloud computing are summarized as follows:
(1)
Ultralarge scale: cloud computing service providers have large-scale server groups. Google has more than 1 million cloud computing servers, and every cloud computing service provider such as Amazon, IBM, and Microsoft has at least several hundred thousand. The server “cloud” can give users advanced computing power(2)
Virtualization: the biggest feature of the cloud computing platform at the current stage of development is to rely on a series of technologies such as virtualization to realize the virtualized control, management, scheduling, and application of hardware resources. Users can use network resources provided by cloud service providers through virtual platforms, but they can complete complex calculations that cannot be solved by local computers(3)
Scalable: in the cloud computing system, the number of servers can be expanded at any time, and more computing resources can enhance the processing capacity of cloud computing(4)
On-demand service: in cloud computing applications, users can purchase cloud services according to their own needs(5)
High reliability: the application runs on the server side, the calculation is processed by the server side, and the generated data is also stored on the server side. When a server has a problem, the task will continue to run by other servers, ensuring the normal progress of applications and calculations, users do not need to back up, and the data is automatically restored and saved on the server(6)
Low cost: the operation of “cloud” enables enterprises to reduce the high operating costs of data centers, and cloud service providers charge according to user needs


### 2.2. Cloud Computing Service Model

Cloud computing has three service models, Software as a Service (SaaS), Platform as a Service (PaaS), and Infrastructure as a Service (IaaS). The cloud computing service model is shown in Figure1.Figure 1
Cloud computing service model.


#### 2.2.1. Software as a Service (SaaS)

SaaS provides access to complete programs as a service. SaaS service providers uniformly deploy application service software on the server and divide and price the application service software according to specifications. Users can pay service fees through the Internet to enjoy application software services. The quantity and use time of application software can be customized according to user needs.


#### 2.2.2. Platform as a Service (PaaS)

PaaS is a basic platform service used to generate various applications. PaaS service providers can provide basic platform services to users. Users can purchase platform services from PaaS providers according to their own R&D needs to customize the R&D platform.


#### 2.2.3. Infrastructure as a Service (IaaS)

IaaS is an infrastructure service that provides a workplace for publishing, running, and processing virtual machines and storage space. IaaS service providers provide services to users based on the granularity of virtual resources. IaaS provides the possibility of real-time scalability of computing resources and on-demand storage devices.


### 2.3. Cloud Computing-Related Technologies

#### 2.3.1. Hadoop Cloud Computing Platform

Hadoop is a distributed system basic framework developed by Apache Software Foundation, which allows users to ignore the underlying details when developing programs and focus on the development of programming models [7]. Hadoop includes three main components: distributed file system (Hadoop Distributed File System, HDFS), MapReduce programming framework, and distributed database HBase.(1) HDFS. HDFS is designed and inspired by Google’s file system GFS (Google File System, GFS) and is highly fault-tolerant. HDFS is a reliable and fault-tolerant file system suitable for low-cost storage of large-scale data. The organization structure of HDFS is shown in Figure 2.Figure 2
Organizational structure of HDFS.The files in HDFS are written once and read multiple times, and the system does not need to be deployed on expensive and stable hardware devices. HDFS adopts the master/slave architecture, which can realize applications that optimize the throughput of large amounts of data. The HDFS cluster includes a NameNode node and several DataNode nodes. These two types of nodes have different responsibilities, but they cooperate with each other to complete their different tasks through work in different modes.(2) MapReduce Programming Framework. MapReduce is a programming model proposed by Google for parallel operations on large-scale data sets [8]. A MapReduce job contains a large number of Map and Reduce operation pairs. Map operations generally perform data operations similar to filtering, sorting, and data conversion. Reduce operations are generally used to complete data aggregation operations. The MapReduce workflow is shown in Figure 3.Figure 3
MapReduce work flow chart.According to the characteristics of the task, the data processing process is generally divided into two stages: Map and Reduce: in the Map stage, the Map task reads input file blocks, analyzes the data in parallel, and saves the processed intermediate results in the Map task node. In the Reduce phase, the Reduce task reads and merges the intermediate execution results of multiple Map tasks. Both Map tasks and Reduce tasks can be executed in parallel, which can speed up the overall processing speed by increasing the number of computing nodes. The parameters required for cross-border e-commerce smart cost prediction include e-commerce cost, e-commerce price, and e-commerce quantity.(3) HBase Distributed Database. HBase Distributed Database is an open source implementation of Google Big-table, which imitates and provides all the functions of the Big-table database based on the Google file system. The HBase data model is a sorted, multidimensional, sparse, long-term mapping table stored on the hard disk. HBase is mainly used to store unstructured and semistructured loose data.


#### 2.3.2. Spark Cloud Computing Platform

Spark is a general parallel computing framework developed by UC Berkeley AMP Lab based on the MapReduce computing framework [9]. Based on the advantages of MapReduce, it saves the intermediate results of tasks directly in memory. The running architecture of Spark is shown in Figure 4.Figure 4
Spark running architecture diagram.The task control node (Driver Program) sends the partitioned task set to the cluster’s running job task node (Worker Node) through the cluster resource management service (Cluster Manager) and executes the corresponding process (Executor) on each node.RDD is the core of Spark and the foundation of the entire Spark architecture. All operations of Spark are implemented on the basis of RDD. RDD is a data collection that has a good fault tolerance mechanism and can be executed in parallel. RDD can be created from an existing data set in memory through the parallelize function, or from a file through the textFile function. At the same time, RDD provides transformations and actions to operate on RDD data sets. The conversion can be converted from an existing RDD to a new RDD by functions such as map, filter, and join. The action is to transfer the running result on the RDD data set back to the driver or write it to the storage system, such as reduce, count, saveAsTextFile, and other functional operations.


## 2.1. Cloud Computing Concepts and Characteristics

Cloud computing is an Internet-based computing method. In this way, shared software and hardware resources and information can be provided to computers and other devices on demand [6]. Cloud computing is a computing mode that integrates large-scale computing, storage, applications, and other decentralized computing resources to work together and provides users with infrastructure, platforms, software, applications, and other services through the Internet. The characteristics of cloud computing are summarized as follows:
(1)
Ultralarge scale: cloud computing service providers have large-scale server groups. Google has more than 1 million cloud computing servers, and every cloud computing service provider such as Amazon, IBM, and Microsoft has at least several hundred thousand. The server “cloud” can give users advanced computing power(2)
Virtualization: the biggest feature of the cloud computing platform at the current stage of development is to rely on a series of technologies such as virtualization to realize the virtualized control, management, scheduling, and application of hardware resources. Users can use network resources provided by cloud service providers through virtual platforms, but they can complete complex calculations that cannot be solved by local computers(3)
Scalable: in the cloud computing system, the number of servers can be expanded at any time, and more computing resources can enhance the processing capacity of cloud computing(4)
On-demand service: in cloud computing applications, users can purchase cloud services according to their own needs(5)
High reliability: the application runs on the server side, the calculation is processed by the server side, and the generated data is also stored on the server side. When a server has a problem, the task will continue to run by other servers, ensuring the normal progress of applications and calculations, users do not need to back up, and the data is automatically restored and saved on the server(6)
Low cost: the operation of “cloud” enables enterprises to reduce the high operating costs of data centers, and cloud service providers charge according to user needs


## 2.2. Cloud Computing Service Model

Cloud computing has three service models, Software as a Service (SaaS), Platform as a Service (PaaS), and Infrastructure as a Service (IaaS). The cloud computing service model is shown in Figure1.Figure 1
Cloud computing service model.


### 2.2.1. Software as a Service (SaaS)

SaaS provides access to complete programs as a service. SaaS service providers uniformly deploy application service software on the server and divide and price the application service software according to specifications. Users can pay service fees through the Internet to enjoy application software services. The quantity and use time of application software can be customized according to user needs.


### 2.2.2. Platform as a Service (PaaS)

PaaS is a basic platform service used to generate various applications. PaaS service providers can provide basic platform services to users. Users can purchase platform services from PaaS providers according to their own R&D needs to customize the R&D platform.


### 2.2.3. Infrastructure as a Service (IaaS)

IaaS is an infrastructure service that provides a workplace for publishing, running, and processing virtual machines and storage space. IaaS service providers provide services to users based on the granularity of virtual resources. IaaS provides the possibility of real-time scalability of computing resources and on-demand storage devices.


## 2.2.1. Software as a Service (SaaS)

SaaS provides access to complete programs as a service. SaaS service providers uniformly deploy application service software on the server and divide and price the application service software according to specifications. Users can pay service fees through the Internet to enjoy application software services. The quantity and use time of application software can be customized according to user needs.


## 2.2.2. Platform as a Service (PaaS)

PaaS is a basic platform service used to generate various applications. PaaS service providers can provide basic platform services to users. Users can purchase platform services from PaaS providers according to their own R&D needs to customize the R&D platform.


## 2.2.3. Infrastructure as a Service (IaaS)

IaaS is an infrastructure service that provides a workplace for publishing, running, and processing virtual machines and storage space. IaaS service providers provide services to users based on the granularity of virtual resources. IaaS provides the possibility of real-time scalability of computing resources and on-demand storage devices.


## 2.3. Cloud Computing-Related Technologies

### 2.3.1. Hadoop Cloud Computing Platform

Hadoop is a distributed system basic framework developed by Apache Software Foundation, which allows users to ignore the underlying details when developing programs and focus on the development of programming models [7]. Hadoop includes three main components: distributed file system (Hadoop Distributed File System, HDFS), MapReduce programming framework, and distributed database HBase.(1) HDFS. HDFS is designed and inspired by Google’s file system GFS (Google File System, GFS) and is highly fault-tolerant. HDFS is a reliable and fault-tolerant file system suitable for low-cost storage of large-scale data. The organization structure of HDFS is shown in Figure 2.Figure 2
Organizational structure of HDFS.The files in HDFS are written once and read multiple times, and the system does not need to be deployed on expensive and stable hardware devices. HDFS adopts the master/slave architecture, which can realize applications that optimize the throughput of large amounts of data. The HDFS cluster includes a NameNode node and several DataNode nodes. These two types of nodes have different responsibilities, but they cooperate with each other to complete their different tasks through work in different modes.(2) MapReduce Programming Framework. MapReduce is a programming model proposed by Google for parallel operations on large-scale data sets [8]. A MapReduce job contains a large number of Map and Reduce operation pairs. Map operations generally perform data operations similar to filtering, sorting, and data conversion. Reduce operations are generally used to complete data aggregation operations. The MapReduce workflow is shown in Figure 3.Figure 3
MapReduce work flow chart.According to the characteristics of the task, the data processing process is generally divided into two stages: Map and Reduce: in the Map stage, the Map task reads input file blocks, analyzes the data in parallel, and saves the processed intermediate results in the Map task node. In the Reduce phase, the Reduce task reads and merges the intermediate execution results of multiple Map tasks. Both Map tasks and Reduce tasks can be executed in parallel, which can speed up the overall processing speed by increasing the number of computing nodes. The parameters required for cross-border e-commerce smart cost prediction include e-commerce cost, e-commerce price, and e-commerce quantity.(3) HBase Distributed Database. HBase Distributed Database is an open source implementation of Google Big-table, which imitates and provides all the functions of the Big-table database based on the Google file system. The HBase data model is a sorted, multidimensional, sparse, long-term mapping table stored on the hard disk. HBase is mainly used to store unstructured and semistructured loose data.


### 2.3.2. Spark Cloud Computing Platform

Spark is a general parallel computing framework developed by UC Berkeley AMP Lab based on the MapReduce computing framework [9]. Based on the advantages of MapReduce, it saves the intermediate results of tasks directly in memory. The running architecture of Spark is shown in Figure 4.Figure 4
Spark running architecture diagram.The task control node (Driver Program) sends the partitioned task set to the cluster’s running job task node (Worker Node) through the cluster resource management service (Cluster Manager) and executes the corresponding process (Executor) on each node.RDD is the core of Spark and the foundation of the entire Spark architecture. All operations of Spark are implemented on the basis of RDD. RDD is a data collection that has a good fault tolerance mechanism and can be executed in parallel. RDD can be created from an existing data set in memory through the parallelize function, or from a file through the textFile function. At the same time, RDD provides transformations and actions to operate on RDD data sets. The conversion can be converted from an existing RDD to a new RDD by functions such as map, filter, and join. The action is to transfer the running result on the RDD data set back to the driver or write it to the storage system, such as reduce, count, saveAsTextFile, and other functional operations.


## 2.3.1. Hadoop Cloud Computing Platform

Hadoop is a distributed system basic framework developed by Apache Software Foundation, which allows users to ignore the underlying details when developing programs and focus on the development of programming models [7]. Hadoop includes three main components: distributed file system (Hadoop Distributed File System, HDFS), MapReduce programming framework, and distributed database HBase.(1) HDFS. HDFS is designed and inspired by Google’s file system GFS (Google File System, GFS) and is highly fault-tolerant. HDFS is a reliable and fault-tolerant file system suitable for low-cost storage of large-scale data. The organization structure of HDFS is shown in Figure 2.Figure 2
Organizational structure of HDFS.The files in HDFS are written once and read multiple times, and the system does not need to be deployed on expensive and stable hardware devices. HDFS adopts the master/slave architecture, which can realize applications that optimize the throughput of large amounts of data. The HDFS cluster includes a NameNode node and several DataNode nodes. These two types of nodes have different responsibilities, but they cooperate with each other to complete their different tasks through work in different modes.(2) MapReduce Programming Framework. MapReduce is a programming model proposed by Google for parallel operations on large-scale data sets [8]. A MapReduce job contains a large number of Map and Reduce operation pairs. Map operations generally perform data operations similar to filtering, sorting, and data conversion. Reduce operations are generally used to complete data aggregation operations. The MapReduce workflow is shown in Figure 3.Figure 3
MapReduce work flow chart.According to the characteristics of the task, the data processing process is generally divided into two stages: Map and Reduce: in the Map stage, the Map task reads input file blocks, analyzes the data in parallel, and saves the processed intermediate results in the Map task node. In the Reduce phase, the Reduce task reads and merges the intermediate execution results of multiple Map tasks. Both Map tasks and Reduce tasks can be executed in parallel, which can speed up the overall processing speed by increasing the number of computing nodes. The parameters required for cross-border e-commerce smart cost prediction include e-commerce cost, e-commerce price, and e-commerce quantity.(3) HBase Distributed Database. HBase Distributed Database is an open source implementation of Google Big-table, which imitates and provides all the functions of the Big-table database based on the Google file system. The HBase data model is a sorted, multidimensional, sparse, long-term mapping table stored on the hard disk. HBase is mainly used to store unstructured and semistructured loose data.


## 2.3.2. Spark Cloud Computing Platform

Spark is a general parallel computing framework developed by UC Berkeley AMP Lab based on the MapReduce computing framework [9]. Based on the advantages of MapReduce, it saves the intermediate results of tasks directly in memory. The running architecture of Spark is shown in Figure 4.Figure 4
Spark running architecture diagram.The task control node (Driver Program) sends the partitioned task set to the cluster’s running job task node (Worker Node) through the cluster resource management service (Cluster Manager) and executes the corresponding process (Executor) on each node.RDD is the core of Spark and the foundation of the entire Spark architecture. All operations of Spark are implemented on the basis of RDD. RDD is a data collection that has a good fault tolerance mechanism and can be executed in parallel. RDD can be created from an existing data set in memory through the parallelize function, or from a file through the textFile function. At the same time, RDD provides transformations and actions to operate on RDD data sets. The conversion can be converted from an existing RDD to a new RDD by functions such as map, filter, and join. The action is to transfer the running result on the RDD data set back to the driver or write it to the storage system, such as reduce, count, saveAsTextFile, and other functional operations.


## 3. BP Neural Network

### 3.1. Principle of BP Neural Network

BP neural network is the abbreviation of error back propagation neural network. It is composed of an input layer, one or more hidden layers, and an output layer, and each layer is composed of a certain number of neurons [10]. These neurons are interrelated, and the neurons in adjacent layers are connected with each other, but there is no connection between the neurons in each layer. Such connection constitutes a hierarchical neural network system. The topology of BP neural network is shown in Figure 5.Figure 5
Topology of BP neural network.When the BP neural network obtains an input signal, the signal is transmitted and calculated from the input layer neuron to the hidden layer neuron and then transmitted from the hidden layer neuron to the output layer neuron, and finally, the prediction result is output by the output layer neuron. This is a process of state update layer by layer and a forward propagation process of the network. If there is an error between the output budget result and the actual expected value, the network system will transfer the obtained error from the output layer to the input layer layer by layer, and in the transmission process, modify the connection weights of each layer, redistribute the network weights, and reduce the error until a satisfactory result is obtained. This process is called network back propagation process. The above process is repeated until the error meets the training error requirements, or the training reaches the maximum number of training steps, and the learning is completed. Once the BP neural network is learned, the prediction system only carries out forward propagation, and there is no back propagation of error. To sum up, the learning process of BP neural network is the process of continuously adjusting the connection weight of each layer.


### 3.2. Mathematical Description of BP Neural Network Algorithm

BP neural network algorithm is an artificial neural network suitable for multilayer neural network under tutor training. Its convergence law is carried out through the steepest gradient descent method. The following is a mathematical description of the artificial neural network:Assuming an artificial network with a total ofL layers and n nodes, the nodes of each layer except the input node can only obtain information from the neural network of the previous layer. In the same way, each layer of nodes outside the output node only transmits information to its next layer of nodes, and the activation function of each node of the neural network is set to Sigmoid type [11]. In order to make the whole process easier to understand, suppose that the output layer of the entire neural network has only one node y. Now suppose that xk,yk,k=1,2,⋯,N is the training data, oi is the output of the node i, and oik is the output of the node i corresponding to the xk,yk sample. When the input of the j unit of the l layer is the k sample, the calculation formula for the input of node j is
(1)netijl=∑jwijlojkl−1,(2)ojkl=fnetjkl,where ojkl represents the l layer, when the k sample is input, the output of the j unit node. The calculation method of the error function is
(3)Ek=12∑lylk−y¯lk2,where y¯lk is the actual output of unit j. The calculation formula of the total error is
(4)E=12N∑k=1NEk.Definition:(5)δjkl=∂Ek∂netjkl.Then:(6)∂Ek∂wijl=∂Ek∂netjkl∂netjkl∂wijl=∂Ek∂netjklojkl−1=δjklojkl−1.Then, there are(7)δjkl=∑mδmkl+1wmjl+1f′netjkl,∂Ek∂wijl=δjklojkl−1.The specific steps of the BP neural network algorithm are as follows:(1)
Initialize the weight of neural network(2)
The error of repeated iteration meets the following requirements:(8)E=12N∑k=1NEk<εwhere ε represents the preset accuracy.During thek=1 to N process:Positive direction:ojkl−1, netjkl, and y¯lk of each layer are calculated according to the calculationReverse: Calculate theδjkl of each unit from 2 to L-2Update weight:(9)wij=wij−μ∂E∂wij,μ>0(3)
The algorithm endsIn the training process, the sample is given randomly when needed. In addition, the momentum and learning efficiency of the neural network need to be changed according to the number of iterations.


## 3.1. Principle of BP Neural Network

BP neural network is the abbreviation of error back propagation neural network. It is composed of an input layer, one or more hidden layers, and an output layer, and each layer is composed of a certain number of neurons [10]. These neurons are interrelated, and the neurons in adjacent layers are connected with each other, but there is no connection between the neurons in each layer. Such connection constitutes a hierarchical neural network system. The topology of BP neural network is shown in Figure 5.Figure 5
Topology of BP neural network.When the BP neural network obtains an input signal, the signal is transmitted and calculated from the input layer neuron to the hidden layer neuron and then transmitted from the hidden layer neuron to the output layer neuron, and finally, the prediction result is output by the output layer neuron. This is a process of state update layer by layer and a forward propagation process of the network. If there is an error between the output budget result and the actual expected value, the network system will transfer the obtained error from the output layer to the input layer layer by layer, and in the transmission process, modify the connection weights of each layer, redistribute the network weights, and reduce the error until a satisfactory result is obtained. This process is called network back propagation process. The above process is repeated until the error meets the training error requirements, or the training reaches the maximum number of training steps, and the learning is completed. Once the BP neural network is learned, the prediction system only carries out forward propagation, and there is no back propagation of error. To sum up, the learning process of BP neural network is the process of continuously adjusting the connection weight of each layer.


## 3.2. Mathematical Description of BP Neural Network Algorithm

BP neural network algorithm is an artificial neural network suitable for multilayer neural network under tutor training. Its convergence law is carried out through the steepest gradient descent method. The following is a mathematical description of the artificial neural network:Assuming an artificial network with a total ofL layers and n nodes, the nodes of each layer except the input node can only obtain information from the neural network of the previous layer. In the same way, each layer of nodes outside the output node only transmits information to its next layer of nodes, and the activation function of each node of the neural network is set to Sigmoid type [11]. In order to make the whole process easier to understand, suppose that the output layer of the entire neural network has only one node y. Now suppose that xk,yk,k=1,2,⋯,N is the training data, oi is the output of the node i, and oik is the output of the node i corresponding to the xk,yk sample. When the input of the j unit of the l layer is the k sample, the calculation formula for the input of node j is
(1)netijl=∑jwijlojkl−1,(2)ojkl=fnetjkl,where ojkl represents the l layer, when the k sample is input, the output of the j unit node. The calculation method of the error function is
(3)Ek=12∑lylk−y¯lk2,where y¯lk is the actual output of unit j. The calculation formula of the total error is
(4)E=12N∑k=1NEk.Definition:(5)δjkl=∂Ek∂netjkl.Then:(6)∂Ek∂wijl=∂Ek∂netjkl∂netjkl∂wijl=∂Ek∂netjklojkl−1=δjklojkl−1.Then, there are(7)δjkl=∑mδmkl+1wmjl+1f′netjkl,∂Ek∂wijl=δjklojkl−1.The specific steps of the BP neural network algorithm are as follows:(1)
Initialize the weight of neural network(2)
The error of repeated iteration meets the following requirements:(8)E=12N∑k=1NEk<εwhere ε represents the preset accuracy.During thek=1 to N process:Positive direction:ojkl−1, netjkl, and y¯lk of each layer are calculated according to the calculationReverse: Calculate theδjkl of each unit from 2 to L-2Update weight:(9)wij=wij−μ∂E∂wij,μ>0(3)
The algorithm endsIn the training process, the sample is given randomly when needed. In addition, the momentum and learning efficiency of the neural network need to be changed according to the number of iterations.


## 4. Theories Related to Cross-Border E-Commerce Logistics Costs

### 4.1. Concept and Characteristics of Cross-Border E-Commerce

Cross-border e-commerce refers to the use of existing industrial platforms and resource advantages to explore specific cross-border e-commerce comprehensive service system and basic information standards and interface specifications such as online customs clearance, inspection and quarantine, tax rebate, and foreign exchange settlement involved in cross-border e-commerce import and export. Realize the standardized information flow between customs, national inspection, national taxation, foreign management, and other departments and e-commerce enterprises and logistics supporting enterprises [12]. Cross-border e-commerce is a global, paperless, and direct international trade activity. Transaction subjects in different customs territories reach a transaction agreement on the e-commerce platform, make payment and settlement through various financial payment institutions at home and abroad, and then send goods to consumers through cross-border logistics to complete the transaction.Cross-border e-commerce is a new trade mode relying on the Internet and cross-border logistics. Compared with traditional export e-commerce, it can meet customer needs more quickly and conveniently and has the following characteristics:(1)
Openness and globality: cross-border e-commerce is different from the traditional form of foreign trade. The information of e-commerce enterprises can be displayed on the web page, which increases more trade opportunities for foreign trade enterprises and saves a lot of human and material resources. At the same time, without the limitation of time and place, it has flourished all over the world(2)
Multilateralization: multilateralization is reflected in that when e-commerce enterprises and customers reach a transaction agreement, they may use the transaction platform of country A to reach transaction and use the payment platform of country B to make payment, and the logistics institutions of country C carry out logistics delivery according to the requirements of orders. The characteristics of cross-border e-commerce multilateralization are very obvious(3)
Directness: cross-border e-commerce enterprises can display the specific information of commodities through the network service platform and update them at any time. Customers can directly query the products they need on the network service platform, conduct commodity transactions through the service platform, and complete the signing of purchase and sales contracts. It is direct and different from traditional foreign trade(4)
Low cost: the e-commerce activities carried out by cross-border e-commerce enterprises are completed on their own web pages or network service platforms, and the delivery of commodity ownership is completed online, which greatly reduces the time cost and labor cost and improves the work efficiency


### 4.2. Concept and Classification of Logistics Cost

Logistics cost refers to the monetary performance of materialized labor and live labor consumed in enterprise logistics activities [13]. It includes the summation of human, material, and financial resources consumed in the process of transportation, storage, packaging, loading and unloading, circulation and processing, logistics information, and logistics management, as well as the working capital occupation cost, inventory risk cost, and inventory insurance cost related to inventory. Among them, logistics transportation cost is a part of logistics cost. Logistics transportation costs mainly include labor costs, such as transportation personnel wages and benefits; operating expenses, such as fuel cost of operating vehicles, depreciation, and highway transportation management fee; and other expenses, such as travel expenses.Logistics transportation costs can be classified into several categories:(1)
According to different transportation modes, logistics transportation cost can be divided into road transportation cost, railway transportation cost, water transportation cost, air transportation cost, and pipeline transportation cost(2)
According to the cost characteristics, logistics transportation cost can be divided into fixed transportation cost and variable transportation cost. Fixed transportation cost refers to the cost that does not change with the change of transportation volume and transportation mileage. Variable transportation cost changes with the change of transportation volume and transportation mileage(3)
According to different goods delivery batches, the logistics transportation cost can be divided into vehicle transportation cost and LCL transportation cost. Vehicle transportation cost refers to the freight calculated and charged according to the freight rate of the vehicle. LCL transportation cost refers to the freight charged according to the freight rate of LCL transportation when the goods are delivered sporadically, and the goods are less than the full vehicle and the whole batch tonnage, and the goods are calculated according to the actual weight(4)
According to cost concealment, logistics transportation cost can be divided into explicit transportation cost and implicit transportation cost. Explicit transportation cost refers to the actual expenditure that can be seen in the transportation process, including the monetary performance of various materialized labor and live labor consumed in the transportation process. Implicit transportation cost is relative to explicit transportation cost. It is hidden, difficult to avoid, and difficult to quantify. It mainly includes the increased cost of empty vehicle without cargo, the increased cost of convective transportation, the increased cost of circuitous transportation, the increased cost of repeated transportation, the increased cost of over distance transportation, and the increased cost of improper selection of transportation capacity


## 4.1. Concept and Characteristics of Cross-Border E-Commerce

Cross-border e-commerce refers to the use of existing industrial platforms and resource advantages to explore specific cross-border e-commerce comprehensive service system and basic information standards and interface specifications such as online customs clearance, inspection and quarantine, tax rebate, and foreign exchange settlement involved in cross-border e-commerce import and export. Realize the standardized information flow between customs, national inspection, national taxation, foreign management, and other departments and e-commerce enterprises and logistics supporting enterprises [12]. Cross-border e-commerce is a global, paperless, and direct international trade activity. Transaction subjects in different customs territories reach a transaction agreement on the e-commerce platform, make payment and settlement through various financial payment institutions at home and abroad, and then send goods to consumers through cross-border logistics to complete the transaction.Cross-border e-commerce is a new trade mode relying on the Internet and cross-border logistics. Compared with traditional export e-commerce, it can meet customer needs more quickly and conveniently and has the following characteristics:(1)
Openness and globality: cross-border e-commerce is different from the traditional form of foreign trade. The information of e-commerce enterprises can be displayed on the web page, which increases more trade opportunities for foreign trade enterprises and saves a lot of human and material resources. At the same time, without the limitation of time and place, it has flourished all over the world(2)
Multilateralization: multilateralization is reflected in that when e-commerce enterprises and customers reach a transaction agreement, they may use the transaction platform of country A to reach transaction and use the payment platform of country B to make payment, and the logistics institutions of country C carry out logistics delivery according to the requirements of orders. The characteristics of cross-border e-commerce multilateralization are very obvious(3)
Directness: cross-border e-commerce enterprises can display the specific information of commodities through the network service platform and update them at any time. Customers can directly query the products they need on the network service platform, conduct commodity transactions through the service platform, and complete the signing of purchase and sales contracts. It is direct and different from traditional foreign trade(4)
Low cost: the e-commerce activities carried out by cross-border e-commerce enterprises are completed on their own web pages or network service platforms, and the delivery of commodity ownership is completed online, which greatly reduces the time cost and labor cost and improves the work efficiency


## 4.2. Concept and Classification of Logistics Cost

Logistics cost refers to the monetary performance of materialized labor and live labor consumed in enterprise logistics activities [13]. It includes the summation of human, material, and financial resources consumed in the process of transportation, storage, packaging, loading and unloading, circulation and processing, logistics information, and logistics management, as well as the working capital occupation cost, inventory risk cost, and inventory insurance cost related to inventory. Among them, logistics transportation cost is a part of logistics cost. Logistics transportation costs mainly include labor costs, such as transportation personnel wages and benefits; operating expenses, such as fuel cost of operating vehicles, depreciation, and highway transportation management fee; and other expenses, such as travel expenses.Logistics transportation costs can be classified into several categories:(1)
According to different transportation modes, logistics transportation cost can be divided into road transportation cost, railway transportation cost, water transportation cost, air transportation cost, and pipeline transportation cost(2)
According to the cost characteristics, logistics transportation cost can be divided into fixed transportation cost and variable transportation cost. Fixed transportation cost refers to the cost that does not change with the change of transportation volume and transportation mileage. Variable transportation cost changes with the change of transportation volume and transportation mileage(3)
According to different goods delivery batches, the logistics transportation cost can be divided into vehicle transportation cost and LCL transportation cost. Vehicle transportation cost refers to the freight calculated and charged according to the freight rate of the vehicle. LCL transportation cost refers to the freight charged according to the freight rate of LCL transportation when the goods are delivered sporadically, and the goods are less than the full vehicle and the whole batch tonnage, and the goods are calculated according to the actual weight(4)
According to cost concealment, logistics transportation cost can be divided into explicit transportation cost and implicit transportation cost. Explicit transportation cost refers to the actual expenditure that can be seen in the transportation process, including the monetary performance of various materialized labor and live labor consumed in the transportation process. Implicit transportation cost is relative to explicit transportation cost. It is hidden, difficult to avoid, and difficult to quantify. It mainly includes the increased cost of empty vehicle without cargo, the increased cost of convective transportation, the increased cost of circuitous transportation, the increased cost of repeated transportation, the increased cost of over distance transportation, and the increased cost of improper selection of transportation capacity


## 5. Spark-Based BP Neural Network Cross-Border E-Commerce Logistics Cost Intelligent Prediction Method

This research is oriented to the logistics cost of cross-border e-commerce, using BP neural network, combined with the Spark cloud computing platform, to predict the logistics cost of cross-border e-commerce.


### 5.1. Determine the Network Structure

The important premise of using BP neural network for prediction is to determine a reasonable network structure. Whether the network structure is reasonable or not directly affects the accuracy of the prediction results [14]. When constructing the BP neural network structure, the principles of reducing system scale, reducing system complexity, and shortening learning time should be followed. By determining the number of neurons in the input layer, the number of neurons in the hidden layer, the number of neurons in the output layer, and the activation function of the neural network, a reasonable neural network structure is obtained.


#### 5.1.1. Determination of the Number of Neurons in the Input Layer

The number of input neurons in the BP neural network is determined according to the problem to be solved and the way the data is expressed, which refers to the number of factors that affect the output result. The number of neurons in the output layer of the BP neural network of the cross-border e-commerce logistics cost is the number of factors that affect the cross-border e-commerce logistics cost.


#### 5.1.2. Determination of the Number of neurons in the Hidden Layer

In the BP neural network, neurons in the hidden layer play a role in extracting and storing the internal laws of the sample. The system assigns several weight parameters to each hidden layer neuron to enhance the mapping function of the neural network. Moreover, the number of hidden layer neurons directly affects the nonlinear performance of the network and also determines the complexity of the problem to be solved. The basic steps for determining the number of hidden layer nodes are as follows:By determining the value range of the number of hidden layer nodes, the number of hidden layer nodes is determined after many training processes, the original sample data is input, the network is studied, the error is compared, and the number of nodes is adjusted repeatedly to reduce the error and determine the best number. Generally, for the three-layer forward network, the number of hidden layer neurons is(10)N<∑i=0nCij,where N represents the number of samples, j represents the number of neurons in the hidden layer, and n represents the number of neurons in the input layer. If i>j, Cij=0; in the selection formula of the number of neurons in the hidden layer j, there are mainly two forms, namely,
(11)j=n+m+α,(12)j=log2n,where m represents the number of neurons in the input layer and α represents a constant from 1 to 10.


#### 5.1.3. Determination of the Number of Neurons in the Output Layer

Similar to the neurons in the input layer, output neurons are the purpose of prediction, and the number of neurons is determined by the type of prediction result. The result of cross-border e-commerce logistics cost prediction is the freight cost, so the number of neurons in the output layer is 1.


#### 5.1.4. Determination of Neuron Activation Function

In the construction of the BP neural network, in order to facilitate the learning of the input signal and converge the input signal, the tansig function of the tangent form of the sigmoid function is selected as the activation of the hidden layer neuron function. In order to make the output of the entire network can take any value, the linear function Purelin is used as the transfer function of the neurons in the output layer.


### 5.2. Learning Sample Preprocessing

The number of samples in the input layer of the BP neural network determines the eigenvalues of the network. The more samples input in the input layer, the more eigenvalues that the BP neural network needs to recognize. In order to avoid the loss of indicators with fewer values or the system prematurely falling into the saturation zone due to these differences, the data samples input by the input layer need to be normalized. Considering the characteristics of cross-border e-commerce logistics cost drivers and their impact on the results of cross-border e-commerce logistics cost prediction, the most commonly used data sample preprocessing method is calculated as(13)Yi=1,xmin≤xi,xi−xminxmax−xmin,xmin<xi<xmax,0,xi≤xmax,where Yi represents the normalized result of data i, xi represents the actual value of data i, and xmax and xmin represent the maximum and minimum values of the group of data, respectively.


### 5.3. Selection of Learning Parameters

The learning parameters of the BP neural network include initial weights, thresholds, and learning rate. The following specifically introduces the selection method of learning parameters.


#### 5.3.1. Determination of Initial Weight and Threshold

The initial weight and threshold of BP neural network directly affect the learning results of neural network. The size of initial weight and threshold is related to the convergence of output value in the learning process, whether it can reach the local minimum and the convergence speed of computer network. The basic requirement for the selection of the initial position is that after the initial weight input is accumulated, it can ensure that the output value of each trivial element is close to zero. Based on the above principles, the initial weight and threshold are generally selected randomly between−1,1.


#### 5.3.2. The Determination of the Learning Rate

The network learning rate determines the amount of change of the weight and the threshold generated in each cycle [15]; the relationship between the weight and the threshold and the learning rate is
(14)Δωij=−λ∂Ek∂ωij0<λ<1,Δθi=λδi0<λ<1,δi=−∂Ek∂ai,where Δωij represents the change in connection weights, Δθi represents the threshold change, δi represents the network error correction, ai represents the network input value, and λ represents the learning rate.


### 5.4. Determination of Momentum Coefficient

The momentum term reflects the influence of the last weight change on momentum through the momentum coefficient. The value range of the momentum coefficient is0,1. When the momentum constant is 0, the weight change is obtained according to the gradient. When the momentum constant is 1, the new weight change is equal to the last weight change. After introducing momentum, the iterative relationship that connects the weight and the threshold is
(15)ωijn+1=ωijn+Δωij+ρωijn−ωijn−1,θin+1=θin+Δθi+ρθin−θin−1,where ρωijn−ωijn−1 represents the momentum term and ρ represents the momentum factor.


### 5.5. Distributed BP Neural Network Parallel Computing

When carrying out cross-border e-commerce logistics cost prediction, it is necessary to train massive amounts of data to make the training results meet the requirements. Therefore, this article combines the Spark cloud computing platform with BP neural network and uses the advantages of both to predict the logistics cost of cross-border e-commerce.The BP neural network algorithm needs to be trained under multiple nodes. The calculation method of the final predicted value ofx¯ is
(16)x¯=∑i=1nwixi,where xi represents the predicted value of the i node and wi represents the weight of the i node. The standard error of each node is expressed as
(17)E=12t−y¯2,where t represents the target value of each input training set of the BP neural network. Implementation steps of cross-border e-commerce logistics cost prediction algorithm under Spark platform are as follows:
(1)
Obtain massive data for cross-border e-commerce logistics cost prediction from the distributed file system of the Spark platform. The Map Partition function in Spark divides the prediction data set intoψ parts, where ψ is the number of Spark nodes(2)
The predicted result is obtained by running the designed BP neural network algorithm in the Map function of each node, which is equivalent toψ neural networks(3)
Finally, through the Reduce function, the predicted values ofψ nodes are subjected to weight decision to obtain the final predicted valueThrough the above steps, the intelligent forecast of cross-border e-commerce logistics costs is realized.


## 5.1. Determine the Network Structure

The important premise of using BP neural network for prediction is to determine a reasonable network structure. Whether the network structure is reasonable or not directly affects the accuracy of the prediction results [14]. When constructing the BP neural network structure, the principles of reducing system scale, reducing system complexity, and shortening learning time should be followed. By determining the number of neurons in the input layer, the number of neurons in the hidden layer, the number of neurons in the output layer, and the activation function of the neural network, a reasonable neural network structure is obtained.


### 5.1.1. Determination of the Number of Neurons in the Input Layer

The number of input neurons in the BP neural network is determined according to the problem to be solved and the way the data is expressed, which refers to the number of factors that affect the output result. The number of neurons in the output layer of the BP neural network of the cross-border e-commerce logistics cost is the number of factors that affect the cross-border e-commerce logistics cost.


### 5.1.2. Determination of the Number of neurons in the Hidden Layer

In the BP neural network, neurons in the hidden layer play a role in extracting and storing the internal laws of the sample. The system assigns several weight parameters to each hidden layer neuron to enhance the mapping function of the neural network. Moreover, the number of hidden layer neurons directly affects the nonlinear performance of the network and also determines the complexity of the problem to be solved. The basic steps for determining the number of hidden layer nodes are as follows:By determining the value range of the number of hidden layer nodes, the number of hidden layer nodes is determined after many training processes, the original sample data is input, the network is studied, the error is compared, and the number of nodes is adjusted repeatedly to reduce the error and determine the best number. Generally, for the three-layer forward network, the number of hidden layer neurons is(10)N<∑i=0nCij,where N represents the number of samples, j represents the number of neurons in the hidden layer, and n represents the number of neurons in the input layer. If i>j, Cij=0; in the selection formula of the number of neurons in the hidden layer j, there are mainly two forms, namely,
(11)j=n+m+α,(12)j=log2n,where m represents the number of neurons in the input layer and α represents a constant from 1 to 10.


### 5.1.3. Determination of the Number of Neurons in the Output Layer

Similar to the neurons in the input layer, output neurons are the purpose of prediction, and the number of neurons is determined by the type of prediction result. The result of cross-border e-commerce logistics cost prediction is the freight cost, so the number of neurons in the output layer is 1.


### 5.1.4. Determination of Neuron Activation Function

In the construction of the BP neural network, in order to facilitate the learning of the input signal and converge the input signal, the tansig function of the tangent form of the sigmoid function is selected as the activation of the hidden layer neuron function. In order to make the output of the entire network can take any value, the linear function Purelin is used as the transfer function of the neurons in the output layer.


## 5.1.1. Determination of the Number of Neurons in the Input Layer

The number of input neurons in the BP neural network is determined according to the problem to be solved and the way the data is expressed, which refers to the number of factors that affect the output result. The number of neurons in the output layer of the BP neural network of the cross-border e-commerce logistics cost is the number of factors that affect the cross-border e-commerce logistics cost.


## 5.1.2. Determination of the Number of neurons in the Hidden Layer

In the BP neural network, neurons in the hidden layer play a role in extracting and storing the internal laws of the sample. The system assigns several weight parameters to each hidden layer neuron to enhance the mapping function of the neural network. Moreover, the number of hidden layer neurons directly affects the nonlinear performance of the network and also determines the complexity of the problem to be solved. The basic steps for determining the number of hidden layer nodes are as follows:By determining the value range of the number of hidden layer nodes, the number of hidden layer nodes is determined after many training processes, the original sample data is input, the network is studied, the error is compared, and the number of nodes is adjusted repeatedly to reduce the error and determine the best number. Generally, for the three-layer forward network, the number of hidden layer neurons is(10)N<∑i=0nCij,where N represents the number of samples, j represents the number of neurons in the hidden layer, and n represents the number of neurons in the input layer. If i>j, Cij=0; in the selection formula of the number of neurons in the hidden layer j, there are mainly two forms, namely,
(11)j=n+m+α,(12)j=log2n,where m represents the number of neurons in the input layer and α represents a constant from 1 to 10.


## 5.1.3. Determination of the Number of Neurons in the Output Layer

Similar to the neurons in the input layer, output neurons are the purpose of prediction, and the number of neurons is determined by the type of prediction result. The result of cross-border e-commerce logistics cost prediction is the freight cost, so the number of neurons in the output layer is 1.


## 5.1.4. Determination of Neuron Activation Function

In the construction of the BP neural network, in order to facilitate the learning of the input signal and converge the input signal, the tansig function of the tangent form of the sigmoid function is selected as the activation of the hidden layer neuron function. In order to make the output of the entire network can take any value, the linear function Purelin is used as the transfer function of the neurons in the output layer.


## 5.2. Learning Sample Preprocessing

The number of samples in the input layer of the BP neural network determines the eigenvalues of the network. The more samples input in the input layer, the more eigenvalues that the BP neural network needs to recognize. In order to avoid the loss of indicators with fewer values or the system prematurely falling into the saturation zone due to these differences, the data samples input by the input layer need to be normalized. Considering the characteristics of cross-border e-commerce logistics cost drivers and their impact on the results of cross-border e-commerce logistics cost prediction, the most commonly used data sample preprocessing method is calculated as(13)Yi=1,xmin≤xi,xi−xminxmax−xmin,xmin<xi<xmax,0,xi≤xmax,where Yi represents the normalized result of data i, xi represents the actual value of data i, and xmax and xmin represent the maximum and minimum values of the group of data, respectively.


## 5.3. Selection of Learning Parameters

The learning parameters of the BP neural network include initial weights, thresholds, and learning rate. The following specifically introduces the selection method of learning parameters.


### 5.3.1. Determination of Initial Weight and Threshold

The initial weight and threshold of BP neural network directly affect the learning results of neural network. The size of initial weight and threshold is related to the convergence of output value in the learning process, whether it can reach the local minimum and the convergence speed of computer network. The basic requirement for the selection of the initial position is that after the initial weight input is accumulated, it can ensure that the output value of each trivial element is close to zero. Based on the above principles, the initial weight and threshold are generally selected randomly between−1,1.


### 5.3.2. The Determination of the Learning Rate

The network learning rate determines the amount of change of the weight and the threshold generated in each cycle [15]; the relationship between the weight and the threshold and the learning rate is
(14)Δωij=−λ∂Ek∂ωij0<λ<1,Δθi=λδi0<λ<1,δi=−∂Ek∂ai,where Δωij represents the change in connection weights, Δθi represents the threshold change, δi represents the network error correction, ai represents the network input value, and λ represents the learning rate.


## 5.3.1. Determination of Initial Weight and Threshold

The initial weight and threshold of BP neural network directly affect the learning results of neural network. The size of initial weight and threshold is related to the convergence of output value in the learning process, whether it can reach the local minimum and the convergence speed of computer network. The basic requirement for the selection of the initial position is that after the initial weight input is accumulated, it can ensure that the output value of each trivial element is close to zero. Based on the above principles, the initial weight and threshold are generally selected randomly between−1,1.


## 5.3.2. The Determination of the Learning Rate

The network learning rate determines the amount of change of the weight and the threshold generated in each cycle [15]; the relationship between the weight and the threshold and the learning rate is
(14)Δωij=−λ∂Ek∂ωij0<λ<1,Δθi=λδi0<λ<1,δi=−∂Ek∂ai,where Δωij represents the change in connection weights, Δθi represents the threshold change, δi represents the network error correction, ai represents the network input value, and λ represents the learning rate.


## 5.4. Determination of Momentum Coefficient

The momentum term reflects the influence of the last weight change on momentum through the momentum coefficient. The value range of the momentum coefficient is0,1. When the momentum constant is 0, the weight change is obtained according to the gradient. When the momentum constant is 1, the new weight change is equal to the last weight change. After introducing momentum, the iterative relationship that connects the weight and the threshold is
(15)ωijn+1=ωijn+Δωij+ρωijn−ωijn−1,θin+1=θin+Δθi+ρθin−θin−1,where ρωijn−ωijn−1 represents the momentum term and ρ represents the momentum factor.


## 5.5. Distributed BP Neural Network Parallel Computing

When carrying out cross-border e-commerce logistics cost prediction, it is necessary to train massive amounts of data to make the training results meet the requirements. Therefore, this article combines the Spark cloud computing platform with BP neural network and uses the advantages of both to predict the logistics cost of cross-border e-commerce.The BP neural network algorithm needs to be trained under multiple nodes. The calculation method of the final predicted value ofx¯ is
(16)x¯=∑i=1nwixi,where xi represents the predicted value of the i node and wi represents the weight of the i node. The standard error of each node is expressed as
(17)E=12t−y¯2,where t represents the target value of each input training set of the BP neural network. Implementation steps of cross-border e-commerce logistics cost prediction algorithm under Spark platform are as follows:
(1)
Obtain massive data for cross-border e-commerce logistics cost prediction from the distributed file system of the Spark platform. The Map Partition function in Spark divides the prediction data set intoψ parts, where ψ is the number of Spark nodes(2)
The predicted result is obtained by running the designed BP neural network algorithm in the Map function of each node, which is equivalent toψ neural networks(3)
Finally, through the Reduce function, the predicted values ofψ nodes are subjected to weight decision to obtain the final predicted valueThrough the above steps, the intelligent forecast of cross-border e-commerce logistics costs is realized.


## 6. Experimental Analysis

### 6.1. Experimental Environment and Data

In order to verify the effectiveness of the cloud computing-based intelligent prediction method for cross-border e-commerce logistics costs, the experiment built a Spark platform composed of 9 nodes, and each node’s machine configuration is Intel (R) Core (TM) i7-3537U CPU@ 2.50 GHz, 8 GB RAM, 160 G hard disk space, and 100 Mbit/s network bandwidth. Spark version is 1.0.2. This article uses the ubuntu12.04 system, the JDK1.7.0_55 version is used in the experiment, and SSH is installed to ensure the communication between the nodes. In this experiment, the system is debugged through a stand-alone pseudodistribution, and a fully distributed environment built with 9 nodes is used during the performance test. Taking a cross-border e-commerce logistics enterprise as an example, the cross-border e-commerce logistics cost samples are preprocessed by using cluster analysis method, combining qualitative and quantitative methods, comprehensively considering the characteristics of cross-border e-commerce logistics cost drivers and their impact on the prediction results of cross-border e-commerce logistics cost. The input samples of the prediction model are divided into two parts: training samples and prediction samples. The training samples are used to determine the optimal weights and thresholds of the BP neural network model, and then, the optimized parameters are substituted into the BP neural network, and the prediction samples are input to obtain the prediction results.


### 6.2. Cross-Border E-Commerce Logistics Cost Prediction and Evaluation Indicators

In this paper, the prediction effect, prediction accuracy, and prediction efficiency are used as evaluation indexes. The predicted cost is compared with the actual predicted cost to measure the prediction effect. The more consistent the predicted cost is with the actual predicted cost, the better the prediction effect is. The root mean square (RMSE) of the prediction accuracy is used to measure the prediction accuracy. The smaller the RMSE value, the higher the prediction accuracy. RMSE is the main performance index to measure the advantages and disadvantages of cross-border e-commerce logistics cost prediction algorithm. The calculation formula is(18)RMSE=∑i=1nPmi−Ppi2n×100%,where n is the number of samples, Pmi is the actual cost at time i, and Ppi is the predicted cost at time i. Use the time taken to predict the cost to measure the forecasting efficiency. The shorter the forecasting time, the higher the forecasting efficiency.


### 6.3. Comparison of the Effect of Cross-Border E-Commerce Logistics Cost Prediction

In order to verify the prediction effect of the proposed method, the method of reference [4] and the method of reference [5] are used to compare with the proposed method, and the comparison results of cross-border e-commerce logistics cost prediction results of different methods are shown in Figure 6.Figure 6
Comparison results of cross-border e-commerce logistics cost prediction results with different methods.It can be seen from Figure6 that the results of cross-border e-commerce logistics cost predictions based on the method of reference [4] and the method of reference [5] are quite different from the actual cross-border e-commerce logistics cost prediction results. The cross-border e-commerce logistics cost prediction results of the proposed method are more consistent with the actual cross-border e-commerce logistics cost prediction results. It can be seen that, compared with the method of reference [4] and the method of reference [5], the proposed method has a better effect of predicting the cost of cross-border e-commerce logistics.


### 6.4. Comparison of the Efficiency of Cross-Border E-Commerce Logistics Cost Prediction

To further verify the prediction efficiency of the proposed method, the method of reference [4], the method of reference [5], and the proposed method are used to compare, and the comparison results of cross-border e-commerce logistics cost prediction time of different methods are shown in Figure 7.Figure 7
Comparison results of different methods of cross-border e-commerce logistics cost forecast time.It can be seen from Figure7 that with the increase of the number of prediction samples, the prediction time of cross-border e-commerce logistics cost of different methods increases. When the number of prediction samples is 800, the cross-border e-commerce logistics cost prediction time of the method of reference [4] is 44.5 s, and the cross-border e-commerce logistics cost prediction time of the method of reference [5] is 55 s, while the cross-border e-commerce logistics cost prediction time of the proposed method is only 22.5 s. It can be seen that, compared with the method of reference [4] and the method of reference [5], the cross-border e-commerce logistics cost prediction time of the proposed method is shorter, and it can effectively improve the efficiency of cross-border e-commerce logistics cost prediction. Figures 6 and 7 compare the method in this paper with the traditional method. It can be seen through simulation that the method in this paper has good predictive ability, higher accuracy, and better fault tolerance.


### 6.5. Comparison of the Accuracy of Cross-Border E-Commerce Logistics Cost Prediction

On this basis, the prediction accuracy of the proposed method is further verified. The method of reference [4], the method of reference [5], and the proposed method are compared, respectively, and the RMSE values of cross-border e-commerce logistics cost prediction of different methods are obtained. The comparison results are shown in Table 1.Table 1
Comparison results of the RMSE value of cross-border e-commerce logistics cost forecast by different methods.
Predicted sample quantity (piece)The proposed method (%)The method of reference [4] (%)The method of reference [5] (%)2003.347.989.764006.1812.8715.8360010.9717.7920.6680013.6521.4723.32According to the data in Table1, with the increase of the number of prediction samples, the RMSE value of cross-border e-commerce logistics cost prediction by different methods increases. When the number of prediction samples is 800, the RMSE value of cross-border e-commerce logistics cost prediction of the method of reference [4] is 21.47%, and the RMSE value of cross-border e-commerce logistics cost prediction of the method of reference [5] is 23.32%, while the RMSE value of cross-border e-commerce logistics cost prediction of the proposed method is only 13.65%. Therefore, compared with the methods of reference [4] and the methods of reference [5], the RMSE value of cross-border e-commerce logistics cost prediction of the proposed method is smaller and the prediction accuracy of cross-border e-commerce logistics cost is higher.


## 6.1. Experimental Environment and Data

In order to verify the effectiveness of the cloud computing-based intelligent prediction method for cross-border e-commerce logistics costs, the experiment built a Spark platform composed of 9 nodes, and each node’s machine configuration is Intel (R) Core (TM) i7-3537U CPU@ 2.50 GHz, 8 GB RAM, 160 G hard disk space, and 100 Mbit/s network bandwidth. Spark version is 1.0.2. This article uses the ubuntu12.04 system, the JDK1.7.0_55 version is used in the experiment, and SSH is installed to ensure the communication between the nodes. In this experiment, the system is debugged through a stand-alone pseudodistribution, and a fully distributed environment built with 9 nodes is used during the performance test. Taking a cross-border e-commerce logistics enterprise as an example, the cross-border e-commerce logistics cost samples are preprocessed by using cluster analysis method, combining qualitative and quantitative methods, comprehensively considering the characteristics of cross-border e-commerce logistics cost drivers and their impact on the prediction results of cross-border e-commerce logistics cost. The input samples of the prediction model are divided into two parts: training samples and prediction samples. The training samples are used to determine the optimal weights and thresholds of the BP neural network model, and then, the optimized parameters are substituted into the BP neural network, and the prediction samples are input to obtain the prediction results.


## 6.2. Cross-Border E-Commerce Logistics Cost Prediction and Evaluation Indicators

In this paper, the prediction effect, prediction accuracy, and prediction efficiency are used as evaluation indexes. The predicted cost is compared with the actual predicted cost to measure the prediction effect. The more consistent the predicted cost is with the actual predicted cost, the better the prediction effect is. The root mean square (RMSE) of the prediction accuracy is used to measure the prediction accuracy. The smaller the RMSE value, the higher the prediction accuracy. RMSE is the main performance index to measure the advantages and disadvantages of cross-border e-commerce logistics cost prediction algorithm. The calculation formula is(18)RMSE=∑i=1nPmi−Ppi2n×100%,where n is the number of samples, Pmi is the actual cost at time i, and Ppi is the predicted cost at time i. Use the time taken to predict the cost to measure the forecasting efficiency. The shorter the forecasting time, the higher the forecasting efficiency.


## 6.3. Comparison of the Effect of Cross-Border E-Commerce Logistics Cost Prediction

In order to verify the prediction effect of the proposed method, the method of reference [4] and the method of reference [5] are used to compare with the proposed method, and the comparison results of cross-border e-commerce logistics cost prediction results of different methods are shown in Figure 6.Figure 6
Comparison results of cross-border e-commerce logistics cost prediction results with different methods.It can be seen from Figure6 that the results of cross-border e-commerce logistics cost predictions based on the method of reference [4] and the method of reference [5] are quite different from the actual cross-border e-commerce logistics cost prediction results. The cross-border e-commerce logistics cost prediction results of the proposed method are more consistent with the actual cross-border e-commerce logistics cost prediction results. It can be seen that, compared with the method of reference [4] and the method of reference [5], the proposed method has a better effect of predicting the cost of cross-border e-commerce logistics.


## 6.4. Comparison of the Efficiency of Cross-Border E-Commerce Logistics Cost Prediction

To further verify the prediction efficiency of the proposed method, the method of reference [4], the method of reference [5], and the proposed method are used to compare, and the comparison results of cross-border e-commerce logistics cost prediction time of different methods are shown in Figure 7.Figure 7
Comparison results of different methods of cross-border e-commerce logistics cost forecast time.It can be seen from Figure7 that with the increase of the number of prediction samples, the prediction time of cross-border e-commerce logistics cost of different methods increases. When the number of prediction samples is 800, the cross-border e-commerce logistics cost prediction time of the method of reference [4] is 44.5 s, and the cross-border e-commerce logistics cost prediction time of the method of reference [5] is 55 s, while the cross-border e-commerce logistics cost prediction time of the proposed method is only 22.5 s. It can be seen that, compared with the method of reference [4] and the method of reference [5], the cross-border e-commerce logistics cost prediction time of the proposed method is shorter, and it can effectively improve the efficiency of cross-border e-commerce logistics cost prediction. Figures 6 and 7 compare the method in this paper with the traditional method. It can be seen through simulation that the method in this paper has good predictive ability, higher accuracy, and better fault tolerance.


## 6.5. Comparison of the Accuracy of Cross-Border E-Commerce Logistics Cost Prediction

On this basis, the prediction accuracy of the proposed method is further verified. The method of reference [4], the method of reference [5], and the proposed method are compared, respectively, and the RMSE values of cross-border e-commerce logistics cost prediction of different methods are obtained. The comparison results are shown in Table 1.Table 1
Comparison results of the RMSE value of cross-border e-commerce logistics cost forecast by different methods.
Predicted sample quantity (piece)The proposed method (%)The method of reference [4] (%)The method of reference [5] (%)2003.347.989.764006.1812.8715.8360010.9717.7920.6680013.6521.4723.32According to the data in Table1, with the increase of the number of prediction samples, the RMSE value of cross-border e-commerce logistics cost prediction by different methods increases. When the number of prediction samples is 800, the RMSE value of cross-border e-commerce logistics cost prediction of the method of reference [4] is 21.47%, and the RMSE value of cross-border e-commerce logistics cost prediction of the method of reference [5] is 23.32%, while the RMSE value of cross-border e-commerce logistics cost prediction of the proposed method is only 13.65%. Therefore, compared with the methods of reference [4] and the methods of reference [5], the RMSE value of cross-border e-commerce logistics cost prediction of the proposed method is smaller and the prediction accuracy of cross-border e-commerce logistics cost is higher.


## 7. Conclusion

The intelligent forecasting method of cross-border e-commerce logistics cost based on cloud computing proposed in this paper gives full play to the advantages of cloud computing technology. The BP neural network algorithm is used to train a large number of input and output relationships for parameters in logistics. The intelligent prediction of cross-border e-commerce logistics cost has a good effect, which can effectively improve the accuracy and efficiency of cross-border e-commerce logistics cost intelligent prediction. However, in the process of intelligent cross-border e-commerce logistics cost prediction, because the BP neural network needs to normalize the samples before inputting the samples, there is a problem of selecting decimal places and there are certain errors. Therefore, in the following research, it is necessary to further consider the choice of decimal places to improve the calculation accuracy of the BP neural network, thereby improving the accuracy of the prediction results.



---

*Source: 3838293-2022-03-29.xml*