Data caching method and device of electric vehicle driving system and storage medium

By employing a data caching method in the electric vehicle drive system and utilizing calibrated caching functionality, the problems of limited communication bandwidth and high cost are solved, enabling efficient fault analysis and accurate data acquisition.

CN121166566APending Publication Date: 2025-12-19BEIJING HAINACHUAN AUTOMOTIVE PARTS
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511013413.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

In existing technologies, data analysis of electric vehicle drive systems faces challenges such as limited communication bandwidth and high costs, making it difficult to accurately analyze instantaneous hardware failures and improve the efficiency of drive problem analysis.

Method used

By employing a data caching method and enabling the caching function with a calibrated value, data is cached within the PWM cycle and transmitted on the CAN communication interface, thus avoiding impact on CPU load and achieving efficient data caching and analysis.

Benefits of technology

It improves the efficiency and accuracy of fault analysis in electric vehicle drive systems, reduces usage costs, and ensures the acquisition of message data on the vehicle's CAN bus.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121166566A_ABST
    Figure CN121166566A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a data caching method and device for an electric vehicle driving system and a storage medium, and the method comprises the steps: responding to the determination of starting a data caching counting operation, initializing a caching array, carrying out the assignment of the caching array based on to-be-cached data, and starting a first caching counter, determining whether a count value of the first cache counter reaches a first preset count threshold, determining whether a preset sending condition is met in response to the count value of the first cache counter reaching the first preset count threshold, and determining to start a cache data sending trigger operation in response to the preset sending condition; and in response to determining to start the cache data sending trigger operation, starting a second cache counter in the PWM period, determining whether a count value of the second cache counter reaches a second preset count threshold, and in response to the count value of the second cache counter reaching the second preset count threshold, updating the to-be-cached data in the cache array to the CAN communication interface.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a data caching method of an electric vehicle driving system, a data caching device of an electric vehicle driving system, an electronic device and a computer readable storage medium. BACKGROUND

[0002] Electric vehicles have become the future direction of the current automobile industry, and the power source of electric vehicles is a driving motor. A main driving motor selects a permanent magnet synchronous motor, and an auxiliary driving motor has two options, one of which is a permanent magnet synchronous motor, and the other of which is an asynchronous motor. The safety state of the asynchronous motor is simpler than that of the permanent magnet synchronous motor. Since the rotor of the asynchronous motor itself does not have a magnetic field, it only needs to be connected to a power supply to enter a safe state, without entering a three-phase short-circuit state.

[0003] In the related art, the driving system can use XCP (Universal Measurement and Calibration Protocol) for data calibration and measurement. This protocol can achieve a cycle of 1 ms, and even reach the update rate of the PWM (Pulse Width Modulation) cycle. However, the communication bandwidth of this protocol is limited, and when the communication cycle is fast, the data signals that can be sent are very limited, which brings great difficulty to data analysis. Similarly, a special MCU (Microcontroller Unit) chip can be used, which is equipped with special hardware. The special MCU chip can achieve a data update rate of us level, but this not only brings a large increase in cost, but also is limited by the size of the data amount. SUMMARY

[0004] The present application aims to at least solve one of the technical problems in the related art. To this end, the first object of the present application is to propose a data caching method of an electric vehicle driving system, which can enable the caching function by enabling the calibration amount, without affecting the CPU load rate of normal operation, and can help analyze the control process and the occasional hardware failure of the whole vehicle, can collect message data on the whole vehicle CAN bus, improve the efficiency and accuracy of driving problem analysis, and reduce the use cost.

[0005] The second object of the present application is to propose a data caching device of an electric vehicle driving system.

[0006] The third object of the present application is to propose an electronic device.

[0007] The fourth object of the present application is to propose a computer readable storage medium.

[0008] To achieve the above object, the first aspect of the present application provides a data caching method of an electric vehicle driving system, comprising: in response to receiving an enabling signal for a caching function, determining whether a starting mode of the caching function is a single trigger mode; in response to the starting mode of the caching function being the single trigger mode, determining whether a preset trigger condition is met; in response to the preset trigger condition being met, determining to start a data caching counting operation; in response to determining to start the data caching counting operation, initializing a caching array, assigning the caching array based on to-be-cached data, and starting a first caching counter, determining whether a counting value of the first caching counter reaches a first preset counting threshold, in response to the counting value of the first caching counter reaching the first preset counting threshold, determining whether a preset sending condition is met, in response to the preset sending condition being met, determining to start a caching data sending trigger operation; in response to determining to start the caching data sending trigger operation, starting a second caching counter in a PWM period, determining whether a counting value of the second caching counter reaches a second preset counting threshold, in response to the counting value of the second caching counter reaching the second preset counting threshold, updating the to-be-cached data in the caching array to a CAN (Controller Area Network) communication interface.

[0009] In addition, the data caching method of the electric vehicle driving system according to the above-mentioned embodiments of the present application can further have the following additional technical features:

[0010] According to some embodiments of the present application, the above-mentioned method further comprises: determining a PWM period and a CAN message sending period, calculating a quotient value of the CAN message sending period and the PWM period, and taking the quotient value as the second preset counting threshold.

[0011] According to some embodiments of the present application, after the counting value of the first caching counter reaches the first preset counting threshold, the above-mentioned method further comprises: clearing the counting value of the first caching counter.

[0012] According to some embodiments of the present application, after the to-be-cached data in the caching array is updated to the CAN communication interface, the above-mentioned method further comprises: clearing the counting value of the second caching counter and adding one to a counting value of a data sending counter.

[0013] According to some embodiments of the present application, after the counting value of the data sending counter is added by one, the above-mentioned method further comprises: determining whether the counting value of the sending counter reaches a third preset counting threshold, in response to the counting value of the sending counter reaching the third preset counting threshold, initializing the caching array.

