Data transmission method and device of domain controller, electronic equipment and storage medium
By caching forwarding queues and sending policies according to the category of data frames in domain controllers, the problem of unreasonable allocation of data transmission resources between domain controllers is solved, and the rationality and efficiency of communication resources are improved.
Patent Information
- Application Number
- CN202410723978.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-10-15
AI Technical Summary
In the existing technology, data transmission between domain controllers adopts an equal forwarding method, which results in unreasonable allocation of communication resources. Especially when the amount of data is large, a large amount of bandwidth will be occupied, affecting the transmission of other types of data.
By receiving the data frame sent by the domain controller, the frame category is determined based on the data category field in the data frame, and is cached in the corresponding forwarding queue. It is sent according to the forwarding queue policy, using priority forwarding and traffic shaping policies to Allocate resources appropriately.
It achieves a reasonable allocation of data of different frame categories, avoids large amounts of data occupying bandwidth, and improves the rationality and efficiency of communication resources.
Smart Images

Figure CN118784391A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automobile technology, and in particular to a data transmission method, device, electronic equipment and storage medium of a domain controller. Background Art
[0002] With the continuous development of automobile electronics, informationization and intelligence, the realization of various functions in the car depends on the communication between various domain controllers, which makes the communication information between domain controllers in the car more and more huge and diverse. At present, the existing traditional technical means implement equal forwarding of various types of data between domain controllers, that is, the forwarding method of first come first forward and last come last forward. This forwarding method will occupy too much bandwidth when forwarding very large amounts of data, affecting the forwarding of other types of data, and there is a problem of unreasonable allocation of communication resources. Summary of the invention
[0003] The present application provides a data transmission method, device, electronic device and storage medium of a domain controller to solve the problem of unreasonable allocation of communication resources when using an equal forwarding method.
[0004] In a first aspect, the present application provides a data transmission method of a domain controller, comprising:
[0005] Receive data frames sent by the domain controller;
[0006] Determining a frame category of the data frame according to a data category field in the data frame;
[0007] According to the frame category, caching the data frame into a forwarding queue corresponding to the frame category;
[0008] According to the forwarding strategy corresponding to the forwarding queue, the target data frame in the forwarding queue is sent.
[0009] Optionally, determining the frame category of the data frame according to a data category field in the data frame includes:
[0010] Determine the number of bytes in the data category field;
[0011] Determine the data category to which the byte number belongs;
[0012] The data type is used as the frame type.
[0013] Optionally, determining the data category to which the number of byte bits belongs includes:
[0014] Extract the field value corresponding to the number of byte bits;
[0015] If the field value is within a preset first field value range, determining a preset priority category corresponding to the first field value range as the data category;
[0016] If the field value is not within the preset first field value range, the preset traffic shaping category is determined as the data category.
[0017] Optionally, caching the data frame to a forwarding queue corresponding to the frame category according to the frame category includes:
[0018] In a case where the frame category is the priority category, determining a level parameter corresponding to the field value;
[0019] determining a target position corresponding to the level parameter in the forwarding queue;
[0020] The data frame is cached at the target location.
[0021] Optionally, the forwarding queue includes a priority queue and a traffic shaping queue, and sending the target data frame in the forwarding queue according to the forwarding policy corresponding to the forwarding queue includes:
[0022] In the case where the data frame exists in the priority queue, according to a priority forwarding strategy, taking the data frame with a preset priority in the priority queue as the target data frame, and sending the target data frame, the priority forwarding strategy being the forwarding strategy corresponding to the priority queue;
[0023] When the data frame does not exist in the priority queue, the target data frame is extracted from the traffic shaping queue, and the target data frame is sent according to a traffic shaping forwarding strategy, where the traffic shaping forwarding strategy is a forwarding strategy corresponding to the traffic shaping column.
[0024] Optionally, sending the target data frame in the forwarding queue according to the forwarding policy corresponding to the forwarding queue includes:
[0025] Record the number of continuously sent frames corresponding to the priority queue, where the number of continuously sent frames represents the number of target data frames in the priority queue that are continuously sent;
[0026] When the number of continuous transmissions reaches a preset continuous transmission threshold, determining whether the data frame exists in the traffic shaping queue;
[0027] If the data frame exists in the traffic shaping queue, the target data is extracted from the traffic shaping queue, and the target data frame is sent according to the traffic shaping forwarding strategy.
[0028] Optionally, sending the target data frame according to the traffic shaping forwarding strategy includes:
[0029] Based on the traffic shaping forwarding strategy, extracting the data category field of the target data frame;
[0030] Determining a target sending rate using the data category field;
[0031] The target data frame is sent according to the target sending rate.
[0032] Optionally, before sending the target data frame in the forwarding queue according to the forwarding policy corresponding to the forwarding queue, the method further includes:
[0033] Get policy update information;
[0034] The forwarding strategy is updated according to the strategy update information.
[0035] Optionally, sending the target data frame in the forwarding queue according to the forwarding policy corresponding to the forwarding queue includes:
[0036] Extracting the target data frame from the forwarding queue according to the forwarding strategy corresponding to the forwarding queue;
[0037] Extracting target address information from the target data frame;
[0038] The target data frame is sent to the target domain controller corresponding to the target address information.
[0039] In a second aspect, the present application provides a data transmission device of a domain controller, the device comprising:
[0040] A receiving module, used for receiving data frames sent by a domain controller;
[0041] A determination module, used to determine the frame category of the data frame according to the data category field in the data frame;
[0042] A cache module, used for caching the data frame into a forwarding queue corresponding to the frame category according to the frame category;
[0043] The sending module is used to send the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue.
[0044] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0045] Memory, used to store computer programs;
[0046] The processor is used to implement the data transmission method of the domain controller described in any one of the first aspects when executing the program stored in the memory.
[0047] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data transmission method of the domain controller as described in any one of the first aspects is implemented.
[0048] Beneficial effects of the present invention:
[0049] The embodiment of the present application receives data frames sent by a domain controller to determine the frame category of the data frames, and caches the data frames to a forwarding queue corresponding to the frame category according to the frame category, and then sends the target data frames in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue, thereby achieving the purpose of adopting different forwarding strategies for data frames of different frame categories and being able to reasonably and effectively allocate communication resources, solving the problem of unreasonable communication resource allocation existing in the existing related technology adopting the equal forwarding method, and improving the rationality of communication resource allocation. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A flowchart of a data transmission method of a domain controller provided in an embodiment of the present application;
[0051] Figure 2 A schematic diagram of an application scenario of a data transmission method of a domain controller provided in an embodiment of the present application;
[0052] Figure 3 A schematic diagram of a data frame structure of a data transmission method of a domain controller provided in an embodiment of the present application;
[0053] Figure 4 A schematic diagram of another application scenario of a data transmission method of a domain controller provided in an embodiment of the present application;
[0054] Figure 5 A schematic diagram of another application scenario of a data transmission method of a domain controller provided in an embodiment of the present application;
[0055] Figure 6 A schematic diagram of the structure of a data transmission device of a domain controller provided in an embodiment of the present application;
[0056] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0058] Nowadays, the functional domains of vehicles generally include power domain (Power Train), chassis domain (Chassis), body domain (Body / Comfort), cockpit domain (Cockpit / Infotainment), and autonomous driving domain (ADAS). Information needs to be exchanged between each functional domain, forming a huge information communication network in the car, and various communication data are transmitted between domain controllers. The autonomous driving domain controller may need to receive sensor data from the body domain controller or the chassis domain controller, such as environmental information collected by cameras, radars, or lidars. These data are crucial for autonomous driving systems and are used to identify obstacles, pedestrians, lane markings, etc. to achieve safe navigation and driving decisions. Control instructions or other data are transmitted between domain controllers to ensure the coordinated operation of various vehicle systems. For example, the power domain controller may receive acceleration or deceleration instructions from the autonomous driving domain controller, or the body domain controller may adjust the status of the lights or windows according to the needs of the autonomous driving system. Each domain controller sends status information of the system it is responsible for, such as battery power, tire pressure, door status, etc. This information helps other domain controllers understand the current status of the vehicle and make corresponding adjustments or decisions accordingly. Diagnostic information is also transmitted between domain controllers to monitor and report the health of the vehicle's systems. This helps to detect potential problems in a timely manner and make appropriate repairs or maintenance. As vehicle functions are continuously upgraded and optimized, configuration and update data may need to be transmitted between domain controllers. For example, when a vehicle receives a new software update, the relevant information needs to be transmitted between domain controllers to ensure that it can be correctly applied to each system.
[0059] With the continuous expansion of vehicle functions, the amount of data transmitted between domain controllers is getting larger and larger, and the types of data are also increasing. At present, the existing traditional technical means implement equal forwarding for various types of data between domain controllers, that is, the forwarding method of first come first forward and last come last forward. However, the data information exchanged between various domain controllers has different importance. For example, among vehicle control data, vehicle status data, navigation data and multimedia data, the priority of vehicle control data should be higher than that of multimedia data. If the equal forwarding method of the existing traditional technical means is adopted, important data that needs to be forwarded as soon as possible must wait for the data that arrives first to be forwarded first. Some data with very large amounts of data occupy too much bandwidth, affecting the forwarding bandwidth of other types of data. For example, the vehicle control data is 1 kilobyte in size, and before that, the multimedia data that needs to be transmitted is 2 megabytes in size, that is, 2 megabytes of multimedia data need to be transmitted before the transmission of 1 kilobyte of vehicle control data can be started. At this time, the multimedia data with lower importance will be transmitted for a long time, which makes the transmission of vehicle control data with higher importance delayed. That is, this forwarding method will occupy too much bandwidth when forwarding data with very large amounts of data, affecting the forwarding of other types of data, and there is a problem of unreasonable allocation of communication resources.
[0060] In order to solve the problem of unreasonable allocation of communication resources when using the equal forwarding method in the prior art, the present application provides a data transmission method, device, electronic device and storage medium of a domain controller, which receives data frames sent by the domain controller to determine the frame category of the data frame, and caches the data frame to a forwarding queue corresponding to the frame category according to the frame category, and then sends the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue, thereby achieving the purpose of using different forwarding strategies for data frames of different frame categories and being able to reasonably and effectively allocate communication resources, solving the problem of unreasonable allocation of communication resources when using the equal forwarding method in the prior related technology, and improving the rationality of communication resource allocation.
[0061] Figure 1 A flow chart of a data transmission method of a domain controller provided in an embodiment of the present application. This method can be applied to one or more electronic devices such as a vehicle (e.g., an autonomous driving vehicle), a client, a server, etc. In addition, the execution subject of this method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the above-mentioned execution subject is software, this method can be implemented as multiple software or software modules, or as a single software or software module. It is not specifically limited here.
[0062] like Figure 1As shown, a data transmission method of a domain controller provided in an embodiment of the present application may specifically include the following steps:
[0063] Step S110: receiving a data frame sent by a domain controller;
[0064] Among them, the domain controller may refer to a domain controller in a vehicle, which is a multiple electronic control unit in the automotive electronic and electrical architecture responsible for managing and coordinating specific domains in the vehicle, such as an intelligent driving domain controller, a body domain controller, a chassis domain controller, etc., which is not limited in this embodiment of the present application. The data frame sent by the domain controller refers to the data output during the operation of the domain controller, and the data frame can be a common Layer 2 Ethernet data frame format, such as a data frame sent by the intelligent driving domain controller to the body domain controller during operation, or a data frame sent by the body domain controller to the intelligent driving domain controller during operation, which is not specifically limited in this embodiment.
[0065] Step S120: Determine the frame type of the data frame according to the data type field in the data frame.
[0066] Specifically, in this embodiment, after obtaining the data frame sent by the domain controller, the data category field can be extracted from the data frame. The data category field is a field pre-configured in the data frame, so that the frame category corresponding to the data frame can be determined based on the data category field. The frame category indicates the preset category to which the data frame belongs. The preset category is a pre-configured category, such as a priority category, a traffic shaping category, etc., which can be pre-configured according to the data frame classification requirements, and this embodiment does not impose specific restrictions on this. In addition, the method for determining the frame category of the data frame can be determined by extracting field data of a preset field in the data frame, or it can be determined based on the source domain controller identifier that sends the data frame. Of course, other methods can also be used for determination, and this embodiment does not impose specific restrictions on this.
[0067] This embodiment adds a data category field in the data frame, so that different information can be written in the data category field according to needs during the generation process of the data frame. Therefore, when the data frame is identified and the frame category is determined, the frame category of each data frame can be determined according to the data category field in each data frame, thereby avoiding the problem of low precision and large error in data frame classification, improving the precision of frame category division of data frames and reducing classification errors.
[0068] In one example, if Figure 3 As shown, the data frame in this embodiment can be a common layer 2 Ethernet data frame format including a data category field, which complies with the IEEE 802.3 standard, such as Figure 3As shown, a data frame may include a source media access control address (MAC), a destination MAC, a frame type field, a data category field, and a data segment, and the byte length of the data category field is configured according to the requirements. Each domain controller has its own MAC address. According to the requirements of different services, data frames of different services are divided into different categories. Corresponding to the data category field of the data frame, after the forwarding device receives a data frame sent by a domain controller, it can determine the corresponding frame category according to the data category field of the data frame, so that the data frame can be cached in different forwarding queues according to different frame categories, and then the data frame can be sent to the corresponding destination domain controller according to the destination MAC address in the data frame.
[0069] Step S130: Buffer the data frame into a forwarding queue corresponding to the frame category according to the frame category.
[0070] Specifically, after determining the frame category of the data frame, this embodiment can cache the data frame into a forwarding queue corresponding to the frame category according to the frame category, wherein the forwarding queue represents a queue corresponding to the frame category, and there is a preset corresponding relationship between the frame category and the correspondence between the forwarding queue and the frame category; in this embodiment, based on the frame category of the data frame, the data frame is cached into a forwarding queue corresponding to the frame category, which can play the role of caching different data frames into different forwarding queues.
[0071] Step S140: sending the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue.
[0072] Specifically, after caching the data frame to the forwarding queue corresponding to the frame category, the embodiment can determine the forwarding strategy corresponding to the forwarding queue. The forwarding strategy represents the strategy for forwarding the data frame in the forwarding queue. The forwarding strategy can be forwarding by priority or forwarding at a preset sending rate. Of course, it can also be other forwarding strategies, which are not specifically limited in the embodiment. In addition, there is a preset corresponding relationship between the forwarding strategy and the forwarding queue. The target data frame in the forwarding queue represents the data frame that needs to be sent currently. For example, according to the forwarding strategy, one or more data frames are extracted from the forwarding queue as the target data frame, so that the target data frame is sent.
[0073] It should be noted that when there are multiple forwarding queues, the forwarding strategies corresponding to each forwarding queue can be independently executed for forwarding, or there can be an execution association between the forwarding strategies, such as giving priority to executing the priority forwarding strategy corresponding to the priority forwarding queue, or giving priority to executing the traffic shaping forwarding strategy corresponding to the traffic shaping forwarding queue, etc. Of course, there can also be other execution associations, which are not specifically limited in this embodiment.
[0074] In one example, if Figure 2 As shown, there are multiple domain controllers in the vehicle communication network, such as a power domain controller, a body domain controller, an intelligent driving domain controller, a chassis domain controller, etc. The domain controllers communicate with each other through Ethernet through a forwarding device. The data transmission method of the domain controller in the present application can be applied to the forwarding device. When the domain controller sends a data frame, the forwarding device can receive the data frame sent by the domain controller, determine the frame category of the data frame, and cache the data frame to the forwarding queue corresponding to the frame category. For example, the forwarding queue can include a priority forwarding queue and a traffic shaping queue. At this time, for the priority forwarding queue, the target data frame in the priority forwarding queue can be sent according to the priority according to the priority forwarding policy corresponding to the priority forwarding queue. For the traffic shaping forwarding queue, the target data frame in the traffic shaping forwarding queue can be sent according to the sending rate according to the traffic shaping forwarding policy corresponding to the traffic shaping forwarding queue, thereby playing a role in sending different types of output frames with different forwarding policies, avoiding excessive bandwidth occupation when forwarding data with a very large amount of data, affecting the forwarding of other types of data, and the problem of unreasonable communication resource allocation, thereby improving the rationality of communication resource allocation.
[0075] In the process of determining the frame category based on the data category field, the specific data in the data category field can be directly extracted for determination. However, if the data category field is determined for each data frame, and then the data in the data category field is extracted and calculated to determine its corresponding frame category, there will be a problem of large amount of calculation and low efficiency during the recognition process.
[0076] In an optional embodiment of the present application, the data category corresponding to the data category field is determined as a frame category, which may specifically include the following sub-steps: determining the number of byte bits in the data category field; determining the data category to which the byte bits belong; and using the data category as the frame category.
[0077] In this embodiment, after extracting the data category field in the data frame, the byte bit number of the data category field can be determined. The byte bit number indicates the number of bytes contained in the data category field, such as 1 byte bit number, 2 byte bit number, etc., so that the data category to which the byte bit number belongs can be determined. The data category is a pre-configured category, such as a priority category, a traffic shaping category, etc. Different byte bit numbers can correspond to different or the same data categories. For example, the data category corresponding to 1 byte bit number is the priority category, and the data category corresponding to 2 byte bit numbers is the traffic shaping category. Of course, the relationship between the byte bit number and the data category can also be expressed in other corresponding ways, which is not specifically limited in this embodiment; and then the data category to which the byte bit number belongs can be used as the frame category, so that the frame category of the data frame can be quickly and accurately determined through the byte bit number of the data category field, avoiding the problem of large amount of calculation and low efficiency in the recognition process, reducing the amount of calculation and improving the recognition effect.
[0078] In order to further improve the accuracy of data category classification, in an optional embodiment of the present application, determining the data category to which the number of byte bits belongs can specifically include the following sub-steps: extracting the field value corresponding to the number of byte bits; if the field value is within a preset first field value range, determining the preset priority category corresponding to the first field value range as the data category; if the field value is not within the preset first field value range, determining the preset traffic shaping category as the data category.
[0079] In this embodiment, after determining the number of byte bits in the data category field, the field value corresponding to the number of byte bits can be extracted. The field value represents the data value stored in the byte corresponding to the number of byte bits. For example, the byte corresponding to the number of byte bits stores hexadecimal data 0x00E6. At this time, it can be determined that the field value corresponding to 0x00E6 is 230; thereby, it can be determined whether the field value is within the first field value range. The first field value range represents the field value range corresponding to the pre-set priority category. That is, when the field value is within the preset first field value range, the preset priority category corresponding to the first field value range can be determined as the data category. If the field value is not within the preset first field value range, it means that the current data frame does not belong to the priority category. At this time, the preset traffic shaping category is determined as the data category. Of course, multiple field value ranges can also be pre-configured to correspond to multiple data categories. For example, the second field value range corresponds to the traffic shaping category, the third field value range corresponds to the restricted forwarding category, etc. This embodiment does not make specific limitations on this.
[0080] This embodiment pre-configures the correspondence between the field value range and the data category, so that the data category corresponding to the data frame can be determined based on the field value corresponding to the byte number. It can play the role of using a fixed number of byte numbers to correspond to multiple data categories, and can effectively improve the classification accuracy of data categories.
[0081] In one example, if Figure 3 As shown in the figure, the length of the byte number of the data category field is defined as 2 bytes, so the field value that the data category field can express can be 65536 (i.e. 2 16 ) types, at this time, the first 0 to 32767 types of field values can be divided into traffic shaping categories, and the latter 32768 to 65535 types of field values can be divided into priority categories, that is, the first field value range is 32768 to 65535. At this time, after receiving the data frame sent by the domain controller, the byte number of the data category field of the data frame can be identified to obtain the field value. If the data category field of the data frame is 230 (0x00E6 in hexadecimal), it can be determined that the field value is not within the preset first field value range, and the preset traffic shaping category is determined as the data category of the data frame. If the data category field of the data frame is 41000 (0xA028 in hexadecimal), it can be determined that the field value is within the preset first field value range, and the preset priority category is determined as the data category of the data frame; of course, the above is only an example for illustration, and it can be configured according to specific needs during specific implementation, and this embodiment does not make specific limitations.
[0082] The data frames of the priority category in this embodiment need to be sent in order of priority, and each data frame is cached in a priority forwarding queue. At this time, there is a problem of how to accurately send the data frames in the priority forwarding queue in order of priority.
[0083] In an optional embodiment of the present application, step S130 caches the data frame to a forwarding queue corresponding to the frame category according to the frame category, and may specifically include the following sub-steps: when the frame category is a priority category, determining the level parameter corresponding to the field value; determining the target position corresponding to the level parameter in the forwarding queue; and caching the data frame to the target position.
[0084] In this embodiment, after determining the frame category, it can be determined whether the frame category is a priority category. In the case that the frame category is a priority category, the level parameter corresponding to the field value can be determined. Since the priority forwarding strategy corresponding to the priority queue is to send data frames in a preset priority order, the data frames in the priority queue need to be arranged in a preset priority order, wherein the level parameter represents the level in the preset priority order. For example, the preset priority order is A, B, and C from high to low. At this time, the level parameter is used to indicate one of the levels of A, B, and C. Since the priority forwarding strategy corresponding to the priority queue is to send data frames in a preset priority order, According to the frame, the target position corresponding to the level parameter can be determined in the forwarding queue, and the target position indicates the position where the data frame needs to be cached in the forwarding queue. For example, the forwarding queue is preset with three positions, from front to back, respectively, position A1 for storing level A data frames, position AB for storing level B data frames, and position C1 for storing level C data frames. At this time, if the level parameter is B, it can be determined that the target position corresponding to the level parameter is position B1, and the data frame corresponding to the level parameter can be cached to position B1 in the forwarding queue; of course, the above is only an example for explanation, and it can be adaptively configured according to needs during specific implementation, and this embodiment does not make specific limitations on this.
[0085] In this embodiment, by determining the level parameter corresponding to the field value, the data frame is cached to the target position corresponding to the level parameter. In the process of caching the data frame to the forwarding queue, it can be sorted according to the preset priority order, so that in the process of forwarding the forwarding queue data frame, it only needs to be sent according to the preset order, thereby improving the sending efficiency of the forwarding queue.
[0086] In a specific example, if Figure 4 As shown, the data frames in the forwarding queue of the priority category are sorted according to the preset priority order. The higher the priority, the more it is placed at the front of the queue, and the data frames closer to the front of the queue are sent first. The mapping relationship between the level parameter and the target position is as follows: Figure 4 As shown, Figure 4 On the left is the level parameter of the data category field of the corresponding data frame, and on the right is the corresponding target position. The smaller the number of the target position, the higher the priority, and the closer it is to the front of the queue, the higher the priority it will be sent. If the level parameter of the data category field of the data frame is 41000, and its mapped target position is 2100, the data frame will be forwarded before the data frame with a target position greater than 2100, and after the data frame with a target position less than 2100.
[0087] In this embodiment, the forwarding queue includes a priority queue and a traffic shaping queue, and the forwarding policy corresponding to the priority queue is the priority forwarding policy, and the forwarding policy corresponding to the traffic shaping queue is the traffic shaping forwarding policy. Since the priority queue is used to store data frames of preset priority levels, that is, more important data frames can be stored in the priority queue, and the traffic shaping queue is a queue for sending data frames at a preset sending rate, and can be used to cache data frames with lower importance levels, it can be seen that the sending order of data frames in the priority queue will be greater than that of data frames in the traffic shaping queue.
[0088] In an optional embodiment of the present application, the target data frame in the forwarding queue is sent according to the forwarding policy corresponding to the forwarding queue, which may specifically include the following sub-steps: when there are data frames in the priority queue, according to the priority forwarding policy, the data frame with a preset priority in the priority queue is used as the target data frame, and the target data frame is sent, and the priority forwarding policy is the forwarding policy corresponding to the priority queue; when there are no data frames in the priority queue, the target data frame is extracted from the traffic shaping queue, and the target data frame is sent according to the traffic shaping forwarding policy, and the traffic shaping forwarding policy is the forwarding policy corresponding to the traffic shaping queue.
[0089] In this embodiment, in the process of sending the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue, since there are two queues, namely the priority queue and the traffic shaping queue, and the sending order of the data frames in the priority queue is greater than the data frames in the traffic shaping queue, it can be determined whether there are data frames in the priority queue. If there are data frames in the priority queue, the priority forwarding strategy can be used to take the data frames with preset priority in the priority queue as the target data frames and send the target data frames, wherein the target data frames represent the data frames to be sent extracted from the priority queue according to the priority strategy, and the priority forwarding strategy is the forwarding strategy corresponding to the priority queue, and the preset priority is the priority of the data frames extracted according to the priority forwarding strategy, which can be the highest priority or a set priority, etc.; specifically, the priority forwarding strategy can be to extract the data frames in the priority queue from the front end of the queue to the back end of the queue in sequence as the target data frames for sending, or it can be to extract the data frames from the back end of the queue to the front end of the queue in sequence as the target data frames for sending. Of course, other strategies can also be adopted, and this embodiment does not make specific limitations. When there are no data frames in the priority queue, the target data frames can be extracted from the traffic shaping queue and sent according to the traffic shaping forwarding strategy. The traffic shaping forwarding strategy is the forwarding strategy corresponding to the traffic shaping column. The traffic shaping forwarding strategy can be to send the target data frame according to the preset sending rate.
[0090] In this embodiment, by configuring the priority queue and the traffic shaping queue, the data frames in the priority queue can be sent first, and the data frames in the traffic shaping queue can be sent at a preset sending rate according to the traffic shaping forwarding strategy, so that different sending strategies are adopted for different types of data frames, which avoids the problem of excessive bandwidth occupation when forwarding very large amounts of data, affecting the forwarding of other types of data, and the problem of unreasonable communication resource allocation, thereby improving the rationality of communication resource allocation.
[0091] Since the priority queue and traffic shaping queue are pre-configured, and if there are data frames in the priority queue, the data frames in the priority queue will be sent first. However, if there are many data frames in the priority queue, the data frames in the priority queue will be sent for a long time, causing the data frames in the traffic shaping queue to stop forwarding for a long time. Although the importance of the data frames in the traffic shaping queue is relatively low, if they are not forwarded for a long time, it will cause a very long delay time, and abnormal operation may occur.
[0092] In an optional embodiment of the present application, the target data frames in the forwarding queue are sent according to the forwarding strategy corresponding to the forwarding queue, and may further include the following sub-steps: recording the number of continuously sent frames corresponding to the priority queue, the number of continuously sent frames indicating the number of target data frames continuously sent in the priority queue; when the number of continuous sending reaches a preset continuous sending threshold, determining whether there are data frames in the traffic shaping queue; if there are data frames in the traffic shaping queue, extracting the target data from the traffic shaping queue, and sending the target data frames according to the traffic shaping forwarding strategy.
[0093] In this embodiment, in the process of sending the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue, it is determined whether the target data frame is sent according to the priority forwarding strategy. If so, the number of continuously sent frames corresponding to the priority queue can be recorded. The number of continuously sent frames indicates the number of target data frames in the continuously sent priority queue, and when it is determined that the continuously sent number reaches a preset continuous sending threshold, the preset continuous sending threshold indicates the maximum number of target data frames in the continuously sent priority queue pre-configured. When the continuously sent number reaches the preset continuous sending threshold, it means that the maximum number of target data frames in the priority queue has been continuously sent. At this time, if the target data frame in the priority queue continues to be sent, the data frame in the traffic shaping queue is not forwarded for a long time, and an operation abnormality will occur. At this time, it can be determined whether there is a data frame in the traffic shaping queue. If there is a data frame in the traffic shaping queue, the target data is extracted from the traffic shaping queue, and the target data frame is sent according to the traffic shaping forwarding strategy, so that the data frames in the priority queue and the traffic shaping queue can be staggered and forwarded, so as to avoid the problem of data frames in a queue being delayed for a long time, resulting in an operation abnormality, thereby improving the rationality of communication resource allocation. It should be noted that this embodiment only takes two queues as an example. The specific embodiment may be to switch between different queues according to the number of continuous transmissions in the case of three queues, four queues or more queues. This embodiment does not make specific limitations on this.
[0094] In addition, when the number of continuous transmissions reaches a preset continuous transmission threshold, the target data is extracted from the traffic shaping queue, and after the target data frame is sent according to the traffic shaping forwarding strategy, the second continuous transmission frame number corresponding to the traffic shaping queue can also be recorded, the second continuous transmission frame number represents the number of target data frames in the continuously transmitted traffic shaping queue, and it is determined whether the second continuous transmission frame number reaches the second preset continuous transmission threshold. When the second continuous transmission frame number reaches the second preset continuous transmission threshold, if the forwarding queue only has a priority queue and a traffic shaping queue, it can be determined whether there is a data frame in the priority queue. If there is a data frame in the priority queue, the target data can be extracted from the priority queue, and the target data frame can be sent according to the priority forwarding strategy; the steps in this embodiment are executed in a loop; and in the case where the forwarding queue includes other queues other than the priority queue and the traffic shaping queue, when the second continuous transmission frame number reaches the second preset continuous transmission threshold, it can be determined whether there is a data frame in other queues. If there is a data frame in other queues, the target data can be extracted from the other queues, and the target data frame can be sent according to the forwarding strategy corresponding to the other queues; the steps in this embodiment are executed in a loop.
[0095] In addition to the communication between domain controllers in the vehicle system, there are other data that need to be communicated, such as automatic emergency braking, electronic stability control, etc., which require real-time and reliable data transmission; the two will occupy common bandwidth resources. Therefore, if the communication rate between domain controllers is high, it will occupy more bandwidth resources, which will cause delays or rate reduction in the transmission of other communication data.
[0096] In an optional embodiment of the present application, sending a target data frame according to a traffic shaping forwarding strategy may specifically include the following sub-steps: extracting a data category field of the target data frame based on the traffic shaping forwarding strategy; determining a target sending rate using the data category field; and sending the target data frame according to the target sending rate.
[0097] In this embodiment, in the process of sending the target data frame according to the traffic shaping forwarding strategy, the target data frame can be extracted from the traffic shaping queue based on the traffic shaping forwarding strategy, and the data category field of the target data frame can be extracted, wherein the specific method of extracting the target data frame from the traffic shaping queue can be to extract the data frames in the traffic shaping queue in sequence as the target data frame in a first-in-first-out order, or to extract the data frames as the target data frames in other ways, and this embodiment does not make specific limitations on this; the data category field is used to determine the target sending rate, and the target sending rate represents the sending rate of the data frame. For example, the data category field can record different field information, and different field information represents different target sending rates. Then, the target data frame can be sent according to the target sending rate; wherein there is a preset corresponding relationship between the data category field and the target sending rate.
[0098] In this embodiment, the sending rate of each target data frame can be determined through the data category field of the target data frame, thereby avoiding the problem of high-speed sending of target data frames, which will occupy more bandwidth resources and cause delays or rate reduction in the transmission of other communication data, thereby improving the balance of data transmission within the vehicle system.
[0099] In one example, if Figure 5 As shown, the mapping relationship between the data category field and the target sending rate can be as follows Figure 5 As shown, Figure 5 On the left is the data category field of the corresponding data frame. Figure 5 On the right is the corresponding target sending rate. The unit of the target sending rate can be kilobits per second. If the data category field of the received data frame is 230, based on the traffic shaping forwarding strategy, the target data frame can be controlled to be sent at a target rate of 30 kilobits per second.
[0100] The data exchange priority and flow control between automotive domain controllers are the main factors affecting the overall performance, safety, and real-time response capabilities of the vehicle. Generally speaking, the priority of data exchange is set according to the nature of the data frame, the real-time requirements, and the importance to the operation of the vehicle. First, for data frames directly related to safety, such as brake signals, collision warnings, etc., their priority is usually set to the highest. Such data frames need to be transmitted and processed in real time and accurately to ensure that the vehicle can maintain the highest safety under any circumstances. Secondly, data frames related to vehicle driving stability, such as steering control and vehicle speed control, also have a higher priority. These data frames are crucial to maintaining the stable driving of the vehicle, so they need to be exchanged quickly and accurately between domain controllers. In addition, some data frames related to comfort and convenience, such as air conditioning control, audio system, and audio and video data frames, although they have little impact on the safety and stability of the vehicle, are of great significance in improving the passenger experience, and large amounts of data require traffic shaping and speed limit control. Therefore, without affecting safety and driving stability, the exchange priority of such data frames can be appropriately adjusted as needed. It should be noted that the data frame exchange priority between automotive domain controllers is not static, and it may be dynamically adjusted according to factors such as the specific status of the vehicle, the driving environment, and user needs. For example, in an emergency, the priority of safety-related data frame exchanges may be further increased to ensure that the vehicle can respond quickly. For another example, when the vehicle is stopped, the threshold for limiting the bandwidth of its audio and video-related data frames can be increased to enhance the audio and video quality. Therefore, in the specific control process of the vehicle, there will be different communication requirements in different scenarios. For example, the priority of each data frame in different vehicles may be different, or the transmission rate of data frames in different application device environments will have different restrictions. Therefore, if you only rely on pre-configured forwarding strategies to send data frames, there will be problems that cannot meet different communication needs.
[0101] In an optional embodiment of the present application, step S140 may further include the following sub-steps before sending the target data frame in the forwarding queue according to the forwarding policy corresponding to the forwarding queue: obtaining policy update information; and updating the forwarding policy according to the policy update information.
[0102] In this embodiment, before sending the target data frame in the forwarding queue according to the forwarding policy corresponding to the forwarding queue, it can be determined whether the policy update information is received. The policy update information represents the information used to update the forwarding policy. The policy update information can be input by the user according to the communication needs, or obtained through the server. Of course, other acquisition methods can also be used, and this embodiment does not specifically limit this. When the policy update information is obtained, the policy identifier and update information can be extracted from the policy update information, wherein the policy identifier represents the identifier of the forwarding policy that needs to be updated. The policy identifier can include one or more identifiers, and the update information represents the information of the specific forwarding policy, such as the sending rate update information, the priority update information, etc., so that the update information in the policy update information can be used to update the forwarding policy corresponding to the policy identifier.
[0103] In this embodiment, before sending the target data frame in the forwarding queue according to the forwarding policy corresponding to the forwarding queue, it is determined whether the policy update information is obtained, and the forwarding policy is updated according to the policy update information. This allows the forwarding policy to be updated in real time as needed, avoiding the problem of not being able to meet different communication needs when only relying on pre-configured forwarding policies to send data frames, and achieving the effect of flexible update of forwarding policies.
[0104] In order to improve the accuracy of sending the target data frame, in an optional embodiment of the present application, step S140 sends the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue, which may specifically include the following sub-steps:
[0105] Sub-step S1401, extracting a target data frame from a forwarding queue according to a forwarding strategy corresponding to the forwarding queue;
[0106] Sub-step S1402, extracting target address information from the target data frame;
[0107] Sub-step S1403, sending the target data frame to the target domain controller corresponding to the target address information.
[0108] In this embodiment, after the data frame is cached in the forwarding queue pair corresponding to the frame category, the target data frame can be extracted from the forwarding queue according to the forwarding policy corresponding to the forwarding queue, and the address field is determined in the target data frame, and the target address information is extracted from the destination address field, wherein the destination address field can be as follows: Figure 3The destination MAC shown in the figure, the target address information represents the address information of the received target data frame, and the target domain controller corresponding to the target address information is determined. The target domain controller represents the domain controller used to receive the target data frame. The specific determination can be to extract the target domain controller identifier from the target address information, and determine the target domain controller based on the target domain controller identifier, so that the target data frame can be sent to the target domain controller, thereby achieving the purpose of accurately forwarding the target data frame and improving the accuracy of sending the target data frame.
[0109] like Figure 6 As shown, the present application also discloses an embodiment, which provides a data transmission device of a domain controller, including:
[0110] The receiving module 610 is used to receive the data frame sent by the domain controller;
[0111] A determination module 620, configured to determine a frame category of the data frame according to a data category field in the data frame;
[0112] The cache module 630 is used to cache the data frame to the forwarding queue corresponding to the frame category according to the frame category;
[0113] The sending module 640 is used to send the target data frame in the forwarding queue according to the forwarding policy corresponding to the forwarding queue.
[0114] In an optional embodiment of the present application, the determination module 620 may include:
[0115] A first determining unit, used to determine the number of byte bits in the data category field;
[0116] A second determining unit is used to determine the data category to which the byte number belongs;
[0117] The third determining unit is configured to use the data category as the frame category.
[0118] In an optional embodiment of the present application, the second determining unit includes:
[0119] A first extraction subunit is used to extract the field value corresponding to the number of bytes;
[0120] A first determining unit, configured to determine a preset priority category corresponding to the first field value range as a data category if the field value is within a preset first field value range;
[0121] The second determination unit is used to determine the preset traffic shaping category as the data category if the field value is not within the preset first field value range.
[0122] In an optional embodiment of the present application, the cache module 630 may include:
[0123] a fourth determining unit, configured to determine a level parameter corresponding to the field value when the frame category is a priority category;
[0124] a fifth determining unit, configured to determine a target position corresponding to the level parameter in the forwarding queue;
[0125] The first cache unit is used to cache the data frame to a target location.
[0126] In an optional embodiment of the present application, the forwarding queue includes a priority queue and a traffic shaping queue, and the sending module 640 may include:
[0127] A first sending unit is used to, when there are data frames in the priority queue, take the data frames with preset priorities in the priority queue as target data frames and send the target data frames according to the priority forwarding strategy, and the priority forwarding strategy is the forwarding strategy corresponding to the priority queue;
[0128] The second sending unit is used to extract the target data frame from the traffic shaping queue when there is no data frame in the priority queue, and send the target data frame according to the traffic shaping forwarding strategy, where the traffic shaping forwarding strategy is the forwarding strategy corresponding to the traffic shaping column.
[0129] In an optional embodiment of the present application, the sending module 640 may include:
[0130] A recording unit, used for recording the number of continuously sent frames corresponding to the priority queue, where the number of continuously sent frames indicates the number of target data frames in the continuously sent priority queue;
[0131] A first judgment unit is used to judge whether there is a data frame in the traffic shaping queue when the number of continuous transmissions reaches a preset continuous transmission threshold;
[0132] The second extraction unit is configured to extract target data from the traffic shaping queue if there are data frames in the traffic shaping queue, and send the target data frame according to the traffic shaping forwarding strategy.
[0133] In an optional embodiment of the present application, the second extraction unit may include:
[0134] A second extraction subunit is used to extract a data category field of a target data frame based on a traffic shaping forwarding strategy;
[0135] a sixth determining subunit, configured to determine a target sending rate using a data category field;
[0136] The sending subunit is used to send the target data frame according to the target sending rate.
[0137] In an optional embodiment of the present application, the device may further include:
[0138] An acquisition module is used to obtain policy update information;
[0139] The update module is used to update the forwarding strategy according to the strategy update information.
[0140] In an optional embodiment of the present application, the sending module 640 may include:
[0141] A third extraction unit, configured to extract a target data frame from the forwarding queue according to a forwarding policy corresponding to the forwarding queue;
[0142] A fourth extraction unit, used to extract target address information from the target data frame;
[0143] The third sending unit is used to send the target data frame to the target domain controller corresponding to the target address information.
[0144] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0145] like Figure 7 As shown, the embodiment of the present application provides an air conditioner control device, including a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740.
[0146] Memory 730, for storing computer programs;
[0147] In one embodiment of the present application, the processor 710, when used to execute the program stored in the memory 730, implements the control method for data transmission of the domain controller provided by any of the aforementioned method embodiments, by receiving the data frame sent by the domain controller to determine the frame category of the data frame, and according to the frame category, caches the data frame to the forwarding queue corresponding to the frame category, and then sends the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue, thereby achieving the purpose of adopting different forwarding strategies for data frames of different frame categories and being able to reasonably and effectively allocate communication resources, solving the problem of unreasonable communication resource allocation existing in the equal forwarding method adopted in the existing related technology, and improving the rationality of communication resource allocation.
[0148] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the data transmission method of the domain controller provided in any of the aforementioned method embodiments are implemented, by receiving a data frame sent by the domain controller to determine the frame category of the data frame, and caching the data frame to a forwarding queue corresponding to the frame category according to the frame category, and then sending the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue, thereby achieving the purpose of adopting different forwarding strategies for data frames of different frame categories and being able to reasonably and effectively allocate communication resources, solving the problem of unreasonable communication resource allocation existing in the equal forwarding method adopted in the existing related technology, and improving the rationality of communication resource allocation.
[0149] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0150] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0151] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0152] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A data transmission method of a domain controller, It is characterized in that include: Receive data frames sent by the domain controller; Determining a frame category of the data frame according to a data category field in the data frame; According to the frame category, caching the data frame into a forwarding queue corresponding to the frame category; According to the forwarding strategy corresponding to the forwarding queue, the target data frame in the forwarding queue is sent.
2. The data transmission method of the domain controller according to claim 1, It is characterized in that The step of determining the frame category of the data frame according to the data category field in the data frame comprises: Determine the number of bytes in the data category field; Determine the data category to which the byte number belongs; The data type is used as the frame type.
3. The data transmission method of the domain controller according to claim 2, It is characterized in that Determining the data category to which the byte number belongs includes: Extract the field value corresponding to the number of byte bits; If the field value is within a preset first field value range, determining a preset priority category corresponding to the first field value range as the data category; If the field value is not within the preset first field value range, the preset traffic shaping category is determined as the data category.
4. The data transmission method of the domain controller according to claim 3, It is characterized in that The step of caching the data frame into a forwarding queue corresponding to the frame category according to the frame category includes: In a case where the frame category is the priority category, determining a level parameter corresponding to the field value; determining a target position corresponding to the level parameter in the forwarding queue; The data frame is cached at the target location.
5. The data transmission method of the domain controller according to claim 1, It is characterized in that The forwarding queue includes a priority queue and a traffic shaping queue, and sending the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue includes: In the case where the data frame exists in the priority queue, according to a priority forwarding strategy, taking the data frame with a preset priority in the priority queue as the target data frame, and sending the target data frame, the priority forwarding strategy being the forwarding strategy corresponding to the priority queue; When the data frame does not exist in the priority queue, the target data frame is extracted from the traffic shaping queue, and the target data frame is sent according to a traffic shaping forwarding strategy, where the traffic shaping forwarding strategy is a forwarding strategy corresponding to the traffic shaping column.
6. The data transmission method of the domain controller according to claim 5, It is characterized in that The sending of the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue includes: Record the number of continuously sent frames corresponding to the priority queue, where the number of continuously sent frames represents the number of target data frames in the priority queue that are continuously sent; When the number of continuous transmissions reaches a preset continuous transmission threshold, determining whether the data frame exists in the traffic shaping queue; If the data frame exists in the traffic shaping queue, the target data is extracted from the traffic shaping queue, and the target data frame is sent according to the traffic shaping forwarding strategy.
7. The data transmission method of the domain controller according to claim 5 or 6, It is characterized in that The sending of the target data frame according to the traffic shaping forwarding strategy includes: Based on the traffic shaping forwarding strategy, extracting the data category field of the target data frame; Determining a target sending rate using the data category field; The target data frame is sent according to the target sending rate.
8. The data transmission method of a domain controller according to any one of claims 1 to 6, It is characterized in that The claims According to the forwarding strategy corresponding to the forwarding queue, before sending the target data frame in the forwarding queue, the method further includes: Get policy update information; The forwarding strategy is updated according to the strategy update information.
9. The data transmission method of a domain controller according to any one of claims 1 to 6, It is characterized in that The sending of the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue includes: Extracting the target data frame from the forwarding queue according to the forwarding strategy corresponding to the forwarding queue; Extracting target address information from the target data frame; The target data frame is sent to the target domain controller corresponding to the target address information.
10. A data transmission device of a domain controller, It is characterized in that The device comprises: A receiving module, used for receiving data frames sent by a domain controller; A determination module, used to determine the frame category of the data frame; A cache module, used for caching the data frame into a forwarding queue corresponding to the frame category according to the frame category; The sending module is used to send the target data frame in the forwarding queue according to the forwarding strategy corresponding to the forwarding queue.
11. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the data transmission method of the domain controller described in any one of claims 1 to 9 when executing the program stored in the memory.
12. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the data transmission method of the domain controller according to any one of claims 1 to 9 is implemented.
Citation Information
Cited By
Data transmission method and device and storage medium
CN119892302A
Vehicle body and chassis cooperative control system and method, vehicle and medium
CN120704183A
