Vehicle-side data processing method, device, electronic device and readable storage medium

By adding a caching function to the car-side controller, caching and packet processing trigger data, and dynamically adjusting the queue length of the write interface, the data loss problem caused by the write interface in the car-side controller being called multiple times is solved, improving the Improve the efficiency and reliability of data storage.

CN117931088BActive Publication Date: 2024-09-27CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410155119.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-02
Publication Date
2024-09-27
Estimated Expiration
2044-02-02

AI Technical Summary

Technical Problem

Due to the existence of multiple task schedules in the vehicle-side controller, trigger data may be lost when the write interface is called multiple times, and there is no guarantee that all trigger data will be stored in the storage unit.

Method used

By adding a cache function, the function module periodically detects whether a trigger event occurs, and caches and packages the trigger data. When the data package meets the calling conditions, the queue length of the write interface is adjusted, and multiple trigger data are stored at once. to the storage unit.

Benefits of technology

It effectively avoids triggered data loss caused by write interface congestion, improves data storage efficiency, and dynamically adjusts the queue length of the write interface to ensure the storage of all data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117931088B
    Figure CN117931088B
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and provides a vehicle-side data processing method, device, electronic device and readable storage medium. The method includes: periodically detecting whether a trigger event occurs in each functional module; when a trigger event is detected in any functional module, caching and grouping the trigger data of the trigger event in the functional module to obtain a data packet corresponding to the functional module; when the data packet corresponding to any functional module meets the calling condition, the data length of the trigger data in the data packet corresponding to each functional module that meets the calling condition is obtained, and the queue length of the write interface is adjusted to the sum of the data lengths of the trigger data in the data packets corresponding to all functional modules that meet the calling condition, and the trigger data in the data packets corresponding to all functional modules that meet the calling condition are stored in the storage unit through the write interface. The present application effectively avoids the situation where the write interface is blocked and the trigger data is lost when the write interface is called multiple times.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a vehicle-side data processing method, device, electronic device and readable storage medium. Background Art

[0002] With the progress of automobile electrification, automobile functions are becoming more and more intelligent and complex, which brings more and more electrical problems.

[0003] For example, in the prior art, multiple task schedules are set in the vehicle-side controller, and each task schedule runs periodically. When a trigger event is detected in the functional module, the write interface is called to store the trigger data when the trigger event occurs in the functional module into the storage unit of the vehicle-side controller through the write interface.

[0004] However, since multiple task schedules are set up in the vehicle-side controller, and there are multiple operating states in each task schedule, when the write interface is called multiple times, the trigger data may not be written in, that is, the trigger data may be lost, and it cannot be guaranteed that all trigger data are stored in the storage unit. Summary of the invention

[0005] In view of this, an embodiment of the present application provides a vehicle-side data processing method, device, electronic device and readable storage medium to solve the problem of possible triggering data loss in the vehicle-side controller in the prior art.

[0006] In a first aspect of an embodiment of the present application, a vehicle-side data processing method is provided, which is applied to a vehicle-side controller, and the method includes:

[0007] Periodically check whether each functional module has a trigger event;

[0008] When a trigger event is detected in any functional module, the trigger data of the trigger event in the functional module is cached and packaged to obtain a data packet corresponding to the functional module;

[0009] When the data packet corresponding to any functional module meets the calling conditions, the data length of the trigger data in the data packets corresponding to each functional module that meets the calling conditions is obtained, and the queue length of the write interface is adjusted to the sum of the data lengths of the trigger data in the data packets corresponding to all functional modules that meet the calling conditions, and the trigger data in the data packets corresponding to all functional modules that meet the calling conditions are stored in the storage unit through the write interface.

[0010] According to a second aspect of an embodiment of the present application, a vehicle-side data processing device is provided, which is applied to a vehicle-side controller. The device includes:

[0011] The detection module is configured to periodically detect whether a trigger event occurs in each functional module;

[0012] The cache module is configured to cache and package the trigger data of the trigger event of any functional module when a trigger event is detected, so as to obtain a data packet corresponding to the functional module;