[0014] According to some embodiments of the application, the method further comprises: keeping the enable flag as 1 before the updating of the data to be cached in the cache array to the CAN communication interface is completed; and setting the enable flag as 0 after the updating is completed.

[0015] According to some embodiments of the application, the method further comprises: in response to the starting mode of the cache function not being the single trigger mode, determining whether the starting mode of the cache function is the continuous trigger mode; and in response to the starting mode of the cache function being the continuous trigger mode, updating the data to be cached in the cache array to the CAN communication interface.

[0016] The data caching method of the electric vehicle driving system according to the embodiments of the application comprises: in response to receiving an enable signal for a cache function, determining whether a starting mode of the cache function is a single trigger mode; in response to the starting mode of the cache function being the single trigger mode, determining whether a preset trigger condition is met; in response to the preset trigger condition being met, determining to start a data caching counting operation; in response to determining to start the data caching counting operation, initializing a cache array, assigning the cache array based on data to be cached, and starting a first cache counter; determining whether a counting value of the first cache counter reaches a first preset threshold; in response to the counting value of the first cache counter reaching the first preset threshold, determining whether a preset sending condition is met; in response to the preset sending condition being met, determining to start a cache data sending trigger operation; in response to determining to start the cache data sending trigger operation, starting a second cache counter in a PWM cycle; determining whether a counting value of the second cache counter reaches a second preset threshold; and in response to the counting value of the second cache counter reaching the second preset threshold, updating the data to be cached in the cache array to the CAN communication interface. Thus, the enable of the cache function can be enabled by a calibration amount, without affecting the CPU load rate in normal operation, which is helpful for analyzing the control process and the occasional hardware faults of the vehicle, can collect message data on the CAN bus of the vehicle, improves the efficiency and accuracy of driving problem analysis, and reduces the use cost.

[0017] A second object of the application is to provide a data caching device of an electric vehicle driving system, which can enable the cache function by a calibration amount, without affecting the CPU load rate in normal operation, which is helpful for analyzing the control process and the occasional hardware faults of the vehicle, can collect message data on the CAN bus of the vehicle, improves the efficiency and accuracy of driving problem analysis, and reduces the use cost.

[0018] To achieve the above object, the second aspect of the present application provides a data caching device of an electric vehicle driving system, comprising: a first response module configured to determine whether the starting mode of the caching function is a single trigger mode in response to receiving an enabling signal for the caching function, determine whether a preset trigger condition is met in response to the starting mode of the caching function being the single trigger mode, and determine to start a data caching counting operation in response to the preset trigger condition being met; a second response module configured to initialize a cache array, assign the cache array based on the data to be cached, and start a first cache counter in response to determining to start the data caching counting operation, determine whether the counting value of the first cache counter reaches a first preset threshold, determine whether a preset sending condition is met in response to the counting value of the first cache counter reaching the first preset threshold, and determine to start a cached data sending trigger operation in response to the preset sending condition being met; and a third response module configured to start a second cache counter within a PWM cycle in response to determining to start the cached data sending trigger operation, determine whether the counting value of the second cache counter reaches a second preset threshold, and update the data to be cached in the cache array to a CAN communication interface in response to the counting value of the second cache counter reaching the second preset threshold.

[0019] The data caching device of the electric vehicle driving system according to the embodiment of the present application comprises: a first response module configured to determine whether the starting mode of the caching function is a single trigger mode in response to receiving an enabling signal for the caching function, determine whether a preset trigger condition is met in response to the starting mode of the caching function being the single trigger mode, and determine to start a data caching counting operation in response to the preset trigger condition being met; a second response module configured to initialize a cache array, assign the cache array based on the data to be cached, and start a first cache counter in response to determining to start the data caching counting operation, determine whether the counting value of the first cache counter reaches a first preset threshold, determine whether a preset sending condition is met in response to the counting value of the first cache counter reaching the first preset threshold, and determine to start a cached data sending trigger operation in response to the preset sending condition being met; and a third response module configured to start a second cache counter within a PWM cycle in response to determining to start the cached data sending trigger operation, determine whether the counting value of the second cache counter reaches a second preset threshold, and update the data to be cached in the cache array to a CAN communication interface in response to the counting value of the second cache counter reaching the second preset threshold. Thus, the present device can enable the caching function through calibration, without affecting the normal running CPU load rate, which is helpful for analyzing the control process and the occasional hardware failure of the whole vehicle, can collect message data on the CAN bus of the whole vehicle, improve the efficiency and accuracy of driving problem analysis, and reduce the use cost.

[0020] To achieve the above object, the third aspect of the present application provides an electronic device, comprising: a processor and a memory, the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the data caching method of the electric vehicle driving system.

[0021] According to the electronic device of the embodiments of the present application, by executing the data caching method of the electric vehicle driving system, the enabling of the caching function can be enabled by the calibration quantity, without affecting the CPU load rate of normal operation, which helps to analyze the control process and the occasional hardware failure of the whole vehicle, can collect message data on the CAN bus of the whole vehicle, improves the efficiency and accuracy of driving problem analysis, and reduces the use cost.

[0022] To achieve the above object, the fourth aspect of the present application provides a computer readable storage medium, the readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to implement the steps of the data caching method of the electric vehicle driving system.

[0023] According to the computer readable storage medium of the embodiments of the present application, by executing the data caching method of the electric vehicle driving system, the enabling of the caching function can be enabled by the calibration quantity, without affecting the CPU load rate of normal operation, which helps to analyze the control process and the occasional hardware failure of the whole vehicle, can collect message data on the CAN bus of the whole vehicle, improves the efficiency and accuracy of driving problem analysis, and reduces the use cost.

