Traffic light control method based on environment edge calculation
By using the YOLOv5s detection model and redundant server selection mechanism in the traffic light control system, video frames are divided and allocated to multiple edge servers for processing, combined with Bloom filter for rapid service discovery, the high deployment cost of traffic light control and The problem of delay enables a low-cost and reliable traffic light control system.
Patent Information
- Application Number
- CN202411422855.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-10-12
AI Technical Summary
Traffic light control deployment of mobile edge devices is expensive and has a long deployment cycle. The existing technology fails to effectively utilize the processing capabilities of smart devices, resulting in communication delays and waste of resources.
By running the YOLOv5s network detection model in the data center part for initial object detection, and dividing the video frame into multiple subframes, using the redundant server selection mechanism to allocate to multiple edge servers for processing, combined with the Bloom filter for rapid service discovery, Implement lightweight task splitting and result integration to reduce costs and improve reliability.
A low-cost and reliable traffic light control system is realized, and by unloading tasks to mobile devices carried by crowds, the demand for dedicated edge servers is reduced, and the system flexibility and post-disaster availability is improved.
Smart Images

Figure CN118942058A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of Internet of Things technology and edge computing technology, and in particular to a traffic light control method based on environmental edge computing. Background Art
[0002] In the 21st century, with its rapid economic and technological development, innovative mobile applications and services such as augmented reality, federated learning, object detection, and edge caching are increasingly emerging. These applications significantly increase the demand for computing resources, which are typically provided by cloud servers. However, due to the heavy load and long distances of backhaul links, communication latency is high. For traffic control services, acceptable latency ranges from 10 milliseconds to 100 milliseconds.
[0003] Edge computing is considered a complement to cloud computing, aiming to provide elastic resources at the edge of the network. To reduce communication latency, edge devices, physically closer to the network than the cloud infrastructure, are used. These edge devices are called edge servers. EdgeGo is a mobile resource sharing framework that uses mobile edge servers (mounted on mobile robots or drones) to enable low-cost deployment of 6G edge computing. Unfortunately, this framework does not fully utilize the rich processing power of increasingly powerful ambient devices such as smartphones. MiVeCC is a vehicle-edge-cloud simulation framework designed to optimize vehicle cooperative control within large areas with multiple intersections. However, it does not consider resource budgets or the impact of communication and computational variability.
[0004] In smart cities, resource-constrained end devices can enhance various AI services by connecting to edge servers. However, deploying dedicated, heavyweight edge servers and resources to establish large-scale service coverage can be very expensive, requiring additional manpower, material, and financial resources. Traditional edge server deployment requires the purchase of physical equipment, site leasing, installation and maintenance costs, and additional costs for electricity and backhaul transmission. Base station capital and operating expenses are high, and base station deployment typically requires a long deployment cycle. Summary of the Invention
[0005] The purpose of the present invention is to provide a traffic light control method based on environmental edge computing to solve the technical problems of high cost and long deployment cycle of mobile edge devices for traffic light control.
[0006] To solve the above technical problems, the traffic light control method based on environmental edge computing of the present invention includes the following steps:
[0007] Step S1: The data center periodically broadcasts a WiFi beacon embedded with a request for service through an access point, and discovers mobile devices that can serve as edge servers through a service manager.
[0008] Step S2: The camera starts collecting video frames. Each frame is transmitted through two paths: one for local detection by the local detector in the data center, and the other for remote detection by the edge computing part.
[0009] Step S3: The data center runs the YOLOv5s network detection model on the local detector, performs video frame analysis on the local resource-limited site, and performs initial object detection, namely, object localization and classification. The video frame is divided into boundary lines, and based on the coordinate position information of the detected objects, the objects crossing the boundary lines are extracted. The index of the frame in which the object is located and the object detection results are sent to the integration manager.
[0010] The object detection results include a detection box, label, and score, which are directly obtained after the local detection model and the remote detection model detect the video frame. The detection box refers to the bounding box of the detected object, which is used to describe the position and size of the object in the video frame. The label refers to the category to which the detected object belongs. The score is the probability of belonging to the category, that is, the confidence level.
[0011] Step S4: The cropping manager in the data center part crops each video frame into several main slices according to the boundary lines; then, fills each main slice with surrounding padding slices to create a new video subframe; and then encodes it into a byte stream that can be used for transmission;
[0012] Step S5: The offload manager in the data center allocates a corresponding edge server to each video subframe based on the CPU load and RSSI information of each edge server transmitted by the service manager through a redundant server selection mechanism. The offload manager also assembles the IP address, port number, and encoded video subframe corresponding to the edge server into transmission data and stores it in a sending queue, waiting to be sent to the selected edge server.
[0013] The redundant server selection mechanism assigns each video subframe to multiple edge servers for processing, rather than just a single edge server. Because edge server computing resources are limited and communication instability caused by edge server mobility can reduce task reliability, it's necessary to select multiple edge servers to handle the same task, essentially creating redundant servers.
[0014] Step S6: The edge server of the edge computing part receives the transmission data sent by the data center part, decodes the transmission data in the receiving queue, performs target detection through the Nanodet-Plus target detection model of the remote detector, and sends the current video subframe index and target detection result obtained by target detection to the data center part;
[0015] Step S7: The integration manager of the data center integrates the target detection results obtained by local detection and the target detection results obtained by remote detection of the edge server to obtain a final target detection result, and controls the traffic light according to the final target detection result.
[0016] Furthermore, in step S1, the data center embeds service information in the beacon to enable the data center to efficiently discover mobile devices that can provide the requested service; nearby mobile devices perform service queries by parsing the beacon information; if the mobile device can provide the service requested by the data center, it will actively establish a WiFi connection with the data center and become an edge server.
[0017] Furthermore, the data center part has a Bloom filter and provides a list of requested services; each edge device has a Bloom filter and provides a list of available services; in the service map of the data center part, the bit array Initially, it is set to an array of all 0s; then the data center part hashes the name of each requested service in the list of requested services, maps it to the corresponding position through multiple hash functions, and converts the bit array The bits corresponding to these positions in the bit array are set to 1; then the bit array Embedded in the beacon, beacon broadcast regularly; in the service query of the edge computing part, each edge device parses the beacon after receiving it to obtain the bit array , and query the list of services it can provide; the edge device performs hash mapping on the name of each service it can provide, and the mapping result is the same as the received bit array Compare and map the result to 1 in the bit array Only when the corresponding bits in the _ ...
[0018] Furthermore, the edge server sends a network connection request to the data center part. After the connection is successful, the edge server registers the device status and service information with the data center part; the data center part initiates a service request to the edge computing part according to the edge offloading needs, and the edge computing part processes the request and returns the result.
[0019] Furthermore, the data center part predetermines the padding size before cropping each video frame into several main slices. Since the edge server performs object detection on the cropped video frame, i.e., the video subframe, and cropping may split a target instance into multiple erroneous instances, it is necessary to determine the minimum detectable target width. and minimum detectable target height To calculate the padding size, padding the corresponding frame part on each main slice can reduce the number of error instances. Specifically, the target category to be detected is recorded as , including people, bicycles, cars, motorcycles, buses, and trucks; for each category , the minimum width and minimum height that the local detector can detect are recorded as ,in Representation category The minimum width, Representation category The minimum height, Represents the minimum width and minimum height of all categories. Indicates the minimum width of all categories, Represents the minimum height of all categories; the width threshold and height threshold of small objects are determined by selecting the maximum value of the product of the minimum width and minimum height in all categories, recorded as The padding width is then determined by halving the width and height thresholds for small objects. and fill height ,Right now ;
[0020] The data center evenly divides the complete video frame into multiple main slices according to the available edge servers. The width and height of each main slice are recorded as and ,Right now ;in Represents the index of each main slice, Indicates the number of edge servers, and Indicates the width and height of a complete video frame; in addition, each main slice will be resized accordingly after padding to form a video subframe.
[0021] Furthermore, the filling rule for each main slice is as follows: each main slice contains two edge lines of width and two edge lines of height. If the edge line does not overlap with the edge line of the complete frame, the edge line is filled. If a main slice is filled once in the width direction, the adjusted width is: Similarly, if the height is filled once, the adjusted height is: .
[0022] Furthermore, in step S5, the offload manager can not only speed up the detection process, but also ensure the reliability and low cost of the task; for each subtask / video subframe, the cost of each edge server is estimated based on the end-to-end delay and payment; then, the edge server with the lowest cost and meeting the deadline requirements is selected; if no edge server meets the deadline requirements, the edge server with the smallest end-to-end delay is selected to ensure that the current subtask is not missed; after selecting the first optimal edge server for each subtask, decide whether to continue selecting more edge servers based on the reliability of the current subtask.
[0023] Furthermore, every time a video frame is generated, it is divided into video sub-frames, and the video sub-frame set is ;have The edge servers that can provide services are connected to the data center part, and their collection is ;use Represents a video subframe Is it assigned to an edge server? ;
[0024] Video subframe On edge servers The computation time on is:
[0025]
[0026] in, The number of CPU cycles required for decoding; The number of CPU cycles required for detection; Represents an edge server CPU load; It is a The calculation time function of For edge servers CPU frequency;
[0027] Data center part to edge server The communication time is:
[0028]
[0029] in, Indicates the size of the input data; From data center to edge server Data transmission rate; Represents an edge server The download time of the test result data to the data center is small compared to the input data, so the download time Set to a fixed constant value based on the round-trip time (RTT);
[0030] Video subframe On edge servers The processing delay on is calculated as:
[0031] .
[0032] Furthermore, the video subframe On edge servers Payment Calculated as:
[0033]
[0034] in, Indicates unit payment;
[0035] On edge servers Cost Calculated as:
[0036]
[0037] in, and are the weighting coefficients of payment and delay, respectively;
[0038] Total cost of the current frame It can be calculated as:
[0039]
[0040] Furthermore, after selecting the first optimal edge server for each subtask, whether to continue selecting more edge servers is determined based on the reliability of the current subtask in the following manner: if the reliability of the subtask is lower than the task reliability threshold, redundant edge servers are selected one by one until the reliability requirement is met; then the edge server set excludes the selected edge servers and is sorted in ascending order of cost to select the redundant edge servers for the subtask; whenever deciding whether to select an edge server, the edge server reliability must be greater than a minimum threshold to avoid selecting too many redundant edge servers; at the same time, the deadline requirement must be met; and in order to avoid queue delay, each edge server cannot be selected twice in a set of video subframes.
[0041] Furthermore, step S7 specifically includes: all target detection results from the data center part and the target detection results returned by the edge server are collected as initial results and then added to the detection list; targets that do not cross any boundary lines in the complete video frame will be deleted from the detection list; if the intersection of the detection boxes of the targets between the video subframes exceeds 75%, it means that the same target may be repeatedly detected by multiple edge servers, then the one with the higher score is accepted as a better choice, that is, the target with the high score continues to remain in the detection list, and the label corresponding to the score is used as the category of the target, while the other target with a lower score is deleted; finally, if the intersection of the detection boxes of the target crossing the boundary line in the complete video frame and the target between the video subframes exceeds 75%, it means that the same target may be repeatedly detected by the local and edge servers. Since the target may be incomplete when input to the edge server, resulting in edge server detection errors, the one in the complete frame is considered better and the other is deleted.
[0042] Compared to existing technologies, this invention offers the following advantageous technical advantages: Instead of pre-deploying base stations and servers, this invention offloads the task of slice-level object detection to devices owned by the user, enabling intelligent traffic light control. The present invention primarily addresses the discovery of available devices and the offloading of tasks. Access points periodically transmit beacons embedded with required services to discover available edge servers. A detection model is run locally for initial object detection. Objects crossing any boundaries are then extracted. To improve detection accuracy and reduce decoding time, each frame is cropped into multiple slices for fine-grained detection on selected servers. An effective redundant server mechanism ensures reliable task completion. Furthermore, the server's CPU load is used to estimate its computing power, and computing power is used to estimate resource costs. Finally, the locally and remotely detected objects are integrated to produce the final object detection result, providing a foundation for the development of a low-cost, reliable system. By proposing lightweight task splitting, redundant edge selection, and a fast service discovery scheme, this invention enables lightweight and opportunistic offloading of video frames to edge mobile devices, enabling real-time traffic light control.
[0043] The crowd-assisted system for discovering edge servers in this invention is highly flexible and can be rapidly expanded as needed. Finally, frequent disasters such as heavy rains, landslides, forest fires, and earthquakes can damage network infrastructure, leaving the area without end-to-end communication networks. However, the opportunistic network provisioning assisted by the crowd in this invention ensures post-disaster availability. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in describing the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0045] Figure 1 This is a schematic diagram of the structure of the traffic light control system based on environmental edge computing of the present invention.
[0046] Figure 2 Schematic diagram of the structure of the connectionless service discovery based on Bloom filter and WiFi beacon of the present invention. DETAILED DESCRIPTION
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0048] Example 1
[0049] like Figure 1 As shown, the present invention provides a traffic light control system with ambient edge intelligence based on edge computing. Edge computing is considered to be an important means to realize intelligence anywhere in a smart city. In a smart city, resource-constrained terminal devices can enhance various AI services by connecting to edge servers. However, deploying dedicated heavyweight edge servers and resources to establish large-scale service coverage can be very expensive, requiring more manpower, material and financial resources. Therefore, the mobile devices carried by mobile users can be used as lightweight edge servers, which have great potential to provide computing resources, which may make up for the shortcomings of dedicated edge servers.
[0050] This paper focuses on intelligent traffic light control, an emerging smart city application. Traffic cameras control traffic lights based on real-time traffic information, creating a massive image processing workload across vast urban areas. Based on the concept of ambient edge intelligence, a new control system is proposed to enable collaboration among cameras, traffic lights, and mobile devices. Through a proposed lightweight task splitting, redundant edge selection, and fast service discovery scheme, video frames can be offloaded to edge mobile devices in a lightweight and opportunistic manner and used to control traffic lights in real time.
[0051] The control system consists of a data center part and an edge computing part. The data center part includes: cameras, local detectors, an integration manager, a service manager with a Bloom filter, a clipping manager, and an offload manager. The edge computing part includes the Bloom filter, decoder, and remote detector of the edge node. Figure 1 The solid arrows in the middle represent wired data transmission, and the dashed arrows represent wireless data transmission. The edge computing part actually includes multiple devices, and the ellipsis indicates that there are more than two devices.
[0052] The present invention proposes a traffic light control method based on environmental edge computing, comprising the following steps:
[0053] In step S1, the data center periodically broadcasts WiFi beacons embedded with service requests through access points, and discovers mobile devices that can serve as edge servers through the service manager.
[0054] After becoming a member of a server set, each edge server registers with the service manager and periodically reports its device status via heartbeat packets. Specifically, the device status includes IP address, CPU load, RSSI (Received Signal Strength Indicator), and service information (list of available services and ports).
[0055] Step S2: The camera starts to collect video frames, and each frame will be transmitted through two paths; one is used for local detection by the local detector in the data center part, and the other is used for remote detection by the edge computing part.
[0056] Specifically, the YOLOv5s network model is selected as the detection model for local detection to obtain coarse target information on the complete frame, that is, only the target information across the boundary line is obtained. The lightweight Nanodet-Plus target detection model is selected for remote detection to obtain more precise target information on the video subframe, that is, to further obtain other potential targets in the data center part that are not detected or detected inaccurately by local detection.
[0057] Step S3: The data center runs the YOLOv5s network detection model on the local detector, analyzing the video frames within limited local resources for initial object detection, namely, object localization and classification. The video frames are demarcated by boundary lines. Based on the detected object coordinates, objects crossing the boundary lines are extracted and the frame index and object detection results are sent to the integration manager. Objects include, but are not limited to, people, bicycles, cars, motorcycles, buses, and trucks.
[0058] The target detection results include detection boxes, labels, and scores, which are directly obtained after the local detection model and the remote detection model detect the video frame. The detection box refers to the bounding box of the detected target, which is used to describe the position and size of the target in the video frame. The label refers to the category to which the detected target belongs, namely people, bicycles, cars, motorcycles, buses, and trucks. The score refers to the probability of belonging to the category, namely the confidence level.
[0059] Step S4: The cropping manager in the data center part crops each video frame into several main slices according to the boundary lines; then, each main slice is padded with surrounding padding slices to create a new video subframe; and then encoded into a byte stream that can be used for transmission; by reducing the dependency between slices, the parallelism of slice-level detection is achieved.
[0060] Step S5: The data center offload manager uses the redundant server selection mechanism to assign each video subframe to a corresponding edge server based on the CPU load and RSSI information of each edge server passed by the service manager. The offload manager then assembles the edge server's IP address, port number, and encoded video subframe into transmission data and stores it in a send queue, awaiting transmission to the selected edge server.
[0061] The redundant server selection mechanism assigns each video subframe to multiple edge servers for processing, rather than just a single edge server. Because edge server computing resources are limited and communication instability caused by edge server mobility can reduce task reliability, it's necessary to select multiple edge servers to handle the same task, essentially creating redundant servers.
[0062] Step S6: The edge server of the edge computing part receives the transmission data sent by the data center part, decodes the transmission data in the receiving queue, performs target detection through the Nanodet-Plus target detection model of the remote detector, and sends the current video subframe index and target detection result obtained by the target detection to the data center part; the target detection result includes the detection box, label and score.
[0063] Step S7: The integration manager of the data center integrates the target detection results obtained by local detection and the target detection results obtained by remote detection of the edge server to obtain a final target detection result, and controls the traffic light according to the final target detection result.
[0064] Optionally, the traffic light switching time is adaptively adjusted according to the target number of current video frames, thereby ensuring the safety and smooth flow of traffic.
[0065] Example 2
[0066] like Figure 2Figure 1 shows a connectionless service discovery protocol based on Bloom filters and Wi-Fi beacons. This allows edge devices to determine whether they have the services requested by the data center, even when they are not connected to the data center's network. Traditional methods require the data center to establish communication connections (such as Wi-Fi) with devices within its coverage area to discover available devices. In densely populated areas, the number of devices around is enormous. If the data center frequently communicates with all devices, even establishing connections with some devices without services, this wastes energy and time.
[0067] The WiFi protocol has a characteristic: even when no data is being transmitted, it must periodically (typically every 100 milliseconds) broadcast beacons to announce the existence of its network, allowing nearby devices to connect to it. This invention leverages this characteristic of the WiFi protocol. The data center embeds service information in the beacons, enabling it to efficiently discover mobile devices that can provide the requested service. Nearby mobile devices parse the beacon information to query for services. If the mobile device can provide the requested service, it proactively establishes a WiFi connection with the data center, becoming an edge server. This service discovery process incurs virtually no additional communication overhead.
[0068] Use bloom filter optimization method in service manager.
[0069] Standard Bloom filter: First, all elements of the set to be mapped are traversed, and then multiple independent hash functions are used to map all elements to the array in turn. The different positions / indexes in the set are mapped and the bits at the corresponding positions are set to 1. Then when you need to query an element, if the corresponding bit at any position after the element is mapped is 0, then the element is definitely not in the set to be mapped. Otherwise, if the corresponding bits at all positions after the element is mapped are 1, then either the element is in the set, or the bits corresponding to these positions happened to be set to 1 when mapping another element (resulting in a false positive rate). Generated). The number of elements to be mapped The false positive rate of the Bloom filter under certain circumstances The bit array size can be , number of hash functions To optimize. Then The calculation formula is:
[0070] .
[0071] Service discovery optimization: Apply the standard Bloom filter described above to the service discovery process. Figure 2In the figure, to more intuitively illustrate the internal processing mechanism of the Bloom filter, the small dotted box on the left indicates that service mapping is the processing mechanism of the Bloom filter in the data center. The large dotted box on the left indicates the specific processing process of service mapping. To distinguish the mapping process of different services, the dotted arrows in the large dotted box on the left indicate the mapping process for one service, while the solid arrows in the large dotted box on the left indicate the mapping process for another service. Similarly, the small dotted box on the right indicates that service query is the processing mechanism of the Bloom filter in the edge. The large dotted box on the right indicates the specific processing process of service query. To distinguish the query process of different services, the dotted arrows in the large dotted box on the right indicate the query process for one service, while the solid arrows in the large dotted box on the right indicate the query process for another service.
[0072] The data center has a Bloom filter and provides a list of requested services (to be mapped set). Each edge device has a Bloom filter and provides a list of available services (to be queried set). In the service mapping of the data center, the bit array Initially, it is set to an array of all 0s. Then the data center part hashes the name of each requested service in the list of requested services, maps it to the corresponding position through multiple hash functions (such as 3 hash functions), and sets the bit array Set the bits corresponding to these positions in the array to 1 (for example, "Image_detection" is mapped to the corresponding positions 1, 7, and 11 of the array through hash 1, hash 2, and hash 3, and the bits corresponding to these positions are set to 1; similarly, "Pose_estimation" is mapped to the corresponding positions 2, 7, and 10 of the array, and the bits corresponding to these positions are set to 1). Then, set the bit array Embedded in the beacon. In the service query of the edge computing part, each edge device parses the beacon after receiving it to obtain the bit array , and query the list of services it can provide.
[0073] Specifically, taking an edge device as an example, hash mapping is performed on the name of each service it can provide (e.g., "Image_detection" is mapped to new positions 1, 7, and 11 using the same hash function including hash 1, hash 2, and hash 3; similarly, "Image_smoothing" is mapped to new positions 3, 7, and 10). The mapping result is the same as the received bit array. Compare and map the result to 1 in the bit array Only when the corresponding bits in are all 1, the edge device has the service requested by the data center.
[0074] For example, the positions corresponding to "Image_detection" in the service query in the edge computing part are 1, 7, and 11. These positions are in the bit array sent from the data center part. The values of "Image_smoothing" in the edge computing service query are all 1, indicating that the service "Image_detection" provided by the edge device is the service "Image_detection" requested by the data center. That is, the service provided by the edge device matches the service requested by the data center. The corresponding positions of "Image_smoothing" in the service query in the edge computing part are 3, 7, and 10, although positions 7 and 10 are sent from the data center. The corresponding bit in is 1, but position 3 is sent from the data center. The corresponding bit in is 0, that is, not all the bits corresponding to the positions are 1, indicating that the service "Image_smoothing" that the edge device can provide is not the service requested by the data center, that is, the service that the edge device can provide does not match the service requested by the data center.
[0075] If at least one of the edge device's services meets the requirements—that is, if at least one of the services it can provide matches the service requested by the data center—then the edge device connects to the data center's wireless network and becomes an edge server. The edge server sends a network connection request to the data center (which, in Wi-Fi, involves a probe request, probe response, authentication request, authentication response, association request, association response, EAPol, and DHCP). After a successful connection, the edge server registers its device status and service information with the data center. The data center, based on edge offloading needs, initiates a service request to the edge computing component, which processes the request and returns the result.
[0076] The time complexity of Bloom filter query is , while the time complexity of traditional linear query is This method can effectively avoid the need for the data center to communicate with each device individually. This can significantly reduce communication costs, especially when there are many devices in the environment.
[0077] Example 3
[0078] The present invention provides a lightweight task splitting and result integration mechanism for target detection. Specifically, it includes the process of pre-determining the filling size, slice-level cropping and result integration. The pre-determination of the filling size requires that it be determined by technicians or researchers based on the application scenario before the system is deployed, and slice-level cropping and result integration are automatically run after the system is deployed. Due to the low computing power of the edge server and limited available resources, the deployment of edge-based deep neural networks remains challenging. A single resource-constrained edge server cannot meet high service quality requirements. Therefore, the data center part must effectively divide the task into multiple subtasks to improve parallelism. However, simple division may lead to a decrease in detection accuracy.
[0079] To improve detection accuracy, we crop video frames into multiple subframes. This reduces the compression ratio of the video frames after inputting them into the detection model, resulting in higher resolution during detection. To improve processing parallelism, the present invention distributes these subframes to multiple edge servers for simultaneous processing. However, when performing object detection on these cropped subframes, a single object may be cropped into multiple incomplete instances, resulting in an edge server being unable to accurately detect it.
[0080] In the prior art, the edge device collaboration framework EdgeDuet uses local detectors to extract large and medium-sized targets, and remote detectors to extract small targets that are not detected or detected inaccurately. However, in EdgeDuet, the remote detector is heavyweight, and although it has high accuracy, it is more expensive. The present invention adopts the lightweight Nanodet-Plus target detection model, which can not only detect small targets, but also some large and medium-sized targets. The video resolution input by the remote detector is higher, so the target is more accurately detected by the remote detector. For targets that cross the boundary line, it is more accurate to detect them by the local detector because these targets are completely input into the local detector, and the targets input into the remote detector may be incomplete. Therefore, the present invention needs to adopt a result integration method to process the detection results.
[0081] Predetermining the padding size: To ensure that small objects that are undetectable by the local detector still have a chance of being detected by the remote detector, it is necessary to determine the minimum object size for each category that the local detector can detect. Generally, as an object approaches the camera's field of view, its size relative to the frame increases, and vice versa. Therefore, a threshold object size at which the local detector may not be able to detect can be calculated. To do this, we first pre-detect a few video frames using the heavyweight detection model (these video frames are only used to estimate the padding size before system deployment. Once the padding size is determined, it is set to a fixed value and does not require the heavyweight detection model after system deployment). The detection results are saved in a list of ground truth results. The same video frames are then detected using the local lightweight detection model in the data center. If an object is present in the ground truth list but not detected by the local detector in the data center, it is considered a small object. Finally, the padding size is determined based on the maximum size of all small objects obtained.
[0082] Since the edge server performs target detection on the cropped video frame, that is, the video subframe, and cropping may split a target instance into multiple erroneous instances, it is necessary to determine the minimum detectable target width. and minimum detectable target height To calculate the padding size, padding the corresponding frame part on each main slice can reduce the number of error instances. Specifically, the target category to be detected is recorded as , including people, bicycles, cars, motorcycles, buses, and trucks; for each category , the minimum width and minimum height that the local detector can detect are recorded as ,in Representation category The minimum width, Representation category The minimum height, Represents the minimum width and minimum height of all categories. Indicates the minimum width of all categories, Represents the minimum height of all categories; the width threshold and height threshold of small objects are determined by selecting the maximum value of the product of the minimum width and minimum height in all categories, recorded as The padding width is then determined by halving the width and height thresholds for small objects. and fill height ,Right now ;
[0083] Slice-level cropping: The data center evenly divides the complete video frame into multiple main slices based on the available edge servers. The width and height of each main slice are recorded as and ,Right now ;in Represents the index of each main slice, Indicates the number of edge servers, and Indicates the width and height of a complete video frame; in addition, each main slice will be resized accordingly after padding to form a video subframe.
[0084] The filling rule for each main slice is as follows: Each main slice contains two width edge lines and two height edge lines. If the edge line does not overlap with the edge line of the complete frame, the edge line is filled. If a main slice is filled once in the width direction, the adjusted width is: Similarly, if the height is filled once, the adjusted height is: .
[0085] Result integration: All target detection results from the data center part and the target detection results returned by the edge server are collected as initial results and then added to the detection list. Targets that do not cross any boundary lines in the complete video frame will be deleted from the detection list. If the intersection of the detection boxes of the target between the video subframes exceeds 75%, it means that the same target may be repeatedly detected by multiple edge servers. The one with the higher score is accepted as a better choice, that is, the target with the high score continues to remain in the detection list, and the label corresponding to the score is used as the category of the target, while the other target with a lower score is deleted; finally, if the intersection of the detection boxes of the target crossing the boundary line in the complete video frame and the target between the video subframes exceeds 75%, it means that the same target may be repeatedly detected by the local and edge servers. Since the target may be incomplete when input to the edge server, resulting in an edge server detection error, the one in the complete frame is considered better and the other is deleted.
[0086] Example 4
[0087] The present invention provides a redundant server selection mechanism for task offloading, taking into account the fact that variations in CPU load can lead to changes in computing performance and cost. This redundant server selection mechanism allocates each video subframe to multiple edge servers for processing, rather than just a single edge server. Because limited edge server computing resources and unstable communications caused by edge server mobility can reduce task reliability, it is necessary to select multiple edge servers to handle the same task, i.e., to select redundant servers.
[0088] As CPU load increases, the decoding and detection time per frame can increase from tens of milliseconds to hundreds of milliseconds, potentially making task completion unreliable. Furthermore, participating edge servers must pay a fee to increase their participation, otherwise users with such mobile devices will be reluctant to join. In other words, the more abundant the device's resources, the higher the fee. For edge servers, lower CPU loads result in lower latency, but higher resource costs. Therefore, when selecting an edge server, it is important to develop an effective task offloading plan and balance performance and cost. An offload manager not only accelerates the detection process but also ensures task reliability and cost-effectiveness to complete real-time tasks.
[0089] The redundant server selection mechanism is implemented as follows: For each subtask / video subframe, the cost of each edge server is estimated based on the end-to-end latency and payment. The edge server with the lowest cost and that meets the deadline is then selected. If no edge server meets the deadline, the edge server with the lowest end-to-end latency is selected to ensure that the current subtask is not missed. After selecting the first optimal edge server for each subtask, the decision on whether to select more edge servers is made based on the reliability of the current subtask.
[0090] An edge system composed of multiple edge servers. Whenever a video frame is generated, it is divided into video sub-frames, and the video sub-frame set is .have The edge servers that can provide services are connected to the data center part, and their collection is .use Represents a video subframe Is it assigned to an edge server? Therefore, the data center needs to determine the edge server selection for each subtask through the following delay analysis, payment analysis, and cost analysis to minimize the cost. And further improve reliability by selecting redundant servers.
[0091] Latency Analysis: 1) For calculating latency, the common method for calculating computing power is based on the CPU frequency of each edge server. This invention adds the CPU load of the edge server to the calculation. In practice, even if the edge servers maintain the same CPU frequency, the computing power can vary greatly.
[0092] The following is a brief introduction to the method of calculating the computation time and communication time of a task:
[0093] 1) For calculation delay, Represents an edge server CPU load, Expressed as a percentage; Indicates the size of the input data, Expressed in bits; the number of CPU cycles required to decode one bit of a frame is defined as the decoding complexity ; The number of CPU cycles required to detect an object in a frame is defined as the detection complexity ; The number of CPU cycles required for decoding is recorded as , ; The number of CPU cycles required for detection is recorded as ;The number of CPU cycles required to process a frame is Edge Server The CPU frequency is recorded as .
[0094] Also, consider the CPU load CPU load Calculated as 1 minus the ratio of CPU idle time to total CPU time, it indicates the proportion of CPU resources used.
[0095] Therefore, as the CPU idle time increases, the CPU load decreases and the CPU resources increase. It is a The computation time function is used to measure the computation time trend. As the CPU load decreases and CPU resources increase, the computation time is shortened, which means that the edge computing part is faster.
[0096] Video subframe On edge servers The computation time on is: .
[0097] 2) Regarding communication delay, the data center part to the edge server The data transmission rate (in bit / s) can be achieved by Obtain, among which It is an edge server RSSI, It is a function of the data transmission rate with respect to RSSI, that is, the calculation formula of the data transmission rate.
[0098] Data center part to edge server The communication time is Communication time From data center to edge server Uninstall time and edge server Download time to the data center The size of the test result data is relatively small compared to the input data, so the download time is set to a fixed constant value based on the round-trip time (RTT). .
[0099] Therefore, the video subframe On edge servers The processing delay on can be calculated as:
[0100] .
[0101] 3) Payment Analysis: Payment can be measured by the CPU resources contributed by the edge server, that is, it is determined by the CPU load and the amount of data processed. A decrease in CPU load and an increase in the amount of data processed will lead to a linear increase in payment. On edge servers Payment It can be calculated as .in Indicates payment in cents / GHz / KB.
[0102] 4) Cost Analysis: The cost is calculated by weighting the payment and delay. Video subframe On edge servers Cost It can be calculated as:
[0103] .
[0104] in, and are the weighting coefficients of payment and delay, respectively.
[0105] Total cost of the current frame It can be calculated as:
[0106] .
[0107] 5) Reliability Guarantee: Reliability is measured by task completion rate, reflecting the impact of user mobility and resource fluctuations. If a subtask is offloaded to an edge server and the data center receives the execution result from the edge server before the deadline, the subtask is considered successfully completed. Due to heterogeneity in mobility and CPU resources, the completion probability of each edge server for a task may vary over time. To address this, we use historical performance data over time to update the reliability of each device.
[0108] For estimating subtasks Complete reliability. Edge Server The reliability of , it is calculated as the ratio of the number of subtasks successfully executed within each heartbeat time period (for example, 2 seconds) to the total number of subtasks.
[0109] It can be calculated as:
[0110]
[0111] If the subtask The reliability is lower than the mission reliability threshold (set up ), then redundant edge servers are selected one by one until the reliability requirement is met. Then the edge server set excludes the selected edge servers and is sorted in ascending order of cost to select the subtask Whenever deciding whether to select an edge server, the edge server reliability must be greater than the minimum threshold (set up ), to avoid selecting too many redundant edge servers. At the same time, the deadline requirements must be met. And to avoid queuing delays, each edge server cannot be selected twice in a set of video subframes.
[0112] 6) Offloading Control: Offloading control coordinates the detection process between the data center and edge servers. The key idea is to greedily minimize the cost of each subtask, thereby minimizing the total cost, based on channel quality, available CPU resources, and task completion reliability. Then, the optimal set of edge servers is determined for each subframe.
[0113] Specifically, first initialize the optimal edge server set for each frame , the optimal edge server set for each video subframe , the set of selected edge servers for each frame . Each frame is then divided into Video subframes. Start selecting video subframes The best edge server To avoid queue delay, each edge server cannot be selected twice in a set of video subframes. For each video subframe, the edge server with the lowest cost in the edge server set is selected first, and the selected edge server must meet the deadline requirement. If no edge server meets the deadline requirement, the edge server with the smallest delay will be directly selected. If the subtask The reliability is lower than the reliability threshold (set up ), then redundant edge servers are selected one by one until the reliability requirement is met. Then the edge server set excludes the selected edge servers and is sorted in ascending order of cost to select the subtask Whenever deciding whether to select an edge server, the reliability must be greater than the minimum threshold (set up ), to avoid selecting too many redundant edge servers. At the same time, the deadline requirements must be met.
[0114] The main work of this invention is how to discover available devices and how to offload tasks. Access points periodically send beacons embedded with required services to discover available devices as edge servers. A detection model is run locally for initial target detection. Targets that cross any boundaries are then extracted. To improve detection accuracy and shorten decoding time, each frame is cropped into multiple slices for fine-grained detection on selected servers. An effective redundant server mechanism ensures the reliability of task completion. Furthermore, the server's CPU load is used to estimate its computing power, and computing power is used to estimate resource costs. Finally, the locally and remotely detected targets are integrated to obtain the final target detection result, providing a foundation for the development of a low-cost, reliable system. Through the proposed lightweight task splitting, redundant edge selection, and fast service discovery scheme, this invention can offload video frames to edge mobile devices in a lightweight and opportunistic manner and use them to control traffic lights in real time.
[0115] It will be understood that the present invention is described by way of some embodiments, and it will be appreciated by those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are intended to be protected by the present invention.
Claims
1. A traffic light control method based on environmental edge computing, characterized in that: The steps include: Step S1, the data center part periodically broadcasts a WiFi beacon embedded with a request service through an access point, and discovers a mobile device that can serve as an edge server through a service manager; Step S2: The camera starts to collect video frames, and each frame is transmitted through two paths; one is used for local detection by the local detector in the data center part, and the other is used for remote detection in the edge computing part; Step S3: The data center runs the YOLOv5s network detection model on the local detector, performs analysis of the video frame in the local area with limited resources, and performs initial target detection, i.e., target positioning and classification; divides the video frame into boundary lines, extracts the targets crossing the boundary lines according to the coordinate position information of the detected targets, and sends the index of the frame where the target is located and the target detection result to the integration manager; Step S4: the cropping manager of the data center part crops each video frame into several main slices according to the boundary lines; Each main slice is then padded with surrounding padding slices to create a new video subframe; this is then encoded into a byte stream that can be used for transmission; Step S5: The offload manager of the data center part allocates a corresponding edge server to each video subframe through a redundant server selection mechanism according to the CPU load and RSSI information of each edge server transmitted by the service manager; and assembles the IP, port and encoded video subframe corresponding to the edge server into transmission data and stores it in a sending queue, waiting to be sent to the selected edge server; Step S6: The edge server of the edge computing part receives the transmission data sent by the data center part, decodes the transmission data in the receiving queue, performs target detection through the Nanodet-Plus target detection model of the remote detector, and sends the current video subframe index and target detection result obtained by the target detection to the data center part; Step S7: The integration manager of the data center integrates the target detection results obtained by local detection and the target detection results obtained by remote detection of the edge server to obtain the final target detection result, and controls the traffic lights according to the final target detection result.
2. The traffic light control method based on environmental edge computing according to claim 1, characterized in that: In step S1, the data center embeds service information in the beacon to allow the data center to discover mobile devices that can provide the requested service; nearby mobile devices perform service queries by parsing the beacon information; if the mobile device can provide the service requested by the data center, it will actively establish a WiFi connection with the data center and become an edge server.
3. The traffic light control method based on environmental edge computing according to claim 2 is characterized in that: The data center part has a Bloom filter and provides a list of requested services; each edge device has a Bloom filter and provides a list of available services; in the service map of the data center part, the bit array Initially, it is set to an array of all 0s; then the data center part hashes the name of each requested service in the list of requested services, maps it to the corresponding position through multiple hash functions, and converts the bit array Set the bits corresponding to these positions in the bit array to 1; then Embedded in beacons, broadcast beacons periodically; In the service query of the edge computing part, each edge device parses the received beacon to obtain the bit array , and query the list of services it can provide; The edge device performs a hash mapping on the name of each service it can provide, and the mapping result is the same as the received bit array. Compare, the bit with mapping result of 1 is in the bit array Only when the corresponding bits in the data center are all 1, the edge device has the service requested by the data center; if the edge device has at least one service that meets the requirements, that is, at least one service that the edge device can provide matches the service requested by the data center, then the edge device is connected to the wireless network of the data center and becomes an edge server.
4. The traffic light control method based on environmental edge computing according to claim 3 is characterized in that: The edge server sends a network connection request to the data center. After the connection is successful, the edge server registers the device status and service information with the data center. The data center initiates a service request to the edge computing part according to the edge offloading needs. The edge computing part processes the request and returns the result.
5. The traffic light control method based on environmental edge computing according to claim 1, characterized in that: Before the data center cuts each video frame into several main slices, the padding size is determined in advance; the target category to be detected is recorded as , including people, bicycles, cars, motorcycles, buses, and trucks; for each category , the minimum width and minimum height that the local detector can detect are recorded as ,in Indicates category The minimum width of Indicates category The minimum height of Represents the minimum width and minimum height of all categories. Indicates the minimum width of all categories. Represents the minimum height of all categories; the width threshold and height threshold of small objects are determined by selecting the maximum value of the product of the minimum width and the minimum height among all categories, denoted as ,in Indicates the minimum detectable target width, represents the minimum detectable object height; the padding width is then determined by halving the width and height thresholds for small objects and fill height ,Right now ; The data center evenly divides the complete video frame into multiple main slices according to the available edge servers. The width and height of each main slice are recorded as and ,Right now ;in Represents the index of each main slice, Indicates the number of edge servers, and Represents the width and height of a complete video frame; in addition, each main slice will be resized accordingly after padding to form a video subframe.
6. The traffic light control method based on environmental edge computing according to claim 5, characterized in that: The filling rule for each main piece is as follows: each main piece contains two edge lines of width and two edge lines of height. If its edge line does not overlap with the edge line of the complete frame, the edge line is filled; if a main piece is filled once in the width direction, the adjusted width is: Similarly, if the height is filled once, the adjusted height is: .
7. The traffic light control method based on environmental edge computing according to claim 1, characterized in that: In step S5, the offload manager of the data center part is used to accelerate the detection process to complete the real-time task; the redundant server selection mechanism is implemented in the following way: for each subtask / video subframe, the cost of each edge server is estimated based on the end-to-end delay and payment; then, the edge server with the lowest cost and meeting the deadline requirement is selected; if no edge server meets the deadline requirement, the edge server with the smallest end-to-end delay is selected to ensure that the current subtask is not missed; after selecting the first optimal edge server for each subtask, decide whether to continue to select more edge servers based on the reliability of the current subtask.
8. The traffic light control method based on environmental edge computing according to claim 7, characterized in that: Whenever a video frame is generated, it is divided into video subframes, and the video subframe set is ;have The edge servers that can provide services are connected to the data center part, and their collection is ;use Represents a video subframe Is it assigned to the edge server? ; Video subframe On edge servers The computation time on is: in, The number of CPU cycles required for decoding; The number of CPU cycles required for detection; Represents edge server CPU load; is a The calculation time function of For edge servers CPU frequency; Data center to edge server The communication time is: in, Indicates the size of the input data; From data center to edge server The data transfer rate, Represents edge server The time to download the test result data to the data center; Video subframe On edge servers The processing delay on is calculated as: 。 9. The traffic light control method based on environmental edge computing according to claim 8, characterized in that: Video subframe On edge servers Payment Calculated as: in, Indicates unit payment; On edge servers Cost Calculated as: in, and are the weighting coefficients of payment and delay, respectively; Total cost of the current frame It can be calculated as: 。 10. The traffic light control method based on environmental edge computing according to claim 9, characterized in that: After selecting the first optimal edge server for each subtask, the decision on whether to continue selecting more edge servers is made based on the reliability of the current subtask in the following way: If the reliability of a subtask is lower than the task reliability threshold, redundant edge servers are selected one by one until the reliability requirement is met; then the edge server set excludes the selected edge servers and is sorted in ascending order of cost to select the redundant edge servers of the subtask; whenever deciding whether to select an edge server, the edge server reliability must be greater than the minimum threshold to avoid selecting too many redundant edge servers; at the same time, the deadline requirement must be met; and in order to avoid queue delays, each edge server cannot be selected twice in a set of video subframes.
Citation Information
Patent Citations
Monitoring method and system of road traffic signal base station
CN118471009A
Traffic light control method with environment edge intelligence based on edge calculation
CN118781829A
Managing task offloading to edge servers in a multi-access edge computing, MEC, system
US20230401094A1
Cited By
Traffic light control method with environment edge intelligence based on edge calculation
CN118781829A
Traffic light control method with ambient edge intelligence based on edge computing
CN118781829B
