Optimization method and system for computing unloading and service caching of Internet of Vehicles system
By building a comprehensive model in the Internet of Vehicles system and proposing a joint optimization method, the problem of underutilization of the synergy between computing offloading and service cache is solved, and the joint optimization of computing offloading and service cache in the Internet of Vehicles system is realized, which significantly reduces the task processing delay.
Patent Information
- Application Number
- CN202510045381.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-30
AI Technical Summary
The existing technology has failed to fully tap the potential synergy between computing offloading and service cache, making it difficult to meet the needs of low latency and high real-time in latency-sensitive applications such as the Internet of Vehicles.
By building a comprehensive Internet of Vehicles system model, combining the service cache optimization model and the computing unloading model, a joint optimization method for Internet of Vehicles system is proposed, and the objective function is optimized using the Lagrangian partial relaxation method to minimize delay.
The joint optimization of computing offloading and service cache in the Internet of Vehicles system is realized, which significantly reduces task processing delays, improves the utilization rate of system resources, and meets the needs of delay-sensitive applications.
Smart Images

Figure CN120075219A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Vehicles (IoV), and specifically to an optimization method and system for computing offloading and service caching in an IoV system. Background Art
[0002] With the popularization of 5G communication technology and the rapid development of the Internet of Things (IoT), delay-sensitive applications such as Internet of Vehicles (IoV), Augmented Reality (AR), and Virtual Reality (VR) have an increasingly urgent demand for computing resources and service response speed. However, the computing power and energy reserves of terminal devices (such as in-vehicle devices, drones, and mobile terminals) are usually limited, and they will face resource bottlenecks when processing complex tasks. In the traditional cloud computing mode, computing tasks are uploaded to a remote cloud server for processing. Although it can provide powerful computing capabilities, due to the long-distance transmission of data between the terminal and the cloud, it is often difficult to meet the requirements of low latency and high real-time performance. Therefore, Mobile Edge Computing (MEC), as a new type of computing architecture, by deploying computing and storage resources at the network edge close to end-users, has become an important technical means to solve the above problems.
[0003] In the MEC architecture, computing offloading and service caching are two core technologies. Computing offloading can effectively reduce the computing load of the device, reduce energy consumption, and significantly improve the task completion efficiency by offloading some or all of the computing tasks of the terminal device to the edge server for processing. At the same time, service caching can further reduce communication latency and bandwidth consumption by pre-storing services or data frequently accessed by users on the edge server, avoiding repeated data transmission. The combination of computing offloading and service caching enables edge computing to not only meet the requirements of delay-sensitive applications but also greatly improve the utilization rate of system resources.
[0004] However, most current research studies computing offloading and service caching as independent problems and fails to fully explore the potential synergy between the two. In practical applications, computing offloading and service caching are often tightly coupled. For example, the offloading decision of some computing tasks may be affected by the cached content on the edge server, and the design of the caching policy also needs to consider the offloading frequency of computing tasks. Therefore, how to jointly optimize the computing offloading and service caching policies under a unified framework has become the focus and difficulty of current research.
[0005] From an application perspective, the joint optimization of computing offloading and service caching has broad application prospects in fields such as vehicle-to-everything (V2X) networks, intelligent logistics, and smart cities. For example, in the V2X scenario, joint optimization can enhance the collaborative computing ability between vehicles, enabling functions such as traffic flow prediction, path planning, and collision warning; in intelligent logistics, optimization can achieve dynamic adjustment and real-time monitoring of cargo delivery routes; in smart cities, it can support multi-user, high-density real-time data processing and service distribution, improving urban management efficiency.
[0006] In summary, the research background of computing offloading and service caching covers multiple levels from technical requirements to practical applications. By deeply studying the joint optimization method of the two, not only can the current technical bottlenecks be broken through, but also the implementation of MEC technology in more fields can be promoted, providing efficient and intelligent technical support for the next-generation network system. Therefore, it is indeed necessary to propose a joint optimization method and system for computing offloading and service caching for V2X systems to solve the above problems. Summary of the Invention
[0007] Aiming at the deficiencies of the prior art, the present invention provides an optimization method and system for computing offloading and service caching in a V2X system to solve the problems in the background technology.
[0008] To achieve the above object, the present invention provides the following technical solutions: A joint optimization method and system for computing offloading and service caching for a V2X system, including the following steps:
[0009] Step 1: Describe and define each element in the system, and on this basis, construct a comprehensive V2X system model to accurately reflect the communication, computing, and service requirements in the actual scenario, providing a basis for subsequent optimization and algorithm design;
[0010] Step 2: Construct an optimization model for service caching in the V2X system;
[0011] Step 3: Construct a computing offloading model, and effectively combine it with the service caching model to optimize the V2X system, minimizing the total task processing delay;
[0012] Step 4: Construct a communication model;
[0013] Step 5: Propose a joint optimization method for computing offloading and service caching for a V2X system to solve the minimum delay optimization problem.
[0014] As a preferred solution of the joint optimization method and system for computing offloading and service caching for the V2X system of the present invention, wherein: establishing the V2X system model includes:
[0015] Build a mobile edge computing system with multi-layer joint computing offloading and service caching, which consists of an RSU and an MBS equipped with A and N antennas respectively, and multiple vehicles (R) each equipped with a single antenna. Services are provided by a service library S = {1, …, S}, and these services have different computing and storage requirements. Each service type is requested by a vehicle, and each RSU is equipped with a server. In the system model, all vehicles first offload their computing tasks to the RSU. If the corresponding service is cached in the edge server (ES), the ES executes the task. Otherwise, the task will be offloaded to the cloud through the RSU, and then the task is offloaded by the cloud computing. After that, the cloud sends the task execution result back to the vehicle.
[0016] As a preferred solution of the joint optimization method and system for computing offloading and service caching for the vehicle-to-everything (V2X) system described in the present invention, the method includes: building an optimization model for service caching in the V2X system, including:
[0017] Assume that each service s ∈ S corresponds to a specific software package, indexed by s ∈ S. Specifically, the data length of the s-type software package is l s bits, s ∈ S. In the multi-layer service caching, the software packages frequently requested by vehicles are actively cached in the ES. According to the popularity distribution, the software packages are sorted in descending order. The cache size of the RSU is C RSU bits, and the size of the software package library is greater than C RSU . The software packages required by the vehicle are downloaded from the library according to the Zipf popularity distribution. In this model, the software packages are sorted in descending order of their popularity. Let z A,s represent the caching result of the sth software package in the ES. For an ES that does not cache any software packages or does not provide sufficient computing resources, the computing task is offloaded to the cloud through the micro base station.
[0018] Assume that the micro base station and the cloud server are located at the same location and are connected by high-throughput and low-latency optical fibers. Therefore, the task offloading delay caused by the task transmission between the micro base station and the cloud server is negligible; due to the limited cache capacity of the ES, assume that the storage size allocated for the task content on the ES is C RSU bits, which can be expressed as:
[0019]
[0020] As a preferred solution of the joint optimization method and system for computing offloading and service caching for the vehicle-to-everything (V2X) system described in the present invention, the method includes: building a computing offloading model, including:
[0021] Each service has a specific task, so let r s represent the vehicle r that requests service s, where the size of the task input data is L r,s bits. Let ρr,s Denote the task offloading decision of vehicle r:
[0022]
[0023] where ρ r,s = 0 means the task is computed by the edge server, and ρ r,s = 1 means the task is offloaded to be executed in the cloud. Let ρ = (ρ r,s ) r∈R,s∈S represent the computing offloading action.
[0024] In the mobile edge computing system, the total number of CPU cycles is considered to be linearly proportional to the number of bits to be processed. Therefore, the number of CPU cycles used to complete the rth task of the vehicle is C r L r,s where C r represents the number of CPU cycles per bit, which depends on the CPU type and the software task to be executed. Assume that the edge server has multiple cores, and each core is independently assigned to a specific offloading task. In addition, assume that each core has the same maximum clock frequency (in cycles per second). Therefore, the computing delay of task offloading to the ES:
[0025]
[0026] where As an advantage of the dynamic voltage and frequency scaling technology (DVFS), is specifically adjusted. The computing delay of task offloading to the cloud:
[0027]
[0028] where represents the clock frequency of each core in the cloud. If the edge server does not cache the required software package, the computing delay of the task on the cloud is:
[0029]
[0030] As a preferred solution of the joint optimization method and system for computing offloading and service caching for the vehicle networking system described in the present invention, where: construct a communication model, including:
[0031] In the edge computing architecture, the task is offloadable and executed by the cloud or the edge server. Specifically, if the software is cached by the RSU, the offloading task is executed by the edge server or the cloud. Then, the task offloading time delay and task transmission rate from the RSU to the rth vehicle to the cloud are given by the following formula:
[0032]
[0033] R RSU = Blog 2 (1 + γ r )
[0034] where R RSU represents the task transmission rate from the RSU to the cloud. If the software is not cached by the RSU, the task will be offloaded and executed by the cloud. Therefore, the task transmission time delay from the RSU to the r-th vehicle is:
[0035]
[0036] The task transmission time and transmission rate from the r-th vehicle to the RSU are:
[0037]
[0038] R r = Blog 2 (1 + η r )
[0039] Then, the total system transmission energy consumption of the r-th vehicle task is given by:
[0040]
[0041] where R r and p r ∈ p = [p 1 ,..., p R represent the task transmission rate from the r-th vehicle to the RSU and the RSU transmission power assigned to the task of offloading vehicle r, respectively.
[0042] As a preferred embodiment of the joint optimization method and system for computing offloading and service caching for the vehicle-to-everything (V2X) system according to the present invention, wherein: constructing a total delay function, including:
[0043]
[0044] As a preferred embodiment of the joint optimization method and system for computing offloading and service caching for the vehicle-to-everything (V2X) system according to the present invention, wherein: constructing an objective function for the V2X system, including:
[0045]
[0046] s.t. C1: ∑ R β r = 1
[0047] C2:
[0048] C3:
[0049] C4:
[0050] C5:
[0051] Among them, each vehicle is assigned a positive weight coefficient β r ∈(0, 1), satisfying The fairness between vehicles is controlled by using this coefficient. C1 means that the sum of the weighted coefficients of all vehicles is 1; C2 means the task offloading decision; C3 means the software package caching result; C4 means that the amount of cached data shall not exceed the storage capacity C of the edge server RSU ; C5 ensures that the total computing resources allocated by the edge server to all offloading tasks shall not exceed the computing power F of the edge server RSU .
[0052] As a preferred solution of the joint optimization method and system for computing offloading and service caching for the vehicle - to - everything system described in the present invention, wherein: the Lagrangian partial relaxation method is used to optimize the objective function of the vehicle - to - everything system, including:
[0053] Determine the objective function and constraint conditions;
[0054] Introduce a new variable o r,s = ρ r,s z A,s , and adopt the following problem transformation:
[0055]
[0056] s.t.C1:
[0057] C2:
[0058] C3:
[0059] C4: o r,s = ρ r,s z A,s
[0060] Convert the equality constraint C4 into an inequality constraint to solve the transformation problem under the non - convex constraint C4. Then, using the McCormick envelope, apply McCormick convex relaxation to equivalently transform C4 into a series of inequality constraints, from
[0061]
[0062] Use classical Lagrangian partial relaxation to relax the constraints and handle the task offloading and software package caching problems. Then, define the corresponding dual Lagrangian multiplier set as:
[0063]
[0064] Given the dual Lagrangian multipliers, the Lagrangian function obtained therefrom is:
[0065]
[0066] Therefore, rewrite the dual problem as:
[0067]
[0068] s.t.C1:
[0069] C2:
[0070] C3:
[0071] C4:
[0072] C5:
[0073] C6:
[0074] Decompose the dual problem into three subproblems with independent feasible regions, which are respectively expressed as:
[0075]
[0076] s.t.C1:
[0077]
[0078] s.t.C1:
[0079] C2:
[0080]
[0081] s.t.C1:
[0082] After decomposing the dual problem, the general linear programming method is used to solve the linear optimization problem in the joint task offloading and software package caching optimization problem. Then, the software package caching problem is solved on the time scale based on the service package popularity, data size, and computing resources required by the service. By solving the linear optimization problem, the optimized values of ρ, z, and o are obtained. In addition, the dual variables are updated by the subgradient method. Specifically, the initialization of the dual variable t1 is updated as follows:
[0083] κ r,s (t 1 +1) = [κ r,s (t 1 ) + ψ(t 1 )d(κ r,s (t 1 ))] +
[0084] υ r,s (t 1 +1) = [υ r,s (t 1 ) + ψ(t 1 )d(υ r,s (t 1 ))] +
[0085] where [x] + = max{0, x}, ψ(t 1 ) is the step size, and d(κ r,s (t 1 )) = o r,s - z A,s and d(υ r,s (t 1 )) = o r,s - ρ r,s are the subgradients of the dual problem.
[0086] In solving the total objective function problem, the binary variables ρ and z are relaxed to continuous variables, and the problem is transformed into a convex problem. Therefore, when solving the task offloading and service caching problem, the binary variables are restored after the subgradient process converges. According to the proof, the optimal solution of the problem is found, which is regarded as the optimal task offloading and software caching strategy.
[0087] Compared with the prior art, the present invention has the following beneficial effects:
[0088] Compared with the prior art, the beneficial effect of the technical solution of the present invention is that the present invention comprehensively considers various constraints of the joint optimization method and system for computing offloading and service caching in the vehicle-to-everything (V2X) system, and minimizes the delay through the joint caching and computing offloading strategy under these conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Figure 1 System model for computing offloading and service caching;
[0090] Figure 2 Flowchart for optimizing computing offloading and service caching algorithms;
[0091] Figure 3 Graph of weighted sum delay versus cache size under different offloading strategies;
[0092] Figure 4 Graph of weighted sum delay versus number of vehicles under different popularity indices;
[0093] Figure 5 Graph of edge server cache size versus delay under different offloading strategies. Detailed implementation manners
[0094] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art in the technical field of the present invention without creative efforts based on the embodiments of the present invention belong to the scope of protection of the present invention.
[0095] Embodiment 1
[0096] Refer to Figures 1-2 , this embodiment provides a joint optimization method and system for computing offloading and service caching for a vehicle networking system, and the specific steps are as follows:
[0097] Step 1, establish a system model, specifically including: designing a multi-layer joint computing offloading and service caching mobile edge computing system. It consists of an RSU and an MBS equipped with A and N antennas respectively, and multiple vehicles (R) each equipped with a single antenna. Services are provided by a service library S = {1,..., S}, such as video streams, AR, intelligent driving control software, etc. These services have different computing and storage requirements, and each service type is requested by a vehicle in the figure. Each RSU is equipped with a server that can provide caching and computing services. In the system model, all vehicles first offload their computing tasks to the RSU. Then, if the corresponding service cache is in the edge server (ES), the ES executes the task. Otherwise, the task is offloaded to the cloud through the RSU, and then the task is offloaded by cloud computing. After that, the cloud transmits the task execution result back to the vehicle.
[0098] Step 2, construct a service caching model. Assume that each service s ∈ S corresponds to a specific software package, indexed by s ∈ S. Specifically, the data length of the s-type software package is l s bits, s ∈ S. It should be noted that inFigure 1 In the cache-assisted multi-layer system, software packages frequently requested by vehicles can be actively cached to the ES. According to the popularity distribution, the software packages are sorted in descending order, which means that the sth file is the most popular software package. The cache size of the RSU is C RSU bits, and the size of the software package library is greater than C RSU . The software packages required by vehicles are downloaded from the library according to the Zipf popularity distribution. In this model, the software packages can be sorted in descending order of their popularity, with z A,s represented as the caching result of the sth software package by the ES. For an ES that has not cached any software packages or does not provide sufficient computing resources, the computing tasks should be offloaded to the cloud through the micro base station.
[0099] Assume that the micro base station and the cloud server are located at the same location and are connected using high-throughput low-latency optical fibers. Therefore, the task offloading latency caused by the task transmission between the micro base station and the cloud server can be ignored. Due to the limited cache capacity of the ES, assume that the storage size allocated for the task content on the ES is C RSU bits. It can be expressed as:
[0100]
[0101] Step 3: Build a computing offloading model. Each service has a specific task, so r s is represented as the vehicle r that requests service s, where the size of the task input data is L r,s bits. Let ρ r,s represent the task offloading decision of vehicle r:
[0102]
[0103] where ρ r,s = 0 means the task is computed on the edge server, and ρ r,s = 1 means the task is offloaded to be executed in the cloud. Let ρ = (ρ r,s ) r∈R,s∈S represent the computing offloading action.
[0104] In the mobile edge computing system of the present invention, the total number of CPU cycles is considered to be linearly proportional to the number of bits to be processed. Therefore, the number of CPU cycles used to complete the rth task of the vehicle is C r L r,s , where C r represents the number of CPU cycles per bit, which depends on the CPU type and the software task to be executed. For simplicity, assume that the edge server has multiple cores, and each core is independently allocated to a specific offloading task. In addition, assume that each core has the same maximum clock frequency (in cycles per second). Therefore, the computing delay of task offloading to the ES:
[0105]
[0106] Where As an advantage of the dynamic voltage and frequency scaling technology (DVFS), is adjustable. The computing delay of task offloading to the cloud:
[0107]
[0108] Where represents the clock frequency of each core in the cloud. If the edge server does not cache the required software package, the computing delay of the task on the cloud is:
[0109]
[0110] Step 4, propose a joint optimization method and system for computing offloading and service caching for the vehicle networking system, including:
[0111] Determine the objective function and constraints:
[0112]
[0113] s.t.C1:∑ R β r =1
[0114] C2:
[0115] C3:
[0116] C4:
[0117] C5:
[0118] Introduce a new variable o r,s =ρ r,s z A,s , and adopt the following problem transformation:
[0119]
[0120] s.t.C1:
[0121] C2:
[0122] C3:
[0123] C4:o r,s= ρ r,s z A,s
[0124] To solve the transformation problem under the non - convex constraint C4, the equality constraint C4 needs to be transformed into an inequality constraint. Then, using the McCormick envelope, the McCormick convex relaxation is applied to equivalently transform C4 into a series of inequality constraints, given by:
[0125]
[0126] To handle the task offloading and software package caching problems, classical Lagrangian partial relaxation can be used to relax the constraints. Then, the corresponding set of dual Lagrange multipliers is defined as:
[0127]
[0128] Given the dual Lagrange multipliers, the Lagrangian function is obtained as:
[0129]
[0130] Optimizing the binary variables, the dual function is obtained, and the dual problem is rewritten as:
[0131]
[0132] s.t. C1:
[0133] C2:
[0134] C3:
[0135] C4:
[0136] C5:
[0137] C6:
[0138] The dual problem is decomposed into three sub - problems with independent feasible regions, respectively denoted as:
[0139]
[0140] s.t. C1:
[0141]
[0142] s.t. C1:
[0143] C2:
[0144]
[0145] s.t.C1:
[0146] More specifically, after decomposing the dual problem, a set of problems separated from the joint task offloading and software package caching optimization problem are obtained, and the sub-problems are linear optimization problems; in this case, the general linear programming method can be used to solve them. Then, the software package caching problem is solved on the time scale considering the service package popularity, data size, and computing resources required by the service. By solving the sub-problems, the optimized values of ρ, z, and o are obtained. In addition, the dual variables are updated by the subgradient method. Specifically, the initialization of the dual variable t1 is updated as follows:
[0147] κ r,s (t 1 +1) = [κ r,s (t 1 ) + ψ(t 1 )d(κ r,s (t 1 ))] +
[0148] υ r,s (t 1 +1) = [υ r,s (t 1 ) + ψ(t 1 )d(υ r,s (t 1 ))] +
[0149] where [x] + = max{0, x}, ψ(t 1 ) is the step size, and d(κ r,s (t 1 )) = o r,s - z A,s and d(υ r,s (t 1 )) = o r,s - ρ r,s are the subgradients of the dual problem.
[0150] In solving the total objective function problem, the binary variables ρ and z are relaxed to continuous variables, and the problem is transformed into a convex problem. Therefore, when solving the task offloading and service caching sub-problems, the binary variables must be restored after the subgradient process converges. According to the proof, the optimal solution of the problem can be found, which can be regarded as the optimal task offloading and software caching strategy.
[0151] Based on the caching and computing capabilities provided by the edge server, the present invention designs a joint optimization method and system for computing offloading and service caching for a vehicle networking system to minimize the latency of user-requested computing content.
[0152] Embodiment 2
[0153] For a joint optimization method and system for computing offloading and service caching for a vehicle networking system mentioned in this article, in this embodiment, a simulation environment is programmed using the Matlab language to test and compare the experimental results to verify the effectiveness of this method. In this embodiment, the proposed service caching and computing offloading algorithms are compared with six other offloading strategies:
[0154] (1) Local: The computing tasks of all vehicles are processed locally on the vehicles.
[0155] (2) Edge: The computing tasks of all vehicles are offloaded to the edge server for processing.
[0156] (3) Cloud: The computing tasks of all vehicles are offloaded to the cloud server for processing through the RSU.
[0157] (4) Random: The task offloading decisions of the vehicles are randomly selected among the vehicles, the edge server, and the cloud server.
[0158] (5) Content caching strategy: By storing copies of the vehicle computing tasks at the cache nodes in the system, and then processing the computing tasks through this node.
[0159] (6) Optimal simulation algorithm: The optimal simulation algorithm is used to process the computing tasks.
[0160] Figure 3 Shows the relationship diagram between the weighted sum delay and the cache size under different offloading strategies. It can be observed that when the cache size of the edge server increases, the weighted sum delay of the pure edge offloading scheme decreases significantly. In this case, offloading the tasks to the edge server will result in a lower delay than offloading the tasks to the cloud, ultimately leading to the observed reduction in the weighted sum delay. Similarly, the random offloading scheme shows a reduced delay when increasing the cache size. In contrast, when the cache size of the edge server is small, the pure cloud computing-based scheme will have better performance than the pure edge offloading scheme. As expected, this algorithm shows the best weighted sum delay performance among all the schemes. However, as the cache size increases, due to the limited computing resources of the edge server, the weighted sum delay decreases to a constant minimum value.
[0161] Figure 4It is a graph showing the relationship between the weighted sum delay and the number of vehicles under different popularity indices. It can be seen from the graph that the performance related to the popularity index distribution is better than that of the random offloading strategy. In addition, as the popularity index increases, the weighted sum delay decreases. This is because as the popularity index increases, the number of popular software packages accessed by most users becomes smaller and smaller. At the same time, the weighted sum delay increases approximately linearly with the increase in the number of vehicles because as the number of vehicles increases, the number of computing tasks also increases.
[0162] Figure 5 It is a graph showing the relationship between the cache size at the edge server and the delay under different offloading strategies. The computing power is 0.3 GHz. It can be observed that when using the optimal software package caching strategy, the weighted sum delay of the optimal task scheduling scheme weakens more slowly than that of the random task offloading scheme. This is because the task computing delay dominates the transmission delay. In addition, when increasing the cache size, the delay will decrease significantly. This phenomenon indicates that if the cache size increases, more tasks will be executed locally. This is an obvious benefit because more popular software packages are cached in the edge server, so tasks are more likely to be computed locally with the help of more computing resources.
Claims
1. A method and system for optimizing computation offloading and service cache of a vehicle networking system, characterized in that: The specific steps are as follows: Step 1: Describe and define each element in the system, and build a comprehensive Internet of Vehicles system model based on this to accurately reflect the communication, computing and service requirements in actual scenarios, providing a basis for subsequent optimization and algorithm design; Step 2: Build a service cache optimization model for the Internet of Vehicles system; Step 3: Build a computing offload model and effectively combine it with the service cache model to optimize the Internet of Vehicles system and minimize the total task processing delay. Step 4: Build a communication model; Step 5: Propose a joint optimization method for computation offloading and service caching for the Internet of Vehicles system to solve the problem of minimizing latency optimization.
2. According to claim 1, a method and system for optimizing calculation offloading and service cache of a vehicle networking system, characterized in that: Establish a connected vehicle system model, including: A multi-layer joint computing offloading and service caching mobile edge computing system is constructed. It consists of RSU and MBS equipped with A and N antennas respectively, and multiple vehicles (R) each equipped with a single antenna. Services are provided by a service library S = {1,…,S}. These services have different computing and storage requirements. Each service type is requested by a vehicle. Each RSU is equipped with a server, which provides caching and computing services. The time required for the RSU and the cloud to transmit the execution results is negligible. In the system model, all vehicles first offload their computing tasks to the RSU. If the corresponding service is cached in the edge server (ES), the ES executes the task. Otherwise, the task is offloaded to the cloud through the RSU, and then the cloud computes the offloaded task. After that, the cloud transmits the task execution result back to the vehicle.
3. A method and system for optimizing calculation offloading and service cache of a vehicle networking system according to claim 1 or 2, characterized in that: Build a service cache optimization model for the Internet of Vehicles system, including: Assume that each service s∈S corresponds to a specific software package, indexed by s∈S. Specifically, the data length of the s-type software package is l s , s∈S. In the multi-layer service cache, the software packages frequently requested by vehicles are actively cached to ES. According to the popularity distribution, the software packages are sorted in descending order. The cache size of RSU is C RSU bits, the size of the package library is larger than C RSU The software packages required by the vehicle are downloaded from the repository according to the Zipf popularity distribution. In this model, the software packages are sorted in descending order of their popularity. A,s It is represented as the ES cache result for the sth software package. For ES that does not cache any software package or does not provide sufficient computing resources, the computing task is offloaded to the cloud through the micro base station. Assume that the micro base station and the cloud server are located at the same location and connected by a high-throughput, low-latency optical fiber. Therefore, the task offloading delay caused by the task transmission between the micro base station and the cloud server is negligible. Due to the limited ES cache capacity, assume that the storage size allocated for the task content on the ES is C RSU Bit, expressed as:
4. The method and system for optimizing calculation offloading and service cache of a vehicle networking system according to claim 3, characterized in that: Build a computational offloading model, including: Each service has a specific task, so s Represented as a vehicle r requesting service s, where the task input data size is L r,s Let ρ r,s Denotes the task offloading decision of vehicle r: Among them, ρ r,s =0 means the task is calculated on the edge server, ρ r,s =1 indicates that the task is offloaded to the cloud for execution. Let ρ = (ρ r,s ) r∈R,s∈S Indicates a compute offload action. In a mobile edge computing system, the total number of CPU cycles is considered to be linearly proportional to the number of bits to be processed, so the number of CPU cycles used to complete the rth task of the vehicle is C r L r,s , where C r represents the number of CPU cycles per bit, which depends on the CPU type and the software task to be executed. Assume that the edge server has multiple cores and each core is independently assigned to a specific offload task. In addition, assume that each core has the same maximum clock frequency (in cycles per second). Therefore, the computational latency of the task offloaded to ES is: in, As an advantage of Dynamic Voltage and Frequency Scaling (DVFS), The computing latency of offloading tasks to the cloud is: in represents the clock frequency of each core in the cloud. If the edge server does not cache the required software package, the computing delay of the task on the cloud is:
5. The method and system for optimizing calculation offloading and service cache of a vehicle networking system according to claim 4, characterized in that: Build a communication model, including: In the edge computing architecture, tasks can be offloaded and executed by the cloud or edge server. Specifically, if the software is cached by the RSU, the task is offloaded and executed by the edge server or cloud. Then, the task offloading time delay and task transmission rate of the rth vehicle from the RSU to the cloud are given by: R RSU =Blog2(1+c r ) Where R RSU represents the task transmission rate from RSU to the cloud. If the software is not cached by the RSU, the task will be offloaded and executed by the cloud. Therefore, the task transmission time delay of the rth vehicle from the RSU to the cloud is: The task transmission time and transmission rate from the rth vehicle to the RSU are: R r =Blog2(1+η r ) Then, the total system transmission energy consumption for the rth vehicle mission is given by: Where R r and p r ∈p=[p1,...,p R ] denote the task transmission rate from the rth vehicle to the RSU and the RSU transmission power assigned to the task of unloading vehicle r, respectively.
6. The method and system for optimizing calculation offloading and service cache of a vehicle networking system according to claim 4, characterized in that: Construct the total delay function:
7. A method and system for optimizing calculation offloading and service cache of a vehicle networking system according to claims 5 and 6, characterized in that: Objective function for building a connected vehicle system: Among them, each vehicle is assigned a positive weight coefficient β r ∈(0,1), satisfying By using this coefficient, fairness between vehicles can be controlled.
8. A method and system for optimizing calculation offloading and service cache of a vehicle networking system according to claims 1-7, characterized in that: The Lagrangian partial relaxation method is used to optimize the objective function of the Internet of Vehicles system, and the method specifically includes the following steps: a. Determine the objective function and constraints; b. Introduce new variables o r,s =ρ r,s z A,s , and adopt the following problem transformation: C4:o r,s =ρ r,s With A,s The equality constraint C4 is transformed into an inequality constraint to solve the transformation problem under the non-convex constraint C4. Then, using the McCormick envelope, the McCormick convex relaxation is applied to equivalently transform C4 into a series of inequality constraints, which is: The constraints are relaxed using classical Lagrangian partial relaxation to handle task offloading and package caching problems. Then, the corresponding dual Lagrangian multiplier set is defined as: c. Given the dual Lagrangian multiplier, the Lagrangian function is: d. Optimize the binary variables to obtain the dual function. The dual problem can be rewritten as: e. In solving the total objective function problem, the binary variables ρ and z are relaxed into continuous variables and the problem is transformed into a convex problem. Therefore, when solving the task offloading and service caching problems, the binary variables are restored after the subgradient process converges. According to the proof, finding the optimal solution to the problem is regarded as the optimal task offloading and software caching strategy.