[0024] Additional aspects and advantages of the present application will be given in part in the following description, become apparent from the following description, or be understood through practice of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0025] Figure 1 Flow chart of the data caching method of the electric vehicle driving system according to some embodiments of the present application;

[0026] Figure 2 Schematic diagram of the selection of the cached signal variable according to some embodiments of the present application;

[0027] Figure 3 Flow chart of the data caching process according to some embodiments of the present application;

[0028] Figure 4 Flow chart of the caching counting process according to some embodiments of the present application;

[0029] Figure 5 Flow chart of the cached data sending process according to some embodiments of the present application;

[0030] Figure 6Flow chart for triggering of data caching according to some embodiments of the application;

[0031] Figure 7 Schematic diagram of data caching device for electric vehicle drive system according to some embodiments of the application;

[0032] Figure 8 Block schematic diagram of electronic device according to some embodiments of the application. DETAILED DESCRIPTION

[0033] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the embodiments and the accompanying drawings.

[0034] It should be noted that, unless otherwise defined, technical terms or scientific terms used in the embodiments of the present application should be understood as their common meanings to those skilled in the art to which the present application pertains. The terms "first", "second", and similar terms used in the embodiments of the present application do not denote any order, quantity, or importance, but are only used to distinguish different components. The terms "include", "contain", and similar terms mean that the elements or objects before the terms encompass the elements or objects listed after the terms and their equivalents, without excluding other elements or objects. The terms "connect" or "connected" and similar terms do not mean only physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms "upper", "lower", "left", "right", and the like only represent relative positional relationships, which can change when the absolute positions of the described objects change.

[0035] As described in the background section, electric vehicles have become the future direction of the current automobile industry, and the power source of electric vehicles is a drive motor. The main drive motor can select a permanent magnet synchronous motor, and the auxiliary drive motor can have two options, one of which is a permanent magnet synchronous motor, and the other of which is an asynchronous motor. The safety state of the asynchronous motor is simpler than that of the permanent magnet synchronous motor. Since the rotor of the asynchronous motor itself does not have a magnetic field, it only needs to be closed to enter a safe state, without the need to enter a three-phase short-circuit state.

[0036] The hardware faults of the asynchronous motor controller system that perform the closed-loop protection mainly include overvoltage faults, overcurrent faults, and drive faults. Some of these faults are short-time triggered and short-time recovered faults, i.e., transient faults. The transient faults can be caused by electromagnetic interference, or can be real but quickly disappearing faults. In addition to transient faults, they can also be permanent faults.

[0037] Most of the time when the hardware failure is triggered, it is triggered accidentally or instantaneously, although it can be easily captured by the hardware, but since the time of failure maturity is very short, it is us level. The CAN communication message is ms level, and even the sending period is dozens of ms, so if the normal CAN data message of the drive system is used to analyze the failure cause and the data change before the failure, it will become very inaccurate, and even the data change cannot be captured. At the same time, some hardware failures disappear after a short time of triggering, especially the drive system has a fast recovery function, at this time the fault is triggered for a short time, but the short time triggering will be cleared by the drive system, and the time and process of the fault occurrence cannot be seen on the CAN message of the drive system, even whether the fault occurs cannot be confirmed, which brings great challenges to the safety and service life of the entire drive system.

[0038] The applicant finds in the implementation of the present application that in the related art, the drive system can use XCP for data calibration and measurement, this protocol can achieve a cycle of 1ms, and even reach the update rate of the PWM cycle. However, the communication bandwidth of this protocol is limited, when the communication cycle is fast, the data signals that can be sent are very limited, which brings great difficulty to the analysis of data. Similarly, a special MCU chip can be used, and special hardware is matched, and the special MCU chip can achieve a data update rate of us level, but this not only brings a large increase in cost, but also is limited by the size of the data amount.

[0039] Therefore, the present application can enable the enabling of the cache function through the calibration amount, without affecting the normal running CPU load rate, which is helpful for analyzing the control process and the occasional hardware failure of the entire vehicle, can collect message data on the CAN bus of the entire vehicle, improves the efficiency and accuracy of the drive problem analysis, and reduces the use cost.

[0040] The data cache method of the electric vehicle drive system, the data cache device of the electric vehicle drive system, the electronic equipment and the computer readable storage medium proposed by the embodiment of the present application are described below with reference to the accompanying drawings.

[0041] Reference Figure 1 The flowchart of the data cache method of the electric vehicle drive system according to some embodiments of the present application is shown in FIG. 1.

[0042] In some embodiments, reference Figure 2 The schematic diagram of the selection of the cache signal variable according to some embodiments of the present application is shown in FIG. 2. First, the related signals are numbered as much as possible to cover all the diagnosis and control processes, and then the observation signals are selected by setting the numbers of the index signal variables.

[0043] AsFigure 1 As shown, the data caching method of the electric vehicle driving system according to the embodiments of the present application can include the following steps:

[0044] S101, in response to receiving an enabling signal for the caching function, determining whether the starting mode of the caching function is a single trigger mode, in response to the starting mode of the caching function being the single trigger mode, determining whether a preset trigger condition is met, and in response to the preset trigger condition being met, determining to start a data caching counting operation.

[0045] Specifically, since the data caching is running in the PWM cycle, it will bring the load rate to be improved, and needs to be started through the enabling signal in normal operation. Therefore, it is needed to determine whether the electric vehicle driving system receives the enabling signal for the caching function, wherein the caching function is in a closed state by default, and when the electric vehicle driving system receives the enabling signal for the caching function, it can represent that the caching function has been started, at this time, it is determined whether the starting mode of the caching function is a single trigger mode, and when the starting mode of the caching function is the single trigger mode, since the single trigger mode is suitable for use when a fault occurs, only when a specific fault trigger condition is met, the data sending function will be started, therefore, it is also needed to determine whether the single trigger mode meets the preset trigger condition, and when the single trigger mode meets the preset trigger condition, the single trigger mode is started, and the data caching counting operation is started. That is, when the electric vehicle driving system receives the enabling signal for the caching function, the caching array starts to update the value in the PWM interrupt, and the counting is accumulated, if it is the single trigger mode, it will be cached all the time until the preset trigger condition is met, and then all the values of the current array are sent to the CAN message.