[0013] The write module is configured to obtain the data length of the trigger data in the data packets corresponding to each functional module that meets the call condition when the data packet corresponding to any functional module meets the call condition, and adjust the queue length of the write interface to the sum of the data lengths of the trigger data in the data packets corresponding to all functional modules that meet the call condition, and store the trigger data in the data packets corresponding to all functional modules that meet the call condition to the storage unit through the write interface.

[0014] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0015] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0016] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0017] By adding a cache function, the trigger data of the trigger events occurring in each functional module are cached and packaged. When the data packet corresponding to any functional module meets the calling conditions, the data length of the trigger data in the data packets corresponding to each functional module that meets the calling conditions is obtained. The queue length of the write interface is adjusted according to the data length of the trigger data in the data packets corresponding to each functional module that meets the calling conditions. One or more trigger data can be written at one time through the write interface, so that one or more trigger data can be stored in the storage unit at one time, which not only improves the efficiency of storing data, but also effectively avoids the loss of trigger data caused by blockage of the write interface when the write interface is called multiple times. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1It is a flowchart of a vehicle-side data processing method provided in an embodiment of the present application;

[0020] Figure 2 It is a schematic diagram of the internal architecture of a vehicle-side controller provided in an embodiment of the present application;

[0021] Figure 3 This is a structural diagram of a vehicle-side data processing device provided in an embodiment of the present application.

[0022] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0024] A vehicle-side data processing method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0025] Figure 1 It is a flow chart of a vehicle-side data processing method provided in an embodiment of the present application. Figure 1 The vehicle-side data processing method can be Figure 2 The vehicle-side controller in the vehicle is executed. The vehicle-side controller can be any electronic control unit on the vehicle. Figure 1 As shown, the vehicle-side data processing method includes:

[0026] S101, periodically detecting whether a trigger event occurs in each functional module;

[0027] S102, when a trigger event is detected in any functional module, the trigger data of the trigger event in the functional module is cached and packaged to obtain a data packet corresponding to the functional module;

[0028] S103, when the data packet corresponding to any functional module meets the calling condition, the data length of the trigger data in the data packet corresponding to each functional module that meets the calling condition is obtained, and the queue length of the write interface is adjusted to the sum of the data lengths of the trigger data in the data packets corresponding to all functional modules that meet the calling condition, and the trigger data in the data packets corresponding to all functional modules that meet the calling condition are stored in the storage unit through the write interface.

[0029] According to the technical solution provided in the embodiment of the present application, by adding a caching function, the trigger data of the trigger events occurring in each functional module are cached and packaged. When the data packet corresponding to any functional module meets the calling conditions, the data length of the trigger data in the data packets corresponding to each functional module that meets the calling conditions is obtained, and the queue length of the write interface is adjusted according to the data length of the trigger data in the data packets corresponding to each functional module that meets the calling conditions. One or more trigger data can be written at one time through the write interface, so that one or more trigger data can be stored in the storage unit at one time, which not only improves the efficiency of storing data, but also effectively avoids the loss of trigger data caused by blockage of the write interface when the write interface is called multiple times.

[0030] Optionally, periodically detecting whether a trigger event occurs in each functional module includes: periodically detecting whether the trigger data of each functional module changes; when it is detected that the trigger data of the functional module changes, it is determined that a trigger event occurs in the functional module; when it is detected that the trigger data of the functional module does not change, it is determined that no trigger event occurs in the functional module.

[0031] Optionally, when it is detected that the trigger data of the functional module changes, it is determined that a trigger event occurs in the functional module, including: when it is detected that the trigger data of the functional module in the current detection cycle is different from the trigger data in the previous detection cycle, it is determined that a trigger event occurs in the functional module.

[0032] Optionally, when it is detected that the trigger data of the functional module has not changed, it is determined that no trigger event has occurred in the functional module, including: when it is detected that the trigger data of the functional module in the current detection cycle is the same as the trigger data in the previous detection cycle, it is determined that no trigger event has occurred in the functional module.

[0033] In some embodiments, when a trigger event is detected in any functional module, the trigger data of the trigger event in the functional module is cached and packaged to obtain a data packet corresponding to the functional module, including:

[0034] For each functional module, do the following:

[0035] When the first trigger event of the functional module is detected, the number of detection cycles is counted to obtain a first count value of the corresponding functional module, wherein the first count value of the first trigger event of the corresponding functional module is 1;

[0036] The trigger data of the trigger event of the functional module and the first count value corresponding to the trigger data of each trigger event are cached and packaged to obtain a data packet corresponding to the functional module.

[0037] In some embodiments, before caching and packetizing the trigger data of the trigger event of the functional module and the first count value corresponding to each trigger event to obtain the data packet corresponding to the functional module, the method further includes:

[0038] When the first trigger event of the functional module is detected, the number of trigger events of the functional module is counted to obtain a second count value of the corresponding functional module, wherein the second count value of the first trigger event of the corresponding functional module is 1;

[0039] And, when a data packet corresponding to any functional module meets the calling condition, the data length of the trigger data in the data packet corresponding to the functional module meeting the calling condition is obtained, including:

[0040] When the first count value corresponding to the functional module reaches the first preset value or the second count value reaches the second preset value, the data length of the trigger data in the data packet corresponding to the functional module is acquired.

[0041] In some embodiments, when the first count value corresponding to the functional module reaches the first preset value or the second count value reaches the second preset value, obtaining the data length of the trigger data in the data packet corresponding to the functional module includes:

[0042] When the first count value corresponding to the functional module reaches the first preset value or the second count value reaches the second preset value, the data length of the trigger data in the data packet corresponding to the functional module is obtained, and the current time is obtained;

[0043] The time of the trigger data in the data packet corresponding to the functional module is obtained by using the current time and the detection cycle.

[0044] In some embodiments, adjusting the queue length of the write interface to the sum of the data lengths of the trigger data in the data packets corresponding to all the functional modules that meet the call conditions, and storing the trigger data in the data packets corresponding to all the functional modules that meet the call conditions to the storage unit through the write interface includes:

[0045] The queue length of the write interface is adjusted to the sum of the data length of the trigger data in the data packets corresponding to all functional modules that meet the calling conditions and the data length of the moment of the trigger data in the data packets, and the trigger data in the data packets corresponding to all functional modules that meet the calling conditions and the moment of the trigger data are stored in the storage unit through the write interface.

[0046] In some embodiments, after storing the trigger data and the time of the trigger data in the data packets corresponding to all the functional modules that meet the calling conditions into the storage unit through the write interface, it also includes: clearing the first count value and the second count value.

[0047] In some embodiments, using the current time and the detection cycle to obtain the time of the trigger data in the data packet corresponding to the functional module includes:

[0048] The time of triggering data in the data packet corresponding to the functional module is obtained by calculating according to the first formula using the current time and the detection cycle; the first formula includes:

[0049] T_n=Tc-(P-CNT_n)×△T;

[0050] Among them, T_n represents the moment of trigger data of the nth trigger event in the data packet, Tc represents the current moment; P represents the first count value corresponding to the current moment; CNT_n represents the first count value corresponding to the trigger data of the nth trigger event in the data packet; △T represents the time length of the detection cycle; n is a positive integer.

[0051] For details, see Figure 2 , the steps of the vehicle-side data processing method provided in the embodiment of the present application can be executed by the vehicle-side controller. The vehicle-side data processing method provided in the embodiment of the present application is described in detail below. The vehicle-side controller includes an MCU (microcontroller, Micro Controller Unit) and an MPU (microprocessor, Micro Processor Unit). Each MCU is provided with multiple task scheduling Tasks, such as Task1, Task2, etc. Each task scheduling runs according to preset rules, for example, Task1 is set to run once every 10ms (milliseconds), Task2 is set to run once every 20ms (milliseconds), etc. There are multiple running states in each task scheduling, and there are multiple functional modules that trigger events at the same time during the execution of a single task scheduling program. Multiple detection modules can be set according to the number of task scheduling, or only one detection module can be set to detect the trigger data of the functional modules of multiple task scheduling when the program is running. For example, the detection module can be set in the task scheduling with the fastest program running among all task scheduling, which can increase the detection rate and avoid missed detection. Figure 2 The write module in can also be set in the MPU.

[0052] like Figure 2 As shown, the data processing method for each functional module in this application is the same.

