Due to the complex topology of the connected vehicles scenario, the same vehicle may appear in the service scope of multiple RSUs at the same time. The system’s vehicles and RSU must be correctly matched in order to prevent network congestion brought on by multiple users connecting to the same RSU at once. In addition, radio resources are shared via virtualization among users with different resource needs due to MEC’s strong computing and storage capabilities. After completing system matching, the server provides bandwidth and computing power resources for users. Therefore, this section will be divided into two stages to achieve the final system optimization.
4.1. Edge Service Node Selection
Fuzzy control is an intelligent control method based on fuzzy set theory, fuzzy language variables, and fuzzy logic reasoning. It is an intelligent control algorithm that imitates human fuzzy reasoning and decision-making process in behavior. In fuzzy control, the experience of operators or experts are composed of fuzzy rules, and then the real-time signals from sensors are fuzziness; the fuzziness signals are used as the input of the fuzzy rules to complete fuzzy inference, and the output obtained after inference is added to the actuator. Fuzzy inference systems include both Mamdani and Sugeno models, both of which are used to achieve decision processing in complex systems. The latter has high complexity but little performance improvement, making it not the best choice for fuzzy inference. Therefore, a service node selection algorithm based on the fuzzy logic control principle (SNFLC) is suggested in this part, and its structure is shown in
Figure 2.
Load ratio (LR) determines whether it has enough room to store vehicle tasks. By introducing the three indicators, task mobility (TM) depicts the node’s task-forwarding effectiveness, continuous connectivity probability (CCP) gauges the node’s dependability, and performance of the service node (PSN) is determined, as shown in
Figure 3. It is important to note that the network architecture of the internet of vehicles is constantly evolving. The topology structure is assumed to be constant throughout each time slot segment in order to efficiently complete the duties that come after.
- (1)
LR
Load ratio describes the load balance of RSU at a certain time slot
. The load ratio at any node is defined by the task queue length
and cache capacity threshold
of the time slot
. The expression (8) shows that the smaller the load ratio is, the larger the remaining storage space is, and the more likely it is to successfully store vehicle tasks.
- (2)
TM
Vehicle tasks arrive at the service node in the form of data packets, and task mobility is a metric to measure the task processing rate of the node. The larger the mobility rate, the faster the task can be migrated to the MEC server for processing. The task arrival rate can be represented by using the sliding exponential average algorithm to mimic the packet arrival rate
.
where
is a constant, reflecting the correlation between the arrival rate of the task before and after and the time. Usually, the value of
is 0.1, which is used to represent the instantaneous rate.
indicates the number of tasks that reach the node in a time slot
.
is the node forwarding service rate, so the task migration rate can be expressed as the ratio of the two.
- (3)
CCP
The benchmark used to assess the node’s dependability is the constant connection probability between the vehicle and the node. The higher the probability is, the longer the connection will not be forced to terminate the task due to the signal terminal, and the connection will always exist until the end of the task processing. The Poisson distribution with density as
is satisfied by the system’s car distribution. On a road with as area denoted as
, the number of vehicles is a Poisson random variable. Therefore, the probability of having
vehicle on this road section is:
is the connection probability of the vehicle directly connecting to the RSU , and is the continuous connection probability of the vehicle directly connecting to the RSU (namely, the connectivity stability of the two). On the contrary, the probability that the vehicle fails to connect to the RSU or fails to continuously connect after establishing the connection are and , respectively. A vehicle’s likelihood of connecting to the RSU is unaffected by whether another vehicle is connected to the RSU due to the strong transceiver power of the RSU, meaning that the connection establishment process is entirely rational. Therefore, the probability that the vehicle is directly connected to the RSU is:
In a certain time slot
, the vehicles connected with the RSU in the system are called the effective vehicle set
, which can be known from the law of full probability:
Since the probability that the randomly selected vehicles in
are directly connected to the RSU is identical and independently and identically distributed, the probability of
vehicle in
follows the binomial distribution
to obtain the following formula:
where,
represents the probability that a vehicle in
belongs to the
set.
As for the above three performance indicators, it is difficult to determine which node can be used as a service node or an unloading node based solely on the size of a single item. As a result, the Mamdani system has been created, and the fuzzy values of the three indicators are input to the system’s fuzzy logic to determine the final output target node.
4.1.1. Fuzzy Variables
The entire system only makes basic disclosures—such as speed, direction, and location—while RSU and MEC servers make task queue disclosures to safeguard user privacy. The SNFLC algorithm aims to select a reliable server node RSU by integrating three performance indicators. In order to eliminate dimensional influence, the three indicators are normalized according to Equation (15) (that is, the domain of the three parameters are all (0, 1)), which can be used as the input of the algorithm [
21].
where,
represents the actual variable performance value of a service node,
are, respectively, the maximum and minimum allowed theoretically for this performance, and the three normalized performance indexes are denoted as
.
There are three types of commonly used fuzzy membership functions: triangular function, trapezoidal function and Gaussian function. The membership degree of triangular fuzzy function increases first and then decreases. It is suitable for describing well-defined nearby units. Where the definition is clear, the membership degree is the largest, but it allows a point to have the largest membership degree. The trapezoidal function is first raised and maintained for a period of time before decreasing, and its maximum membership can maintain its characteristic of maintaining a period to fit more real scenes. At the same time, when the maximum membership remains short enough, it is equal to triangular blur. Gaussian blur is the result of weighted average, which is more objective in theory. A Gaussian function is used to describe the membership degree of each fuzzy variable.
are an adjustable parameters used to correct the shape and offset point of the membership function. Meanwhile, in order to convert the normalized clear input features into fuzzy language variables, this study uses three fuzzy membership functions to fuzzify the clarity value of each feature. LR = {small, medium, large}, TM = {low, middle, high}, and CCP = {poor, general, good}, as shown in
Figure 4.
4.1.2. Fuzzy Rules
The fuzzy set is composed of overlapping parts of each language variable [
22]. In contrast, each language variable’s clear value is a member of the fuzzy set of each language variable, with varying degrees of participation. An IF-THEN rule is developed to represent the nature of this relationship and the various impacts of each parameter on node performance:
where
are the corresponding language variable values of the three variables in the Nth rule;
is the fuzzy output value of this rule, and its mathematical relationship can be described as a linear polynomial function of three performance parameters.
is a constant term with value 1, representing the coefficient of each parameter, so as to determine the relative influence degree of each feature and meet the following relationship [
23]:
To ensure the minimum fairness, any item parameter cannot be zero, that is, every characteristic plays a part in assessing node performance. Theoretically, the fuzzy system has 3 inputs, and each input variable has 3 language values, and, at most, a
rule can be established, as shown in
Table 1.
The coefficients in the linear equation describing the outcome of the rules are further determined by the fact that not all rules are reasonable. The trial-and-error method is not the best option in this work because of the large number of tasks and poor efficiency involved, while the empirical method has too many subjective factors, making it impossible to ensure the validity of the results. Therefore, the gradient descent method is used to obtain the objective and reasonable coefficients by adjusting the coefficients of the above linear polynomial functions. Its performance indicator function is defined as follows:
In order to improve the stability of the algorithm, a set of forward coefficients
that meet Lyapunov criterion are adopted, and the above functions are adjusted accordingly to obtain the modified coefficients, as shown in the following equations:
where,
is called the fuzzy basis function, and the specific expression is given in the following section. As seen from the diagram above, the system can identify a collection of appropriate dynamic adjustment performance coefficients
.
Set up the Lyapunov function:
Introduce error variables:
It can be concluded
, from the above equation
that the convergence of the algorithm can be guaranteed only when
. Therefore, the value interval of the forward coefficient of the Lyapunov criterion is as follows:
4.1.3. Solution of Fuzzy
The output results obtained by the fuzzy inference system are still fuzzy values. Defuzzing is required to transform them into readable and obvious values. According to the above fuzzy rules, the weighted average method is adopted, and the evaluation value of any RSU for the vehicle of the time slot
is:
For each user vehicle, the result vector
is finally generated as
, to represent the performance evaluation value of the node
j by user
i through evaluating the nearby service nodes. The best service node is the maximum value
in vector. For the system, the final output is a vector
is made up of the best service nodes of all vehicles. The Algorithm 1 is shown as follows:
Algorithm 1: Service Node Selection Algorithm Based on Fuzzy Logic (SNFLC) |
1: Enter vehicle information and RSU information 2: Output: vehicle optimal service node vector 3: Initialize = 0, and the number of vehicles 4: Each cycle 5: 6: The service node releases information to all vehicles, and the vehicles broadcast requests to the system 7: for 8: The vehicle evaluates the performance of each service node according to the system information (LR, TM, CCP). 9: Use fuzzy inference system to output the evaluation result vector 10: Select the maximum value of the element in the vector 11: End 12: Output the best service node vector |
4.2. Uninstallation Ratio and Resource Allocation
The analysis of optimization objective function P1 shows that constraint (8) is an integer variable, and other constraints are non-convex, so problem P1 is an NP problem that is difficult to solve directly [
24]. Firstly, the problem is simplified. The integer constraint in the optimization objective is the key to the complexity of the problem. Here, it is relaxed into a continuous variable [
25], that is, the discrete variable
is transformed into a continuous variable
. The restriction on task queue backlog can be disregarded here since it was considered in the prior service node selection [
25]. Constraint (1) can be equivalent to
. Combining the above expressions, Equations (19) and (20) can be obtained as follows:
By relaxing Equation (19) and substituting it into Equation (28), we obtain:
It can be seen from (18) that bandwidth resource is a variable related to unloading proportion, so the constraint on time of constraint (1) in problem P1 can be integrated into the bandwidth resource constraint, and the expression
of bandwidth and power resource is restated at the same time. The final problem P1 is restated as P2.
The two variables are first decoupled in the revised problem P2 because the objective function and constraint conditions cause the bandwidth resources and unloading ratio to be mutually coupled. LC-IRA is proposed. For example, Algorithm 2 decomposed problem P2 into two sub-problems to reach an alternate optimization solution: (1) Given
, solved resource allocation strategy (bandwidth and power) based on alternating direction multiplier method (ADMM); (2) Given
, solve the unloading ratio
. Problem P2.1 can be defined as:
The s.t constraint is equivalent to P2. Considering the independence between bandwidth resource allocation and power resource allocation, the following assumptions are proposed:
Assumption 1: Under the given unloading ratio, there exists an optimal solution
in problem P2.1, which meets Equation (31).
Evidence: When the offloading ratio
is known, the constraint on bandwidth allocation
is no longer coupled, and the calculation power allocation
is independent of the former. The following is an example of how broadband resources can be optimized:
The s.t constraint is equivalent to P2. In this case, the objective function is convex with respect to , and the constraint is also linear. can be solved based on the basic convex optimization algorithm. In the same way, can be obtained, as shown in Equation (32) above.
Then, the augmented Lagrange function is established:
where
is the Lagrange multiplier and
is the penalty parameter greater than 0. By introducing the concept of inertia strategy, the iteration expression of each parameter is redefined as follows:
is the improved inertia step, which improves the calculation accuracy numerically. is the acceleration coefficient to improve the convergence speed of the algorithm, and represents the error. The smaller the error value, the higher the convergence accuracy of the algorithm.
Issue P2.2 can be described as the issue of offloading ratio:
In this case, the optimization objective is a linear function of the offload ratio
. However, the positive and negative coefficients of
are unknown, so this function can be described as a linear function,
, which can be solved by ordinary linear equation solving methods with constraints.
Algorithm 2: A Low-Complexity Alternate Iteration Resource Allocation Algorithm (LC-IRA) |
1: Initialization: The service node selects the vector, , and sets the minimum error value of iteration number , as the convergence target of the algorithm. 2: Repeat 3: Update , according to Equation (26). 4: Update , according to Equation (27). 5: Update , according to Equation (28). 6: Update , according to Formula (29). 7: Update 8: Update 9: Update . 10: To compare the 11: 12: Until the algorithm converges 13. Solve problem P2.2 by using the linear equation solution method to obtain the optimal unloading proportion 14: Output |
After a fuzzy model, the optimization goal, and concrete calculation processing, each vehicle’s service node output evaluation values define the assessment points of maximum value, which are the best edge service nodes. The vehicle chooses the discharge to the node on the task, and, by adjusting the proportion of unloading, reasonable resource allocation, in order to achieve the optimization target of reducing system energy consumption.