[0046] When the single trigger mode does not meet the preset trigger condition, the caching function will always cache until the single trigger mode meets the preset trigger condition. When the electric vehicle driving system does not receive the enabling signal for the caching function, the caching function is not run.

[0047] In some embodiments of the present application, the above method further includes: in response to the starting mode of the caching function not being the single trigger mode, determining whether the starting mode of the caching function is a continuous trigger mode; and in response to the starting mode of the caching function being the continuous trigger mode, updating the data to be cached in the caching array to the CAN communication interface.

[0048] Specifically, when the starting mode of the cache function is not the single trigger mode, it is determined whether the starting mode of the cache function is the continuous trigger mode. When the starting mode of the cache function is the continuous trigger mode, the continuous trigger mode is applicable to observation and analysis of abnormal control signals, such as resolver signals and the like. The continuous trigger mode does not require a trigger condition. At this time, the to-be-cached data in the cache array is updated to the CAN communication interface. After the cache is completed, the cached data can be sent to the CAN message.

[0049] As a specific example, as shown in Figure 3 The data caching process of the application can include the following steps:

[0050] S301, it is determined whether the electric vehicle driving system receives an enabling signal for the cache function. If yes, step S302 is performed; if no, the step is ended.

[0051] S302, the data caching is started.

[0052] S303, it is determined whether the starting mode of the cache function is the single trigger mode. If yes, step S304 is performed; if no, step S306 is performed.

[0053] S304, it is determined whether the single trigger mode meets a preset trigger condition. If yes, step S305 is performed; if no, step S303 is returned.

[0054] S305, the single trigger mode is started, and the data caching counting operation is started.

[0055] S306, the to-be-cached data in the cache array is updated to the CAN communication interface. After the cache is completed, the cached data can be sent to the CAN message.

[0056] S102, in response to determining to start the data caching counting operation, the cache array is initialized, the cache array is assigned based on the to-be-cached data, and the first cache counter is started. It is determined whether the counting value of the first cache counter reaches a first preset threshold. In response to the counting value of the first cache counter reaching the first preset threshold, it is determined whether a preset sending condition is met. In response to the preset sending condition being met, it is determined to start the cached data sending trigger operation. The first preset threshold can be calibrated according to actual conditions.

[0057] Specifically, when determining to start the data cache counting operation, the cached data is first initialized, and the size of the cache array can be determined according to the memory size of the master chip or the analysis needs. In the case of permission, the more cached data is, the more helpful it is for problem analysis. Then, the cache array is assigned based on the data to be cached, and the first cache counter is started. The counting value of the first cache counter is compared with the first preset counting threshold value, and it is judged whether the counting value of the first cache counter reaches the first preset counting threshold value. When the counting value of the first cache counter reaches the first preset counting threshold value, it is judged whether the preset sending condition is met. When the preset sending condition is met, data sending is started. When the preset sending condition is not met, the cache array is continuously assigned, and the cache counting is continued. It can also be understood that when the data is cached, a "small warehouse" (cache array) is prepared for the data. The size of the "small warehouse" can be determined according to the memory size of the master chip. Generally, the larger the "small warehouse", the more data can be stored, and the more helpful it is for problem analysis. Before starting to cache data, the "small warehouse" is cleaned, that is, it is initialized. When the cache condition is met, data is stored in the "small warehouse". When storing data, a counter is used to record how much is stored. When it is full, the counter is reset to zero. If the data sending condition is met at this time, data sending is started; if not, continue to store in the "small warehouse", and the newly stored data will overwrite the previously stored data.

[0058] In some embodiments of the present application, after the counting value of the first cache counter reaches the first preset counting threshold value, the above method further comprises: resetting the counting value of the first cache counter to zero.

[0059] Specifically, after the counting value of the first cache counter reaches the first preset counting threshold value, it can be indicated that the first cache counter cannot continue to count at this time. The counting value of the first cache counter is reset to zero so that the first cache counter can continue to count. Then, it is judged whether the preset sending condition is met. When the preset sending condition is met, the data cache sending trigger operation is started.

[0060] As a specific example, as shown in the figure, the cache counting process of the present application can include the following steps: Figure 4

[0061] S401, starting a data cache counting operation, initializing a cache array, assigning the cache array based on data to be cached, and starting a first cache counter.

[0062] S402, judging whether the counting value of the first cache counter reaches the first preset counting threshold value. If yes, step S403 is executed; if no, returning to step S401.

[0063] ​S403, clear the count value of the first cache counter.

[0064] S404, determine whether the preset sending condition is met. If yes, execute step S405; if no, return to step S401.

[0065] S405, start the cache data sending trigger operation.

[0066] S103, in response to determining to start the cache data sending trigger operation, start the second cache counter in the PWM cycle, determine whether the count value of the second cache counter reaches a second preset threshold, and in response to the count value of the second cache counter reaching the second preset threshold, update the to-be-cached data in the cache array to the CAN communication interface, wherein the second preset threshold can be calibrated according to actual conditions.

