Data processing method and device, vehicle-mounted chip, vehicle-mounted equipment and storage medium
By utilizing message queues for data transmission and redundant message management in the data processing module, the problem of excessive system resource consumption in traditional data processing methods is solved, achieving more efficient data processing and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING CHANGAN AUTOMOBILE CO LTD
- Filing Date
- 2026-05-06
- Publication Date
- 2026-07-31
AI Technical Summary
Traditional data processing methods require a lot of system resources, which can lead to data processing lag and delays when there is a large amount of sensor data and system resources are scarce.
The data processing module utilizes a message queue for data transmission through its receiving, encoding, and publishing components. After the sensor data processing is complete, the target message is re-placed into the message queue to carry newly received data. The number of redundant messages in the message queue is dynamically adjusted to achieve message reuse and real-time detection of redundant messages.
It effectively reduces system resource consumption, avoids repeated memory allocation and deallocation, reduces unnecessary system overhead, and improves data processing efficiency and system stability.
Smart Images

Figure CN122496523A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, specifically to a data processing method, apparatus, vehicle-mounted chip, vehicle-mounted equipment, and storage medium. Background Technology
[0002] As vehicles become increasingly intelligent, the types and number of sensors installed on them are also increasing, which poses a significant challenge to sensor data processing capabilities.
[0003] In related technologies, traditional data processing methods require a lot of system resources. When the amount of sensor data is large and system resources are scarce, some data processing may be blocked, resulting in stuttering and delays in the data received by the backend application. Therefore, how to reduce the system resources consumed by data processing has become an urgent technical problem to be solved. Summary of the Invention
[0004] This application provides a data processing method, apparatus, vehicle-mounted chip, vehicle-mounted equipment, and storage medium to solve the problem that traditional data processing methods require a large amount of system resources.
[0005] In a first aspect, this application provides a data processing method, the method comprising: Upon receiving sensor data collected by the target sensor, the sensor data is processed by the data processing module corresponding to the target sensor. The data processing module includes a receiving component, an encoding component, and a publishing component. The receiving component, the encoding component, and the publishing component transmit data through a message queue, and the sensor data is transmitted using messages in the message queue as carriers. Once the sensor data processing is complete, the target message that was originally used to carry the sensor data is put back into the message queue so that the newly received sensor data can be carried by the target message. Redundant messages in the message queue are detected, and the number of messages in the message queue is dynamically adjusted according to the detection results.
[0006] Optionally, the step of detecting redundant messages in the message queue and dynamically adjusting the number of messages in the message queue based on the detection results includes: Obtain the number of redundant messages and the total number of messages in the message queue, wherein the redundant messages refer to messages that do not currently carry sensor data; Calculate the ratio between the number of redundant messages and the total number of messages, and determine whether the ratio is greater than a first preset threshold. If the ratio is greater than the first preset threshold, the redundant messages are deleted sequentially to dynamically adjust the number of messages in the message queue.
[0007] Optionally, the step of sequentially deleting the redundant messages includes: After each deletion operation is completed, the time interval between the last time the data processing module received sensor data and the last time the data was received is obtained. Determine whether the time interval is less than or equal to a second preset threshold; If the time interval is less than or equal to the second preset threshold, the deletion operation on the redundant message continues until a preset condition is met and the deletion operation stops. The preset condition is that the time interval is greater than the second preset threshold, or the ratio is less than or equal to the first preset threshold.
[0008] Optionally, the method further includes: If the time interval is greater than the second preset threshold, the receiving component, the encoding component, and the publishing component are controlled to enter a sleep state until the sensor data collected by the target sensor is received again.
[0009] Optionally, the step of processing the sensor data through the data processing module corresponding to the target sensor includes: The receiving component is used to fill the target message with the received sensor data, and the target message is stored in the message queue; The target message is obtained from the message queue using the encoding component, the sensor data carried in the target message is decoded, the decoded sensor data is refilled into the target message, and the target message is stored in the message queue. The target message is retrieved from the message queue using the publishing component, and the decoded sensor data carried in the target message is published according to a preset format.
[0010] Optionally, before processing the sensor data through the data processing module corresponding to the target sensor, the method further includes: Load the preset configuration file and obtain the configuration data from the configuration file; Based on the configuration data, the data processing module corresponding to the target sensor is determined; The receiving component, the encoding component, and the publishing component in the data processing module corresponding to the target sensor are activated.
[0011] Secondly, this application provides a data processing apparatus, the apparatus comprising: The processing module is used to process the sensor data collected by the target sensor through the data processing module corresponding to the target sensor when the sensor data is received. The data processing module includes a receiving component, an encoding component, and a publishing component. The receiving component, the encoding component, and the publishing component transmit data through a message queue. The sensor data is transmitted using messages in the message queue as carriers. The adjustment module is used to, after the sensor data processing is completed, put the target message originally used to carry the sensor data back into the message queue, so as to use the target message to carry the newly received sensor data, and to detect redundant messages in the message queue, so as to dynamically adjust the number of messages in the message queue according to the detection results.
[0012] Thirdly, this application provides an in-vehicle chip, which includes a data abstraction layer, a data abstraction service module and multiple data processing modules. Each data processing module includes a receiving component, an encoding component and a publishing component. The receiving component, the encoding component and the publishing component transmit data through a message queue, and sensor data is transmitted using messages in the message queue as carriers. The data abstraction service module is used to process the sensor data collected by the target sensor through the data processing module corresponding to the target sensor when it receives the sensor data. After the sensor data processing is completed, the target message that was originally used to carry the sensor data is put back into the message queue so that the newly received sensor data can be carried by the target message. The module also detects redundant messages in the message queue and dynamically adjusts the number of messages in the message queue according to the detection results.
[0013] Fourthly, this application provides an in-vehicle device, which includes the in-vehicle chip described in the third aspect, and the in-vehicle chip is connected to a plurality of sensors.
[0014] Fifthly, this application provides a computer storage medium storing computer-executable instructions for performing the data processing method described in the first aspect.
[0015] The beneficial effects of this application are: (1) When the sensor data processing is completed, the target message originally used to carry the sensor data can be put back into the message queue so as to carry the newly received sensor data. This achieves message reuse and avoids creating a new message every time sensor data is received and destroying the message every time the sensor data is processed, which causes a lot of repeated memory allocation and memory release, and thus leads to a lot of system resource consumption.
[0016] (2) This application performs real-time detection of redundant messages in the message queue and dynamically adjusts the number of messages in the message queue according to the detection results, thereby reducing unnecessary system overhead caused by excessive redundant messages and further reducing the system resources occupied by data processing. Attached Figure Description
[0017] Figure 1 A flowchart illustrating a data processing method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a data processing module provided in an embodiment of this application; Figure 3 This is a schematic diagram illustrating data processing by multiple data processing modules provided in an embodiment of this application; Figure 4 An interactive schematic diagram of a data processing method provided in an embodiment of this application; Figure 5 A flowchart illustrating another data processing method provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an in-vehicle chip provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a vehicle-mounted device provided in an embodiment of this application. Detailed Implementation
[0018] The embodiments of this application will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be understood that the preferred embodiments are only for illustrating this application and are not intended to limit the scope of protection of this application.
[0019] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0020] For ease of description, spatial relative terms may be used in the text to describe the relative position or movement of one element or feature relative to another element or feature, as shown in the figure. These relative terms include, for example, "inside," "outside," "middle," "outer," "below," "below," "above," "front," "back," etc. Such spatial relative terms are intended to include different orientations of the device in use or operation, other than those depicted in the figure. For example, if the device in the figure undergoes a positional flip, orientation change, or change of motion, these directional indications will change accordingly. For instance, an element described as "below other elements or features" or "below other elements or features" will subsequently be oriented "above other elements or features" or "above other elements or features." Therefore, the example term "below" can include both upper and lower orientations. The device may be otherwise oriented (rotated 90 degrees or in other directions), and the spatial relative descriptors used in the text will be interpreted accordingly.
[0021] To address the issue that traditional data processing methods require significant system resources, this application provides a data processing method, apparatus, vehicle-mounted chip, vehicle-mounted equipment, and storage medium that can reduce the system resources required for data processing.
[0022] See Figure 1 , Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 1 As shown, the data processing method may include the following steps: Step S102: Upon receiving sensor data collected by the target sensor, the sensor data is processed by the data processing module corresponding to the target sensor. The data processing module includes a receiving component, an encoding component, and a publishing component. The receiving component, the encoding component, and the publishing component transmit data through a message queue, and the sensor data is transmitted using messages in the message queue as the carrier.
[0023] Specifically, the target sensor mentioned above can be any vehicle-mounted sensor, such as LiDAR, millimeter-wave radar, or a camera. The data processing module mentioned above can include a receiver, a decoder, and a publisher. These components transmit data via a message queue, with sensor data transmitted as messages (msg) within the message queue. Figure 2 As shown, sensor data is processed through a series of steps, including receiving, decoding, and publishing. These steps involve parsing, framing, and mapping the sensor data, and finally, the sensor data in different formats is transmitted to the downstream in-vehicle intelligent driving module through a unified data format.
[0024] It should be noted that because different types of automotive sensors collect sensor data in different formats, they typically require corresponding data processing modules to process the data, ultimately converting it into a preset format before distributing it to downstream automotive intelligent driving modules. In other words, different types of data processing modules are usually needed for different types of automotive sensors. Multiple sensors of the same type can share the same data processing module or use different modules for data processing. When different sensors use different data processing modules, the processing flow is as follows: Figure 3 As shown.
[0025] Step S104: After the sensor data processing is completed, the target message that was originally used to carry the sensor data is put back into the message queue so that the newly received sensor data can be carried by the target message. Redundant messages in the message queue are detected so that the number of messages in the message queue can be dynamically adjusted according to the detection results.
[0026] Specifically, after the data processing module completes the sensor data processing (i.e., the publisher component publishes the format-converted sensor data), the publisher component can re-place the target message originally used to carry the sensor data into the message queue. This allows the receiver component to use the target message to carry newly received sensor data, thus achieving message reuse. Furthermore, redundant messages in the message queue can be detected, and the number of messages in the queue can be dynamically adjusted based on the detection results.
[0027] In this way, once sensor data processing is complete, the target message originally used to carry that sensor data can be put back into the message queue. This allows the target message to carry newly received sensor data, thus achieving message reuse. This avoids creating new messages each time sensor data is received and destroying existing messages after processing, preventing excessive redundant memory allocation and deallocation, which leads to high system resource consumption. Furthermore, by real-time monitoring of redundant messages in the message queue and dynamically adjusting the message count based on the monitoring results, unnecessary system overhead caused by excessive redundant messages can be reduced, further lowering the system resources consumed by data processing.
[0028] In an optional embodiment, step S104 above, detecting redundant messages in the message queue and dynamically adjusting the number of messages in the message queue based on the detection results, includes: Get the number of redundant messages in the message queue and the total number of messages; Calculate the ratio between the number of redundant messages and the total number of messages, and determine whether the ratio is greater than a first preset threshold. If the ratio is greater than the first preset threshold, redundant messages are deleted sequentially to dynamically adjust the number of messages in the message queue.
[0029] Specifically, the number of redundant messages and the total number of messages in the message queue can be obtained. Redundant messages refer to messages that do not currently carry sensor data, i.e., messages in the message queue between the publisher and receiver components. The total number of messages is the sum of redundant messages and messages currently carrying sensor data. The ratio between the number of redundant messages and the total number of messages can then be calculated, and it can be determined whether this ratio is greater than a first preset threshold. If the ratio is greater than the first preset threshold, redundant messages can be deleted sequentially to dynamically adjust the number of messages in the message queue. If the ratio is less than or equal to the first preset threshold, no deletion of redundant messages is necessary. The first preset threshold can be set according to actual needs and is not specifically limited here.
[0030] In this way, when the ratio between the number of redundant messages and the total number of messages exceeds a first preset threshold, redundant messages can be deleted sequentially to dynamically adjust the number of messages in the message queue. This reduces unnecessary system overhead caused by excessive redundant messages and further reduces the system resources occupied by data processing.
[0031] In an optional embodiment, the above steps, including deleting redundant messages sequentially, include: After each deletion operation is completed, the time interval between the data processing module's last reception of sensor data and the last time the data was received is obtained. Determine whether the time interval is less than or equal to the second preset threshold; If the time interval is less than or equal to the second preset threshold, the deletion operation on redundant messages continues until a preset condition is met and the deletion operation stops. The preset condition is that the time interval is greater than the second preset threshold, or the ratio is less than or equal to the first preset threshold.
[0032] Specifically, when deleting redundant messages sequentially, after each deletion operation, the time interval between the data processing module's last received sensor data and the current time interval can be obtained. Then, it can be determined whether this time interval is less than or equal to a second preset threshold. If the time interval is less than or equal to the second preset threshold, the deletion operation can continue until a preset condition is met. This preset condition is that the time interval is greater than the second preset threshold, or the ratio is less than or equal to a first preset threshold. The second preset threshold can be set according to actual needs and is not specifically limited here.
[0033] In this way, during the process of deleting redundant messages, the system can determine whether to continue deleting redundant messages based on the time interval between the data processing module and the last time it received sensor data, as well as the ratio between the number of redundant messages and the total number of messages. This ensures that the number of remaining redundant messages is neither too many nor too few.
[0034] In an optional embodiment, the method further includes: If the time interval exceeds the second preset threshold, the receiving component, encoding component, and publishing component are controlled to enter a sleep state until they receive sensor data collected by the target sensor again.
[0035] Specifically, if the time interval is greater than the second preset threshold, the receiving component, encoding component, and publishing component can be controlled to enter a sleep state until the sensor data collected by the target sensor is received again, and the receiving component, encoding component, and publishing component are woken up and data processed.
[0036] In this way, when the sensor data of the target sensor is interrupted (such as due to network interruption, sensor failure, or other factors), the receiving component, encoding component, and transmitting component can be put into sleep mode, thereby further reducing the energy consumption and resource consumption of the data processing module.
[0037] In an optional embodiment, step S102, processing the sensor data through the data processing module corresponding to the target sensor, includes: The receiving component is used to fill the target message with the received sensor data, and the target message is stored in the message queue; The target message is retrieved from the message queue using the encoding component, the sensor data carried in the target message is decoded, the decoded sensor data is refilled into the target message, and the target message is stored in the message queue. The publishing component retrieves the target message from the message queue and publishes the decoded sensor data carried in the target message according to a preset format.
[0038] Specifically, the aforementioned receiving component, encoding component, and publishing component can be controlled using asynchronous threads, thereby enabling secure communication between asynchronous threads within a process using message queues, ensuring that no problems occur when reading or modifying the same data during communication between asynchronous threads.
[0039] When processing sensor data through the data processing module corresponding to the target sensor, the receiver component can fill the received sensor data into the target message and store the target message in a message queue. The message queue then passes the target message to the decoder component. The decoder retrieves the target message from the message queue and decodes the sensor data carried in the target message (decoding can be divided into parsing / framing / mapping operations depending on the sensor type). The decoded sensor data is then refilled into the target message, which is then stored in the message queue. The message queue passes it to the publisher component. The publisher then retrieves the target message from the message queue and publishes the decoded sensor data carried in the target message according to a preset format. After publication, the publisher puts the target message back into the message queue, waiting for the receiver component to receive new sensor data. This achieves message reuse, avoiding the creation of a new message and thus preventing a large number of repetitive memory allocation and release operations, reducing system resource consumption.
[0040] In this way, the receiver component, decoder component, and publisher component can be used to complete the operations of receiving, encoding, and publishing sensor data, respectively, so as to process and abstract the sensor data and facilitate its use by downstream vehicle intelligent driving modules.
[0041] In an optional embodiment, before step S102 above, where the sensor data is processed by the data processing module corresponding to the target sensor, the method further includes: Load the preset configuration file and retrieve the configuration data from the configuration file; Based on the configuration data, determine the data processing module corresponding to the target sensor; Start the receiving component, encoding component, and publishing component in the data processing module corresponding to the target sensor.
[0042] Specifically, before processing the sensor data through the data processing module corresponding to the target sensor, a preset configuration file can be loaded, and configuration data can be obtained from the configuration file. Then, based on the configuration data, the data processing module corresponding to the target sensor is determined, and the receiving component, encoding component, and publishing component in the data processing module corresponding to the target sensor are started. This facilitates subsequent processing of the sensor data using the data processing module corresponding to the target sensor.
[0043] In an optional embodiment, the data processing flow provided in this application can be as follows: Figure 4 As shown, the specific process is as follows: The data abstraction service module (das) first loads the publisher, decoder, and receiver components from the data processing module. Then, it starts these components. The receiver components in the data processing module can then receive sensor data, fill the received sensor data into the corresponding message, and store the message in the message queue (i.e., perform a push msg operation). The decoder component can then retrieve the message from the message queue (i.e., perform a get msg operation), decode the sensor data carried in the message, refill the message with the decoded sensor data, and store the message in the message queue (i.e., perform a push msg operation). The publisher component can then retrieve the message from the message queue (i.e., perform a get msg operation) and publish the decoded sensor data carried in the message according to a preset format. After the current sensor data has been published, the message is stored in the message queue (i.e., a push msg operation is performed), and the same process is repeated for the next sensor data. This cycle continues until all sensor data has been processed, at which point the data abstraction service module can stop the receiver component, the decoder component, and the publisher component.
[0044] Furthermore, vehicles may encounter complex road conditions during driving, but these conditions are usually short-lived. Sensors will increase the frequency of data transmission under these conditions. When the frequency of sensor data received by the data processing module is too high, leading to insufficient messages in the message queue, the data abstraction service module (DAS) will create new messages. Once the road conditions return to normal, the data transmission frequency will return to normal, resulting in a large number of redundant messages. The DAS will periodically check the number of redundant messages in the message queue. If a large number of redundant messages exist, they will be destroyed to reduce redundant memory consumption. The destruction of redundant messages can also determine if sensor data has been unreceived for an extended period. If no data has been received from the corresponding sensor for a period, the receiver, decoder, and publisher of that data processing module will enter sleep mode to reduce system CPU consumption. The specific process is as follows: Figure 5 As shown: Step S501: Create a message queue.
[0045] Step S502: Preset the number of messages in the message queue.
[0046] Step S503: Periodically detect the ratio of redundant messages to all messages in the message queue.
[0047] Step S504: Determine whether the ratio is greater than the first preset threshold.
[0048] Step S505: Delete redundant messages.
[0049] Step S506: Determine whether the time interval between the last time the data processing module received data and the last time it received data is greater than the second preset threshold.
[0050] Step S507: The data processing module enters a sleep state.
[0051] Therefore, the data processing method provided in this application has the following beneficial effects: 1. Effectively reduce system resource overhead: By dynamically adjusting the queue size and message quantity, cache overhead can be saved, and message reuse can avoid a large number of repeated memory allocations and releases, which can reduce the overhead of the central processing unit (CPU). At the same time, the message queue-based framework can put the receiver, decoder, and publisher into sleep mode when no sensor data is received, which can further effectively reduce unnecessary CPU overhead.
[0052] 2. Enhanced scalability: By maintaining an internal message queue, unified data flow operations are achieved, allowing developers to focus solely on the data processing module. This reduces the workload of developing the data processing module, thereby shortening the development cycle and improving efficiency. Simultaneously, it ensures a consistent data format for downstream intelligent driving modules, eliminating the need for significant adjustments to the intelligent driving module when dealing with different vehicle models. Only the data processing module requires modification, greatly reducing the workload of updating and iterating the intelligent driving modules across different vehicle models.
[0053] See Figure 6 , Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. Figure 6 As shown, the data processing device 600 includes: The processing module 602 is used to process the sensor data collected by the target sensor through the data processing module corresponding to the target sensor when the sensor data is received. The data processing module includes a receiving component, an encoding component, and a publishing component. The receiving component, the encoding component, and the publishing component transmit data through a message queue. The sensor data is transmitted using messages in the message queue as the carrier. The adjustment module 604 is used to put the target message that was originally used to carry the sensor data back into the message queue after the sensor data processing is completed, so as to use the target message to carry the newly received sensor data, and to detect redundant messages in the message queue so as to dynamically adjust the number of messages in the message queue according to the detection results.
[0054] Furthermore, adjustment module 604 includes: The `get` submodule is used to retrieve the number of redundant messages and the total number of messages in the message queue. The judgment submodule is used to calculate the ratio between the number of redundant messages and the total number of messages, and to determine whether the ratio is greater than a first preset threshold. The deletion submodule is used to delete redundant messages sequentially when the ratio is greater than a first preset threshold, so as to dynamically adjust the number of messages in the message queue.
[0055] Furthermore, deleting submodules includes: The acquisition unit is used to acquire the time interval between the last time the data processing module received sensor data and the completion of each deletion operation. The judgment unit is used to determine whether the time interval is less than or equal to a second preset threshold. The execution unit is used to continue performing deletion operations on redundant messages when the time interval is less than or equal to a second preset threshold, until the deletion operation stops when a preset condition is met. The preset condition is that the time interval is greater than the second preset threshold, or the ratio is less than or equal to a first preset threshold.
[0056] Furthermore, deleting submodules also includes: The control unit is used to control the receiving component, encoding component and publishing component to enter a sleep state when the time interval is greater than a second preset threshold, until the sensor data collected by the target sensor is received again.
[0057] Furthermore, the processing module 602 includes: The filling submodule is used to fill the target message with the received sensor data using the receiving component and store the target message in the message queue; The decoding submodule is used to retrieve the target message from the message queue using the encoding component, decode the sensor data carried in the target message, refill the target message with the decoded sensor data, and store the target message in the message queue. The publishing submodule is used to retrieve target messages from the message queue using the publishing component, and publish the decoded sensor data carried in the target messages according to a preset format.
[0058] Furthermore, the data processing device 600 also includes: The loading module is used to load preset configuration files and obtain configuration data from the configuration files; The determination module is used to determine the data processing module corresponding to the target sensor based on the configuration data. The startup module is used to start the receiving component, encoding component, and publishing component in the data processing module corresponding to the target sensor.
[0059] It should be noted that the data processing device 600 can implement the data processing method provided in any of the aforementioned method embodiments and achieve the same technical effect, which will not be elaborated here.
[0060] See Figure 7 , Figure 7 This is a schematic diagram of the structure of an automotive chip provided in an embodiment of this application. Figure 7 As shown, the vehicle chip 700 includes a data abstraction layer 710, which includes a data abstraction service module 702 and multiple data processing modules 704. Each data processing module 704 includes a receiving component, an encoding component, and a publishing component. The receiving component, the encoding component, and the publishing component transmit data through a message queue, and the sensor data is transmitted using messages in the message queue as the carrier. The data abstraction service module 702 is used to process the sensor data collected by the target sensor through the data processing module corresponding to the target sensor when it receives the sensor data collected by the target sensor. After the sensor data processing is completed, the target message that was originally used to carry the sensor data is put back into the message queue so that the newly received sensor data can be carried by the target message. The module also detects redundant messages in the message queue and dynamically adjusts the number of messages in the message queue according to the detection results.
[0061] In addition, the vehicle chip 700 may also include an on-board intelligent driving module 720, which is used to realize intelligent driving, route planning, vehicle control and other related functions based on sensor data.
[0062] It should be noted that the data abstraction service module 702 can implement the data processing methods provided in any of the aforementioned method embodiments and achieve the same technical effect, which will not be elaborated here.
[0063] See Figure 8 , Figure 8 This is a schematic diagram of the structure of a vehicle-mounted device provided in an embodiment of this application. Figure 8 As shown, the vehicle-mounted device 800 includes a vehicle-mounted chip 802, which is connected to multiple sensors 804.
[0064] It should be noted that the vehicle chip 802 can be the vehicle chip provided in the aforementioned embodiments, which can implement the data processing method provided in any of the aforementioned method embodiments and achieve the same technical effect, which will not be elaborated here.
[0065] In addition, embodiments of this application also provide a vehicle, which may include on-board equipment.
[0066] It should be noted that the vehicle-mounted device can be the vehicle-mounted device provided in the foregoing embodiments, which can implement the data processing method provided in any of the foregoing method embodiments and achieve the same technical effect, and will not be described in detail here.
[0067] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the data processing method provided in any of the foregoing method embodiments.
[0068] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0069] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0070] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0071] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily 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 this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A data processing method, characterized by, The method includes: Upon receiving sensor data collected by the target sensor, the sensor data is processed by the data processing module corresponding to the target sensor. The data processing module includes a receiving component, an encoding component, and a publishing component. The receiving component, the encoding component, and the publishing component transmit data through a message queue, and the sensor data is transmitted using messages in the message queue as carriers. Once the sensor data processing is complete, the target message that was originally used to carry the sensor data is put back into the message queue so that the newly received sensor data can be carried by the target message. Redundant messages in the message queue are detected, and the number of messages in the message queue is dynamically adjusted according to the detection results.
2. The method of claim 1, wherein, The step of detecting redundant messages in the message queue and dynamically adjusting the number of messages in the message queue based on the detection results includes: Obtain the number of redundant messages and the total number of messages in the message queue; Calculate the ratio between the number of redundant messages and the total number of messages, and determine whether the ratio is greater than a first preset threshold. If the ratio is greater than the first preset threshold, the redundant messages are deleted sequentially to dynamically adjust the number of messages in the message queue.
3. The method of claim 2, wherein, The step of deleting the redundant messages sequentially includes: After each deletion operation is completed, the time interval between the last time the data processing module received sensor data and the last time the data was received is obtained. Determine whether the time interval is less than or equal to a second preset threshold; If the time interval is less than or equal to the second preset threshold, the deletion operation on the redundant message continues until a preset condition is met and the deletion operation stops. The preset condition is that the time interval is greater than the second preset threshold, or the ratio is less than or equal to the first preset threshold.
4. The method of claim 3, wherein, The method further includes: If the time interval is greater than the second preset threshold, the receiving component, the encoding component, and the publishing component are controlled to enter a sleep state until the sensor data collected by the target sensor is received again.
5. The method of claim 1, wherein, The step of processing the sensor data through the data processing module corresponding to the target sensor includes: The receiving component is used to fill the target message with the received sensor data, and the target message is stored in the message queue; The target message is obtained from the message queue using the encoding component, the sensor data carried in the target message is decoded, the decoded sensor data is refilled into the target message, and the target message is stored in the message queue. The target message is retrieved from the message queue using the publishing component, and the decoded sensor data carried in the target message is published according to a preset format.
6. The method of claim 5, wherein, Before processing the sensor data through the data processing module corresponding to the target sensor, the method further includes: Load the preset configuration file and obtain the configuration data from the configuration file; Based on the configuration data, the data processing module corresponding to the target sensor is determined; The receiving component, the encoding component, and the publishing component in the data processing module corresponding to the target sensor are activated.
7. A data processing apparatus, characterized by, The device includes: The processing module is used to process the sensor data collected by the target sensor through the data processing module corresponding to the target sensor when the sensor data is received. The data processing module includes a receiving component, an encoding component, and a publishing component. The receiving component, the encoding component, and the publishing component transmit data through a message queue. The sensor data is transmitted using messages in the message queue as carriers. The adjustment module is used to, after the sensor data processing is completed, put the target message originally used to carry the sensor data back into the message queue, so as to use the target message to carry the newly received sensor data, and to detect redundant messages in the message queue, so as to dynamically adjust the number of messages in the message queue according to the detection results.
8. An in-vehicle chip, characterized by, The vehicle-mounted chip includes a data abstraction layer, which includes a data abstraction service module and multiple data processing modules. Each data processing module includes a receiving component, an encoding component, and a publishing component. The receiving component, the encoding component, and the publishing component transmit data through a message queue, and sensor data is transmitted using messages in the message queue as carriers. The data abstraction service module is used to process the sensor data collected by the target sensor through the data processing module corresponding to the target sensor when it receives the sensor data. After the sensor data processing is completed, the target message that was originally used to carry the sensor data is put back into the message queue so that the newly received sensor data can be carried by the target message. The module also detects redundant messages in the message queue and dynamically adjusts the number of messages in the message queue according to the detection results.
9. An in-vehicle device characterized by comprising: The vehicle-mounted device includes the vehicle-mounted chip of claim 8, and the vehicle-mounted chip is connected to multiple sensors.
10. A computer storage medium, characterized in that, The device stores computer-executable instructions for performing the data processing method according to any one of claims 1-6.