Load Balancing Method and Device, Data Interaction Method and Device, System, and Vehicle
By using the message bus to coordinate the planning of the periodic interaction data of the interactive device in the vehicle, setting the balanced interaction start time, and generating and sending configuration files, the blockage problem caused by the increase in the data transmission of the vehicle bus is solved, and load balancing and efficient data transmission are achieved.
Patent Information
- Application Number
- CN202211151834.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-09-21
AI Technical Summary
The increase in the amount of data transmission in the bus in the vehicle leads to delay or failure of data transmission, especially in automated driving vehicles, real-time requirements are high. How to reasonably schedule data on the bus to meet the reliability and real-timeness of message transmission is a technical problem that needs to be solved urgently.
The message bus obtains the total number of periodic interaction data between multiple interactive devices in the preset time period, and sets the interaction start time of periodic interaction data based on the time period and the total data amount, generates a configuration file, including communication rules and interaction start time between interactive devices, and sends it to the interactive device for data interaction according to the configuration file.
Load balancing on the message bus is realized, blockage and saturation are reduced, the utilization rate of the message bus is improved, and the communication efficiency and effect of interactive devices are ensured.
Smart Images

Figure CN115589387B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of bus load transmission, and particularly relates to a load balancing method and device, a data interaction method and device, a system, and a vehicle. Background Art
[0002] The bus on a vehicle undertakes the transmission of various instructions and data messages in the vehicle. With the continuous improvement of vehicle performance, such as automated driving vehicles (including passenger cars, engineering vehicles, etc.), there are more and more components that need to communicate on the vehicle, which makes the amount of data transmitted by the bus also increasing. When the amount of data transmitted by the bus is too large at a single moment, congestion or saturation will occur, resulting in delays or failures in data transmission. Especially for automated driving vehicles, in order to ensure driving safety, high real-time requirements are imposed. Therefore, how to reasonably schedule the data on the bus to meet the reliability and real-time requirements of message transmission in the vehicle communication system is a technical problem that urgently needs to be solved at present. Summary of the Invention
[0003] In order to solve the above technical problems, the present application is proposed. Embodiments of the present application provide a load balancing method and device, a data interaction method and device, a system, and a vehicle, which solve the above technical problems.
[0004] According to one aspect of the present application, a load balancing method is provided, which is applied to a message bus. The message bus is communicatively connected to a plurality of interaction devices. The load balancing method includes: obtaining the total number of periodic interaction data between the plurality of interaction devices within a preset time period; setting an interaction start time of the periodic interaction data according to the time period and the total number of the periodic interaction data; generating a configuration file according to a preset rule and the interaction start time of the periodic interaction data, where the preset rule includes a communication rule between the plurality of interaction devices; and sending the configuration file to the plurality of interaction devices for the plurality of interaction devices to perform data interaction according to the configuration file.
[0005] In an embodiment, the setting of the interaction start time of the periodic interaction data according to the time period and the total number of the periodic interaction data includes: evenly distributing the interaction start time of the periodic interaction data within the time period.
[0006] In one embodiment, the preset rules include the interaction channels and interaction periods of the periodic interaction data; wherein, generating a configuration file according to the preset rules and the interaction start time of the periodic interaction data includes: generating a configuration file according to the preset rules and the interaction start time of the periodic interaction data; wherein, the configuration file includes the communication rules between the interaction devices corresponding to the periodic interaction data and the interaction start time of the periodic interaction data.
[0007] In one embodiment, before the multiple interaction devices perform data interaction according to the configuration file, the load balancing method further includes: calibrating the timing starting points of the multiple interaction devices.
[0008] In one embodiment, calibrating the timing starting points of the multiple interaction devices includes: when a preset trigger condition occurs, calibrating the timing starting points of the multiple interaction devices.
[0009] According to another aspect of the present application, a load balancing device is provided, which is communicatively connected to a message bus, and the message bus is communicatively connected to multiple interaction devices; the load balancing device includes: a first acquisition module, configured to acquire the total number of periodic interaction data between the multiple interaction devices within a preset time period; a time setting module, configured to set the interaction start time of the periodic interaction data according to the time period and the total number of the periodic interaction data; a configuration file generation module, configured to generate a configuration file according to preset rules and the interaction start time of the periodic interaction data; wherein, the preset rules include the communication rules between the multiple interaction devices; and a configuration file sending module, configured to send the configuration file to the multiple interaction devices for the multiple interaction devices to perform data interaction according to the configuration file.
[0010] According to another aspect of the present application, a data interaction method is provided, which is applied to a single interaction device. The single interaction device is communicatively connected to other interaction devices through a message bus. The data interaction method includes: obtaining a configuration file; wherein, the configuration file includes communication rules between the single interaction device and the other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices within a preset time period; the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices is set by the message bus according to the total number of periodic interaction data between each interaction device in the single interaction device and the other interaction devices within the time period; parsing the configuration file to obtain the communication rules between the single interaction device and the other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices within the time period; and performing data interaction according to the communication rules between the single interaction device and the other interaction devices and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices.
[0011] According to another aspect of the present application, a data interaction device is provided, which is disposed in a single interaction device. The single interaction device is communicatively connected to other interaction devices through a message bus. The data interaction device includes: a second obtaining module, configured to obtain a configuration file; wherein, the configuration file includes communication rules between the single interaction device and the other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices within a preset time period; the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices is set by the message bus according to the total number of periodic interaction data between each interaction device in the single interaction device and the other interaction devices within the time period; a parsing module, configured to parse the configuration file to obtain the communication rules between the single interaction device and the other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices within the time period; and an execution module, configured to perform data interaction according to the communication rules between the single interaction device and the other interaction devices and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices.
[0012] In an embodiment, the data interaction device further includes: an alarm module, configured to send an alarm signal when data interaction is abnormal.
[0013] According to another aspect of the present application, there is provided a data interaction system, including: a plurality of interaction devices, wherein a data interaction device as described above is provided in a single interaction device; a message bus; and a load balancing device as described above.
[0014] According to another aspect of the present application, there is provided a vehicle, including: a vehicle body; and a data interaction system as described above.
[0015] A load balancing method and device, a data interaction method and device, a system, and a vehicle provided by the present application obtain the total number of periodic interaction data between a plurality of interaction devices within a preset time period through a message bus, and set the interaction start time of the periodic interaction data according to the time period and the total number of the periodic interaction data. Then, according to a preset rule and the interaction start time of the periodic interaction data, a configuration file including communication rules between a plurality of interaction devices is generated and sent to the corresponding interaction device, and the interaction device performs data interaction according to the configuration file; that is, the message bus is used to overall plan the total number of periodic interaction data of all interaction devices within the time period, and the interaction start time of the periodic interaction data is evenly set within the time period to achieve load balancing on the message bus, reduce the blocking and saturation phenomena of the message bus, thereby improving the utilization rate of the message bus and ensuring the communication efficiency and effect of the interaction devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] By describing the embodiments of the present application in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present application will become more obvious. The drawings are used to provide a further understanding of the embodiments of the present application, and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation to the present application. In the drawings, the same reference numerals generally represent the same components or steps.
[0017] Figure 1 is a flowchart of a load balancing method provided by an exemplary embodiment of the present application.
[0018] Figure 2 is a flowchart of a load balancing method provided by another exemplary embodiment of the present application.
[0019] Figure 3 is a flowchart of a data interaction method provided by an exemplary embodiment of the present application.
[0020] Figure 4 is a structural schematic diagram of a load balancing device provided by an exemplary embodiment of the present application.
[0021] Figure 5 is a structural schematic diagram of a load balancing device provided by another exemplary embodiment of the present application.
[0022] Figure 6 It is a schematic structural diagram of a data interaction device provided by an exemplary embodiment of the present application.
[0023] Figure 7 It is a schematic principle structure diagram of a data interaction system provided by an exemplary embodiment of the present application.
[0024] Figure 8 It is a schematic structural diagram of a vehicle provided by an exemplary embodiment of the present application.
[0025] Figure 9 It is a structural diagram of an electronic device provided by an exemplary embodiment of the present application. Detailed implementation manners
[0026] Next, exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. It should be understood that the present application is not limited by the exemplary embodiments described herein.
[0027] Engineering vehicles, as one of the essential equipment for construction, are of great importance. Moreover, with the continuous development of automated driving technology, more and more engineering vehicles are also equipped with automated or semi-automated driving technology. To achieve automated or semi-automated driving, it is necessary to monitor various environmental data and obtain reasonable control strategies based on various environmental data analyses. This requires a lot of data and instruction transmissions. In engineering vehicles, message buses (such as CAN buses) are usually used for data and message transmissions. To ensure the normal operation of the entire engineering vehicle, each interaction device on the engineering vehicle (including all devices communicatively connected through the message bus, such as controllers, sensors, etc.) needs to perform polling or data transmission (send and receive messages) periodically. With the continuous increase in the number of interaction devices on engineering vehicles, the interaction data is also increasing continuously, which leads to an increasing amount of data to be transmitted on the message bus. With the message bus transmission channel unchanged, the data on the message bus will become more and more congested, which is likely to cause the message bus to be blocked or saturated, thus reducing the data transmission efficiency and even resulting in data transmission failures.
[0028] To alleviate the blocking and saturation of the message bus as much as possible, load balancing processing can be performed on the data on the message bus. However, load balancing is usually implemented on a server (such as one of the interaction devices), that is, considering the balance of the throughput of the server, and it cannot perform load balancing processing on the load on the message bus. That is to say, performing load balancing processing on a single interaction device can only ensure the data transmission efficiency of that single interaction device and cannot improve the data transmission efficiency of other interaction devices.
[0029] To solve the problem of message bus congestion in engineering vehicles, the present application provides a load balancing method and device, a data interaction method and device, a system, and a vehicle. The method uses the message bus to obtain the total amount of periodic interaction data of all interacting devices, and considering from an overall perspective, evenly distributes the periodic interaction data within a time period, thereby ensuring the balance of the data transmitted on the message bus, and thus alleviating the congestion problem of the message bus as much as possible to improve the interaction timeliness of each interacting device.
[0030] The following specifically describes the specific implementation manners of the load balancing method and device, the data interaction method and device, the system, and the vehicle of the present application with reference to the accompanying drawings.
[0031] Figure 1 FIG. is a schematic flowchart of a load balancing method provided by an exemplary embodiment of the present application. The load balancing method is applied to a message bus, and the message bus is communicatively connected to multiple interacting devices. As Figure 1 shown, the load balancing method includes the following steps:
[0032] Step 110: Obtain the total number of periodic interaction data between multiple interacting devices within a preset time period.
[0033] On the message bus, count the total number of packets to be sent within a certain time (preset time period) to obtain the total amount of periodic interaction data transmitted through the message bus within this time period (which can be the number of times of sending packets). For example, within 1 second (time period), the packets with a 100 - millisecond polling period will be sent 10 times, and the packets with a 200 - millisecond polling period will be sent 5 times. Then the total number of packets sent within this time period is 10 + 5 = 15 times. It should be understood that the present application can also consider the data length of a single packet. For example, set a length threshold as a division standard, divide the data length of a single packet into one or more length thresholds (less than one length threshold is counted as one length threshold), and the total number of packets sent within this time period can be the sum of the lengths of all packets within this time period (i.e., multiple length thresholds). By refining the data length of a single packet, the data volume of data transmission on the message bus can be further balanced.
[0034] Step 120: Set the interaction start time of the periodic interaction data according to the time period and the total number of the periodic interaction data.
[0035] In one embodiment, the specific implementation of step 120 may be: evenly distribute the interaction start time of the periodic interaction data within the time period. To achieve load balancing of the message bus, on the premise of ensuring the transmission period of each message within this time period, all messages within this time period are evenly distributed within this time period. For example, the 15 messages in the above example are evenly distributed within 1 second, and the transmission start times of the 15 messages are evenly distributed within this 1 second, that is, ensuring that the time intervals between the transmission start times of these 15 messages are consistent.
[0036] Step 130: Generate a configuration file according to a preset rule and the interaction start time of the periodic interaction data.
[0037] The preset rule includes communication rules between multiple interaction devices. By connecting a protocol modeling tool to the message bus, using the protocol modeling tool to customize the protocol according to the data that needs to be transmitted by the current message bus, stipulating the rules of data interaction, and generating a configuration file for the corresponding interaction device according to the established rules. The communication rules and the interaction start time of the periodic interaction data defined in the interaction device are imported into the configuration file. Specifically, the communication rules include interaction channels, interaction periods, interaction conditions, priorities, data lengths, physical meanings of data, transmission modes (including point-to-point mode, network mode, standard frame mode, extended frame mode, etc.). The protocol modeling tool can also uniformly archive the interaction data of all interaction devices, improving data security; and when designing a new system (such as a new system formed by adding new interaction devices), the existing communication rules can also be used as a new master template for design, improving the efficiency of system development. In addition, the present application can also use the protocol modeling tool to obtain the interaction data of each interaction device, thereby diagnosing faults or anomalies of each interaction device and the message bus according to the obtained interaction data, and can also issue an alarm or warning signal when a fault or anomaly occurs, so as to remind the staff to perform maintenance to ensure the interaction effect.
[0038] Step 140: Send the configuration file to multiple interaction devices for the multiple interaction devices to perform data interaction according to the configuration file.
[0039] After the configuration file is generated, it is sent to all interactive devices for the interactive devices to perform data interaction according to the configuration file. Specifically, there can be one or multiple configuration files (corresponding to the interactive devices respectively). In this application, the configuration files are sent to all interactive devices simultaneously, or the configuration files can be sent to relevant interactive devices according to the corresponding relationship. After receiving the configuration file, the interactive device performs data interaction with other interactive devices according to the communication rules in the configuration file. Moreover, each interactive device is an independent entity and can work independently, that is, each interactive device can independently send interactive data according to the communication rules and interactive start time set in the configuration file. And when a single interactive device is connected or disconnected (at this time, the connected or disconnected interactive device has obtained the configuration file), the bus end can also quickly adjust the interactive start time to ensure load balancing.
[0040] A load balancing method provided by this application obtains the total number of periodic interactive data among multiple interactive devices within a preset time period through a message bus, and sets the interactive start time of the periodic interactive data according to the time period and the total number of the periodic interactive data. Then, according to the preset rules and the interactive start time of the periodic interactive data, a configuration file including the communication rules among multiple interactive devices is generated, and the configuration file is sent to the corresponding interactive device, and the interactive device performs data interaction according to the configuration file; that is, the message bus is used to overall plan the total number of periodic interactive data of all interactive devices within the time period, and the interactive start time of the periodic interactive data is evenly set within the time period to achieve load balancing on the message bus, reduce the congestion and saturation phenomena of the message bus, thereby improving the utilization rate of the message bus and ensuring the communication efficiency and effect of the interactive devices.
[0041] Figure 2 It is a schematic flowchart of the load balancing method provided by another exemplary embodiment of this application. As Figure 2 shown, the above load balancing method may further include:
[0042] Step 150: Calibrate the timing starting points of multiple interactive devices.
[0043] Due to the separation among multiple interactive devices, in order to ensure that all interactive devices rotate on the same time slice, time synchronization processing can be performed on all interactive devices, that is, calibrate the timing starting points of multiple interactive devices to ensure that the timing starting points of all interactive devices are consistent. Specifically, the time synchronization of the interactive device can be the calibration of absolute time (i.e., calibrating according to the clock time); it can also be the calibration of trigger conditions, such as the appearance of a physical signal or a specific message (such as the first message) as the timing starting point.
[0044] In one embodiment, the specific implementation of step 150 may be: when a preset trigger condition occurs, calibrate the timing start points of multiple interaction devices.
[0045] To ensure the accuracy of load balancing, it is necessary to ensure that the time cycles of all interaction devices are consistent. However, it is not possible to waste resources for periodic time synchronization. Therefore, this application proposes to perform time synchronization operations only when a preset trigger condition occurs. Specifically, the trigger condition may be an interaction device startup signal (the interaction device has received the configuration file), that is, when a single interaction device is started, time synchronization operations for all started interaction devices are performed to ensure that the timing start points of all currently started interaction devices are consistent.
[0046] Figure 3 It is a schematic flowchart of a data interaction method provided by an exemplary embodiment of this application. This data interaction method is applied to a single interaction device, and the single interaction device is communicatively connected to other interaction devices through a message bus; as Figure 3 shown, this data interaction method includes the following steps:
[0047] Step 310: Obtain a configuration file.
[0048] Among them, the configuration file includes the communication rules between a single interaction device and other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and other interaction devices within a preset time cycle; the interaction start time of the periodic interaction data between the single interaction device and other interaction devices is set by the message bus according to the total number of the periodic interaction data between each interaction device among the single interaction device and other interaction devices within the time cycle. After the configuration file is generated at the message bus end and sent to the interaction device, the single interaction device receives and obtains the relevant configuration file.
[0049] Step 320: Parse the configuration file to obtain the communication rules between a single interaction device and other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and other interaction devices within the time cycle.
[0050] Specifically, by building a parsing software compiled in C language on the interactive device side, the obtained configuration file is traversed and parsed by using the parsing software to obtain the communication rules between the single interactive device and other interactive devices, and the start time of the periodic interaction data between the single interactive device and other interactive devices within a time period, that is, the communication rules and the start time of the interaction between the single interactive device and other interactive devices are known by parsing the configuration file. And by developing the parsing software, it can be applied to each interactive device side. When the interactive device is first connected to the message bus, the parsing software can parse the configuration file once to complete the full parsing of the communication rules of the current interactive device. Without changing the communication rules, the interactive device does not need to parse the configuration file again and only needs to perform data interaction according to the communication rules and the start time of the interaction.
[0051] Step 330: Perform data interaction according to the communication rules between the single interactive device and other interactive devices and the start time of the periodic interaction data between the single interactive device and other interactive devices.
[0052] After the single interactive device parses and obtains the communication rules between it and other interactive devices and the start time of the periodic interaction data between the single interactive device and other interactive devices within a time period, it performs data interaction according to the communication rules between the single interactive device and other interactive devices and the start time of the periodic interaction data between the single interactive device and other interactive devices, so as to perform data interaction in accordance with the overall scheduling scheme to achieve the overall load balancing of the message bus.
[0053] A data interaction method provided by the present application obtains the total number of periodic interaction data between multiple interactive devices within a preset time period through a message bus, sets the start time of the periodic interaction data according to the time period and the total number of the periodic interaction data, then generates a configuration file including the communication rules between multiple interactive devices according to the preset rules and the start time of the periodic interaction data, and sends the configuration file to the corresponding interactive device. After receiving the configuration file, the interactive device parses the configuration file to obtain the communication rules and the start time of the interaction, and performs data interaction according to the corresponding communication rules and the start time of the interaction; that is, the message bus is used to overall plan the total number of periodic interaction data of all interactive devices within a time period, and the start time of the periodic interaction data is evenly set within the time period to achieve load balancing on the message bus, reduce the congestion and saturation phenomena of the message bus, thereby improving the utilization rate of the message bus and ensuring the communication efficiency and effect of the interactive device.
[0054] Figure 4It is a schematic structural diagram of a load balancing device provided by an exemplary embodiment of the present application. The load balancing device is connected to the message bus (the load balancing device can be set in the message bus, for example, solidified on one or more nodes, and the load balancing device can also be set independently), and the message bus is communicatively connected to multiple interaction devices; as Figure 4 shown, the load balancing device 40 includes: a first acquisition module 41, configured to acquire the total number of periodic interaction data between multiple interaction devices within a preset time period; a time setting module 42, configured to set the interaction start time of the periodic interaction data according to the time period and the total number of periodic interaction data; a configuration file generation module 43, configured to generate a configuration file according to a preset rule and the interaction start time of the periodic interaction data; wherein the preset rule includes a communication rule between multiple interaction devices; and a configuration file sending module 44, configured to send the configuration file to multiple interaction devices for the multiple interaction devices to perform data interaction according to the configuration file.
[0055] A load balancing device provided by the present application, through the first acquisition module 41 acquires the total number of periodic interaction data between multiple interaction devices within a preset time period, the time setting module 42 sets the interaction start time of the periodic interaction data according to the time period and the total number of periodic interaction data, and then the configuration file generation module 43 generates a configuration file including the communication rules between multiple interaction devices according to the preset rule and the interaction start time of the periodic interaction data, and the configuration file sending module 44 sends the configuration file to the corresponding interaction devices, and the interaction devices perform data interaction according to the configuration file; that is, the message bus is used to overall plan the total number of periodic interaction data of all interaction devices within the time period, and evenly set the interaction start time of the periodic interaction data within the time period to achieve load balancing on the message bus, reduce the congestion and saturation phenomena of the message bus, thereby improving the utilization rate of the message bus and ensuring the communication efficiency and effect of the interaction devices.
[0056] In one embodiment, the above-mentioned first acquisition module 41 can be further configured to: acquire the total number of periodic interaction data between multiple interaction devices within a preset time period.
[0057] In one embodiment, the above-mentioned time setting module 42 can be further configured to: evenly distribute the interaction start time of the periodic interaction data within the time period.
[0058] Figure 5 It is a schematic structural diagram of a load balancing device provided by another exemplary embodiment of the present application. As Figure 5 shown, the above-mentioned load balancing device 40 may further include: a time synchronization module 45, configured to calibrate the timing start points of multiple interaction devices.
[0059] In one embodiment, the time calibration module 45 may be further configured to: when a preset trigger condition occurs, calibrate the timing start points of multiple interaction devices.
[0060] Figure 6 FIG. 4 is a schematic structural diagram of a data interaction device provided by an exemplary embodiment of the present application. The data interaction device is disposed in a single interaction device, and the single interaction device is communicatively connected to other interaction devices through a message bus; as Figure 6 shown, the data interaction device 60 includes: a second acquisition module 61, configured to acquire a configuration file; wherein the configuration file includes communication rules between the single interaction device and other interaction devices, and an interaction start time of periodic interaction data between the single interaction device and other interaction devices within a preset time period; the interaction start time of the periodic interaction data between the single interaction device and other interaction devices is set by the message bus according to the total number of periodic interaction data between each interaction device among the single interaction device and other interaction devices within the time period; a parsing module 62, configured to parse the configuration file to obtain the communication rules between the single interaction device and other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and other interaction devices within the time period; and an execution module 63, configured to perform data interaction according to the communication rules between the single interaction device and other interaction devices and the interaction start time of the periodic interaction data between the single interaction device and other interaction devices.
[0061] A data interaction device provided by the present application obtains the total number of periodic interaction data between multiple interaction devices within a preset time period through a message bus, and sets the interaction start time of the periodic interaction data according to the time period and the total number of the periodic interaction data. Then, according to the preset rules and the interaction start time of the periodic interaction data, a configuration file including communication rules between multiple interaction devices is generated and sent to the corresponding interaction device. After receiving the configuration file, the second acquisition module 61 parses the configuration file by the parsing module 62 to obtain the communication rules and the interaction start time, and the execution module 63 performs data interaction according to the corresponding communication rules and the interaction start time; that is, the message bus is used to overall plan the total number of periodic interaction data of all interaction devices within the time period, and the interaction start time of the periodic interaction data is evenly set within the time period to achieve load balancing on the message bus, reduce the congestion and saturation phenomena of the message bus, thereby improving the utilization rate of the message bus and ensuring the communication efficiency and effect of the interaction devices.
[0062] In one embodiment, as Figure 6 shown, the above data interaction device may further include: an alarm module 64, configured to send an alarm signal when data interaction is abnormal.
[0063] Since the data interaction device may cause abnormal or failed interactions for various reasons during the interaction process, at this time, the alarm module 64 monitors the abnormal information in the interaction process in real time. When abnormal information is detected, it is determined that the interaction is abnormal, and an alarm signal is sent at this time to inform the abnormal interaction data, so that the interaction can be carried out again or the cause of the abnormality can be checked to improve the interaction success rate.
[0064] Figure 7 It is a schematic diagram of the principle structure of a data interaction system provided by an exemplary embodiment of the present application. As Figure 7 shown, the data interaction system 70 includes: a plurality of interaction devices, a message bus, and the load balancing device 40 as described above. Among them, the data interaction device 60 as described above is provided in a single interaction device. The load balancing device 40 generates a configuration file by using a protocol modeling tool and sends the configuration file to the interaction device side. The data interaction device 60 of the interaction device receives, parses, and performs data interaction on the configuration file.
[0065] A data interaction system provided by the present application obtains the total number of periodic interaction data between multiple interaction devices within a preset time period through the load balancing device 40, and sets the interaction start time of the periodic interaction data according to the time period and the total number of the periodic interaction data. Then, according to the preset rules and the interaction start time of the periodic interaction data, a configuration file including the communication rules between multiple interaction devices is generated and sent to the corresponding interaction device. After receiving the configuration file, the data interaction device 60 parses the configuration file to obtain the communication rules and the interaction start time, and performs data interaction according to the corresponding communication rules and the interaction start time; that is, the message bus is used to overall plan the total number of periodic interaction data of all interaction devices within the time period, and the interaction start time of the periodic interaction data is evenly set within this time period to achieve load balancing on the message bus, reduce the congestion and saturation phenomena of the message bus, thereby improving the utilization rate of the message bus and ensuring the communication efficiency and effect of the interaction devices.
[0066] Figure 8 It is a schematic diagram of the structure of a vehicle provided by an exemplary embodiment of the present application. As Figure 8 shown, the vehicle includes: a vehicle body 1 and the data interaction system 70 as described above.
[0067] A vehicle provided by the present application obtains the total number of periodic interaction data among multiple interaction devices within a preset time period through a load balancing device, sets the interaction start time of the periodic interaction data according to the time period and the total number of the periodic interaction data, then generates a configuration file including communication rules among the multiple interaction devices according to a preset rule and the interaction start time of the periodic interaction data, and sends the configuration file to the corresponding interaction device. After receiving the configuration file, a data interaction device parses the configuration file to obtain the communication rules and the interaction start time, and performs data interaction according to the communication rules and the interaction start time; that is, the message bus is used to overall plan the total number of periodic interaction data of all interaction devices within the time period, and the interaction start time of the periodic interaction data is evenly set within the time period, so as to achieve load balancing on the message bus, reduce the blocking and saturation phenomena of the message bus, thereby improving the utilization rate of the message bus and ensuring the communication efficiency and effect of the interaction devices.
[0068] Next, refer to Figure 9 to describe the electronic device according to an embodiment of the present application. The electronic device may be any one or both of the first device and the second device, or a stand-alone device independent of them, and the stand-alone device may communicate with the first device and the second device to receive the input signals collected from them.
[0069] Figure 9 The block diagram of the electronic device according to an embodiment of the present application is illustrated.
[0070] As Figure 9 shown, the electronic device 10 includes one or more processors 11 and a memory 12.
[0071] The processor 11 may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.
[0072] The memory 12 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage media, and the processor 11 may run the program instructions to implement the load balancing or data interaction methods of the various embodiments of the present application described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage media.
[0073] In one example, the electronic device 10 may further include: an input device 13 and an output device 14, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown).
[0074] When the electronic device is a stand-alone device, the input device 13 may be a communication network connector for receiving the collected input signals from the first device and the second device.
[0075] In addition, the input device 13 may further include, for example, a keyboard, a mouse, and so on.
[0076] The output device 14 may output various information to the outside, including the determined distance information, direction information, etc. The output device 14 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0077] Of course, for simplicity, Figure 9 only some of the components related to the present application in the electronic device 10 are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device 10 may further include any other appropriate components.
[0078] The computer program products may be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present application. The programming languages include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as the "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0079] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0080] The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the present application to the form disclosed herein. Although several example aspects and embodiments have been discussed above, those skilled in the art will recognize some of their variations, modifications, alterations, additions, and sub-combinations.
Claims
1. A load balancing method, which is applied to a message bus, and the message bus is communicatively connected to multiple interaction devices; characterized in that, The load balancing method includes: Obtaining the total quantity of periodic interaction data between the multiple interaction devices within a preset time period; Setting the interaction start time of the periodic interaction data according to the time period and the total quantity of the periodic interaction data; Generating a configuration file according to a preset rule and the interaction start time of the periodic interaction data; wherein the preset rule includes the communication rules between the multiple interaction devices; and Sending the configuration file to the multiple interaction devices so that the multiple interaction devices obtain the configuration file; wherein the configuration file includes the communication rules between a single interaction device and other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices within a preset time period; the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices is set by the message bus according to the total quantity of the periodic interaction data between each interaction device among the single interaction device and the other interaction devices within the time period; Parsing the configuration file to obtain the communication rules between the single interaction device and the other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices within the time period; and Performing data interaction according to the communication rules between the single interaction device and the other interaction devices and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices.
2. The load balancing method according to claim 1, wherein The setting the interaction start time of the periodic interaction data according to the time period and the total quantity of the periodic interaction data includes: Uniformly distributing the interaction start time of the periodic interaction data within the time period.
3. The load balancing method according to claim 1, wherein Before the multiple interaction devices perform data interaction according to the configuration file, the load balancing method further includes: Calibrating the timing starting points of the multiple interaction devices.
4. The load balancing method according to claim 3, wherein The calibrating the timing starting points of the multiple interaction devices includes: When a preset trigger condition occurs, calibrating the timing starting points of the multiple interaction devices.
5. A load balancing device is communicatively connected to a message bus, and the message bus is communicatively connected to multiple interaction devices; characterized in that, The load balancing device includes: A first acquisition module, configured to obtain the total quantity of periodic interaction data between the multiple interaction devices within a preset time period; A time setting module, configured to set the interaction start time of the periodic interaction data according to the time period and the total quantity of the periodic interaction data; A configuration file generation module, configured to generate a configuration file according to a preset rule and the interaction start time of the periodic interaction data; wherein the preset rule includes the communication rules between the multiple interaction devices; and A configuration file sending module, configured to send the configuration file to the multiple interaction devices, so that the multiple interaction devices can obtain the configuration file; wherein, the configuration file includes communication rules between a single interaction device and other interaction devices, and an interaction start time of periodic interaction data between the single interaction device and the other interaction devices within a preset time period; the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices is set by the message bus according to the total number of periodic interaction data between each interaction device in the single interaction device and the other interaction devices within the time period; parsing the configuration file to obtain the communication rules between the single interaction device and the other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices within the time period; and performing data interaction according to the communication rules between the single interaction device and the other interaction devices and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices.
6. A data interaction method, which is applied to a single interaction device, and the single interaction device is communicatively connected to other interaction devices through a message bus; characterized in that, The data interaction method includes: Obtaining a configuration file; wherein, the configuration file includes communication rules between the single interaction device and the other interaction devices, and an interaction start time of periodic interaction data between the single interaction device and the other interaction devices within a preset time period; the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices is set by the message bus according to the total number of periodic interaction data between each interaction device in the single interaction device and the other interaction devices within the time period; Parsing the configuration file to obtain the communication rules between the single interaction device and the other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices within the time period; and Performing data interaction according to the communication rules between the single interaction device and the other interaction devices and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices.
7. A data interaction device is provided in a single interaction device, and the single interaction device is communicatively connected to other interaction devices through a message bus; characterized in that, The data interaction device includes: A second obtaining module, configured to obtain a configuration file; wherein, the configuration file includes communication rules between the single interaction device and the other interaction devices, and an interaction start time of periodic interaction data between the single interaction device and the other interaction devices within a preset time period; the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices is set by the message bus according to the total number of periodic interaction data between each interaction device in the single interaction device and the other interaction devices within the time period; A parsing module, configured to parse the configuration file to obtain the communication rules between the single interaction device and the other interaction devices, and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices within the time period; and An execution module, configured to perform data interaction according to the communication rules between the single interaction device and the other interaction devices and the interaction start time of the periodic interaction data between the single interaction device and the other interaction devices.
8. The data interaction device according to claim 7, wherein The data interaction device further includes: An alarm module, configured to send an alarm signal when data interaction is abnormal.
9. A data interaction system, characterized in that, Comprising: A plurality of interaction devices, wherein a data interaction device as described in claim 7 is provided in a single interaction device; A message bus; And A load balancing device as described in claim 5.
10. A vehicle, characterized in that, Comprising: A vehicle body; And A data interaction system as described in claim 9.
Citation Information
Patent Citations
Bus load balancing processing method and device and storage medium
CN113515366A