[0067] Specifically, when it is determined to start the cache data sending trigger operation, the second cache counter is started in the PWM cycle, so that the second cache counter starts time counting in the PWM cycle. The count value of the second cache counter is compared with the second preset threshold to determine whether the count value of the second cache counter reaches the second preset threshold. When the count value of the second cache counter reaches the second preset threshold, the corresponding cache array value is assigned to the CAN communication interface, that is, the to-be-cached data in the cache array is updated to the CAN communication interface, and the count is incremented, and the array serial number for the next sending is sent. If the count reaches an upper limit value, the cache array is reinitialized to prepare for the next caching. Otherwise, the time counting in the PWM cycle is restarted, and the CAN communication interface is periodically updated until the data in the cache array is completely sent. Thus, the enabling of the cache function can be enabled by a calibration amount, without affecting the normal running CPU load rate, which is helpful for analyzing the control process and the occasional hardware failure of the whole vehicle, can collect message data on the whole vehicle CAN bus, improve the efficiency and accuracy of driving problem analysis, and reduce the use cost.

[0068] Therefore, the hardware failure of the electric vehicle driving system matures in a short time, and the software running time of the driving system is usually the fastest cycle of PWM interruption, which is usually us level. Therefore, PWM interruption is adopted to record data, but the CAN message cycle of the electric vehicle driving system is ms level. Therefore, the data needs to be cached first, and then sent out according to the normal CAN message cycle. The data to be cached is different according to different fault analysis. Therefore, each observation signal needs to be numbered according to experience or a limited amount of signal, and each cache signal is calibrated by a calibration amount of the cache signal index. Therefore, the software does not need to be updated according to different faults.

[0069] In some embodiments of the present application, the method further comprises determining the PWM period and the CAN message sending period, calculating the quotient of the CAN message sending period and the PWM period, and taking the quotient as the second preset count threshold.

[0070] Specifically, since the data of the CAN message sending period is in the order of milliseconds, and the cache data sending function is implemented in the PWM period, the count value required for the sending interval of the PWM period needs to be calculated according to the PWM period and the CAN message sending period, that is, the second preset count threshold is calculated. Assuming that the PWM period is T pwm , the CAN message sending period is T CAN , and the second preset count threshold Count is calculated as follows:

[0071]

[0072] It can also be understood that, since the CAN data is sent slowly, and the cache data is processed in the fast PWM period, it is necessary to calculate how long to send data once. For example, the PWM period is like the time for the second hand to move once, and the CAN message sending period is like the time for the minute hand to move once. The formula is used to calculate how many times the data is sent in the PWM period.

[0073] In some embodiments of the present application, after the to-be-cached data in the cache array is updated to the CAN communication interface, the method further comprises resetting the count value of the second cache counter and adding one to the count value of the data sending counter.

[0074] Specifically, after the to-be-cached data in the cache array is updated to the CAN communication interface, the count value of the second cache counter cannot continue to be counted, and the count value of the second cache counter is reset so that the second cache counter can continue to count. Then, the count value of the data sending counter is added by one. It can also be understood that, in the PWM period, the count value of the second cache counter is counted while the count value of the second cache counter is counted. If it is equal, the corresponding data in the cache array is updated to the CAN communication interface for communication between the vehicle and the outside world, and then the count value of the second cache counter is reset and the count value of the data sending counter is added by one.

[0075] In some embodiments of the present application, after the count value of the data sending counter is added by one, the method further comprises determining whether the count value of the sending counter reaches a third preset count threshold, and initializing the cache array in response to the count value of the sending counter reaching the third preset count threshold. The third preset count threshold can be calibrated according to actual conditions.

[0076] Specifically, after the count value of the data sending counter is incremented by one, the count value of the sending counter is compared with the third preset count threshold to determine whether the count value of the sending counter reaches the third preset count threshold. When the count value of the sending counter reaches the third preset count threshold, that is, when the count value of the sending counter reaches the upper limit of the cache, the cache array is initialized. That is, when the count value of the sending counter reaches the maximum number of the cache array (the upper limit of the cache), the cache array is cleared; if not, the PWM time is restarted, and the process of repeated sending is continued until the data in the cache array is all sent.

[0077] As a specific example, as shown in FIG. 6, the cache data sending process of the present application can include the following steps: Figure 5

[0078] S501, a cache data sending trigger operation is started, and the second cache counter is started in the PWM period.

[0079] S502, it is determined whether the count value of the second cache counter reaches the second preset count threshold. If yes, step S503 is performed; if not, step S501 is returned.

[0080] S503, the data to be cached in the cache array is updated to the CAN communication interface, the count value of the second cache counter is cleared, and the count value of the data sending counter is incremented by one.

[0081] S504, it is determined whether the count value of the sending counter reaches the third preset count threshold. If yes, step S505 is performed; if not, step S501 is returned.

[0082] S505, the cache array is initialized.

[0083] In some embodiments of the present application, the above method further includes: before the updating of the data to be cached in the cache array to the CAN communication interface is completed, the sending enable flag is kept as 1; and after the sending is completed, the sending enable flag is set to 0.

[0084] ​Specifically, before the data in the cache array is updated to the CAN interface, the default state of the cache data sending is disabled. When the data sending trigger condition is met, the cache data sending enable flag is set to 1, and the cache data sending function is enabled. The sending enable flag is kept as 1 until the cache data sending is completed. After the cache data sending is completed, the cache data sending enable flag is set to 0 to wait for the next data sending trigger condition. If the working condition is continuous triggering, the sending enable flag of the next PWM cycle is kept as 1. If the working condition is single triggering, the data is kept in the cache until the next trigger condition is met, and the sending enable flag is set to 1 to enable the sending of the next cache data. In other words, by default, the cache data sending is disabled, like a closed door. Only when the sending condition is met (for example, the cache is full), the door is opened, that is, the sending enable flag is set to 1, and the cache data is sent. Before the data sending is completed, the door is kept open, and the sending enable flag is kept as 1. After the data sending is completed, the door is closed, and the sending enable flag is set to 0. If the working condition is continuous triggering, the door of the next PWM cycle is automatically opened. If the working condition is single triggering, the data is kept in the cache until the next trigger condition is met, and the door is opened to start the next data sending.