[0053] Exemplarily, a detection module is set in Task1, and Task1 runs once every 10ms (milliseconds), then each functional module and detection module in Task1 runs once every 10 milliseconds. That is, the detection module detects once every 10 milliseconds, and the time length of the detection cycle is 10 milliseconds. The detection module detects the functional modules of the task scheduling Task1, Task2... When a trigger event occurs in one or more functional modules, the trigger data of the trigger event in the functional module is cached and packaged, respectively, to obtain a data packet corresponding to each functional module. When the data packets of one or more functional modules meet the calling conditions, the write interface is called, and the queue length of the write interface is adjusted according to the data length of the trigger data in the data packets corresponding to the one or more functional modules that meet the calling conditions, and the trigger data is stored in the MPU through the write interface.

[0054] For example, the first preset value is 100, and the second preset value is 3.

[0055] like Figure 2 In the cache module, the trigger data 1 and CNT_1 of the first trigger event corresponding to the functional module 1, the trigger data 2 and CNT_2 of the second trigger event, the trigger data 3 and CNT_3 of the third trigger event, the trigger data 1 and CNT_1 of the first trigger event corresponding to the functional module 2, the trigger data 2 and CNT_2 of the second trigger event, the trigger data 3 and CNT_3 of the third trigger event, and the trigger data 1 and CNT_1 of the first trigger event corresponding to the functional module 3.

[0056] Among them, CNT_1 corresponding to the functional module 1 is the first count value of the trigger data 1 of the first trigger event, and CNT_1=1, indicating that the first count value of the functional module 1 when the first trigger event occurs is 1; CNT_2 is the first count value of the trigger data 2 of the second trigger event of the functional module 1;

[0057] CNT_3 is the first count value of trigger data 3 of the third trigger event of function module 1.

[0058] CNT_1 corresponding to the functional module 2 is the first count value of the trigger data 1 of the first trigger event, and CNT_1=1, indicating that the first count value of the functional module 2 when the first trigger event occurs is 1;

[0059] CNT_2 is the first count value of trigger data 2 of the second trigger event of function module 2;

[0060] CNT_3 is the first count value of trigger data 3 of the third trigger event of function module 2.

[0061] CNT_1 corresponding to the functional module 3 is the first count value of the trigger data 1 of the first trigger event, and CNT_1=1, indicating that the first count value of the functional module 3 when the first trigger event occurs is 1.

[0062] When the second count value reaches the second preset value 3, the write interface and time function are called, and the current time is obtained, that is, when three trigger events occur in function module 1, when the data packet corresponding to function module 1 in the cache module is full of three trigger data, the call condition is met, and the write interface and time function are called, and the current time is obtained; when the data packet corresponding to function module 2 in the cache module is full of three trigger data, the write interface and time function are called, and the current time is obtained. Function module 1 and function module 2 may or may not have trigger events at the same time. If the three trigger data in the data packet corresponding to function module 1 and the three trigger data in the data packet corresponding to function module 2 may or may not meet the call condition at the same time, when the data packets corresponding to function module 1 and function module 2 meet the call condition at the same time, the write interface is called at the same time, and the current time is obtained. According to the data length of the six trigger data in the data packets corresponding to function module 1 and function module 2, the queue length of the write interface is adjusted, and the queue length of the write interface is adjusted to the data length of the six trigger data, and the trigger data is stored in the MPU through the write interface.

[0063] Alternatively, when the first count value reaches the first preset value of 100, the write interface is called and the current time is obtained, that is, when the function module has one trigger event or two trigger events, but has not reached three trigger events, the cache module has stored one trigger data or two trigger data in the data packet of the corresponding function module. At this time, the first count value has reached the first preset value of 100, that is, it has been detected 100 times since the first trigger event occurred in the function module, so the write interface is called and the current time is obtained. For example Figure 2 In the function module 3 in Task 1, only one trigger event occurs in the function module 3, which does not reach three trigger events. The corresponding position in the cache module only stores the trigger data of the first trigger event of the function module 3. At this time, the first count value has reached the first preset value of 100, and the calling condition is met. Then, the write interface and time function are called to obtain the current time.

