Vehicle-mounted mixed flow shaping scheduling method and device, storage medium and equipment
By classifying and scheduling the on-board network traffic, network congestion and delay problems caused by the increase in intelligent driving functions are solved, and efficient use of traffic and optimized resource allocation are achieved.
Patent Information
- Application Number
- CN202411734311.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-22
AI Technical Summary
With the increase in intelligent driving functions, the traffic of on-board communication networks increases, resulting in network congestion and delays, and may even cause the dangerous situation of vehicle out of control.
By dividing in-vehicle network traffic into the first, second and third types of traffic, different scheduling methods are adopted according to their importance and characteristics. Specifically, it includes: the first type of traffic is periodically scheduled according to priority and gate switch status, the second type of traffic is alternately scheduled according to credit adjustment rules, and the third type of traffic is read from adjacent queues for priority dispatch when there is an idle time slot.
It effectively improves the utilization rate of traffic in the communication network, avoids network congestion and delay, ensures timely scheduling of important traffic, improves resource utilization, and reduces problems such as lag in video playback.
Smart Images

Figure CN119863921A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automobile technology, and in particular to a method, device, storage medium and equipment for shaping and scheduling vehicle-mounted mixed traffic. Background Art
[0002] With the development of Ethernet transmission technology and automotive network communication technology, the functions of intelligent driving are becoming more and more diverse. It can not only assist users in driving vehicles, but also provide unmanned driving functions, and provide users with entertainment information, further improving the user's driving experience. However, with the increase in driving functions, the types and data volume of vehicle communication network traffic have also increased, making the current vehicle communication network develop towards high traffic and centralized, which will cause network congestion and delay, and instantaneous delays may also cause dangerous situations such as vehicle loss of control. Summary of the invention
[0003] The present application provides a method, device, storage medium and equipment for shaping and scheduling vehicle-mounted mixed traffic, which can improve the utilization rate of traffic in a communication network and avoid network congestion, delay and other problems.
[0004] The specific technical solutions are as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for shaping and scheduling mixed vehicle traffic, the method comprising:
[0006] According to the control domain source and importance of the vehicle network traffic, different traffic is divided into the first type of traffic, the second type of traffic and the third type of traffic, wherein each type of traffic is stored in the form of a queue of preset length in the order of the time when the traffic is generated, and the importance of the first type of traffic, the second type of traffic and the third type of traffic decreases in sequence;
[0007] Dividing the traffic in the first category of traffic into multiple priorities, and periodically scheduling the first category of traffic according to the order of priorities from high to low, and a list of gated switch status information, wherein the list of gated switch status information includes the states of multiple gated switches corresponding to each of multiple moments in a single cycle, the gated switches correspond to the priorities one by one, and the multiple gated switches corresponding to each moment are arranged in order of priority from high to low;
[0008] Dividing the second-category traffic into first-subcategory traffic and second-subcategory traffic, and scheduling the first-subcategory traffic and the second-subcategory traffic alternately according to a preset credit adjustment rule;
[0009] The third type of traffic of different queues is scheduled in sequence according to the order of queue generation, and when there is an idle time slot between the current traffic queue of the third type of traffic and the next adjacent traffic queue, according to the preset scheduling rules, the traffic is read from multiple traffic queues to be scheduled adjacent to the current traffic queue and filled into the idle time slot for priority scheduling.
[0010] In a possible implementation, the method further includes:
[0011] When any type of video traffic being scheduled does not meet the preset constraint condition, the video traffic to be scheduled subsequent to the video traffic being scheduled is extracted and then scheduled; and / or,
[0012] When the data volume of any type of video traffic to be scheduled accounts for a proportion of the data volume of the traffic to be scheduled of the corresponding category that is greater than or equal to a preset proportion threshold, the background information of each frame of the video traffic to be scheduled is removed before scheduling.
[0013] In a possible implementation manner, the preset constraint condition includes at least one of:
[0014] In a single operation process of the gate switch corresponding to the video traffic from opening to closing, there is no uncompleted video traffic;
[0015] Video traffic must not collide with other vehicle control traffic in the link;
[0016] Video traffic cannot exceed the preset delay range and / or preset jitter range;
[0017] The same video traffic can only be transmitted once within the gated switch and cannot be occupied by frame-preempting traffic.
[0018] In a possible implementation manner, the method for extracting frames of the video traffic to be scheduled includes:
[0019] For the video traffic to be scheduled within a preset time period, if a preset percentage of the Euclidean distances between any image frame to be judged in the video traffic to be scheduled and other image frames is less than or equal to a preset distance threshold, the image frame to be judged will be deleted from the video traffic to be scheduled.
[0020] In a possible implementation manner, according to a preset credit adjustment rule, the first subclass traffic and the second subclass traffic are alternately scheduled, including:
[0021] Allocating a first initial credit value, a first credit value increasing slope, and a first credit value decreasing slope to the first subclass traffic, and allocating a second initial credit value, a second credit value increasing slope, and a second credit value decreasing slope to the second subclass traffic;
[0022] The first subclass traffic is started to be transmitted with the first initial credit value as the starting value, and during the transmission process, the credit value of the first subclass traffic decreases at the first credit value decreasing slope until the current credit value of the first subclass traffic is less than or equal to 0, and the transmission is stopped after the data that has started to be transmitted before the current credit value is less than 0 is completely transmitted, or when the current credit value of the first subclass traffic is greater than 0 and the transmission of the first subclass traffic is completed, the transmission is stopped;
[0023] During the transmission of the first subclass traffic, the credit value of the second subclass traffic starts with the second initial credit value and increases at the second credit value growth slope until the first subclass traffic stops transmitting, at which time the credit value of the second subclass traffic stops increasing;
[0024] When the transmission of the first subclass traffic stops, the transmission of the second subclass traffic begins, and during the transmission process, the credit value of the second subclass traffic decreases at the second credit value decreasing slope until the current credit value of the second subclass traffic is less than or equal to 0, and the transmission stops after the data that has started to be transmitted before the current credit value is less than 0 is completely transmitted, or when the current credit value of the second subclass traffic is greater than 0 and the transmission of the second subclass traffic is completed, the transmission stops;
[0025] When the first subclass traffic is not completely transmitted, during the transmission of the second subclass traffic, the credit value of the second subclass traffic increases at the first credit value growth slope until the second subclass traffic stops transmitting, at which point the credit value of the first subclass traffic stops increasing;
[0026] When the first subclass traffic and the second subclass traffic are both in a waiting state and their credit values increase from negative to positive at the same time, the traffic with a relatively large credit value is preferentially scheduled;
[0027] And so on, until the transmission of the first subclass traffic and the second subclass traffic is completed.
[0028] In a possible implementation, according to a preset scheduling rule, reading traffic from a plurality of to-be-scheduled traffic queues adjacent to the current traffic queue and filling the idle time slot for priority scheduling includes:
[0029] Initializing the counter of each traffic queue to be scheduled according to the number of bytes of the maximum transmission unit and the weight pre-assigned to each traffic queue to be scheduled, and obtaining the initial value of the counter of each traffic queue to be scheduled;
[0030] According to the order of the plurality of traffic queues to be scheduled, a message is obtained from each of the traffic queues to be scheduled and filled into the idle time slot, and after each message is scheduled, the counter of the traffic queue to be scheduled corresponding to the scheduled message is updated, and the time slot value of the idle time slot is updated at the same time, wherein the value of the updated counter is the value of the counter before the update minus the number of bytes of the scheduled message;
[0031] After completing one polling of the plurality of traffic queues to be scheduled, the next polling is performed according to the above method until the counter of a certain traffic queue to be scheduled is less than or equal to 0, the scheduling of the traffic queue to be scheduled is stopped, and the counters of the plurality of traffic queues to be scheduled are all less than or equal to 0, the counter of each of the traffic queues to be scheduled is reset to the initial value of the counter, and the next polling is performed;
[0032] During the polling period, when the time slot value of the idle time slot is 0, the polling is stopped. In a possible implementation, different traffic is divided into first-class traffic, second-class traffic and third-class traffic according to the control domain source and importance of the vehicle network traffic, including:
[0033] Classify the key frame video traffic, the first common video traffic, and the second common video traffic collected by the visual sensor in the autonomous driving domain into the first type of traffic, the second type of traffic, and the third type of traffic, respectively, wherein the first common video traffic is more important than the second common video traffic;
[0034] Classify the critical radar traffic and the common radar traffic in the autonomous driving domain into the first category of traffic and the second category of traffic, respectively;
[0035] Classifying the fault emergency flow, power control flow and high-speed vehicle control flow in the vehicle control domain into the first type of flow;
[0036] Classifying the low-speed vehicle control traffic in the vehicle control domain into the second type of traffic;
[0037] The first entertainment media traffic and the second entertainment media traffic in the smart cockpit domain are respectively divided into the second type of traffic and the third type of traffic, wherein the first entertainment media traffic is more important than the second entertainment media traffic.
[0038] In a second aspect, an embodiment of the present application provides a vehicle-mounted mixed traffic shaping and dispatching device, the device comprising:
[0039] a classification unit, for classifying different traffic into first-class traffic, second-class traffic and third-class traffic according to the control domain source and importance of the in-vehicle network traffic, wherein each class of traffic is stored in a queue of preset length in the order of the time when the traffic is generated, and the importance of the first-class traffic, the second-class traffic and the third-class traffic is reduced in sequence;
[0040] A division unit, configured to divide the traffic in the first type of traffic into a plurality of priorities;
[0041] A first scheduling unit, configured to periodically schedule the first type of traffic according to a descending order of priority and a gated switch state information list, wherein the gated switch state information list includes states of a plurality of gated switches corresponding to each of a plurality of moments in a single cycle, the gated switches correspond to the priorities one by one, and the plurality of gated switches corresponding to each moment are arranged in a descending order of priority;
[0042] A second scheduling unit, configured to divide the second class of traffic into a first subclass of traffic and a second subclass of traffic, and to alternately schedule the first subclass of traffic and the second subclass of traffic according to a preset credit adjustment rule;
[0043] The third scheduling unit is used to schedule the third type of traffic of different queues in sequence according to the order of queue generation, and when there is an idle time slot between the current traffic queue of the third type of traffic and the next adjacent traffic queue, according to the preset scheduling rules, read the traffic from multiple to-be-scheduled traffic queues adjacent to the current traffic queue and fill the idle time slot for priority scheduling.
[0044] In a possible implementation, the device further includes:
[0045] A frame extraction unit is used to extract frames of the video traffic to be scheduled subsequent to the video traffic being scheduled before scheduling when any type of video traffic being scheduled does not meet the preset constraint condition; and / or,
[0046] The removal unit is used to remove the background information of each frame image in the video traffic to be scheduled before scheduling when the proportion of the data volume of any type of video traffic to be scheduled to the data volume of the traffic to be scheduled in the corresponding category is greater than or equal to a preset proportion threshold.
[0047] In a possible implementation manner, the preset constraint condition includes at least one of:
[0048] In a single operation process of the gate switch corresponding to the video traffic from opening to closing, there is no uncompleted video traffic;
[0049] Video traffic must not collide with other vehicle control traffic in the link;
[0050] Video traffic cannot exceed the preset delay range and / or preset jitter range;
[0051] The same video traffic can only be transmitted once within the gated switch and cannot be occupied by frame-preempting traffic.
[0052] In one possible implementation, the frame extraction unit is used to delete the image frame to be judged from the video traffic to be scheduled within a preset time period if a preset percentage of the Euclidean distances between any image frame to be judged in the video traffic to be scheduled and other image frames is less than or equal to a preset distance threshold.
[0053] In a possible implementation manner, the second scheduling unit includes:
[0054] an allocation module, configured to allocate a first initial credit value, a first credit value growth slope, and a first credit value reduction slope to the first subclass traffic, and to allocate a second initial credit value, a second credit value growth slope, and a second credit value reduction slope to the second subclass traffic;
[0055] A scheduling module, used to start transmitting the first subclass traffic with the first initial credit value as the starting value, and during the transmission process, the credit value of the first subclass traffic decreases at a first credit value decreasing slope until the current credit value of the first subclass traffic is less than or equal to 0, and then the transmission is stopped after the data that has been transmitted before the current credit value is less than 0 is completely transmitted, or when the current credit value of the first subclass traffic is greater than 0 and the first subclass traffic is completely transmitted, the transmission is stopped; in the process of transmitting the first subclass traffic, the credit value of the second subclass traffic starts with the second initial credit value and increases at a second credit value increasing slope until the first subclass traffic stops transmitting, and the credit value of the second subclass traffic stops increasing; when the first subclass traffic stops transmitting, the second subclass traffic starts transmitting, and during the transmission process, the second subclass traffic is started transmitting. The credit value of the second subclass traffic decreases at the second credit value decreasing slope until the current credit value of the second subclass traffic is less than or equal to 0, and then the data that has been transmitted before the current credit value is less than 0 is completely transmitted and then the transmission is stopped; or, when the current credit value of the second subclass traffic is greater than 0 and the second subclass traffic is completely transmitted, the transmission is stopped; when the first subclass traffic has not been completely transmitted, during the transmission of the second subclass traffic, the credit value of the second subclass traffic increases at the first credit value increasing slope until the second subclass traffic stops transmitting, and then the credit value of the first subclass traffic stops increasing; when the first subclass traffic and the second subclass traffic are both in a waiting state and their credit values increase from negative numbers to positive numbers at the same time, the traffic with a relatively large credit value is scheduled preferentially; and so on until the first subclass traffic and the second subclass traffic are completely transmitted.
[0056] In a possible implementation manner, the third scheduling unit includes:
[0057] An initialization module, used to initialize the counter of each traffic queue to be scheduled according to the number of bytes of the maximum transmission unit and the weight pre-assigned to each traffic queue to be scheduled, and obtain the initial value of the counter of each traffic queue to be scheduled;
[0058] A polling scheduling module is used to obtain a message from each of the traffic queues to be scheduled and fill it into the idle time slot in the order of the multiple traffic queues to be scheduled, and after each message is scheduled, the counter of the traffic queue to be scheduled corresponding to the scheduled message is updated, and the time slot value of the idle time slot is updated at the same time, wherein the value of the updated counter is the value of the counter before the update minus the number of bytes of the scheduled message; after completing a poll of the multiple traffic queues to be scheduled, the next polling is performed according to the above method until the counter of a traffic queue to be scheduled is less than or equal to 0, and the scheduling of the traffic queue to be scheduled is stopped, until the counters of the multiple traffic queues to be scheduled are all less than or equal to 0, the counter of each traffic queue to be scheduled is reset to the initial value of the counter, and the next polling is performed;
[0059] The stop module is used to stop polling when the time slot value of the idle time slot is 0 during the polling period.
[0060] In a possible implementation, the classification unit includes:
[0061] A first classification module is used to classify key frame video traffic, first common video traffic, and second common video traffic collected by a visual sensor in an autonomous driving domain into the first type of traffic, the second type of traffic, and the third type of traffic, respectively, wherein the first type of common video traffic is more important than the second type of common video traffic;
[0062] A second classification module, used to classify the critical radar traffic and the common radar traffic in the autonomous driving domain into the first category of traffic and the second category of traffic, respectively;
[0063] A third classification module is used to classify the fault emergency flow, power control flow and high-speed vehicle control flow in the vehicle control domain into the first type of flow;
[0064] a fourth classification module, configured to classify the low-speed vehicle control traffic in the vehicle control domain into the second type of traffic;
[0065] The fifth classification module is used to classify the first entertainment media traffic and the second entertainment media traffic in the smart cockpit domain into the second type of traffic and the third type of traffic respectively, wherein the first entertainment media traffic is more important than the second entertainment media traffic.
[0066] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any possible implementation manner of the first aspect.
[0067] In a fourth aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
[0068] one or more processors;
[0069] The processor is coupled to a storage device, and the storage device is used to store one or more programs;
[0070] When the one or more programs are executed by the one or more processors, the electronic device implements the method described in any possible implementation manner of the first aspect.
[0071] The shaping and scheduling method, device, storage medium and equipment for vehicle-mounted mixed traffic provided in the embodiments of the present application can first divide different traffic into three categories according to the control domain source and importance of the vehicle-mounted network traffic, and then adopt different scheduling methods according to the characteristics of different traffic. Specifically, for the first category of traffic, it can be divided into multiple priorities first, and then the first category of traffic can be periodically scheduled according to the priority and gate switch status information list; for the second category of traffic, it can be divided into two categories of sub-traffic first, and then the two categories of sub-traffic can be alternately scheduled according to the preset credit adjustment rules; for the third category of traffic, in the process of scheduling each queue in turn, when it is found that there is an idle time slot between two adjacent teams, part of the traffic can be read from the subsequent queue and filled into the idle time slot for priority scheduling. It can be seen from this that the embodiments of the present application can not only avoid network congestion, delay and other problems on the premise that important traffic is scheduled in time, but also improve resource utilization.
[0072] In addition, the embodiments of the present application can also achieve the following technical effects:
[0073] In the embodiment of the present application, when any type of video traffic being scheduled does not meet the preset constraint condition, the video traffic to be scheduled after the video traffic being scheduled is extracted before scheduling; and / or, when the data volume of any type of video traffic to be scheduled accounts for a proportion of the data volume of the to-be-scheduled traffic of the category to which it belongs is greater than or equal to the preset proportion threshold, the background information of each frame of the video traffic to be scheduled is removed before scheduling. Thus, under the premise of ensuring the normal scheduling of valid video frames, invalid information in scheduling is further reduced, avoiding network congestion, delay and other problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art description are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative work.
[0075] Figure 1A flow chart of a method for shaping and dispatching mixed vehicle traffic provided in an embodiment of the present application;
[0076] Figure 2 A schematic diagram of vehicle network traffic classification provided in an embodiment of the present application;
[0077] Figure 3 A flow chart of another method for shaping and dispatching mixed vehicle traffic provided in an embodiment of the present application;
[0078] Figure 4 An example diagram of an idle time slot between queues provided in an embodiment of the present application;
[0079] Figure 5 A block diagram of the composition of a vehicle-mounted mixed traffic shaping and scheduling device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0080] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0081] It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The terms "including" and "having" in the embodiments of the present application and the accompanying drawings and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0082] Figure 1 The flowchart of a method for shaping and dispatching mixed traffic on a vehicle is shown in FIG. 1 . The method can be applied to electronic equipment or computer equipment, and can be specifically applied to a central computing platform and an intelligent controller in a future automotive electronic and electrical architecture. The method includes:
[0083] S110: Different traffic is divided into first-class traffic, second-class traffic, and third-class traffic according to the control domain source and importance of the in-vehicle network traffic.
[0084] The control domains of vehicle network traffic include autonomous driving domain, vehicle control domain, smart cockpit domain, etc. The autonomous driving domain includes video traffic collected by visual sensors, radar traffic collected by radars, etc. The vehicle control domain includes fault emergency traffic, power control traffic and vehicle control traffic, etc. The smart cockpit domain includes entertainment media traffic, etc.
[0085] The following are descriptions of the above traffic types:
[0086] Video traffic can be divided into key frame video traffic, first ordinary video traffic and second ordinary video traffic according to importance. The importance is mainly reflected in driving safety. Other dimensions can also be added on the basis of safety to comprehensively evaluate the importance, such as comfort, speed, etc. Key frame video traffic includes obstacle recognition images and landmark recognition images during driving, as well as key images that change driving behavior, etc.; first ordinary video traffic includes driving image information, reversing information traffic, etc.; second ordinary video traffic includes driving record information, surrounding environment information, etc.
[0087] Radar traffic comes from the radar system in the autonomous driving domain. Depending on the different radars used in each automotive system, the on-board radar traffic used is also different. In the future, the industry will mainly use millimeter-wave radars and lidars, and a small number of ultrasonic radars. Different radars generate different amounts of traffic, and the communication load caused by the encapsulated frame traffic is also different. We will not do too much research here. The embodiment of this application directly divides radar traffic into critical radar traffic and ordinary radar traffic according to importance. Among them, critical radar traffic is mainly used for vehicle control and obstacle avoidance; ordinary radar traffic is mainly used as traffic to support functions such as path planning, driving monitoring, and driving recording.
[0088] Fault emergency traffic comes from the vehicle warning and avoidance system, including airbag deployment control traffic, vehicle defogger control traffic, braking behavior traffic, etc.
[0089] The power control flow mainly comes from the vehicle control instructions and feedback information within the power system domain, including accelerator and brake pedal signals, power response signals, engine / motor drive signal instructions, driving mode signals and power output signals.
[0090] Vehicle control traffic can be divided into high-speed vehicle control traffic and low-speed vehicle control traffic according to importance. High-speed vehicle control traffic includes body module control, such as control of doors and windows, instruments, instrument display, switch control of various systems in the car, air conditioning switch, thermal management start switch, etc. Low-speed vehicle control traffic includes non-emergency traffic such as smart car air conditioning mode, smart seat massage, simulated driving style system, etc., which increase the user's additional experience of car functions.
[0091] Media traffic originates from the smart cockpit domain and includes multimedia video, audio information (including voice interaction), smart rearview mirror transmission information, and simulated driving style information. It can be divided into first entertainment media traffic and second entertainment media traffic according to importance. First entertainment media traffic includes multimedia traffic with a small amount of data, including low-resolution video, audio, and smart device interaction traffic. Second entertainment media traffic includes multimedia traffic with a large amount of data.
[0092] Based on the above segmentation of various traffic types, they can be classified into first-class traffic, second-class traffic and third-class traffic, with the importance of first-class traffic, second-class traffic and third-class traffic decreasing in turn. Figure 2 As shown, the specific division is as follows:
[0093] The key frame video traffic, the first common video traffic and the second common video traffic collected by the visual sensor in the autonomous driving domain are respectively divided into the first type of traffic, the second type of traffic and the third type of traffic, wherein the first type of common video traffic is more important than the second type of common video traffic;
[0094] The key radar traffic and common radar traffic in the autonomous driving domain are divided into the first type of traffic and the second type of traffic respectively;
[0095] Classify the fault emergency flow, power control flow and high-speed vehicle control flow in the vehicle control domain into the first type of flow;
[0096] Classify the low-speed vehicle control traffic in the vehicle control domain into the second type of traffic;
[0097] The first entertainment media traffic and the second entertainment media traffic in the smart cockpit domain are respectively divided into the second type of traffic and the third type of traffic, wherein the first entertainment media traffic is more important than the second entertainment media traffic.
[0098] After different traffic flows are divided into three categories, each type of traffic flow is stored in a queue of preset length in the order of the time when the traffic flow is generated. Among them, the preset lengths corresponding to different types of traffic may be different, and some preset lengths may be determined based on time (such as a fixed period), and some preset lengths may be determined based on byte length.
[0099] S120: Divide the traffic in the first category of traffic into multiple priorities, and periodically schedule the first category of traffic according to the order of priority from high to low and the list of gate switch status information.
[0100] Among them, the gated switch status information list includes the status of multiple gated switches corresponding to each moment in multiple moments in a single cycle, the gated switches correspond to the priorities one by one, and the multiple gated switches corresponding to each moment are arranged in descending order of priority.
[0101] The first type of traffic, as an important traffic in the vehicle network communication system, has the highest priority and is a periodic transmission mechanism. At the same time, it strictly limits traffic redundancy to avoid excessive traffic segments causing blockage and delays in the transmission channel. The vehicle Ethernet traffic itself will be transmitted according to priority. Here, for the first type of traffic in the system, it can be divided into multiple priorities according to priority sorting. One of the classification methods is as follows:
[0102] Emergency fault traffic is ranked first, that is, Fpriority = 1, because safety is the first priority during the driving of the vehicle, and the response to emergency signals can often minimize the loss. For example, the airbag can be deployed in time when a collision occurs; the power control traffic weight is second, that is, Fpriority = 2. The most basic factor in the driving experience of a car is the driving feeling. This attribute returns to the car attribute itself. Therefore, timely power response and feedback can enhance the driving controllability, stability, comfort and other functional experiences; high-speed vehicle control traffic is the first type of traffic, and its priority is set to the third priority, that is, Fpriority = 3, which includes body module control, such as doors and windows, instrument control, such as instrument display, and switch control of various systems in the car, such as air conditioning switch, Thermal management start switch, etc., this part is also a module that needs to respond in time, which will affect vehicle driving, so it is classified as the first type of traffic; key frame video traffic is the first type of traffic transmitted as the fourth priority, that is, Fpriority = 4, because video and radar traffic both belong to the category of autonomous driving, so relative to the control of the vehicle itself, the priority should be ranked behind, but key frame video traffic and key radar traffic are also perception modules for road obstacle avoidance and emergency events, and this part of information is needed for key event processing, so it cannot be classified separately as second or third type of traffic; key radar traffic similar to key frame video traffic is defined as the fifth priority, that is, Fpriority = 5. Radar can be used as a supplement or substitute for the video perception system and can be exchanged with the video traffic priority according to its importance.
[0103] The first type of traffic is used for periodic business flows. The model is based on time synchronization, and the end-to-end delay is usually strictly defined. Vehicle control and video radar traffic uses a time-triggered transmission mechanism to ensure the delay and jitter requirements of business flows. Emergency avoidance and some video traffic, as bursty business flows, are scheduled based on the schedulability of periodic business flows to ensure service quality as much as possible. All first-type traffic is periodic traffic. Similar to traditional bus communications, the Ethernet traffic frames here are also specified to be transmitted within a specific period. This part of the traffic has a high priority and high importance, and must be responded to in a timely manner. Traffic that does not meet the sending conditions within the sending cycle should be discarded in a timely manner.
[0104] Based on the condition of time synchronization, multiple gated switches are set up here. The number of gated switches is the same as the number of traffic priorities in the first category of traffic, and the gated switches correspond to the priorities one by one. The states of all gated switches can be set for each moment in a single scheduling cycle, so that the first category of traffic corresponding to the priority of the gated switches can be scheduled according to the states of the gated switches. The states of the gated switches include the on state and the off state.
[0105] The following describes the scheduling process of the first type of traffic using the above five priorities as an example:
[0106] Each cycle Tcycle defines four moments (T1, T2, T3, T4) to configure the gating state. The first type of traffic is queued according to the five levels of priority defined above, that is, the five levels of priority. The queued traffic is sent to the buffer. The traffic output from the buffer is transmitted in sequence according to the five priority gating switches. The gating switches will periodically open and close the five gates according to the cycle Tcycle of the cyclic scheduling. The cycle Tcycle is set to 1ms, O (Open) represents opening, C (close) represents closing, and the timing of the five gating switches is:
[0107] T1:OOCCC;
[0108] T2: OCOOC;
[0109] T3:COCCO;
[0110] T4:OOOCC.
[0111] S130: Divide the second category traffic into first sub-category traffic and second sub-category traffic, and alternately schedule the first sub-category traffic and the second sub-category traffic according to a preset credit adjustment rule.
[0112] The second type of traffic is a non-periodic traffic. Under the condition of ensuring the normal transmission of the first type of emergency traffic, it meets bounded delay, reduces network throughput, and reduces network congestion for non-periodic network transmission. The second type of traffic can be further divided into the first sub-class traffic and the second sub-class traffic. It can be roughly understood that the priority of the first sub-class traffic is slightly higher than that of the second sub-class traffic. In the traffic shaping system described in the embodiment of the present application, low-speed vehicle control traffic is classified as the first sub-class traffic, such as intelligent vehicle air-conditioning mode, intelligent seat massage, simulated driving style system and other non-emergency traffic that increases the user's additional experience of automobile functions; ordinary radar traffic is also classified as the first sub-class traffic, because radar traffic has a small amount of data and is less affected by interference than video traffic, so it is classified as the first sub-class traffic; as a comparison, the first ordinary video traffic collected by the video sensor is classified as the second sub-class traffic. In addition, the first entertainment media traffic will also be classified as the second sub-class traffic. This part of the traffic is multimedia traffic with a small amount of data, including low-resolution video, audio and smart device interaction traffic.
[0113] Traditional Ethernet generally uses RTP (Real-time Transport Protocol) to transmit audio and video streams. However, RTP transmission does not guarantee the order of data arrival, and the received data needs to be rearranged in the buffer at the receiving end. Therefore, in order to avoid network congestion easily caused by traditional Ethernet transmission, the present application provides a new scheduling method for the second type of traffic embodiment, which specifically includes:
[0114] Allocating a first initial credit value, a first credit value growth slope, and a first credit value reduction slope to the first subclass traffic, and allocating a second initial credit value, a second credit value growth slope, and a second credit value reduction slope to the second subclass traffic;
[0115] The first subclass traffic is transmitted with the first initial credit value as the starting value, and during the transmission process, the credit value of the first subclass traffic decreases at the first credit value decreasing slope until the current credit value of the first subclass traffic is less than or equal to 0, and then the transmission is stopped after the data that has been transmitted before the current credit value is less than 0 is completely transmitted, or when the current credit value of the first subclass traffic is greater than 0 and the transmission of the first subclass traffic is completed, the transmission is stopped;
[0116] During the transmission of the first subclass traffic, the credit value of the second subclass traffic starts with the second initial credit value and increases at the second credit value growth slope until the first subclass traffic stops transmitting, at which time the credit value of the second subclass traffic stops increasing;
[0117] When the transmission of the first subclass traffic stops, the transmission of the second subclass traffic begins, and during the transmission process, the credit value of the second subclass traffic decreases at the second credit value decreasing slope until the current credit value of the second subclass traffic is less than or equal to 0, and the transmission is stopped after the data that has been started to be transmitted before the current credit value is less than 0 is completely transmitted, or when the current credit value of the second subclass traffic is greater than 0 and the transmission of the second subclass traffic is completed, the transmission is stopped;
[0118] When the first subclass traffic is not completely transmitted, during the transmission of the second subclass traffic, the credit value of the second subclass traffic increases at the first credit value growth slope until the second subclass traffic stops transmitting, at which point the credit value of the first subclass traffic stops increasing;
[0119] When the first subclass traffic and the second subclass traffic are both in a waiting state and their credit values increase from negative to positive at the same time, the traffic with a relatively large credit value is scheduled first;
[0120] And so on, until the transmission of the first subclass traffic and the second subclass traffic is completed.
[0121] Among them, the first subclass traffic and the second subclass traffic correspond to their own gate switches respectively. When a subclass traffic needs to be transmitted, the corresponding gate switch will be opened, and when the transmission of a subclass traffic stops, the corresponding gate switch will be closed. The first initial credit value and the second initial credit value are both values greater than 0, and the two may be the same or different. Similarly, the first credit value growth slope may be the same as the second credit value growth slope, or they may be different; the first credit value reduction slope may be the same as the second credit value reduction slope, or they may be different.
[0122] The embodiment of the present application uses the above-mentioned alternating scheduling method to evenly transmit the first subclass traffic and the second subclass traffic, and will not cause network congestion due to the transmission of a certain section of large-volume data.
[0123] S140: Schedule the third-category traffic of different queues in sequence according to the order in which the queues are generated, and when there is an idle time slot between the current traffic queue of the third-category traffic and the next adjacent traffic queue, read the traffic from multiple traffic queues to be scheduled adjacent to the current traffic queue and fill the idle time slot for priority scheduling according to the preset scheduling rules.
[0124] In order to avoid video playback freezes and improve the smart cockpit entertainment experience for drivers and passengers, Figure 4 As shown, when there is an idle time slot between the current traffic queue of the third type of traffic and the adjacent next traffic queue, the video playback smoothness can be improved by filling the idle time slot.
[0125] Specifically, according to the preset scheduling rule, the method of reading traffic from multiple to-be-scheduled traffic queues adjacent to the current traffic queue and filling the traffic into the idle time slot for priority scheduling includes:
[0126] A1. Initialize the counter of each traffic queue to be scheduled according to the number of bytes of the Maximum Transmission Unit (MTU) and the weight pre-assigned to each traffic queue to be scheduled, and obtain the initial value of the counter of each traffic queue to be scheduled.
[0127] The initial value of the counter of each traffic queue to be scheduled = the number of bytes of the maximum transmission unit * the weight of the traffic queue to be scheduled. For example, when the weight of a traffic queue to be scheduled is 2 and the number of bytes of the maximum transmission unit is 150, the initial value of the counter = 150*2 = 300.
[0128] A2. According to the order of multiple traffic queues to be scheduled, a message is obtained from each traffic queue to be scheduled and filled into the idle time slot. After each message is scheduled, the counter of the traffic queue to be scheduled corresponding to the scheduled message is updated, and the time slot value of the idle time slot is updated at the same time, wherein the value of the updated counter is the value of the counter before the update minus the number of bytes of the scheduled message.
[0129] A3. After completing one polling of multiple traffic queues to be scheduled, perform the next polling according to the above method until the counter of a traffic queue to be scheduled is less than or equal to 0, then stop scheduling the traffic queue to be scheduled, until the counters of multiple traffic queues to be scheduled are all less than or equal to 0, then reset the counter of each traffic queue to be scheduled to the initial value of the counter, and perform the next polling.
[0130] For example, if there are three traffic queues to be scheduled, namely queue A, B, and C, the initial value of the counter of queue A is 450, and the number of message bytes is 300, the initial value of the counter of queue B is 300, and the number of message bytes is 200, and the initial value of the counter of queue C is 150, and the number of message bytes is 100, then after the first polling, the counter of queue A becomes 150, the counter of queue B becomes 100, and the counter of queue C becomes 50. After the second polling, the counter of queue A becomes -150, the counter of queue B becomes -100, and the counter of queue C becomes -50. At this time, they all become negative numbers. The counter of queue A needs to be reset to 450, the counter of queue B needs to be reset to 300, and the counter of queue C needs to be reset to 150, and then the third polling is performed again.
[0131] A4. During polling, when the slot value of the idle slot is 0, stop polling.
[0132] It should be added that during the polling period, when a queue becomes empty, polling of the queue is stopped, and when the difference between the remaining idle time slot length and the length of a queue is less than 0, the queue is skipped and not polled.
[0133] By filling the idle time slots with subsequent valid traffic, the utilization rate of bandwidth can be improved, so that each type of third-class traffic has the opportunity to be scheduled for priority transmission. This can be reflected in the car computer to avoid video playback jams and improve the smart cockpit entertainment experience of the driver and passengers.
[0134] The shaping and scheduling method for mixed on-vehicle traffic provided in the embodiment of the present application can first divide different traffic into three categories according to the control domain source and importance of the on-vehicle network traffic, and then adopt different scheduling methods according to the characteristics of different traffic. Specifically, for the first category of traffic, it can be divided into multiple priorities first, and then the first category of traffic can be periodically scheduled according to the priority and gate switch status information list; for the second category of traffic, it can be divided into two categories of sub-traffic first, and then the two categories of sub-traffic can be alternately scheduled according to the preset credit adjustment rules; for the third category of traffic, in the process of scheduling each queue in turn, when it is found that there is an idle time slot between two adjacent teams, part of the traffic can be read from the subsequent queue and filled into the idle time slot for priority scheduling. It can be seen from this that the embodiment of the present application can not only avoid network congestion, delay and other problems on the premise that important traffic is scheduled in time, but also improve resource utilization.
[0135] In a possible implementation, Figure 3 As shown, in addition to obtaining the network vehicle traffic, using the traffic classifier to classify it into three categories of traffic and storing them in the cache area, and using different rules to implement scheduling, in order to avoid redundancy or even network congestion and transmission delay caused by too much video traffic due to excessive data volume, the embodiment of the present application also provides the following method:
[0136] When any type of video traffic being scheduled does not meet the preset constraint condition, the video traffic to be scheduled subsequent to the video traffic being scheduled is extracted and then scheduled; and / or,
[0137] When the data volume of any type of video traffic to be scheduled accounts for a proportion of the data volume of the traffic to be scheduled of the corresponding category that is greater than or equal to the preset proportion threshold, the background information of each frame of the video traffic to be scheduled is removed before scheduling.
[0138] The preset constraint condition includes at least one of the following:
[0139] In a single operation process of the gate switch corresponding to the video traffic from opening to closing, there is no uncompleted video traffic;
[0140] Video traffic must not collide with other vehicle control traffic in the link;
[0141] Video traffic cannot exceed the preset delay range and / or preset jitter range;
[0142] The same video traffic can only be transmitted once within the gated switch and cannot be occupied by frame-preempting traffic.
[0143] The preset delay range and the preset jitter range may be determined based on actual experience.
[0144] In addition, the method for extracting frames of the video traffic to be scheduled may include: for the video traffic to be scheduled within a preset time period, if a preset percentage of the Euclidean distances between any image frame to be judged in the video traffic to be scheduled and other image frames is less than or equal to a preset distance threshold, then it is determined that the image frame to be judged does not contain useful information, and the image frame to be judged can be deleted from the video traffic to be scheduled.
[0145] Specifically, a time period T can be specified, and there are n frames of images in the period T, and the image set is recorded as F n , so these n frames of images are recorded as {f 1 ,f 2 ,…,f n}, the width of the image is recorded as W, and the height is recorded as H; the pixel point set should establish the gray value information of each pixel point according to the image coordinate system, and the horizontal coordinate of the image where the pixel point is located is X = {X 1 ,x 2 ,…,x w}, the vertical coordinate is Y={y 1 ,y 2 ,…,y h}, so the nth frame image f n The specific pixel is {X n ,Y n}. For the period T, establish the pixel point set {x n1 ,y n1}、{x n2 ,y n1}、{x n3 ,y n1}, …, {x nw ,y n1}, …, {x n1 ,y n2}、{x n2 ,y n2}、{x n3 ,y n2}, …, {x nw ,y n2}, …, {x nw ,ynh}; The set of pixel points is represented as:
[0146]
[0147] The distance difference between two frames is denoted as d 12 (X, Y), and the difference for each pixel point is:
[0148]
[0149] Definition: If there are a total of t frames in the period T, the distance difference between the current frame fn and other frames is denoted as d(X, Y), and the difference for each pixel point is:
[0150]
[0151] Here, a threshold C is set. If the pixel difference d between the nth frame image and other images in the period T is d > C, it is determined that the current image frame belongs to the key image frame and cannot be frame-skipped, that is, it cannot be discarded; if the pixel difference distance d < C, it is determined that the current image frame has no obvious difference from other frames, and then it can be discarded and frame-skipped.
[0152] In addition, when the key image information that cannot be discarded needs to further reduce the traffic, the extracted video traffic needs to be further processed. The specific processing scheme is motion target extraction, removing the background that does not contain useful information. The algorithm used for target detection is the meanshift motion target extraction algorithm with small resource occupancy, and the frame after target extraction is used as the video traffic FlowBE queued in the input buffer.
[0153] In a possible implementation manner, the embodiments of the present application can also evaluate the scheduling effect of the above vehicle-mounted hybrid traffic shaping and scheduling method. The specific method may include:
[0154] End-to-end delay = processing delay + queuing delay + transmission delay + propagation delay, that is
[0155] Delay = D path + D proc + D queu + D trans
[0156] Among them, Delay represents the end-to-end delay, and D path represents the processing delay, and D proc represents the queuing delay, and D queu represents the transmission delay, and D trans represents the propagation delay.
[0157] The evaluation metrics include jitter, packet loss rate, traffic performance, bounded delay, delay guarantee, deadline, etc.
[0158] The evaluation score is ultimately the standard for evaluating the shaping and scheduling method of this on-vehicle mixed traffic. For systems with lower scores, priority adjustments or classification adjustments can be made based on the type of on-vehicle network traffic to further verify the efficiency of the system, thereby improving the overall system operation effect and achieving the purpose of the system design.
[0159] Based on the above method embodiment, another embodiment of the present application provides a vehicle-mounted mixed traffic shaping and dispatching device, such as Figure 5 As shown, the device comprises:
[0160] The classification unit 210 is used to classify different traffic into first-class traffic, second-class traffic and third-class traffic according to the control domain source and importance of the in-vehicle network traffic, wherein each class of traffic is stored in a queue of preset length in the order of the time when the traffic is generated, and the importance of the first-class traffic, the second-class traffic and the third-class traffic is reduced in sequence;
[0161] A division unit 220, configured to divide the traffic in the first type of traffic into a plurality of priorities;
[0162] The first scheduling unit 230 is used to periodically schedule the first type of traffic according to the order of priority from high to low, and the gated switch state information list, wherein the gated switch state information list includes the states of multiple gated switches corresponding to each of multiple moments in a single cycle, the gated switches correspond to the priorities one by one, and the multiple gated switches corresponding to each moment are arranged in the order of priority from high to low;
[0163] A second scheduling unit 240 is used to divide the second class of traffic into a first subclass of traffic and a second subclass of traffic, and to alternately schedule the first subclass of traffic and the second subclass of traffic according to a preset credit adjustment rule;
[0164] The third scheduling unit 250 is used to schedule the third type of traffic of different queues in sequence according to the order of queue generation, and when there is an idle time slot between the current traffic queue of the third type of traffic and the next adjacent traffic queue, according to the preset scheduling rules, read the traffic from multiple to-be-scheduled traffic queues adjacent to the current traffic queue and fill the idle time slot for priority scheduling.
[0165] In a possible implementation, the device further includes:
[0166] A frame extraction unit is used to extract frames of the video traffic to be scheduled subsequent to the video traffic being scheduled before scheduling when any type of video traffic being scheduled does not meet the preset constraint condition; and / or,
[0167] The removal unit is used to remove the background information of each frame image in the video traffic to be scheduled before scheduling when the proportion of the data volume of any type of video traffic to be scheduled to the data volume of the traffic to be scheduled in the corresponding category is greater than or equal to a preset proportion threshold.
[0168] In a possible implementation manner, the preset constraint condition includes at least one of:
[0169] In a single operation process of the gate switch corresponding to the video traffic from opening to closing, there is no uncompleted video traffic;
[0170] Video traffic must not collide with other vehicle control traffic in the link;
[0171] Video traffic cannot exceed the preset delay range and / or preset jitter range;
[0172] The same video traffic can only be transmitted once within the gated switch and cannot be occupied by frame-preempting traffic.
[0173] In one possible implementation, the frame extraction unit is used to delete the image frame to be judged from the video traffic to be scheduled within a preset time period if a preset percentage of the Euclidean distances between any image frame to be judged in the video traffic to be scheduled and other image frames is less than or equal to a preset distance threshold.
[0174] In a possible implementation manner, the second scheduling unit 240 includes:
[0175] an allocation module, configured to allocate a first initial credit value, a first credit value growth slope, and a first credit value reduction slope to the first subclass traffic, and to allocate a second initial credit value, a second credit value growth slope, and a second credit value reduction slope to the second subclass traffic;
[0176] A scheduling module, used to start transmitting the first subclass traffic with the first initial credit value as the starting value, and during the transmission process, the credit value of the first subclass traffic decreases at a first credit value decreasing slope until the current credit value of the first subclass traffic is less than or equal to 0, and then the transmission is stopped after the data that has been transmitted before the current credit value is less than 0 is completely transmitted, or when the current credit value of the first subclass traffic is greater than 0 and the first subclass traffic is completely transmitted, the transmission is stopped; in the process of transmitting the first subclass traffic, the credit value of the second subclass traffic starts with the second initial credit value and increases at a second credit value increasing slope until the first subclass traffic stops transmitting, and the credit value of the second subclass traffic stops increasing; when the first subclass traffic stops transmitting, the second subclass traffic starts transmitting, and during the transmission process, the second subclass traffic is started transmitting. The credit value of the second subclass traffic decreases at the second credit value decreasing slope until the current credit value of the second subclass traffic is less than or equal to 0, and then the data that has been transmitted before the current credit value is less than 0 is completely transmitted and then the transmission is stopped; or, when the current credit value of the second subclass traffic is greater than 0 and the second subclass traffic is completely transmitted, the transmission is stopped; when the first subclass traffic has not been completely transmitted, during the transmission of the second subclass traffic, the credit value of the second subclass traffic increases at the first credit value increasing slope until the second subclass traffic stops transmitting, and then the credit value of the first subclass traffic stops increasing; when the first subclass traffic and the second subclass traffic are both in a waiting state and their credit values increase from negative numbers to positive numbers at the same time, the traffic with a relatively large credit value is scheduled preferentially; and so on until the first subclass traffic and the second subclass traffic are completely transmitted.
[0177] In a possible implementation manner, the third scheduling unit includes:
[0178] An initialization module, used to initialize the counter of each traffic queue to be scheduled according to the number of bytes of the maximum transmission unit and the weight pre-assigned to each traffic queue to be scheduled, and obtain the initial value of the counter of each traffic queue to be scheduled;
[0179] A polling scheduling module is used to obtain a message from each of the traffic queues to be scheduled and fill it into the idle time slot in the order of the multiple traffic queues to be scheduled, and after each message is scheduled, the counter of the traffic queue to be scheduled corresponding to the scheduled message is updated, and the time slot value of the idle time slot is updated at the same time, wherein the value of the updated counter is the value of the counter before the update minus the number of bytes of the scheduled message; after completing a poll of the multiple traffic queues to be scheduled, the next polling is performed according to the above method until the counter of a traffic queue to be scheduled is less than or equal to 0, and the scheduling of the traffic queue to be scheduled is stopped, until the counters of the multiple traffic queues to be scheduled are all less than or equal to 0, the counter of each traffic queue to be scheduled is reset to the initial value of the counter, and the next polling is performed;
[0180] The stop module is used to stop polling when the time slot value of the idle time slot is 0 during the polling period.
[0181] In a possible implementation, the classification unit includes:
[0182] A first classification module is used to classify key frame video traffic, first common video traffic, and second common video traffic collected by a visual sensor in an autonomous driving domain into the first type of traffic, the second type of traffic, and the third type of traffic, respectively, wherein the first type of common video traffic is more important than the second type of common video traffic;
[0183] A second classification module, used to classify the critical radar traffic and the common radar traffic in the autonomous driving domain into the first category of traffic and the second category of traffic, respectively;
[0184] A third classification module is used to classify the fault emergency flow, power control flow and high-speed vehicle control flow in the vehicle control domain into the first type of flow;
[0185] a fourth classification module, configured to classify the low-speed vehicle control traffic in the vehicle control domain into the second type of traffic;
[0186] The fifth classification module is used to classify the first entertainment media traffic and the second entertainment media traffic in the smart cockpit domain into the second type of traffic and the third type of traffic respectively, wherein the first entertainment media traffic is more important than the second entertainment media traffic.
[0187] The shaping and scheduling device for vehicle mixed traffic provided in the embodiment of the present application can first divide different traffic into three categories according to the control domain source and importance of the vehicle network traffic, and then adopt different scheduling methods according to the characteristics of different traffic. Specifically, for the first category of traffic, it can be divided into multiple priorities first, and then the first category of traffic can be periodically scheduled according to the priority and gate switch status information list; for the second category of traffic, it can be divided into two categories of sub-traffic first, and then the two categories of sub-traffic can be alternately scheduled according to the preset credit adjustment rules; for the third category of traffic, in the process of scheduling each queue in turn, when it is found that there is an idle time slot between two adjacent teams, part of the traffic can be read from the subsequent queue and filled into the idle time slot for priority scheduling. It can be seen from this that the embodiment of the present application can not only avoid network congestion, delay and other problems on the premise that important traffic is scheduled in time, but also improve resource utilization.
[0188] Based on the above method embodiments, another embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the method described in any possible implementation manner above is implemented.
[0189] Based on the above method embodiment, another embodiment of the present application provides an electronic device, the electronic device comprising:
[0190] one or more processors;
[0191] The processor is coupled to a storage device, and the storage device is used to store one or more programs;
[0192] When the one or more programs are executed by the one or more processors, the electronic device implements the method described in any one of the embodiments.
[0193] The above electronic device embodiments all correspond to the system embodiments and have the same technical effects. For specific descriptions, please refer to the system embodiments. A person skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present application.
[0194] Those skilled in the art can understand that the modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be changed accordingly and located in one or more devices different from the embodiment. The modules in the above embodiment can be combined into one module, or can be further divided into multiple sub-modules.
[0195] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A shaping and dispatching method for mixed vehicle traffic, characterized in that: The method comprises: According to the control domain source and importance of the vehicle network traffic, different traffic is divided into the first type of traffic, the second type of traffic and the third type of traffic, wherein each type of traffic is stored in the form of a queue of preset length in the order of the time when the traffic is generated, and the importance of the first type of traffic, the second type of traffic and the third type of traffic decreases in sequence; Dividing the traffic in the first category of traffic into multiple priorities, and periodically scheduling the first category of traffic according to the order of priorities from high to low, and a list of gated switch status information, wherein the list of gated switch status information includes the states of multiple gated switches corresponding to each of multiple moments in a single cycle, the gated switches correspond to the priorities one by one, and the multiple gated switches corresponding to each moment are arranged in order of priority from high to low; Dividing the second-category traffic into first-subcategory traffic and second-subcategory traffic, and scheduling the first-subcategory traffic and the second-subcategory traffic alternately according to a preset credit adjustment rule; The third type of traffic of different queues is scheduled in sequence according to the order of queue generation, and when there is an idle time slot between the current traffic queue of the third type of traffic and the next adjacent traffic queue, according to the preset scheduling rules, the traffic is read from multiple traffic queues to be scheduled adjacent to the current traffic queue and filled into the idle time slot for priority scheduling.
2. The method according to claim 1, characterized in that The method further comprises: When any type of video traffic being scheduled does not meet the preset constraint condition, the video traffic to be scheduled subsequent to the video traffic being scheduled is extracted and then scheduled; and / or, When the data volume of any type of video traffic to be scheduled accounts for a proportion of the data volume of the traffic to be scheduled of the corresponding category that is greater than or equal to a preset proportion threshold, the background information of each frame of the video traffic to be scheduled is removed before scheduling.
3. The method according to claim 2, characterized in that The preset constraint condition includes at least one of: In a single operation process of the gate switch corresponding to the video traffic from opening to closing, there is no uncompleted video traffic; Video traffic must not collide with other vehicle control traffic in the link; Video traffic cannot exceed the preset delay range and / or preset jitter range; The same video traffic can only be transmitted once within the gated switch and cannot be occupied by frame-preempting traffic.
4. The method according to claim 2, characterized in that: The method for extracting frames of the video traffic to be scheduled includes: For the video traffic to be scheduled within a preset time period, if a preset percentage of the Euclidean distances between any image frame to be judged in the video traffic to be scheduled and other image frames is less than or equal to a preset distance threshold, the image frame to be judged will be deleted from the video traffic to be scheduled.
5. The method according to claim 1, characterized in that According to a preset credit adjustment rule, the first sub-category traffic and the second sub-category traffic are alternately scheduled, including: Allocating a first initial credit value, a first credit value increasing slope, and a first credit value decreasing slope to the first subclass traffic, and allocating a second initial credit value, a second credit value increasing slope, and a second credit value decreasing slope to the second subclass traffic; The first subclass traffic is started to be transmitted with the first initial credit value as the starting value, and during the transmission process, the credit value of the first subclass traffic decreases at the first credit value decreasing slope until the current credit value of the first subclass traffic is less than or equal to 0, and the transmission is stopped after the data that has started to be transmitted before the current credit value is less than 0 is completely transmitted, or when the current credit value of the first subclass traffic is greater than 0 and the transmission of the first subclass traffic is completed, the transmission is stopped; During the transmission of the first subclass traffic, the credit value of the second subclass traffic starts with the second initial credit value and increases at the second credit value growth slope until the first subclass traffic stops transmitting, at which time the credit value of the second subclass traffic stops increasing; When the transmission of the first subclass traffic stops, the transmission of the second subclass traffic begins, and during the transmission process, the credit value of the second subclass traffic decreases at the second credit value decreasing slope until the current credit value of the second subclass traffic is less than or equal to 0, and the transmission stops after the data that has started to be transmitted before the current credit value is less than 0 is completely transmitted, or when the current credit value of the second subclass traffic is greater than 0 and the transmission of the second subclass traffic is completed, the transmission stops; When the first subclass traffic is not completely transmitted, during the transmission of the second subclass traffic, the credit value of the second subclass traffic increases at the first credit value growth slope until the second subclass traffic stops transmitting, at which point the credit value of the first subclass traffic stops increasing; When the first subclass traffic and the second subclass traffic are both in a waiting state and their credit values increase from negative to positive at the same time, the traffic with a relatively large credit value is preferentially scheduled; And so on, until the transmission of the first subclass traffic and the second subclass traffic is completed.
6. The method according to claim 1, characterized in that According to a preset scheduling rule, reading traffic from a plurality of to-be-scheduled traffic queues adjacent to the current traffic queue and filling the traffic into the idle time slot for priority scheduling includes: Initializing the counter of each traffic queue to be scheduled according to the number of bytes of the maximum transmission unit and the weight pre-assigned to each traffic queue to be scheduled, and obtaining the initial value of the counter of each traffic queue to be scheduled; According to the order of the plurality of traffic queues to be scheduled, a message is obtained from each of the traffic queues to be scheduled and filled into the idle time slot, and after each message is scheduled, the counter of the traffic queue to be scheduled corresponding to the scheduled message is updated, and the time slot value of the idle time slot is updated at the same time, wherein the value of the updated counter is the value of the counter before the update minus the number of bytes of the scheduled message; After completing one polling of the plurality of traffic queues to be scheduled, the next polling is performed according to the above method until the counter of a certain traffic queue to be scheduled is less than or equal to 0, the scheduling of the traffic queue to be scheduled is stopped, and the counters of the plurality of traffic queues to be scheduled are all less than or equal to 0, the counter of each of the traffic queues to be scheduled is reset to the initial value of the counter, and the next polling is performed; During the polling period, when the time slot value of the idle time slot is 0, the polling is stopped.
7. The method according to any one of claims 1 to 6, characterized in that According to the control domain source and importance of vehicle network traffic, different traffic is divided into first-class traffic, second-class traffic and third-class traffic, including: Classify the key frame video traffic, the first common video traffic, and the second common video traffic collected by the visual sensor in the autonomous driving domain into the first type of traffic, the second type of traffic, and the third type of traffic, respectively, wherein the first common video traffic is more important than the second common video traffic; Classify the critical radar traffic and the common radar traffic in the autonomous driving domain into the first category of traffic and the second category of traffic, respectively; Classifying the fault emergency flow, power control flow and high-speed vehicle control flow in the vehicle control domain into the first type of flow; Classifying the low-speed vehicle control traffic in the vehicle control domain into the second type of traffic; The first entertainment media traffic and the second entertainment media traffic in the smart cockpit domain are respectively divided into the second type of traffic and the third type of traffic, wherein the first entertainment media traffic is more important than the second entertainment media traffic.
8. A vehicle-mounted mixed traffic shaping and dispatching device, characterized in that: The device comprises: a classification unit, for classifying different traffic into first-class traffic, second-class traffic and third-class traffic according to the control domain source and importance of the in-vehicle network traffic, wherein each class of traffic is stored in a queue of preset length in the order of the time when the traffic is generated, and the importance of the first-class traffic, the second-class traffic and the third-class traffic is reduced in sequence; A division unit, configured to divide the traffic in the first type of traffic into a plurality of priorities; A first scheduling unit, configured to periodically schedule the first type of traffic according to a descending order of priority and a gated switch state information list, wherein the gated switch state information list includes states of a plurality of gated switches corresponding to each of a plurality of moments in a single cycle, the gated switches correspond to the priorities one by one, and the plurality of gated switches corresponding to each moment are arranged in a descending order of priority; A second scheduling unit, configured to divide the second class of traffic into a first subclass of traffic and a second subclass of traffic, and to alternately schedule the first subclass of traffic and the second subclass of traffic according to a preset credit adjustment rule; The third scheduling unit is used to schedule the third type of traffic of different queues in sequence according to the order of queue generation, and when there is an idle time slot between the current traffic queue of the third type of traffic and the next adjacent traffic queue, according to the preset scheduling rules, read the traffic from multiple to-be-scheduled traffic queues adjacent to the current traffic queue and fill the idle time slot for priority scheduling.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: The electronic device comprises: one or more processors; The processor is coupled to a storage device, and the storage device is used to store one or more programs; When the one or more programs are executed by the one or more processors, the electronic device implements the method according to any one of claims 1 to 7.
Citation Information
Cited By
Mixed flow multi-mechanism cooperative scheduling method and system of vehicle-mounted TSN
CN121098810A
A mixed traffic multi-mechanism cooperative scheduling method and system for vehicle-mounted TSN
CN121098810B