[0085] As a specific example, as shown in FIG. 6, the cache data sending trigger of the present application can include the following steps: Figure 6

[0086] S601, the state of the cache data sending is disabled.

[0087] S602, it is judged whether the data sending trigger condition is met. If yes, step S603 is executed; if no, step S601 is returned.

[0088] S603, the sending enable flag is kept as 1.

[0089] S604, it is judged whether the cache data sending is completed. If yes, step S605 is executed; if no, step S603 is returned.

[0090] S605, the sending enable flag is set to 0.

[0091] ​Thus, the control process or hardware failure triggering process of the electric vehicle driving system occurs in a very short time, the relevant signals can be recorded in the PWM cycle for analysis, after the completion of the buffering and the conditions are met, the normal CAN message is sent to the bus; the selection of the relevant signals is selected by the calibration quantity, without the need to update the program again; the sending of the buffered data can be triggered by a single trigger, for example, failure triggering, or by continuous triggering, after the completion of the sending, the buffered data is initialized, the buffering is restarted, until the next sending condition is triggered; the default buffering function is in the off state, without affecting the normal CPU load rate; through the buffering of the process data, the efficiency and accuracy of the failure and control process analysis are improved.

[0092] The data buffering method of the electric vehicle driving system of the application is realized by software, without additional hardware cost; the buffering function is enabled by the calibration quantity, by default, without affecting the normal running CPU load rate; the buffered signal variable is selected by the calibration quantity, without the need to update the program multiple times; the buffering function can be triggered by a single trigger or continuously; the buffering data recording cycle is the PWM interrupt, which is the fastest running cycle of the driving system, which is helpful for the analysis of the control process and the occasional hardware failure analysis of the whole vehicle; at the end of the buffering, the normal message cycle can be sent to the CAN bus, the message data can be collected on the whole vehicle CAN bus, and the efficiency and accuracy of the driving problem analysis are improved.

[0093] In summary, according to the data caching method of the electric vehicle driving system according to the embodiment of the present application, in response to receiving an enabling signal for the caching function, it is determined whether the starting mode of the caching function is a single trigger mode, in response to the starting mode of the caching function being the single trigger mode, it is determined whether a preset trigger condition is met, in response to the preset trigger condition being met, it is determined to start a data caching counting operation; in response to determining to start the data caching counting operation, a cache array is initialized, the cache array is assigned based on the to-be-cached data, and a first cache counter is started, it is determined whether a count value of the first cache counter reaches a first preset threshold, in response to the count value of the first cache counter reaching the first preset threshold, it is determined whether a preset sending condition is met, in response to the preset sending condition being met, it is determined to start a cached data sending trigger operation; in response to determining to start the cached data sending trigger operation, a second cache counter is started in a PWM cycle, it is determined whether a count value of the second cache counter reaches a second preset threshold, and in response to the count value of the second cache counter reaching the second preset threshold, the to-be-cached data in the cache array is updated to a CAN communication interface. Thus, the present method can enable the caching function by calibration, without affecting the normal running CPU load rate, and is helpful for analyzing the control process and the occasional hardware fault of the whole vehicle, can collect message data on the CAN bus of the whole vehicle, improves the efficiency and accuracy of driving problem analysis, and reduces the use cost.

[0094] It should be noted that the method of the embodiment of the present application can be executed by a single device, such as a computer or a server. The method of the present embodiment can also be applied to a distributed scenario, and completed by multiple devices cooperating with each other. In this distributed scenario, one of the multiple devices can only execute one or more steps in the method of the embodiment of the present application, and the multiple devices can interact with each other to complete the above method.

[0095] It should be noted that some embodiments of the present application have been described above. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps in a claim can be performed in an order other than the order described, and indeed, many of the acts and steps can be performed concurrently or in any order. Additionally, the process depicted in the figures does not necessarily require the particular order shown, or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.

[0096] Corresponding to the above embodiment, the present application further proposes a data caching device of an electric vehicle driving system.

[0097] As Figure 7As shown, the data caching device of the electric vehicle driving system in the embodiment of the application comprises a first response module 710, a second response module 720 and a third response module 730.

[0098] The first response module 710 is configured to, in response to receiving an enabling signal for the caching function, determine whether the starting mode of the caching function is a single trigger mode, in response to the starting mode of the caching function being the single trigger mode, determine whether a preset trigger condition is met, and in response to the preset trigger condition being met, determine to start a data caching counting operation. The second response module 720 is configured to, in response to determining to start the data caching counting operation, initialize a caching array, assign the caching array based on the data to be cached, and start a first caching counter, determine whether a counting value of the first caching counter reaches a first preset counting threshold, in response to the counting value of the first caching counter reaching the first preset counting threshold, determine whether a preset sending condition is met, and in response to the preset sending condition being met, determine to start a caching data sending trigger operation. The third response module 730 is configured to, in response to determining to start the caching data sending trigger operation, start a second caching counter in a PWM period, determine whether a counting value of the second caching counter reaches a second preset counting threshold, and in response to the counting value of the second caching counter reaching the second preset counting threshold, update the data to be cached in the caching array to a CAN communication interface.

[0099] In some embodiments of the application, the third response module 730 is further configured to determine a PWM period and a CAN message sending period, calculate a quotient value of the CAN message sending period and the PWM period, and take the quotient value as the second preset counting threshold.

[0100] In some embodiments of the application, after the counting value of the first caching counter reaches the first preset counting threshold, the second response module 720 is further configured to clear the counting value of the first caching counter.

[0101] In some embodiments of the application, after the data to be cached in the caching array is updated to the CAN communication interface, the third response module 730 is further configured to clear the counting value of the second caching counter and add one to a counting value of a data sending counter.