[0064] The multiple function modules in Task1 and Task2 may or may not have trigger events at the same time, and may or may not meet the calling conditions at the same time. Each function module can implement different functions. For example, one function module is responsible for the lifting and lowering of the car window, and another function module is responsible for the opening and closing of the sunroof. Just as an example, let's explain how to determine whether a trigger event has occurred. If a function module is responsible for the lifting and lowering of the car window, when the car window is raised, the value of the trigger data is 1, and when the car window is lowered, the value of the trigger data becomes 0. The detection module detects whether the trigger data of the function module has changed. If the trigger data of the function module detected in the previous detection cycle is 1, and the trigger data of the function module detected in the current cycle is 0, it is determined that a trigger event has occurred in the function module. If the trigger data of the function module detected in the previous detection cycle is 1, and the trigger data of the function module detected in the current cycle is 1, it is determined that no trigger event has occurred in the function module.

[0065] From the above, it can be seen that if the cache module only stores the trigger data of the first trigger event of the functional module, when the function module still does not have a trigger event after 100 detections, the write interface is called and the current time is obtained. At this time, the cache module only stores 1 trigger data of the corresponding functional module. If the cache module stores 3 data of the three trigger events of the functional module, but 50 detections are made at this time, the write interface is called and the current time is obtained. At this time, the cache module only stores 3 trigger data of the corresponding functional module 1.

[0066] Therefore, according to the situation of the trigger event of the functional module, one or more trigger data can be stored in the cache module, and the write interface is called only when the calling condition is met. Compared with the prior art that the write interface is called as long as the trigger event occurs, it can not only save cache space, but also play a role in frequency reduction. The write module dynamically allocates byte space of one or more trigger data according to the data length of the cached trigger data, that is, dynamically adjusts the queue length of the write interface, so that one or more trigger data can be stored in the storage unit at one time, which not only improves the efficiency of storing data, but also effectively avoids the situation that the write interface is blocked and the trigger data is lost when the write interface is called multiple times. Compared with the prior art, the queue length of the write interface is fixed. When the write interface is called multiple times, the write interface will be tight or blocked, resulting in the loss of trigger data, and it cannot be guaranteed that all trigger data are stored in the MPU. The embodiment of the present application can effectively avoid the situation that the write interface is blocked and the trigger data is lost when the write interface is called multiple times by dynamically adjusting the queue length of the write interface.

[0067] Next, the specific description of obtaining the time of triggering data in the data packet corresponding to the functional module by using the current time and the detection cycle is as follows:

[0068] The first case, such as Figure 2 As shown, only one trigger event occurs in the function module 3, and only one trigger data 1 is stored in the cache module. At this time, the first count value reaches the first preset value 100, and the second count value is 1, and has not reached the second preset value 3, that is, only one trigger event occurs in the function module 3, but the number of detection cycles has reached 100, and the calling condition is met. At this time, the write interface is called and the current time is obtained. For example, the current time Tc is 5:00:00:990, where 990 represents 990 milliseconds, 5:00:00:990 is 5 hours, 0 minutes, 0 seconds, and 990 milliseconds, and 1 second is equal to 1000 milliseconds. The first count value P corresponding to the current time Tc is 100, and the first count value CNT_1 corresponding to the trigger data 1 of the first trigger event of the function module 3 is 1. At this time, the number of detection cycles is 1, that is, the first trigger event occurs in 1 detection cycle; the time length △T of the detection cycle can be set to 10 milliseconds.

[0069] The time T_1 of trigger data 1 when the trigger event of function module 1 occurs for the first time can be calculated using the following formula.

[0070] T_1=Tc-(P-CNT_1)×ΔT=5:00:00:990-(100-1)×10=5:00:00:000; the time of trigger data 1 when the trigger event of function module 1 occurs for the first time is 5:00:00:000.

[0071] The queue length of the write interface is adjusted to the sum of the data length of one trigger data and the data length of the time of the trigger data. The trigger data and the time of the trigger data are stored in the storage unit MPU through the write interface.

