A collaborative offloading time delay optimization method and system based on real-time rail detection
By proportionally distributing the collaborative unloading delay optimization model to the local, edge and cloud sides in high-speed train inspection tasks and using genetic algorithms to solve the problem of high-speed train real-time inspection tasks being unable to be unloaded, low-latency processing of real-time rail inspection is achieved.
Patent Information
- Application Number
- CN202411020231.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-07-29
AI Technical Summary
In existing technologies, the real-time rail inspection task of high-speed trains cannot be effectively offloaded to the train's local terminal, edge terminal, and cloud, resulting in high network bandwidth pressure and high latency, making real-time inspection impossible.
By optimizing the allocation plan, the detection tasks are proportionally distributed to the local, edge and cloud ends, a collaborative offloading delay optimization model is built, and heuristic algorithms such as genetic algorithms are used to solve the model to minimize delay, set the task allocation ratio, computing resource allocation ratio and delay constraints.
It effectively reduces the overall system delay, realizes the real-time processing of high-speed train rail inspection tasks, reflects the characteristics of collaborative unloading tasks, and optimizes resource allocation.
Smart Images

Figure CN119011677B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of task offloading, and in particular relates to a collaborative unloading delay optimization method, system, device and medium based on real-time rail detection. Background Art
[0002] Rails are crucial infrastructure for the railway transportation system, and their safety is crucial to train safety. Regular inspections of rail conditions can help identify potential defects and damage. Currently, most rail surface inspections are performed by railway workers on foot during periods when trains are not running, manually pushing inspection devices along the rails to detect defects. This method is extremely inefficient. In recent years, machine vision inspection has been gradually applied to rail inspection. However, due to the large workload of real-time rail inspection on high-speed trains, the local computing resources on the trains cannot meet the requirements. Therefore, inspections can only be carried out during periods when ordinary trains are not running, and real-time inspection is not possible.
[0003] The train's local terminals, edge terminals, and cloud constitute a cloud-edge collaborative network architecture. Splitting and offloading detection tasks to the train's local terminals, edge terminals, and cloud can significantly improve computing resources. However, since the network status of high-speed trains passing through mountainous areas, tunnels, and other remote areas is poor, the network bandwidth will be under great pressure in this situation. The edge and cloud processing detection tasks may not be responded to due to high latency, resulting in large delays and even data loss. Therefore, it is necessary to offload the detection tasks to the train's local terminals, edge terminals, and cloud where the network status is good and computing resources are sufficient, and optimize the allocation plan to minimize the delay. Summary of the Invention
[0004] The purpose of the present invention is to address the above-mentioned problems existing in the prior art and to provide a collaborative unloading delay optimization method, system, device and medium based on real-time rail detection by optimizing the allocation scheme to minimize the delay.
[0005] To achieve the above objectives, the technical solutions of the present invention are as follows:
[0006] In a first aspect, the present invention provides a collaborative unloading delay optimization method based on real-time rail detection, the collaborative unloading delay optimization method comprising:
[0007] S1. Acquire multiple detection tasks, each of which is a set of images of railway rails captured by a high-speed camera;
[0008] S2, proportionally segment each detection task and assign to local, edge, cloud, the local, edge, cloud being proportionally assigned to each detection task part of the calculation resource, to build an assignment model; based on the assignment model, build a local processing model, an edge processing model, a cloud processing model;
[0009] S3, based on the assignment model, the local processing model, the edge processing model, the cloud processing model, build a collaborative offloading delay optimization model; the objective function of the collaborative offloading delay optimization model is:
[0010] min(max(t1, t2, t3));
[0011] In the above formula, t1, t2, t3 respectively represent the total delay of local, edge, cloud processing all detection tasks assigned to them; max(t1, t2, t3) represents the maximum value of t1, t2, t3;
[0012] S4, use heuristic algorithm to solve the collaborative offloading delay optimization model, obtain the global optimal solution; the global optimal solution includes optimal delay, assignment proportion of all detection tasks and calculation resource allocation proportion of local, edge, cloud for all detection tasks.
[0013] In S3, the assignment model includes:
[0014]
[0015] In the above formula, X represents the detection task assignment proportion matrix; x 1i , x 2i , x 3i Respectively represent the proportion of the i-th detection task assigned to local, edge, cloud; Respectively represent the assignment proportion vector of all detection tasks in local, edge and cloud;
[0016]
[0017] In the above formula, Represents the calculation resource matrix required after the detection task is assigned; c 1i , c 2i , c 3i Respectively represent the calculation resource required by the part of the i-th detection task assigned to local, edge, cloud; C i Represents the calculation resource required by the i-th detection task;
[0018]
[0019] In the above formula, Y represents the calculation resource allocation proportion matrix; y 1i , y2i 、y 3i They represent the proportion of computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively;
[0020]
[0021] In the above formula, represents the computing resource allocation matrix; F1, F2, and F3 represent the CPU frequencies of the local, edge, and cloud respectively; f 1i 、f 2i 、f 3i denote the computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively;
[0022] The local processing model includes:
[0023] t1=max(t 11 ,…,t 1i ,…,t 1n );
[0024]
[0025] In the above formula, t 11 , t 1i , t 1n They represent the total delay of the first, i-th, and n-th detection tasks offloaded to the local machine and processed locally; c 1i It represents the computing resources required locally for the portion of the i-th detection task that is allocated to the local area; n represents the total number of detection tasks;
[0026] The edge model includes:
[0027] t2=max(t 21 ,…,t 2i ,…,t 2n );
[0028]
[0029]
[0030] In the above formula, t 21 , t 2i , t 2n represents the total delay of the edge end processing the first, i-th, and n-th detection tasks offloaded to the edge end respectively; c 2i represents the portion of the i-th detection task assigned to the edge and the computing resources required at the edge; C et Indicates the computing resource threshold of a single edge terminal; They represent the transmission delay from the train to the edge and the execution delay at the edge respectively; k is the ratio of the task data volume to the required computing resources; r t2ed represents the data transmission rate of unloading tasks from the train to the edge; b 2i represents the amount of data allocated to the i-th task at the edge;
[0031] The cloud model includes:
[0032] t3=max(t 31 ,…,t 3i ,…,t 3n );
[0033]
[0034] In the above formula, t 31 , t 3i , t 3n They represent the total latency of the first, i-th, and n-th detection tasks assigned to the cloud and processed by the cloud, respectively; c 3i They represent the portion of the i-th detection task offloaded to the cloud and the computing resources required in the cloud; f 1i 、f 2i 、f 3i represents the computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively; b 3i represents the amount of data allocated to the i-th task in the cloud; k is the ratio of task data volume to required computing resources; They represent the transmission delay from the train to the cloud and the execution delay in the cloud respectively; r t2c Indicates the data transmission rate from the train to the cloud.
[0035] In S3, the constraints of the collaborative offloading delay optimization model include task allocation ratio constraints, computing resource allocation constraints, and task delay constraints; the task allocation ratio constraints include:
[0036]
[0037] x ji ∈[0, 1], j∈{1, 2, 3};
[0038] In the above formula, x ji It represents the proportion of the i-th detection task assigned to the j-th processor, where the processor is local, edge or cloud;
[0039] The computing resource allocation constraints include:
[0040]
[0041] In the above formula, f ji represents the computing resources allocated by the jth processor to the i-th detection task; F j represents the CPU frequency of the jth processor;
[0042] The task delay constraints include:
[0043] t ji ≤T i , j∈{1, 2, 3};
[0044] In the above formula, t ji T represents the total delay of the portion of the i-th detection task that is offloaded to the j-th processor and processed by the j-th processor; i represents the delay of the i-th detection task.
[0045] The computing resources C required for the i-th detection task i The calculation formula is:
[0046] C i =mc p ;
[0047] m = ft;
[0048]
[0049] In the above formula, c p is the computing resources required for a single image; f is the frequency of taking pictures by the high-speed camera installed on the train; L is the length of the railway corresponding to the edge service range; υ is the speed of the train; m represents the number of images in a single detection task.
[0050] A genetic algorithm is used to solve the collaborative offloading delay optimization model. The specific solution steps include:
[0051] A1. Initialize the population. Each individual in the population corresponds to a set of decision variables. These decision variables include the allocation ratio of all detection tasks and the allocation ratio of computing resources for all detection tasks locally, on the edge, and in the cloud.
[0052] A2. Encoding, decoding, and crossover mutation are performed on the population. The crossover mutation involves sequentially designating individuals in the population as the chromosomes of the father and randomly selecting individuals in the population as the chromosomes of the mother. A crossover point is then randomly generated, and all genes of the father and mother located after the crossover point are swapped according to the crossover probability to generate offspring chromosomes. A mutant gene position is then randomly generated on the offspring chromosome, and the binary code at the mutant gene position is inverted according to the mutation probability to obtain a mutant individual.
[0053] A3, calculate the fitness value of all individuals in the population, select individuals with larger fitness value to form a new population by roulette method, and select the individual with the largest fitness value as the optimal individual;
[0054] A4, return to A2 iteration calculation until the iteration stopping condition is reached, and output the global optimal solution.
[0055] In a second aspect, the present application provides a collaborative offloading time delay optimization system based on real-time rail detection, which comprises a detection task acquisition module, an allocation model construction module, a local processing model construction module, an edge processing model construction module, a cloud processing model construction module, a collaborative offloading time delay optimization model construction module, and an optimization calculation module.
[0056] The detection task acquisition module is used to acquire a plurality of detection tasks, and each detection task corresponds to a group of railway rail pictures taken by a high-speed camera.
[0057] The allocation model construction module is used to segment and allocate each detection task to the local, edge and cloud in proportion, and the local, edge and cloud allocate computing resources to the allocated part in proportion to construct an allocation model.
[0058] The local processing model construction module is used to construct a local processing model based on the allocation model.
[0059] The edge processing model construction module is used to construct an edge processing model based on the allocation model.
[0060] The cloud processing model construction module is used to construct a cloud processing model based on the allocation model.
[0061] The collaborative offloading time delay optimization model construction module is used to construct a collaborative offloading time delay optimization model based on the allocation model, the local processing model, the edge processing model and the cloud processing model, and the objective function of the collaborative offloading time delay optimization model is:
[0062] min(max(t1, t2, t3));
[0063] In the above formula, t1, t2 and t3 respectively represent the total time delay of all detection tasks allocated to the local, edge and cloud; max(t1, t2, t3) represents the maximum value of t1, t2 and t3.
[0064] The optimization calculation module is used to solve the collaborative offloading time delay optimization model by using a heuristic algorithm to obtain a global optimal solution, and the global optimal solution comprises an optimal delay, an allocation ratio of all detection tasks, and a computing resource allocation ratio of the local, edge and cloud for all detection tasks.
[0065] The allocation model constructed includes:
[0066]
[0067] In the above formula, X represents the detection task allocation ratio matrix; x 1i 、x 2i 、x 3i They represent the proportion of the i-th detection task assigned to the local, edge, and cloud respectively; Represents the distribution ratio vectors of all detection tasks in local, edge and cloud respectively;
[0068]
[0069] In the above formula, represents the computing resource matrix required after the detection task is assigned; c 1i 、c 2i 、c 3i Respectively represent the computing resources required for the i-th detection task to be allocated to the local, edge, and cloud; C i represents the computing resources required for the i-th detection task;
[0070]
[0071] In the above formula, Y represents the computing resource allocation ratio matrix; 1i 、y 2i 、y 3i They represent the proportion of computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively;
[0072]
[0073] In the above formula, represents the computing resource allocation matrix; F1, F2, and F3 represent the CPU frequencies of the local, edge, and cloud respectively; f 1i 、f 2i 、f 3i denote the computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively;
[0074] The local processing model built includes:
[0075] t1=max(t 11 ,…,t 1i ,…,t 1n );
[0076]
[0077] In the above formula, t 11 , t 1i , t1n They represent the total delay of the first, i-th, and n-th detection tasks offloaded to the local machine and processed locally; c 1i It represents the computing resources required locally for the portion of the i-th detection task that is allocated to the local area; n represents the total number of detection tasks;
[0078] The edge model constructed includes:
[0079] t2=max(t 21 ,…,t 2i ,…,t 2n );
[0080]
[0081] In the above formula, t 21 , t 2i , t 2n They represent the total delay of the edge processing of the first, i-th, and n-th detection tasks offloaded to the edge, respectively; C 2i represents the portion of the i-th detection task assigned to the edge and the computing resources required at the edge; C et Indicates the computing resource threshold of a single edge terminal; They represent the transmission delay from the train to the edge and the execution delay at the edge respectively; k is the ratio of the task data volume to the required computing resources; r t2ed represents the data transmission rate of unloading tasks from the train to the edge; b 2i represents the amount of data allocated to the i-th task at the edge;
[0082] The cloud-based models constructed include:
[0083] t3=max(t 31 ,…,t 3i ,…,t 3n );
[0084]
[0085] In the above formula, t 31 , t 3i , t 3n They represent the total latency of the first, i-th, and n-th detection tasks assigned to the cloud and processed by the cloud, respectively; c 3i They represent the portion of the i-th detection task offloaded to the cloud and the computing resources required in the cloud; f 1i 、f 2i 、f 3i represents the computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively; b 3irepresents the amount of data allocated to the i-th task in the cloud; k is the ratio of task data volume to required computing resources; They represent the transmission delay from the train to the cloud and the execution delay in the cloud respectively; r t2c Indicates the data transmission rate from the train to the cloud.
[0086] The constraints of the collaborative offloading delay optimization model include task allocation ratio constraints, computing resource allocation constraints, and task delay constraints; the task allocation ratio constraints include:
[0087]
[0088] x ji ∈[0, 1], j∈{1, 2, 3};
[0089] In the above formula, x ji It represents the proportion of the i-th detection task assigned to the j-th processor, where the processor is local, edge or cloud;
[0090] The computing resource allocation constraints include:
[0091]
[0092] In the above formula, f ji represents the computing resources allocated by the jth processor to the i-th detection task; F j represents the CPU frequency of the jth processor;
[0093] The task delay constraints include:
[0094] t ji ≤Ti, i∈{1, 2, 3};
[0095] In the above formula, t ji T represents the total delay of the portion of the i-th detection task that is offloaded to the j-th processor and processed by the j-th processor; i = the delay of the i-th detection task.
[0096] The computing resources C required for the i-th detection task i The calculation formula is:
[0097] C i =mc p ;
[0098] m = ft;
[0099]
[0100] In the above formula, c pThe required computing resources for a single picture; f is the frequency of the high-speed camera set on the train; L is the length of the railway corresponding to the edge end service range; v is the speed of the train; m represents the number of pictures in a single detection task.
[0101] The optimization calculation module solves the collaborative offloading delay optimization model by using a genetic algorithm (GA algorithm), and the specific solving steps include:
[0102] A1, initializing a population, and individuals in the population correspond to a set of decision variables, the decision variables including allocation proportions of all detection tasks and computing resource allocation proportions of the local, edge end and cloud for all detection tasks;
[0103] A2, encoding and decoding, crossover and mutation of the population; wherein the crossover and mutation is: first, sequentially designate individuals in the population as father chromosomes, randomly select individuals in the population as mother chromosomes, then randomly generate a crossover point, and according to a crossover probability, exchange all genes of the father and the mother located after the crossover point to generate offspring chromosomes; then randomly generate a mutation gene position on the offspring chromosomes, and according to a mutation probability, reverse the binary encoding at the mutation gene position to obtain a mutant individual;
[0104] A3, calculating the fitness values of all individuals in the population, selecting individuals with larger fitness values to form a new population by using a roulette method, and selecting an individual with the largest fitness value as an optimal individual;
[0105] A4, returning to A2 for iterative calculation until an iteration stopping condition is reached, and outputting a global optimal solution.
[0106] In a third aspect, the present application provides a collaborative offloading delay optimization device based on real-time rail detection, the collaborative offloading delay optimization device comprising a memory and a processor;
[0107] The memory is configured to store computer program code and transmit the computer program code to the processor;
[0108] The processor is configured to execute the method according to the instructions in the computer program code.
[0109] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, and the computer program is executed by a processor to implement the method.
[0110] Compared with the prior art, the present application has the following beneficial effects:
[0111] The application is a collaborative unloading time delay optimization method based on real-time rail detection. First, a plurality of detection tasks are obtained, and the detection task is a group of pictures of the railway rail shot by a high-speed camera. Then, each detection task is segmented and distributed to the local, edge, and cloud in proportion. The local, edge, and cloud are proportionally distributed computing resources, thereby constructing a distribution model. Then, the local processing model, edge processing model, and cloud processing model are constructed based on the distribution model. The collaborative unloading time delay optimization model is constructed based on the distribution model, the local processing model, the edge processing model, and the cloud processing model. The objective function of the collaborative unloading time delay optimization model is to minimize the maximum value of t1, t2, and t3. t1, t2, and t3 respectively represent the total time delay of the local, edge, and cloud processing all the distributed detection tasks. Finally, the heuristic algorithm is used to solve the collaborative unloading time delay optimization model to obtain the global optimal solution, output the optimal delay, the distribution proportion of all detection tasks, and the computing resource distribution proportion of the local, edge, and cloud for all detection tasks. The design fully considers the unloading characteristics and advantages of each end, takes minimizing the task time delay of the overall system as the goal, proposes a collaborative unloading time delay optimization model, and sets task distribution proportion constraints, computing resource distribution constraints, and task time delay constraints from the discreteness of the rail detection task and the computing resource characteristics of each end. The task unloading and distribution problem is expressed as a maximum minimization model problem. Finally, the genetic algorithm is used for random search and iteration to try to find the global optimal solution. The experimental results show that the design can effectively reflect the characteristics of collaborative unloading task processing and reduce the overall time delay. Therefore, the rail detection task distribution scheme obtained by the application can effectively reflect the characteristics of collaborative unloading task processing and reduce the overall time delay. BRIEF DESCRIPTION OF DRAWINGS
[0112] Figure 1 It is a schematic diagram of the terminal-edge-cloud architecture in the application.
[0113] Figure 2 It is a flowchart of the collaborative unloading time delay optimization method described in the application.
[0114] Figure 3 It is a graph of the response time delay of different schemes with the train shooting frequency for a single detection task in Example 1.
[0115] Figure 4 It is a graph of the response time delay of different schemes with the number of detection tasks for a plurality of detection tasks in Example 1.
[0116] Figure 5 It is a graph of the response time delay of different schemes with the CPU computing resource required by the detection task for a plurality of detection tasks in Example 1.
[0117] Figure 6This is a structural diagram of the collaborative offloading delay optimization system described in the present invention.
[0118] Figure 7 This is a structural diagram of the collaborative offloading delay optimization device described in the present invention. DETAILED DESCRIPTION
[0119] The present invention will be further described in detail below with reference to specific embodiments and the accompanying drawings.
[0120] This invention targets rail inspection scenarios on high-speed trains. Multiple high-speed cameras are installed at intervals on the train. The inspection tasks captured in real time by the high-speed cameras are processed using a pre-trained collaborative unloading delay optimization model to obtain a real-time rail inspection task allocation plan. The multiple inspection tasks are then sent to each terminal according to the obtained rail inspection task allocation plan for inspection. After comprehensive processing of the inspection results from the multiple inspection tasks, the dynamic changes in the rails along the railway line where the train passes can be determined.
[0121] Example 1:
[0122] The terminal-edge-cloud architecture used in this embodiment for rail detection is as follows: Figure 1 As shown, the local terminal on the train can perform local computing. When the data processing capacity required by the real-time rail inspection task required by the high-speed train is greater than the data processing capacity of the local terminal on the train, the local terminal on the train vertically collaborates with the edge end and the cloud to offload the computing task to the edge end and the cloud. The edge layer is composed of wireless access infrastructure such as base stations and edge servers. It is close to the train. The edge server is generally deployed near the base station. An edge server generally serves a section of railway. When the train passes through a section of railway, the edge server associated with it is the edge server ed. The edge servers adjacent to the edge server ed are the edge servers edr and edl. When the computing resources required for the inspection task are small, the edge server ed can meet the computing requirements. When the computing resources of the edge server ed are insufficient, horizontal collaboration of the edge end can also be considered, that is, the part that exceeds the computing resource threshold of the edge server ed is offloaded to the adjacent edge servers edr and edl through the wired network to achieve collaborative task processing. The cloud end is mainly composed of resource-rich cloud servers, which are connected to the edge end through the core network.
[0123] See also Figure 2 A collaborative unloading delay optimization method based on real-time rail detection is implemented based on the rail detection hierarchical architecture. The specific steps of the collaborative unloading delay optimization method are as follows:
[0124] S1. Obtain multiple inspection tasks. The inspection tasks generated by a single train are a series of unprocessed rail images captured by a high-speed camera as the train passes through a section of railway. Because the high-speed camera captures the rails at a certain frequency, the series of unprocessed rail images captured is discrete data that can be split and distributed to the train's local terminal, edge device, and cloud for recognition and processing. All inspection tasks generated by the train are processed in parallel on these three terminals.
[0125] S2. Each detection task is divided proportionally and allocated to the local, edge, and cloud. The local, edge, and cloud allocate computing resources proportionally to the portion allocated to each detection task, thereby constructing an allocation model; the allocation model includes:
[0126]
[0127] In the above formula, X represents the detection task allocation ratio matrix; x 1i 、x 2i 、x 3i They represent the proportion of the i-th detection task assigned to the local, edge, and cloud respectively; Represents the distribution ratio vectors of all detection tasks in local, edge and cloud respectively;
[0128]
[0129] In the above formula, represents the computing resource matrix required after the detection task is assigned; c 1i 、c 2i 、c 3i Respectively represent the computing resources required for the i-th detection task to be allocated to the local, edge, and cloud; C i represents the computing resources required for the i-th detection task;
[0130]
[0131] In the above formula, Y represents the computing resource allocation ratio matrix; 1i 、y 2i 、y 3i They represent the proportion of computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively;
[0132]
[0133] In the above formula, represents the computing resource allocation matrix; F1, F2, and F3 represent the CPU frequencies of the local, edge, and cloud respectively; f 1i 、f 2i 、f 3irepresents the computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively; in this embodiment, the computing resources allocated to the i-th detection task by the edge servers ed, edr, and edl are all f 2i ;
[0134] Based on the allocation model, a local processing model, an edge processing model, and a cloud processing model are constructed; the local processing model includes:
[0135] t1=max(t 11 ,…,t 1i ,…,t 1n );
[0136]
[0137] In the above formula, t 11 , t 1i , t 1n They represent the total delay of the first, i-th, and n-th detection tasks offloaded to the local machine and processed locally; c 1i It represents the computing resources required locally for the portion of the i-th detection task that is allocated to the local area; n represents the total number of detection tasks;
[0138] The edge model includes:
[0139] t2=max(t 21 ,…,t 2i ,…,t 2n );
[0140]
[0141]
[0142] In the above formula, t 21 , t 2i , t 2n represents the total delay of the edge end processing the first, i-th, and n-th detection tasks offloaded to the edge end respectively; c 2i represents the portion of the i-th detection task assigned to the edge and the computing resources required at the edge; C et Indicates the computing resource threshold of a single edge terminal; They represent the transmission delay from the train to the edge and the execution delay at the edge respectively; k is the ratio of the task data volume to the required computing resources; r t2ed represents the data transmission rate of unloading tasks from the train to the edge; b 2i represents the amount of data allocated to the i-th task at the edge. Since the amount of detection results is small, the delay of transmitting the detection results from the edge or cloud is ignored when calculating the total delay.
[0143] The cloud model includes:
[0144] t3=max(t 31 ,…,t 3i ,…,t 3n );
[0145]
[0146] In the above formula, t 31 , t 3i , t 3n They represent the total latency of the first, i-th, and n-th detection tasks assigned to the cloud and processed by the cloud, respectively; c 3i They represent the portion of the i-th detection task offloaded to the cloud and the computing resources required in the cloud; f 1i 、f 2i 、f 3i represents the computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively; b 3i represents the amount of data allocated to the i-th task in the cloud; k is the ratio of task data volume to required computing resources; They represent the transmission delay from the train to the cloud and the execution delay in the cloud respectively; r t2c represents the data transmission rate from the train to the cloud; r t2ed The calculation formula is:
[0147] r t2ed =B ed log2(1+SINR ed );
[0148]
[0149] In the above formula, B ed is the channel bandwidth of the edge server ed receiving signal; SINR ed is the signal-to-noise ratio when the edge server ed receives the signal; P is the transmission power of the train; g is the channel gain between the train and the edge server ed; N0 is the noise power spectral density at the edge server ed;
[0150] r t2c The calculation formula and r t2ed Similarly, r t2ed In the calculation formula, the parameters related to the edge server ed can be replaced with the parameters related to the cloud server;
[0151] S3. Construct a collaborative offloading delay optimization model based on the distribution model, local processing model, edge processing model, and cloud processing model. The objective function of the collaborative offloading delay optimization model is:
[0152] min(max(t1, t2, t3));
[0153] In the above formula, t1, t2, and t3 represent the total latency for processing all assigned detection tasks locally, on the edge, and in the cloud, respectively; max(t1, t2, t3) represents the maximum value among t1, t2, and t3. Since each detection task is processed in parallel locally, on the edge, and in the cloud after being assigned, the total latency for executing all tasks is max(t1, t2, t3).
[0154] The constraints of the collaborative offloading delay optimization model include task allocation ratio constraints, computing resource allocation constraints, and task delay constraints; the task allocation ratio constraints include:
[0155]
[0156] x ji ∈[0, 1], j∈{1, 2, 3};
[0157] In the above formula, x ji represents the proportion of the i-th detection task assigned to the j-th processor, where the processor refers to the local, edge or cloud;
[0158] The computing resource allocation constraints include:
[0159]
[0160] In the above formula, f ji represents the computing resources allocated by the jth processor to the i-th detection task; F j represents the CPU frequency of the jth processor;
[0161] The task delay constraints include:
[0162] t ji ≤T i , j∈{1, 2, 3};
[0163] In the above formula, t ji T represents the total delay of the portion of the i-th detection task that is offloaded to the j-th processor and processed by the j-th processor; i represents the delay of the i-th detection task.
[0164] The computing resources C required for the i-th detection task i The calculation formula is:
[0165] Ci =mc p ;
[0166] m = ft;
[0167]
[0168] In the above formula, c p is the computing resources required for a single image; f is the frequency of taking pictures by the high-speed camera installed on the train; L is the length of the railway corresponding to the edge service range; υ is the speed of the train; m is the number of images in a single detection task;
[0169] S4. Use a genetic algorithm to solve the collaborative offloading delay optimization model and obtain the global optimal solution. The specific solution steps include:
[0170] A1. Initialize the population. Each individual in the population corresponds to a set of decision variables. These decision variables include the allocation ratio of all detection tasks and the allocation ratio of computing resources for all detection tasks locally, on the edge, and in the cloud.
[0171] A2. Encoding, decoding, and crossover mutation are performed on the population. The crossover mutation involves sequentially designating individuals in the population as the chromosomes of the father and randomly selecting individuals in the population as the chromosomes of the mother. A crossover point is then randomly generated, and all genes of the father and mother located after the crossover point are swapped according to the crossover probability to generate offspring chromosomes. A mutant gene position is then randomly generated on the offspring chromosome, and the binary code at the mutant gene position is inverted according to the mutation probability to obtain a mutant individual.
[0172] A3. Calculate the fitness values of all individuals in the population, use the roulette wheel method to select individuals with larger fitness values to form a new population, and select the individual with the largest fitness value as the optimal individual; in the roulette wheel method, the probability of an individual being selected is:
[0173]
[0174] In the above formula, p sel is the selection probability of each individual; h(s i ) is the fitness value of the i-th individual; ∑h(s i ) is the sum of the fitness values of all individuals in the population;
[0175] A4. Return to A2 and iterate until the iteration stop condition is reached, and output the global optimal solution; the global optimal solution includes the optimal delay, the distribution ratio of all detection tasks, and the distribution ratio of computing resources for all detection tasks locally, on the edge, and in the cloud.
[0176] Performance Verification:
[0177] 1. Experimental Platform and Parameter Settings: The operating platform is Pycharm 2021, the operating environment is Python 3.11, the computer configuration is Windows 10 operating system, Intel Core i5-9300H CPU @ 2.40GHz, and 8GB of memory. The relevant parameters of the genetic algorithm are: chromosome length 8, population size 100, chromosome crossover probability 0.90, chromosome mutation probability 0.10, and maximum number of iterations G = 10000. The basic parameters of the train detection task and each server are shown in Table 1:
[0178] Table 1 Basic parameters of train tasks and associated servers
[0179] Parameters and units Value High-speed camera shooting frequency (Hz) [0,200] Data size of a single image (KB) 100KB CPU resources required for processing a single image (number) 1000000 The speed of the train within the range of a single edge server (km / h) 216 Train travel time within a single edge server (s) 30 Transmission speed from train end to edge server (Gpbs) 20 Transmission speed from train end to cloud server (Gbps) 3
[0180] 2. Single detection task
[0181] The collaborative offloading latency optimization method of the present invention is compared with other solutions, including a local edge-cloud collaborative offloading processing method based on the ant colony optimization algorithm (ACO), a local edge-cloud collaborative offloading processing method based on the particle swarm optimization algorithm (PSO), a local binary offloading (BO) processing method, an edge-side binary offloading processing method, and a cloud-side binary offloading processing method. When the CPU computing power of the local server, edge server, and cloud server is 5000MHz, 10000MHz, and 500000MHz, respectively, the latency of the above solutions is obtained. The results are as follows: Figure 3 As shown;
[0182] Depend on Figure 3 It can be seen that, first, under the same train shooting frequency, the delay generated by the collaborative offloading method is significantly smaller than the delay generated by the binary offloading method, and as the train shooting frequency increases, the delay gap between the collaborative offloading method and the binary offloading method continues to widen; secondly, as the train shooting frequency increases, both the binary offloading method and the collaborative offloading method show an increasing trend in latency, but the collaborative offloading method goes through a stage of first rising, then slowly rising, and then rising again. This is because the increase in the train frequency brings about an increase in the amount of tasks, which makes the amount of tasks exceed the C of the edge server. et , the edge server ed will exceed its C et Part of the tasks are offloaded to the adjacent edge server for processing. When the task volume continues to increase, the collaborative offloading processing delay continues to increase.
[0183] When the train image capture frequency is 200Hz, the response latencies for cloud-based BO, edge-based BO, and local BO are 1612ms, 840ms, and 1200ms, respectively. The response latencies for collaborative offloading based on GA, PSO, and ACO are 325ms, 367ms, and 422ms, respectively. The difference in response latencies among GA, PSO, and ACO is similar because the task segmentation and resource allocation variables for a single detection task are relatively small, resulting in good convergence and optimization results for all three algorithms.
[0184] 3. Multiple detection tasks
[0185] The collaborative offloading latency optimization method of the present invention is compared with other solutions, namely a local edge-cloud collaborative offloading processing method based on an ant colony algorithm and a local edge-cloud collaborative offloading processing method based on a particle swarm algorithm. The following two comparative experiments are conducted when the CPU computing power of the local server, edge server, and cloud server are 5000MHz, 10000MHz, and 500000MHz, respectively:
[0186] Experiment 1: Fix the CPU computing resources required for each detection task to 4e 9 We conducted experiments on the number of detection tasks and the change of delay; the experimental results are as follows Figure 4 As shown;
[0187] Experiment 2: The number of detection tasks is fixed at 5, and the CPU computing resources and processing delay required for the detection tasks are tested. The experimental results are as follows: Figure 5 As shown;
[0188] Depend on Figure 4 、 Figure 5 It can be seen that as the number of detection tasks or the CPU computing resources required for detection tasks increases, the task processing delay increases slowly at first and then increases sharply. This is because for tasks with higher priority, collaborative offloading will allocate more CPU computing power to the task, resulting in less CPU computing power allocated to other tasks, which in turn leads to a significant increase in processing delay when the number of detection tasks increases or the CPU computing resources required for detection tasks increase. When the number of detection tasks is 10, the response delays of collaborative offloading based on GA, PSO, and ACO are 1.050, 3.490, and 4.570s, respectively. When the CPU computing resources required for the detection task are 10G, the response delays of collaborative offloading based on GA, PSO, and ACO are 2.326, 3.336, and 4.050s, respectively. Comparing the response delays of the three algorithms, it can be seen that the GA algorithm performs well in collaborative offloading processing delay, and the greater the number of tasks and the CPU computing resources required for the tasks, the more obvious its advantage over the other two algorithms.
[0189] Example 2:
[0190] Referring to Figure 6 A collaborative offloading time delay optimization system based on real-time rail detection, comprising a detection task acquisition module, an allocation model construction module, a local processing model construction module, an edge end processing model construction module, a cloud end processing model construction module, a collaborative offloading time delay optimization model construction module, and an optimization calculation module; the detection task acquisition module is used to acquire a plurality of detection tasks, and each detection task corresponds to a group of railway rail pictures captured by a high-speed camera; the allocation model construction module is used to segment and allocate each detection task to the local, edge end and cloud end according to a proportion, and the local, edge end and cloud end allocate computing resources to the allocated part according to the proportion, so as to construct an allocation model; the allocation model comprises:
[0191]
[0192] In the above formula, X represents a detection task allocation proportion matrix; x 1i , x 2i , x 3i respectively represent the proportion of the i-th detection task allocated to the local, edge end and cloud end; respectively represent the allocation proportion vectors of all detection tasks in the local, edge end and cloud end;
[0193]
[0194] In the above formula, represents a computing resource matrix required after the detection task is allocated; c 1i , c 2i , c 3i respectively represent the computing resources required by the part of the i-th detection task allocated to the local, edge end and cloud end; C i represents the computing resources required by the i-th detection task;
[0195]
[0196] In the above formula, Y represents a computing resource allocation proportion matrix; y 1i , y 2i , y 3i respectively represent the proportion of computing resources allocated to the i-th detection task by the local, edge end and cloud end;
[0197]
[0198] In the above formula, represents a computing resource allocation matrix; F1, F2 and F3 respectively represent the CPU frequency of the local, edge end and cloud end; f 1i , f 2i , f 3idenote the computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively;
[0199] The local processing model construction module is used to construct a local processing model based on the allocation model; the local processing model includes:
[0200] t1=max(t 11 ,…,t 1i ,…,t 1n );
[0201]
[0202] In the above formula, t 11 , t 1i , t 1n They represent the total delay of the first, i-th, and n-th detection tasks offloaded to the local machine and processed locally; c 1i It represents the computing resources required locally for the portion of the i-th detection task that is allocated to the local area; n represents the total number of detection tasks;
[0203] The edge processing model construction module is used to construct an edge processing model based on the allocation model; the edge model includes:
[0204] t2=max(t 21 ,…,t 2i ,…,t 2n );
[0205]
[0206] In the above formula, t 21 , t 2i , t 2n represents the total delay of the edge end processing the first, i-th, and n-th detection tasks offloaded to the edge end respectively; c 2i represents the portion of the i-th detection task assigned to the edge and the computing resources required at the edge; C et Indicates the computing resource threshold of a single edge terminal; They represent the transmission delay from the train to the edge and the execution delay at the edge respectively; k is the ratio of the task data volume to the required computing resources; r t2ed represents the data transmission rate of unloading tasks from the train to the edge; b 2i represents the amount of data allocated to the i-th task at the edge. Since the amount of detection results is small, the delay of transmitting the detection results from the edge or cloud is ignored when calculating the total delay.
[0207] The cloud processing model construction module is used to construct a cloud processing model based on the allocation model; the cloud model includes:
[0208] t3=max(t 31 ,…,t 3i ,…,t 3n );
[0209]
[0210] In the above formula, t 31 , t 3i , t 3n They represent the total latency of the first, i-th, and n-th detection tasks assigned to the cloud and processed by the cloud, respectively; c 3i They represent the portion of the i-th detection task offloaded to the cloud and the computing resources required in the cloud; f 1i 、f 2i 、f 3i represents the computing resources allocated to the i-th detection task locally, on the edge, and in the cloud respectively; b 3i represents the amount of data allocated to the i-th task in the cloud; k is the ratio of task data volume to required computing resources; They represent the transmission delay from the train to the cloud and the execution delay in the cloud respectively; r t2c represents the data transmission rate from the train to the cloud; r t2ed The calculation formula is:
[0211] r t2ed =B ed log2(1+SINR ed );
[0212]
[0213] In the above formula, B ed is the channel bandwidth of the edge server ed receiving signal; SINR ed is the signal-to-noise ratio when the edge server ed receives the signal; P is the transmission power of the train; g is the channel gain between the train and the edge server ed; N0 is the noise power spectral density at the edge server ed;
[0214] r t2c The calculation formula of r t2ed Similarly, r t2ed In the calculation formula, the parameters related to the edge server ed can be replaced with the parameters related to the cloud;
[0215] The collaborative offloading delay optimization model construction module is used to construct a collaborative offloading delay optimization model based on the distribution model, local processing model, edge processing model, and cloud processing model; the objective function of the collaborative offloading delay optimization model is:
[0216] min(max(t1, t2, t3));
[0217] In the above formula, t1, t2, and t3 represent the total latency for processing all assigned detection tasks locally, on the edge, and in the cloud, respectively; max(t1, t2, t3) represents the maximum value among t1, t2, and t3. Since each detection task is processed in parallel locally, on the edge, and in the cloud after being assigned, the total latency for executing all tasks is max(t1, t2, t3).
[0218] The constraints of the collaborative offloading delay optimization model include task allocation ratio constraints, computing resource allocation constraints, and task delay constraints. The task allocation ratio constraints include:
[0219]
[0220] x ji ∈[0, 1], j∈{1, 2, 3};
[0221] In the above formula, x ji It represents the proportion of the i-th detection task assigned to the j-th processor, where the processor is local, edge or cloud;
[0222] The computing resource allocation constraints include:
[0223]
[0224] In the above formula, f ji represents the computing resources allocated by the jth processor to the i-th detection task; F j represents the CPU frequency of the i-th processor;
[0225] The task delay constraints include:
[0226] t ji ≤T i , i∈{1, 2, 3};
[0227] In the above formula, t ji T represents the total delay of the portion of the i-th detection task that is offloaded to the j-th processor and processed by the j-th processor; i express.
[0228] The computing resources C required for the i-th detection task i The calculation formula is:
[0229] C i =mc p ;
[0230] m = ft;
[0231]
[0232] In the above formula, c p is the computing resources required for a single image; f is the frequency of taking pictures by the high-speed camera installed on the train; L is the length of the railway corresponding to the edge service range; υ is the speed of the train; m is the number of images in a single detection task;
[0233] The optimization calculation module is used to solve the collaborative offloading delay optimization model using a genetic algorithm; the method of solving the collaborative offloading delay optimization model using a genetic algorithm includes:
[0234] A1. Initialize the population. Each individual in the population corresponds to a set of decision variables. These decision variables include the allocation ratio of all detection tasks and the allocation ratio of computing resources for all detection tasks locally, on the edge, and in the cloud.
[0235] A2. Encoding, decoding, and crossover mutation are performed on the population. The crossover mutation involves sequentially designating individuals in the population as the chromosomes of the father and randomly selecting individuals in the population as the chromosomes of the mother. A crossover point is then randomly generated, and all genes of the father and mother located after the crossover point are swapped according to the crossover probability to generate offspring chromosomes. A mutant gene position is then randomly generated on the offspring chromosome, and the binary code at the mutant gene position is inverted according to the mutation probability to obtain a mutant individual.
[0236] A3. Calculate the fitness values of all individuals in the population, use the roulette wheel method to select individuals with larger fitness values to form a new population, and select the individual with the largest fitness value as the optimal individual; in the roulette wheel method, the probability of an individual being selected is:
[0237]
[0238] In the above formula, p sel is the selection probability of each individual; h(s i ) is the fitness value of the i-th individual; ∑h(s i ) is the sum of the fitness values of all individuals in the population;
[0239] A4. Return to A2 and iterate until the iteration stop condition is reached, and output the global optimal solution; the global optimal solution includes the optimal delay, the distribution ratio of all detection tasks, and the distribution ratio of computing resources for all detection tasks locally, on the edge, and in the cloud.
[0240] Example 3:
[0241] See also Figure 7An equipment for optimizing cooperative unloading delay based on real-time rail detection, comprising a memory and a processor; the memory is used for storing computer program codes and transmitting the computer program codes to the processor; the processor is used for executing the method in embodiment 1 according to the instructions in the computer program codes.
[0242] Embodiment 4
[0243] A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program is executed by a processor to implement the method in embodiment 1.
[0244] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system) and computer program product according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The functions specified in one or more flows and / or blocks
[0245] These computer program instructions can also be stored in a computer readable memory capable of directing the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer readable memory produce a product including instruction means, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The functions specified in one or more flows and / or blocks
[0246] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The functions specified in one or more flows and / or blocks
[0247] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to the embodiments once they know the basic inventive concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0248] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A collaborative unloading delay optimization method based on real-time rail detection, characterized by: The collaborative offloading delay optimization method includes: S1. Acquire multiple detection tasks, each of which is a set of images of railway rails captured by a high-speed camera; S2. Divide each detection task proportionally and allocate it to the local, edge, and cloud ends, allocating computing resources proportionally to the allocated portions, thereby constructing an allocation model; and constructing a local processing model, an edge processing model, and a cloud processing model based on the allocation model; S3. Construct a collaborative offloading delay optimization model based on the distribution model, local processing model, edge processing model, and cloud processing model. The objective function of the collaborative offloading delay optimization model is: ; In the above formula, 、 、 Represents the total latency of processing all assigned detection tasks locally, on the edge, and in the cloud respectively; express 、 、 The maximum value in ; S4. Using a heuristic algorithm to solve the collaborative offloading delay optimization model to obtain a global optimal solution; the global optimal solution includes the optimal delay, the distribution ratio of all detection tasks, and the distribution ratio of computing resources for all detection tasks locally, on the edge, and in the cloud; In S3, the allocation model includes: ; In the above formula, Represents the detection task allocation ratio matrix; 、 、 Respectively represent The proportion of detection tasks assigned to local, edge, and cloud devices; 、 、 Represents the distribution ratio vectors of all detection tasks in local, edge and cloud respectively; ; In the above formula, Represents the computing resource matrix required after the detection task is assigned; 、 、 Respectively represent Each detection task is allocated to the required computing resources locally, on the edge, and in the cloud. Indicates the The computing resources required for each detection task; ; In the above formula, Represents the computing resource allocation ratio matrix; 、 、 Respectively represent the local, edge, and cloud allocations to the The ratio of computing resources for each detection task; ; In the above formula, represents the computing resource allocation matrix; 、 、 Represents the CPU frequencies of local, edge, and cloud respectively; 、 、 Respectively represent the local, edge, and cloud allocations to the Computational resources for each detection task; The local processing model includes: ; ; In the above formula, 、 、 Respectively represent the first and , The total latency of the local processing of the portion of the detection task that is offloaded to the local server. Indicates the The computing resources required locally for the portion of a detection task that is assigned to the local machine; Indicates the total number of detection tasks; The edge processing model includes: ; ; ; ; In the above formula, 、 、 Respectively represent the first and , The total latency of processing the portion of a detection task offloaded to the edge. Indicates the The portion of the detection task assigned to the edge and the computing resources required at the edge; Indicates the computing resource threshold of a single edge terminal; 、 They represent the transmission delay from the train to the edge and the execution delay at the edge, respectively; is the ratio of task data volume to required computing resources; represents the data transfer rate for offloading tasks from the train to the edge; Indicates the The amount of data allocated to each task at the edge; The cloud processing model includes: ; ; ; ; In the above formula, 、 、 Respectively represent the first and , The total latency of the cloud-processed portion of a detection task assigned to it; Respectively represent The computing resources required in the cloud for the portion of the detection task that is offloaded to the cloud; 、 、 Respectively represent the local, edge, and cloud allocations to the Computational resources for each detection task; Indicates the The amount of data allocated to each task in the cloud; The ratio of task data volume to required computing resources; 、 They represent the transmission delay from the train to the cloud and the execution delay in the cloud, respectively; Indicates the data transmission rate from the train to the cloud.
2. The method for optimizing the collaborative unloading delay based on real-time rail detection according to claim 1, characterized in that: In S3, the constraints of the collaborative offloading delay optimization model include task allocation ratio constraints, computing resource allocation constraints, and task delay constraints; The task allocation ratio constraints include: ; ; In the above formula, Indicates the The detection task is assigned to The ratio of processors to be local, edge, or cloud-based; The computing resource allocation constraints include: ; In the above formula, Indicates the processors are assigned to Computational resources for each detection task; Indicates the CPU frequency of each processor; The task delay constraints include: ; In the above formula, Indicates the detection tasks to be unloaded to The part of the processor, The total delay of processing by the processor; Indicates the The delay of a detection task.
3. The method for optimizing the collaborative unloading delay based on real-time rail detection according to claim 2, characterized in that: The said The computing resources required for the detection task The calculation formula is: ; ; ; In the above formula, The computing resources required for a single image; Frequency of taking photos for high-speed cameras installed on trains; The length of the railway within the service range of the edge end; is the speed of the train; Indicates the number of images in a single detection task.
4. A collaborative unloading delay optimization method based on real-time rail detection according to any one of claims 1 to 3, characterized in that: A genetic algorithm is used to solve the collaborative offloading delay optimization model. The specific solution steps include: A1. Initialize the population. Each individual in the population corresponds to a set of decision variables. These decision variables include the allocation ratio of all detection tasks and the allocation ratio of computing resources for all detection tasks locally, on the edge, and in the cloud. A2. Encode and decode the population and perform crossover mutation. The crossover mutation is as follows: first, sequentially designate individuals in the population as the chromosomes of the father, randomly select individuals in the population as the chromosomes of the mother, and then randomly generate crossover points with a crossover probability of All genes of the father and mother after the crossover point are exchanged to generate offspring chromosomes; then a mutant gene position is randomly generated on the offspring chromosome, and the mutation probability is used to generate the offspring chromosome. Reverse the binary code at the mutant gene position to obtain the mutant individual; A3. Calculate the fitness values of all individuals in the population, use the roulette wheel method to select individuals with larger fitness values to form a new population, and select the individual with the largest fitness value as the optimal individual; A4. Return to A2 and iterate until the iteration stop condition is reached, and output the global optimal solution.
5. A collaborative unloading delay optimization system based on real-time rail detection, characterized by: The collaborative offloading delay optimization system includes a detection task acquisition module, an allocation model construction module, a local processing model construction module, an edge processing model construction module, a cloud processing model construction module, a collaborative offloading delay optimization model construction module, and an optimization calculation module; The detection task acquisition module is used to acquire multiple detection tasks, where each detection task corresponds to a set of railway rail images taken by a high-speed camera; The allocation model construction module is used to divide each detection task proportionally and allocate it to the local, edge, and cloud ends, and the local, edge, and cloud ends allocate computing resources proportionally to the allocated parts to build an allocation model; The local processing model building module is used to build a local processing model based on the allocation model; The edge processing model construction module is used to construct an edge processing model based on the allocation model; The cloud processing model construction module is used to construct a cloud processing model based on the allocation model; The collaborative offloading delay optimization model construction module is used to construct a collaborative offloading delay optimization model based on the distribution model, local processing model, edge processing model, and cloud processing model. The objective function of the collaborative offloading delay optimization model is: ; In the above formula, 、 、 Represents the total latency of processing all assigned detection tasks locally, on the edge, and in the cloud respectively; express 、 、 The maximum value in ; The optimization calculation module is used to solve the collaborative offloading delay optimization model using a heuristic algorithm to obtain a global optimal solution, which includes the optimal delay, the distribution ratio of all detection tasks, and the distribution ratio of computing resources for all detection tasks locally, on the edge, and in the cloud; The allocation model constructed includes: ; In the above formula, Represents the detection task allocation ratio matrix; 、 、 Respectively represent The proportion of detection tasks assigned to local, edge, and cloud devices; 、 、 Represents the distribution ratio vectors of all detection tasks in local, edge and cloud respectively; ; In the above formula, Represents the computing resource matrix required after the detection task is assigned; 、 、 Respectively represent Each detection task is allocated to the required computing resources locally, on the edge, and in the cloud. Indicates the The computing resources required for each detection task; ; In the above formula, Represents the computing resource allocation ratio matrix; 、 、 Respectively represent the local, edge, and cloud allocations to the The ratio of computing resources for each detection task; ; In the above formula, represents the computing resource allocation matrix; 、 、 Represents the CPU frequencies of local, edge, and cloud respectively; 、 、 Respectively represent the local, edge, and cloud allocations to the Computational resources for each detection task; The local processing model built includes: ; ; In the above formula, 、 、 Respectively represent the first and , The total latency of the local processing of the portion of the detection task that is offloaded to the local server. Indicates the The computing resources required locally for the portion of a detection task that is assigned to the local machine; Indicates the total number of detection tasks; The constructed edge processing model includes: ; ; ; ; In the above formula, 、 、 Respectively represent the first and , The total latency of processing the portion of a detection task offloaded to the edge. Indicates the The portion of the detection task assigned to the edge and the computing resources required at the edge; Indicates the computing resource threshold of a single edge terminal; 、 They represent the transmission delay from the train to the edge and the execution delay at the edge, respectively; is the ratio of task data volume to required computing resources; represents the data transfer rate for offloading tasks from the train to the edge; Indicates the The amount of data allocated to each task at the edge; The cloud processing model built includes: ; ; ; ; In the above formula, 、 、 Respectively represent the first and , The total latency of the cloud-processed portion of a detection task assigned to it; Respectively represent The computing resources required in the cloud for the portion of the detection task that is offloaded to the cloud; 、 、 Respectively represent the local, edge, and cloud allocations to the Computational resources for each detection task; Indicates the The amount of data allocated to each task in the cloud; The ratio of task data volume to required computing resources; 、 They represent the transmission delay from the train to the cloud and the execution delay in the cloud, respectively; Indicates the data transmission rate from the train to the cloud.
6. The collaborative unloading delay optimization system based on real-time rail detection according to claim 5, characterized in that: The constraints of the collaborative offloading delay optimization model include task allocation ratio constraints, computing resource allocation constraints, and task delay constraints; The task allocation ratio constraints include: ; ; In the above formula, Indicates the The detection task is assigned to The ratio of processors to be local, edge, or cloud-based; The computing resource allocation constraints include: ; In the above formula, Indicates the processors are assigned to Computational resources for each detection task; Indicates the CPU frequency of each processor; The task delay constraints include: ; In the above formula, Indicates the detection tasks to be unloaded to The part of the processor, The total delay of processing by the processor; Indicates the The delay of a detection task.
7. The collaborative unloading delay optimization system based on real-time rail detection according to claim 6, characterized in that: The said The computing resources required for the detection task The calculation formula is: ; ; ; In the above formula, The computing resources required for a single image; Frequency of taking photos for high-speed cameras installed on trains; The length of the railway within the service range of the edge end; is the speed of the train; Indicates the number of images in a single detection task.
8. A collaborative unloading delay optimization system based on real-time rail detection according to any one of claims 5 to 7, characterized in that: The optimization calculation module uses a genetic algorithm to solve the collaborative offloading delay optimization model. The specific solution steps include: A1. Initialize the population. Each individual in the population corresponds to a set of decision variables. These decision variables include the allocation ratio of all detection tasks and the allocation ratio of computing resources for all detection tasks locally, on the edge, and in the cloud. A2. Encode and decode the population and perform crossover mutation. The crossover mutation is as follows: first, sequentially designate individuals in the population as the chromosomes of the father, randomly select individuals in the population as the chromosomes of the mother, and then randomly generate crossover points with a crossover probability of All genes of the father and mother after the crossover point are exchanged to generate offspring chromosomes; then a mutant gene position is randomly generated on the offspring chromosome, and the mutation probability is used to generate the offspring chromosome. Reverse the binary code at the mutant gene position to obtain the mutant individual; A3. Calculate the fitness values of all individuals in the population, use the roulette wheel method to select individuals with larger fitness values to form a new population, and select the individual with the largest fitness value as the optimal individual; A4. Return to A2 and iterate until the iteration stop condition is reached, and output the global optimal solution.