[0102] In some embodiments of the application, after the counting value of the data sending counter is added by one, the third response module 730 is further configured to determine whether the counting value of the sending counter reaches a third preset counting threshold, and in response to the counting value of the sending counter reaching the third preset counting threshold, initialize the caching array.

[0103] In some embodiments of the present application, the third response module 730 is further configured to keep the enable flag as 1 until the updating of the data to be cached in the cache array to the CAN communication interface is completed; and set the enable flag as 0 after the updating is completed.

[0104] In some embodiments of the present application, the first response module 710 is further configured to, in response to the starting mode of the cache function not being the single trigger mode, determine whether the starting mode of the cache function is the continuous trigger mode; and in response to the starting mode of the cache function being the continuous trigger mode, update the data to be cached in the cache array to the CAN communication interface.

[0105] It should be noted that details of the data cache device of the electric vehicle driving system in the embodiments of the present application that are not disclosed are for reference to the details disclosed in the data cache method of the electric vehicle driving system in the embodiments of the present application, and will not be described in detail.

[0106] In summary, the data cache device of the electric vehicle driving system according to the embodiments of the present application comprises: a first response module configured to, in response to receiving an enable signal for a cache function, determine whether a starting mode of the cache function is a single trigger mode, in response to the starting mode of the cache function being the single trigger mode, determine whether a preset trigger condition is met, and in response to the preset trigger condition being met, determine to start a data cache counting operation; a second response module configured to, in response to determining to start the data cache counting operation, initialize a cache array, assign the cache array based on data to be cached, and start a first cache counter, determine whether a count value of the first cache counter reaches a first preset threshold, in response to the count value of the first cache counter reaching the first preset threshold, determine whether a preset sending condition is met, and in response to the preset sending condition being met, determine to start a cache data sending trigger operation; and a third response module configured to, in response to determining to start the cache data sending trigger operation, start a second cache counter in a PWM period, determine whether a count value of the second cache counter reaches a second preset threshold, and in response to the count value of the second cache counter reaching the second preset threshold, update the data to be cached in the cache array to the CAN communication interface. Thus, the device can enable the cache function through calibration, does not affect the normal running CPU load rate, helps to analyze the control process and the occasional hardware failure of the whole vehicle, can collect message data on the whole vehicle CAN bus, improves the efficiency and accuracy of driving problem analysis, and reduces the use cost.

[0107] For the convenience of description, the above system is described in various modules. Of course, the functions of the modules can be implemented in the same or multiple software and / or hardware when implementing the present application.

[0108] The system of the above-mentioned embodiments is used to implement the corresponding method of any one of the above-mentioned embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described here again.

[0109] Corresponding to the above-mentioned embodiments, the present application also provides an electronic device.

[0110] Reference Figure 8 For a block schematic diagram of an electronic device according to some embodiments of the present application, a more specific hardware structure schematic diagram of an electronic device provided by the present embodiment is shown, which can include a processor 810, a memory 820, an input / output interface 830, a communication interface 840 and a bus 850. Among them, the processor 810, the memory 820, the input / output interface 830 and the communication interface 840 are connected with each other in the internal communication of the device through the bus 850.

[0111] The processor 810 can be implemented in the form of a general-purpose CPU (Central Processing Unit, central processor), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., for executing related programs to implement the technical solutions provided by the present embodiment.

[0112] The memory 820 can be implemented in the form of a ROM (Read Only Memory, read-only memory), a RAM (Random Access Memory, random access memory), a static storage device, a dynamic storage device, etc. The memory 820 can store an operating system and other application programs, and when the technical solutions provided by the present embodiment are implemented by software or firmware, the related program codes are saved in the memory 820 and called and executed by the processor 810.

[0113] The input / output interface 830 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or can be externally connected to the device to provide corresponding functions. Among them, the input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.

[0114] The communication interface 840 is used to connect the communication module (not shown in the figure) to realize the communication interaction between the present device and other devices. Among them, the communication module can realize communication through wired mode (such as USB, network cable, etc.), or can realize communication through wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0115] The bus 850 includes a path for transferring information between the various components (e.g., the processor 810, the memory 820, the input / output interface 830, and the communication interface 840) of the device.

[0116] It should be noted that although the above device only shows the processor 810, the memory 820, the input / output interface 830, the communication interface 840 and the bus 850, in the specific implementation process, the device can also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device can also only contain the components necessary to implement the embodiments of the present specification, and does not necessarily contain all the components shown in the figure.

[0117] The electronic device of the above embodiment is used to implement the corresponding method in any of the preceding embodiments, and has the beneficial effects of the corresponding method embodiments, which are not repeated here.

[0118] Based on the same inventive concept, the present application also provides a computer readable storage medium corresponding to the method of any of the above embodiments, the computer readable storage medium stores computer instructions for causing a computer to execute the method of any of the above embodiments.

[0119] The above computer readable storage medium can be any available medium or data storage device accessible by a computer, including but not limited to magnetic storage (such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO) and the like), optical storage (such as CD, DVD, BD, HVD and the like), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state disk (SSD)) and the like.

[0120] The computer instructions stored in the storage medium of the above embodiment are used to cause a computer to execute the method of any of the above exemplary method embodiments, and have the beneficial effects of the corresponding method embodiments, which are not repeated here.

[0121] In addition, although the operations of the method of the present application are described in a specific order in the accompanying drawings, this does not require or imply that the operations must be performed in that specific order, or that all of the shown operations must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart can change the order of execution. Additionally or alternatively, some steps can be omitted, a plurality of steps can be combined into one step, and / or one step can be divided into a plurality of steps.