[0072] The second case, such as Figure 2As shown, three trigger events occurred in the functional module 1, and three trigger data were stored in the cache module. At this time, the first count value was 50 and did not reach the first preset value 100. The second count value reached the second preset value 3, that is, three trigger events occurred in the functional module 1, and the calling conditions were met. At this time, the write interface was called and the current time was obtained. For example, the current time Tc is 5:00:00:990, the first count value P corresponding to the current time Tc is 50, the first count value CNT_1 corresponding to the trigger data 1 of the first trigger event of the functional module 1 is 1, and the number of detection cycles at this time is 1, that is, the first trigger event occurs in 1 detection cycle; the first count value CNT_1 corresponding to the trigger data 1 of the second trigger event of the functional module 1 is 20, and the number of detection cycles is 20, that is, the second trigger event occurs in the 20th detection cycle, the first count value CNT_1 corresponding to the trigger data 1 of the third trigger event of the functional module 1 is 50, and the number of detection cycles is 50, that is, the third trigger event occurs in the 50th detection cycle, which is equal to the first count value P corresponding to the current time Tc, and the time length △T of the detection cycle is 10 milliseconds.

[0073] The time T_1 of trigger data 1 when the trigger event of function module 1 occurs for the first time and the time T_2 of trigger data 2 when the trigger event occurs for the second time can be calculated using the following formula.

[0074] T_1 = Tc-(P-CNT_1) × △T = 5:00:00:990-(50-1) × 10 = 5:00:00:500; the time of trigger data 1 when the trigger event of function module 1 occurs for the first time is 5:00:00:500;

[0075] T_2 = Tc-(P-CNT_1) × △T = 5:00:00:990-(50-20) × 10 = 5:00:00:690; the time of trigger data 1 of the second trigger event of function module 1 is 5:00:00:690;

[0076] The time T_3 of the trigger data 3 when the trigger event of the functional module 1 occurs for the third time is the current time Tc, which is 5:00:00:990.

[0077] The queue length of the write interface is adjusted to the sum of the data length of the three trigger data and the data length of the time of the three trigger data. The three trigger data and the time of the three trigger data are stored in the storage unit MPU through the write interface.

[0078] If function module 1, function module 2 and function module 3 meet the calling conditions at the same time, the queue length of the write interface is adjusted to the sum of the data length of the 7 trigger data and the data length of the time of the 7 trigger data. The 7 trigger data and the time of the 7 trigger data are stored in the storage unit MPU through the write interface.

[0079] It should be noted that trigger events may occur simultaneously in multiple functional modules in task scheduling Task1, and trigger events may also occur simultaneously in multiple functional modules in multiple task calls. As long as the calling conditions are met in the current detection cycle, the queue length of the write interface can be adjusted to the sum of the data length of the trigger data in the data packets corresponding to all functional modules that meet the calling conditions and the data length of the moment of the trigger data in the data packets. The trigger data in the data packets corresponding to all functional modules that meet the calling conditions and the moment of the trigger data are stored in the MPU through the write interface.

[0080] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0081] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0082] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0083] Figure 3 Schematic diagram of a vehicle-side data processing device provided in an embodiment of the present application. Figure 3 As shown, the vehicle-side data processing device is applied to the vehicle-side controller, and the vehicle-side data processing device includes:

[0084] The detection module 301 is configured to periodically detect whether a trigger event occurs in each functional module;

[0085] The cache module 302 is configured to cache and package the trigger data of the trigger event of any functional module when a trigger event is detected, so as to obtain a data packet corresponding to the functional module;

[0086] The write module 303 is configured to obtain the data length of the trigger data in the data packets corresponding to each functional module that meets the calling condition when the data packet corresponding to any functional module meets the calling condition, and adjust the queue length of the write interface to the sum of the data lengths of the trigger data in the data packets corresponding to all functional modules that meet the calling condition, and store the trigger data in the data packets corresponding to all functional modules that meet the calling condition to the storage unit through the write interface.

[0087] According to the technical solution provided in the embodiment of the present application, by adding a caching function, the trigger data of the trigger events occurring in each functional module are cached and packaged. When the data packet corresponding to any functional module meets the calling conditions, the data length of the trigger data in the data packets corresponding to each functional module that meets the calling conditions is obtained, and the queue length of the write interface is adjusted according to the data length of the trigger data in the data packets corresponding to each functional module that meets the calling conditions. One or more trigger data can be written at one time through the write interface, so that one or more trigger data can be stored in the storage unit at one time, which not only improves the efficiency of storing data, but also effectively avoids the loss of trigger data caused by blockage of the write interface when the write interface is called multiple times.