[0122] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof, as desired. In the embodiments described above, various steps or methods can be implemented, in software or firmware which are stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following technologies, known in the art, or combinations thereof, can be employed: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and so forth.

[0123] It should be noted that, unless otherwise defined, technical and scientific terms used in the present application shall have the meanings that are commonly understood by one of ordinary skill in the art to which this application pertains. The terms "first", "second", and similar terms used in the present application do not imply any order, quantity, or importance, but are used to distinguish one element from another, and "include" or "comprise" and similar terms are intended to encompass the elements listed thereafter and their equivalents, without excluding other elements. The terms "connected" or "coupled" and similar terms are not limited to physical or mechanical connections or couplings, but can include electrical connections or couplings, whether direct or indirect. The terms "upper", "lower", "left", "right", and the like are used only to indicate relative positions, and when the absolute positions of the described objects are changed, the relative positional relationship can also be changed accordingly.

[0124] While the principles and spirit of the application have been described with reference to several specific embodiments, it is to be understood that the application is not limited to the specific embodiments disclosed, and that the division of aspects is not meant to imply that features from these aspects cannot be combined to benefit, but is merely for ease of presentation. The application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims is to be construed in the broadest sense, encompassing all such modifications and equivalent structures and functions.

Claims

1. A data caching method for an electric vehicle drive system, characterized by, The method comprises: in response to receiving an enabling signal for the cache function, determining whether the start mode of the cache function is a single trigger mode, in response to the start mode of the cache function being the single trigger mode, determining whether a preset trigger condition is met, in response to the preset trigger condition being met, determining to start a data cache counting operation; in response to determining to start the data cache counting operation, initializing a cache array, assigning the cache array based on to-be-cached data, and starting a first cache counter, determining whether a count value of the first cache counter reaches a first preset threshold, in response to the count value of the first cache counter reaching the first preset threshold, determining whether a preset sending condition is met, in response to the preset sending condition being met, determining to start a cache data sending trigger operation; in response to determining to start the cache data sending trigger operation, starting a second cache counter in a PWM period, determining whether a count value of the second cache counter reaches a second preset threshold, and in response to the count value of the second cache counter reaching the second preset threshold, updating the to-be-cached data in the cache array to a CAN communication interface.

2. The data caching method of an electric vehicle drive system according to claim 1, wherein, The method further comprises: determining a PWM period and a CAN message sending period, calculating a quotient value of the CAN message sending period and the PWM period, and taking the quotient value as the second preset threshold.

3. The data caching method of an electric vehicle drive system according to claim 2, wherein, After the response to the count value of the first cache counter reaching the first preset threshold, the method further comprises: clearing the count value of the first cache counter.

4. The data caching method of an electric vehicle drive system according to claim 1, wherein, After the updating of the to-be-cached data in the cache array to the CAN communication interface, the method further comprises: clearing the count value of the second cache counter and adding one to a count value of a data sending counter.

5. The data caching method of an electric vehicle drive system according to claim 4, wherein, After the adding of one to the count value of the data sending counter, the method further comprises: determining whether the count value of the sending counter reaches a third preset threshold, and in response to the count value of the sending counter reaching the third preset threshold, initializing the cache array.

6. The data caching method of an electric vehicle drive system according to claim 1, wherein, The method further comprises: keeping the sending enabling flag as 1 before the updating of the to-be-cached data in the cache array to the CAN communication interface is completed, and setting the sending enabling flag as 0 after the updating is completed.

7. The data caching method of an electric vehicle drive system according to claim 1, wherein, The method further comprises: in response to the start mode of the cache function not being the single trigger mode, determining whether the start mode of the cache function is a continuous trigger mode; in response to the start mode of the cache function being the continuous trigger mode, updating the to-be-cached data in the cache array to the CAN communication interface.

8. A data caching apparatus for an electric vehicle drive system, characterized by comprising: The method comprises: a first response module configured to, in response to receiving an enabling signal for the cache function, determine whether the start mode of the cache function is a single trigger mode, in response to the start mode of the cache function being the single trigger mode, determine whether a preset trigger condition is met, and in response to the preset trigger condition being met, determine to start a data cache counting operation; a second response module configured to, in response to determining to start the data cache counting operation, initialize a cache array, assign the cache array based on to-be-cached data, and start a first cache counter, determine whether a count value of the first cache counter reaches a first preset threshold, in response to the count value of the first cache counter reaching the first preset threshold, determine whether a preset sending condition is met, and in response to the preset sending condition being met, determine to start a cache data sending trigger operation; The second response module is configured to initialize the cache array, assign the cache array based on the data to be cached, and start the first cache counter in response to determining to start the data cache counting operation. It is determined whether the count value of the first cache counter reaches a first preset threshold. In response to the count value of the first cache counter reaching the first preset threshold, it is determined whether a preset sending condition is met. In response to the preset sending condition being met, a cache data sending trigger operation is started. The third response module is configured to start the second cache counter in a PWM cycle in response to determining to start the cache data sending trigger operation. It is determined whether the count value of the second cache counter reaches a second preset threshold. In response to the count value of the second cache counter reaching the second preset threshold, the data to be cached in the cache array is updated to the CAN communication interface.

9. An electronic device, comprising: The application further provides a data cache method of an electric vehicle driving system, comprising the following steps: A processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the data cache method of the electric vehicle driving system according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to implement the steps of the data cache method of the electric vehicle driving system according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Control method and control device of cache resource of shared cache type Ethernet switch

    CN103023806A

  • Remote log data sending method and device, equipment and storage medium

    CN117614945A

  • BMS (Battery Management System) communication abnormity judgment and data reorganization method, BMS system and storage medium

    CN119676064A

  • Sensor data caching method, device and system, storage medium and product

    CN119807126A

  • Driving system control method and device, electronic equipment, chip and vehicle

    CN120049785A