[0088] In some embodiments, the cache module 302 is specifically configured to perform the following operations on each functional module:

[0089] When the first trigger event of the functional module is detected, the number of detection cycles is counted to obtain a first count value of the corresponding functional module, wherein the first count value of the first trigger event of the corresponding functional module is 1;

[0090] The trigger data of the trigger event of the functional module and the first count value corresponding to the trigger data of each trigger event are cached and packaged to obtain a data packet corresponding to the functional module.

[0091] In some embodiments, the cache module 302 is specifically configured to: when detecting the first trigger event of the functional module, start counting the number of trigger events of the functional module to obtain a second count value of the corresponding functional module, wherein the second count value of the first trigger event of the corresponding functional module is 1;

[0092] Furthermore, the writing module 303 is specifically configured to obtain the data length of the trigger data in the data packet corresponding to the functional module when the first count value corresponding to the functional module reaches the first preset value or the second count value reaches the second preset value.

[0093] In some embodiments, the writing module 303 is specifically configured as follows: when the first count value corresponding to the functional module reaches a first preset value or the second count value reaches a second preset value, the data length of the trigger data in the data packet corresponding to the functional module is obtained, and the current moment is obtained; using the current moment and the detection cycle, the moment of the trigger data in the data packet corresponding to the functional module is obtained.

[0094] In some embodiments, the write module 303 is specifically configured to: adjust the queue length of the write interface to the sum of the data length of the trigger data in the data packets corresponding to all functional modules that meet the calling conditions and the data length of the moment of the trigger data in the data packets, and store the trigger data and the moment of the trigger data in the data packets corresponding to all functional modules that meet the calling conditions in the storage unit through the write interface.

[0095] In some embodiments, the cache module 302 is specifically configured to: clear the first count value and the second count value to zero.

[0096] In some embodiments, the cache module 302 is specifically configured to: use the current time and the detection cycle to calculate according to the first formula to obtain the time of the trigger data in the data packet corresponding to the functional module; the first formula includes:

[0097] T_n=Tc-(P-CNT_n)×△T;

[0098] Among them, T_n represents the moment of trigger data of the nth trigger event in the data packet, Tc represents the current moment; P represents the first count value corresponding to the current moment; CNT_n represents the first count value corresponding to the trigger data of the nth trigger event in the data packet; △T represents the time length of the detection cycle; n is a positive integer.

[0099] Figure 4 Schematic diagram of an electronic device 4 provided in an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0100] The electronic device 4 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 The electronic device 4 is merely an example and does not limit the electronic device 4 , and may include more or less components than those shown in the figure, or different components.

[0101] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0102] The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. The memory 402 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.

[0103] Based on the same inventive concept, an embodiment of the present application provides a readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the method described in any of the above embodiments are implemented.

[0104] The readable storage medium provided in the embodiment of the present application has the same inventive concept and the same beneficial effects as the previous embodiments. The contents not shown in detail in the readable storage medium can be referred to the previous embodiments and will not be repeated here.

[0105] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0106] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (e.g., a computer-readable storage medium). Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0107] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A vehicle-side data processing method, characterized in that: Applied to a vehicle-side controller, the method comprises: Periodically check whether each functional module has a trigger event; When it is detected that the trigger event occurs in any of the functional modules, the trigger data of the trigger event occurring in the functional module is cached and packaged to obtain a data packet corresponding to the functional module; When the data packet corresponding to any of the functional modules meets the calling conditions, the data length of the trigger data in the data packet corresponding to each of the functional modules meeting the calling conditions is obtained, and the queue length of the write interface is adjusted to the sum of the data lengths of the trigger data in the data packets corresponding to all the functional modules meeting the calling conditions, and the trigger data in the data packets corresponding to all the functional modules meeting the calling conditions are stored in the storage unit through the write interface; the calling conditions include the number of detection cycles reaching a first preset value or the number of trigger events occurring in the functional module reaching a second preset value.

2. The method according to claim 1, characterized in that When the trigger event is detected in any of the functional modules, the trigger data of the trigger event in the functional module is cached and packaged to obtain a data packet corresponding to the functional module, including: The following operations are performed for each of the functional modules: When it is detected that the first trigger event occurs in the functional module, the number of detection cycles is counted to obtain a first count value corresponding to the functional module, wherein the first count value corresponding to the first trigger event of the functional module is 1; The trigger data of the trigger event occurring in the functional module and the first count value corresponding to the trigger data of each trigger event are cached and packaged to obtain a data packet corresponding to the functional module.

3. The method according to claim 2, characterized in that The trigger data of the trigger event occurring in the functional module and the first count value corresponding to each trigger event are cached and packaged, and before obtaining the data packet corresponding to the functional module, the method further includes: When it is detected that the first trigger event occurs in the functional module, the number of the trigger events occurring in the functional module is counted to obtain a second count value corresponding to the functional module, wherein the second count value corresponding to the first trigger event of the functional module is 1; And, when the data packet corresponding to any of the functional modules meets the calling condition, obtaining the data length of the trigger data in the data packet corresponding to the functional module that meets the calling condition comprises: When the first count value corresponding to the functional module reaches a first preset value or the second count value reaches a second preset value, the data length of the trigger data in the data packet corresponding to the functional module is obtained.

4. The method according to claim 3, characterized in that When the first count value corresponding to the functional module reaches a first preset value or the second count value reaches a second preset value, obtaining the data length of the trigger data in the data packet corresponding to the functional module includes: When the first count value corresponding to the functional module reaches a first preset value or the second count value reaches a second preset value, the data length of the trigger data in the data packet corresponding to the functional module is obtained, and the current time is obtained; The time of the trigger data in the data packet corresponding to the functional module is obtained by using the current time and the detection period.

5. The method according to claim 4, characterized in that The queue length of the write interface is adjusted to the sum of the data lengths of the trigger data in the data packets corresponding to all the functional modules that meet the call condition, and the trigger data in the data packets corresponding to all the functional modules that meet the call condition are stored in the storage unit through the write interface, including: The queue length of the write interface is adjusted to the sum of the data length of the trigger data in the data packets corresponding to all the functional modules that meet the calling conditions and the data length of the moment of the trigger data in the data packets, and the trigger data in the data packets corresponding to all the functional modules that meet the calling conditions and the moment of the trigger data are stored in the storage unit through the write interface.

6. The method according to claim 5, characterized in that After storing the trigger data and the time of the trigger data in the data packets corresponding to all the functional modules that meet the calling condition in the storage unit through the write interface, the method further includes: The first count value and the second count value are cleared to zero.

7. The method according to claim 4, characterized in that Using the current moment and the detection period, obtaining the moment of the trigger data in the data packet corresponding to the functional module includes: The current moment and the detection period are used to calculate according to a first formula to obtain the moment of the trigger data in the data packet corresponding to the functional module; the first formula includes: T_n=Tc-(P-CNT_n)×△T; Among them, T_n represents the moment of the trigger data of the nth trigger event in the data packet, Tc represents the current moment; P represents the first count value corresponding to the current moment; CNT_n represents the first count value corresponding to the trigger data of the nth trigger event in the data packet; △T represents the time length of the detection cycle; n is a positive integer.

8. A vehicle-side data processing device, characterized in that: Applied to a vehicle-side controller, the device comprises: The detection module is configured to periodically detect whether a trigger event occurs in each functional module; A cache module, configured to cache and package the trigger data of the trigger event occurring in any of the functional modules when the trigger event is detected, so as to obtain a data packet corresponding to the functional module; The write module is configured to obtain the data length of the trigger data in the data packets corresponding to each of the functional modules that meet the call condition when the data packet corresponding to any of the functional modules meets the call condition, and adjust the queue length of the write interface to the sum of the data lengths of the trigger data in the data packets corresponding to all the functional modules that meet the call condition, and store the trigger data in the data packets corresponding to all the functional modules that meet the call condition to the storage unit through the write interface; the call condition includes the number of detection cycles reaching a first preset value or the number of trigger events occurring in the functional module reaching a second preset value.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.