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

CN121166566BActive Publication Date: 2026-10-16BEIJING HAINACHUAN AUTOMOTIVE PARTS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511013413.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2026-10-16
Estimated Expiration
2045-07-22

AI Technical Summary

Technical Problem

然而,此协议的通讯带宽有限,当通讯周期很快时,能发送的数据信号就很有限,对于分析数据带来很大的困难

Benefits of technology

[0022] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium on which a program or instructions are stored, and when the program or instructions are executed by a processor, the steps of the above-described data caching method for an electric vehicle drive system are implemented.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121166566B_ABST
    Figure CN121166566B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data processing, and discloses a data caching method and device of an electric vehicle driving system and a storage medium, wherein the method comprises the following steps: in response to determining to start a 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 the counting value of the first caching counter reaches a first preset counting threshold value; in response to the counting value of the first caching counter reaching the first preset counting threshold value, 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 cycle; determining whether the counting value of the second caching counter reaches a second preset counting threshold value; and in response to the counting value of the second caching counter reaching the second preset counting threshold value, updating the to-be-cached data in the caching array to a CAN communication interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a data caching method for an electric vehicle drive system, a data caching device for an electric vehicle drive system, an electronic device, and a computer-readable storage medium. Background Technology

[0002] Electric vehicles have become the future direction of the current automotive industry. The power source of electric vehicles is the drive motor. The main drive motor will be a permanent magnet synchronous motor, and there are two choices for the auxiliary drive motor: a permanent magnet synchronous motor and 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 turn off the tube to enter the safe state, without needing to enter the three-phase short circuit state.

[0003] In related technologies, the drive system can use XCP (Universal Measurement and Calibration Protocol) for data calibration and measurement. This protocol can achieve a cycle time of 1ms, or even the update rate of PWM (Pulse Width Modulation) cycles. However, this protocol has limited communication bandwidth; when the communication cycle is very fast, the amount of data signal that can be sent is very limited, which brings great difficulties to data analysis. Alternatively, a special MCU (Microcontroller Unit) chip can be used with special hardware. This special MCU chip can achieve a data update rate in the microsecond range, but this not only significantly increases the cost but is also limited by the amount of data. Summary of the Invention

[0004] This invention aims to at least partially solve one of the technical problems in related technologies. Therefore, the first objective of this invention is to propose a data caching method for an electric vehicle drive system. This method enables the caching function through calibrated values, without affecting the CPU load rate during normal operation. It facilitates the analysis of the control process and occasional hardware faults in the vehicle, allows the acquisition of message data on the vehicle's CAN bus, improves the efficiency and accuracy of drive problem analysis, and reduces usage costs.

[0005] The second objective of this invention is to provide a data caching device for an electric vehicle drive system.

[0006] The third objective of this invention is to provide an electronic device.

[0007] The fourth objective of this invention is to provide a computer-readable storage medium.

[0008] To achieve the above objectives, a first aspect of the present invention provides a data caching method for an electric vehicle drive system, comprising: in response to receiving an enable signal for a caching function, determining whether the activation mode of the caching function is a single-trigger mode; in response to the activation mode of the caching function being a single-trigger mode, determining whether a preset trigger condition is met; in response to meeting the preset trigger condition, determining to initiate a data caching counting operation; in response to determining to initiate a data caching counting operation, initializing a cache array, assigning a value to the cache array based on the data to be cached, and activating a first cache counter; determining whether the count value of the first cache counter reaches a first preset counting threshold; in response to the count value of the first cache counter reaching the first preset counting threshold, determining whether a preset transmission condition is met; in response to meeting the preset transmission condition, determining to initiate a cache data transmission trigger operation; in response to determining to initiate a cache data transmission trigger operation, activating a second cache counter within a PWM cycle; determining whether the count value of the second cache counter reaches a second preset counting threshold; in response to the count value of the second cache counter reaching the second preset counting threshold, updating the data to be cached in the cache array to the CAN (Controller Area Network) communication interface.

[0009] In addition, the data caching method for the electric vehicle drive system according to the above embodiments of the present invention may also have the following additional technical features:

[0010] According to some embodiments of the present invention, the above method further includes: determining the PWM period and the CAN message transmission period, calculating the quotient of the CAN message transmission period and the PWM period, and using the quotient as a second preset counting threshold.

[0011] According to some embodiments of the present invention, after the count value of the first cache counter reaches a first preset count threshold, the above method further includes: clearing the count value of the first cache counter to zero.

[0012] According to some embodiments of the present invention, after updating the data to be cached in the cache array to the CAN communication interface, the above method further includes: clearing the count value of the second cache counter to zero and incrementing the count value of the data transmission counter by one.

[0013] According to some embodiments of the present invention, after incrementing the count value of the data transmission counter, the above method further includes: determining whether the count value of the transmission counter has reached a third preset counting threshold, and initializing the buffer array in response to the count value of the transmission counter reaching the third preset counting threshold.

[0014] According to some embodiments of the present invention, the above method further includes: keeping the transmit enable flag at 1 before updating the data to be cached in the cache array to the CAN communication interface; and setting the transmit enable flag to 0 after the transmission is completed.

[0015] According to some embodiments of the present invention, the above method further includes: in response to the cache function's startup mode not being a single-trigger mode, determining whether the cache function's startup mode is a continuous-trigger mode; and in response to the cache function's startup mode being a continuous-trigger mode, updating the data to be cached in the cache array to the CAN communication interface.

[0016] A data caching method for an electric vehicle drive system according to an embodiment of the present invention includes: in response to receiving an enable signal for a caching function, determining whether the activation mode of the caching function is a single-trigger mode; in response to the activation mode of the caching function being a single-trigger mode, determining whether a preset trigger condition is met; in response to meeting the preset trigger condition, determining to initiate a data caching counting operation; in response to determining to initiate a data caching counting operation, initializing a cache array, assigning values ​​to the cache array based on the data to be cached, and starting a first cache counter; determining whether the count value of the first cache counter reaches a first preset counting threshold; in response to the count value of the first cache counter reaching the first preset counting threshold, determining whether a preset transmission condition is met; in response to meeting the preset transmission condition, determining to initiate a cache data transmission trigger operation; in response to determining to initiate a cache data transmission trigger operation, starting a second cache counter within a PWM cycle; determining whether the count value of the second cache counter reaches a second preset counting threshold; in response to the count value of the second cache counter reaching the second preset counting threshold, updating the data to be cached in the cache array to the CAN communication interface. Therefore, this method enables the caching function through calibrated values ​​without affecting the CPU load rate during normal operation. It helps in analyzing the control process and occasional hardware faults in the vehicle. It can collect message data on the vehicle's CAN bus, improving the efficiency and accuracy of drive problem analysis and reducing usage costs.

[0017] The second objective of this invention is to propose a data caching device for an electric vehicle drive system. This device enables the caching function through a calibrated value, without affecting the CPU load rate during normal operation. It helps in analyzing the control process and occasional hardware faults in the vehicle. It can collect message data on the vehicle's CAN bus, improving the efficiency and accuracy of drive problem analysis and reducing usage costs.

[0018] To achieve the above objectives, a second aspect of the present invention provides a data caching device for an electric vehicle drive system, comprising: a first response module configured to, in response to receiving an enable signal for a caching function, determine whether the activation mode of the caching function is a single-trigger mode; in response to the activation mode of the caching function being a single-trigger mode, determine whether a preset trigger condition is met; and in response to meeting the preset trigger condition, determine to initiate a data caching counting operation; a second response module configured to, in response to determining to initiate a data caching counting operation, initialize a cache array, assign values ​​to the cache array based on the data to be cached, and start a first cache counter; determine whether the count value of the first cache counter reaches a first preset counting threshold; in response to the count value of the first cache counter reaching the first preset counting threshold, determine whether a preset transmission condition is met; and in response to meeting the preset transmission condition, determine to initiate a cache data transmission trigger operation; and a third response module configured to, in response to determining to initiate a cache data transmission trigger operation, start a second cache counter within a PWM cycle; determine whether the count value of the second cache counter reaches a second preset counting threshold; and in response to the count value of the second cache counter reaching the second preset counting threshold, update the data to be cached in the cache array to the CAN communication interface.

[0019] According to an embodiment of the present invention, a data caching device for an electric vehicle drive system includes: a first response module configured to, in response to receiving an enable signal for a caching function, determine whether the activation mode of the caching function is a single-trigger mode; in response to the activation mode of the caching function being a single-trigger mode, determine whether a preset trigger condition is met; and in response to meeting the preset trigger condition, determine to initiate a data caching counting operation; a second response module configured to, in response to determining to initiate a data caching counting operation, initialize a cache array, assign values ​​to the cache array based on data to be cached, and start a first cache counter; determine whether the count value of the first cache counter reaches a first preset counting threshold; in response to the count value of the first cache counter reaching the first preset counting threshold, determine whether a preset transmission condition is met; and in response to meeting the preset transmission condition, determine to initiate a cache data transmission trigger operation; and a third response module configured to, in response to determining to initiate a cache data transmission trigger operation, start a second cache counter within a PWM cycle; determine whether the count value of the second cache counter reaches a second preset counting threshold; and in response to the count value of the second cache counter reaching the second preset counting threshold, update the data to be cached in the cache array to the CAN communication interface. Therefore, this device enables the caching function through a calibrated value, without affecting the CPU load rate during normal operation. This helps in analyzing the control process and occasional hardware faults in the vehicle. It can collect message data on the vehicle's CAN bus, improving the efficiency and accuracy of drive problem analysis and reducing usage costs.

[0020] To achieve the above objectives, a third aspect of the present invention provides an electronic device, comprising: a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the data caching method of the electric vehicle drive system described above.

[0021] According to the embodiments of the present invention, by executing the above-described data caching method for electric vehicle drive systems, the electronic device can enable the caching function through a calibrated quantity, without affecting the CPU load rate during normal operation. This helps in the analysis of the control process and occasional hardware failures in the vehicle. Message data can be collected on the vehicle's CAN bus, improving the efficiency and accuracy of drive problem analysis and reducing usage costs.

[0022] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium on which a program or instructions are stored, and when the program or instructions are executed by a processor, the steps of the above-described data caching method for an electric vehicle drive system are implemented.

[0023] According to the computer-readable storage medium of the present invention, by executing the above-described data caching method for an electric vehicle drive system, the caching function can be enabled by a calibrated quantity without affecting the CPU load rate during normal operation. This helps in the analysis of the control process and occasional hardware faults in the vehicle. Message data can be collected on the vehicle's CAN bus, improving the efficiency and accuracy of drive problem analysis and reducing usage costs.

[0024] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0025] Figure 1 A flowchart illustrating a data caching method for an electric vehicle drive system according to some embodiments of the present invention;

[0026] Figure 2 This is a schematic diagram illustrating the selection of buffered signal variables according to some embodiments of the present invention;

[0027] Figure 3 This is a flowchart of a data caching process according to some embodiments of the present invention;

[0028] Figure 4 This is a flowchart of a cache counting process according to some embodiments of the present invention;

[0029] Figure 5 This is a flowchart of a cached data sending process according to some embodiments of the present invention;

[0030] Figure 6A flowchart illustrating the triggering of cached data transmission according to some embodiments of the present invention;

[0031] Figure 7 This is a schematic diagram of a data caching device for an electric vehicle drive system according to some embodiments of the present invention;

[0032] Figure 8 This is a block diagram of an electronic device according to some embodiments of the present invention. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings.

[0034] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this invention should have the ordinary meaning understood by those skilled in the art. The terms "first," "second," and similar terms used in the embodiments of this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0035] As mentioned in the background section, electric vehicles have become the future direction of the current automotive industry. The power source of electric vehicles is the drive motor. The main drive motor will be a permanent magnet synchronous motor, and the auxiliary drive motor will have two choices: a permanent magnet synchronous motor or 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 turn off the tube to enter the safe state, and does not need to enter the three-phase short circuit state.

[0036] The main hardware faults that trigger the shut-off protection of the asynchronous motor controller system are overvoltage faults, overcurrent faults, and drive faults. Some of these faults are short-term triggered and short-term recovered faults, i.e., transient faults. Transient faults may be caused by electromagnetic interference, or they may be real faults that disappear quickly. In addition to transient faults, there may also be permanent faults.

[0037] Hardware faults are mostly triggered intermittently or momentarily. Although they are easily detected by the hardware, their maturation time is very short, on the order of microseconds (µs). CAN communication messages, however, have transmission cycles on the order of milliseconds (ms) or even tens of milliseconds. Therefore, using normal CAN data messages from the driver system to analyze the cause of a fault and the data changes prior to the fault becomes very inaccurate, and may even fail to capture the data changes. Furthermore, some hardware faults disappear after a short trigger, especially in driver systems with fast recovery capabilities. In such cases, the fault is briefly triggered but quickly cleared by the driver system, making it impossible to discern the time and process of the fault in the driver system's CAN messages, or even confirm whether the fault ever occurred. This poses a significant challenge to the safety and lifespan of the entire driver system.

[0038] In the process of developing this invention, the applicant discovered that in related technologies, the drive system can use XCP for data calibration and measurement. This protocol can achieve a cycle time of 1ms, or even reach the update rate of the PWM cycle. However, the communication bandwidth of this protocol is limited. When the communication cycle is very fast, the amount of data signal that can be sent is very limited, which brings great difficulties to data analysis. Similarly, special MCU chips can be used with special hardware. Special MCU chips can achieve data update rates at the microsecond level, but this not only significantly increases the cost, but is also limited by the amount of data.

[0039] Therefore, this invention enables the caching function to be enabled by a calibrated value without affecting the CPU load rate during normal operation. This helps in the analysis of the control process and occasional hardware failures in the vehicle. It can collect message data on the vehicle's CAN bus, improving the efficiency and accuracy of drive problem analysis and reducing usage costs.

[0040] The following description, with reference to the accompanying drawings, outlines an embodiment of the present invention for a data caching method, a data caching device, an electronic device, and a computer-readable storage medium for an electric vehicle drive system.

[0041] refer to Figure 1 This is a flowchart of a data caching method for an electric vehicle drive system according to some embodiments of the present invention.

[0042] In some embodiments, reference Figure 2 The diagram illustrates the selection of buffered signal variables according to some embodiments of the present invention. First, the relevant signals are numbered to cover as many diagnostic and control processes as possible. Then, the observed signals are selected by setting the numbers of the index signal variables. If k signals need to be observed, k index signal variables, k buffered signal interface variables, and k buffered array signals need to be established.

[0043] like Figure 1 As shown, the data caching method for an electric vehicle drive system according to an embodiment of the present invention may include the following steps:

[0044] S101, in response to receiving an enable signal for the cache function, determine whether the startup mode of the cache function is a single-trigger mode; in response to the startup mode of the cache function being a single-trigger mode, determine whether a preset trigger condition is met; in response to meeting the preset trigger condition, determine to start the data cache counting operation.

[0045] Specifically, since the data buffer operates within the PWM cycle, it increases the load rate and requires an enable signal to activate during normal operation. Therefore, it's necessary to determine if the electric vehicle drive system receives an enable signal for the buffer function. The buffer function is disabled by default. Receiving an enable signal indicates that the buffer function is activated. Then, it's determined whether the buffer function's activation mode is single-trigger mode. Since single-trigger mode is suitable for use during faults, data transmission is only activated when specific fault trigger conditions are met. Therefore, it's also necessary to determine if the single-trigger mode meets preset trigger conditions. If it does, the single-trigger mode is activated, and the data buffer counting operation begins. That is, when the electric vehicle drive system receives the enable signal for the buffer function, the buffer array begins updating values ​​in the PWM interrupt while simultaneously incrementing the count. If it's single-trigger mode, the buffer will continue to be buffered until the preset trigger conditions are met, at which point all values ​​in the current array are sent to the CAN message.

[0046] If the preset trigger conditions are not met in the single-trigger mode, the caching function will continue to cache until the preset trigger conditions are met in the single-trigger mode. The caching function will not operate if the electric vehicle drive system does not receive an enable signal for the caching function.

[0047] In some embodiments of the present invention, the method further includes: in response to the cache function's startup mode not being a single-trigger mode, determining whether the cache function's startup mode is a continuous-trigger mode; and in response to the cache function's startup mode being a continuous-trigger mode, updating the data to be cached in the cache array to the CAN communication interface.

[0048] Specifically, when the buffering function's startup mode is not a single-trigger mode, it is determined whether the buffering function's startup mode is a continuous-trigger mode. If the buffering function's startup mode is a continuous-trigger mode, which is suitable for observing and analyzing anomalies in control signals, such as resolver signals, then the continuous-trigger mode does not require a trigger condition. In this case, the data to be buffered in the buffer array is updated to the CAN communication interface, and after buffering is complete, the buffered data can be sent to the CAN message.

[0049] As a concrete example, such as Figure 3 As shown, the data caching process of the present invention may include the following steps:

[0050] S301, determine whether the electric vehicle drive system has received an enable signal for the buffer function. If yes, proceed to step S302; if no, end the process.

[0051] S302, Start data caching.

[0052] S303, Determine whether the caching function's startup mode is single-trigger mode. If yes, proceed to step S304; otherwise, proceed to step S306.

[0053] S304, determine whether the single-trigger mode meets the preset trigger conditions. If yes, proceed to step S305; otherwise, return to step S303.

[0054] S305, enable single-trigger mode and start data cache counting operation.

[0055] S306 updates the data to be cached in the cache array to the CAN communication interface. After caching is complete, the cached data can be sent to the CAN message.

[0056] S102, in response to determining to start the data cache counting operation, initialize the cache array, assign values ​​to the cache array based on the data to be cached, and start the first cache counter. Determine whether the count value of the first cache counter reaches the first preset counting threshold. In response to the count value of the first cache counter reaching the first preset counting threshold, determine whether the preset sending condition is met. In response to meeting the preset sending condition, determine to start the cached data sending trigger operation. The first preset counting threshold can be calibrated according to the actual situation.

[0057] Specifically, when determining to initiate the data cache counting operation, the cached data must first be initialized. The size of the cache array can be determined based on the main control chip's memory size or the analysis needs. Where permissible, the more cached data, the more beneficial it is for problem analysis. Then, values ​​are assigned to the cache array based on the data to be cached, and a first cache counter is started. The count value of the first cache counter is compared with a first preset counting threshold to determine if the count value has reached the first preset counting threshold. If the count value reaches the first preset counting threshold, it is determined whether a preset sending condition is met. If the preset sending condition is met, data transmission is initiated. If the preset sending condition is not met, values ​​are continued to be assigned to the cache array, and the cache count continues. This can also be understood as preparing a "small warehouse" (cache array) for the data during data caching. The size of this "small warehouse" can be determined based on the vehicle's main control chip's memory size. Generally, the larger the "small warehouse," the more data it can store, which is more helpful for problem analysis. Before starting data caching, the "small warehouse" must be cleaned up, i.e., initialized. When the caching conditions are met, data begins to be stored in the "small warehouse." When storing data, a counter is used to record how much has been stored. When the counter is full, it resets to zero. If the conditions for sending data are met at this point, data is sent; otherwise, data continues to be stored in the "small warehouse," with the newly stored data overwriting the previously stored data.

[0058] In some embodiments of the present invention, after the count value of the first cache counter reaches a first preset count threshold, the above method further includes: clearing the count value of the first cache counter to zero.

[0059] Specifically, after the count value of the first cache counter reaches the first preset count threshold, it can be indicated that the first cache counter can no longer count. The count value of the first cache counter is then cleared to zero so that the first cache counter can continue counting. Then, it is determined whether the preset sending conditions are met. If the preset sending conditions are met, the cache data sending trigger operation is initiated.

[0060] As a concrete example, such as Figure 4 As shown, the cache counting process of the present invention may include the following steps:

[0061] S401, Start the data cache counting operation, initialize the cache array, assign values ​​to the cache array based on the data to be cached, and start the first cache counter.

[0062] S402, determine whether the count value of the first cache counter has reached the first preset counting threshold. If yes, proceed to step S403; if no, return to step S401.

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

[0064] S404, determine whether the preset sending conditions are met. If yes, proceed to step S405; otherwise, return to step S401.

[0065] S405, trigger operation to send cached data.

[0066] S103, in response to determining the start of the buffer data transmission trigger operation, the second buffer counter is turned on within the PWM cycle, and it is determined whether the count value of the second buffer counter reaches the second preset count threshold. In response to the second buffer counter reaching the second preset count threshold, the data to be buffered in the buffer array is updated to the CAN communication interface. The second preset count threshold can be calibrated according to the actual situation.

[0067] Specifically, when the start-up of the cached data transmission trigger operation is determined, a second cache counter is activated within the PWM cycle. This allows the second cache counter to begin counting within the PWM cycle. The count value of the second cache counter is compared with a second preset counting threshold. If the count value reaches the second preset threshold, the corresponding cache array value is assigned to the CAN communication interface, updating the data to be cached in the cache array to the CAN communication interface. Simultaneously, the transmission count is incremented, corresponding to the array sequence number for the next transmission. If the transmission count reaches its upper limit, the cache array is reinitialized to prepare for the next caching operation. Otherwise, the time counting within the PWM cycle restarts, periodically updating the CAN communication interface until all data in the cache array has been transmitted. This allows the caching function to be enabled through a calibrated value, without affecting the CPU load rate during normal operation. This facilitates the analysis of the control process and occasional hardware faults in the vehicle. Message data can be collected on the vehicle's CAN bus, improving the efficiency and accuracy of drive problem analysis and reducing usage costs.

[0068] Therefore, the maturity time of hardware faults in electric vehicle drive systems is very short, while the fastest runtime of drive system software is typically a PWM interrupt, usually on the order of microseconds. Thus, PWM interrupts are used to record data. However, the CAN message cycle of an electric vehicle drive system is on the order of milliseconds, requiring data to be cached before being sent out according to the normal CAN message cycle. The amount of data to be cached varies depending on the fault analysis, so each observed signal needs to be numbered based on experience or when semaphore is limited. Each cached signal is calibrated using a calibrated index, eliminating the need to update the software for different faults.

[0069] In some embodiments of the present invention, the above method further includes: determining the PWM period and the CAN message transmission period, calculating the quotient of the CAN message transmission period and the PWM period, and using the quotient as a second preset counting threshold.

[0070] Specifically, since the data in the CAN message transmission cycle is at the millisecond level, while the buffered data transmission function is implemented within the PWM cycle, it is necessary to calculate the count value required for the transmission interval of the PWM cycle based on the PWM cycle and the CAN message transmission cycle, i.e., to calculate the second preset counting threshold. Assuming the PWM cycle is T... pwm The CAN message transmission period is T. CAN The second preset counting threshold, Count, is calculated as follows:

[0071]

[0072] This can also be understood as follows: because CAN data transmission is slow, while buffered data is processed within the fast PWM cycle, it's necessary to calculate the optimal data transmission frequency. To illustrate, the PWM cycle is like the time it takes for the second hand to complete one tick, and the CAN message transmission cycle is like the time it takes for the minute hand to complete one tick. This can be achieved using the formula... This is used to calculate how many counts are needed within a PWM cycle before sending data once.

[0073] In some embodiments of the present invention, after updating the data to be cached in the cache array to the CAN communication interface, the above method further includes: clearing the count value of the second cache counter to zero and incrementing the count value of the data transmission counter by one.

[0074] Specifically, after updating the data to be cached in the cache array to the CAN communication interface, the second cache counter can no longer count. The count value of the second cache counter is then cleared to allow it to continue counting. Then, the data transmission counter is incremented. This can also be understood as counting during the PWM cycle while simultaneously checking if the count value of the second cache counter equals the calculated second preset counting threshold. If it does, the corresponding data in the cache array is updated to the CAN communication interface between the vehicle and the outside world. Then, the count value of the second cache counter is cleared, and the data transmission counter is incremented.

[0075] In some embodiments of the present invention, after incrementing the data transmission counter, the method further includes: determining whether the transmission counter's count value has reached a third preset counting threshold; and initializing the buffer array in response to the transmission counter's count value reaching the third preset counting threshold. The third preset counting threshold can be calibrated according to actual conditions.

[0076] Specifically, after incrementing the data transmission counter, the counter value is compared with a third preset threshold to determine if it has reached the threshold. If the counter value reaches the threshold (i.e., when it reaches the buffer limit), the buffer array is initialized. In other words, when the counter value reaches the maximum number of data items the buffer array can hold (the buffer limit), the buffer array is cleared; otherwise, the PWM time counting restarts, and the transmission process continues until all data in the buffer array has been transmitted.

[0077] As a concrete example, such as Figure 5 As shown, the cached data sending process of the present invention may include the following steps:

[0078] S501 initiates the buffer data transmission trigger operation, enabling the second buffer counter within the PWM cycle.

[0079] S502, determine whether the count value of the second cache counter has reached the second preset counting threshold. If yes, proceed to step S503; if no, return to step S501.

[0080] S503 updates the data to be cached in the cache array to the CAN communication interface, clears the count value of the second cache counter to zero, and increments the count value of the data transmission counter by one.

[0081] S504, determine whether the count value of the transmission counter has reached the third preset counting threshold. If yes, proceed to step S505; if no, return to step S501.

[0082] S505 initializes the cache array.

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

[0084] Specifically, before updating the cached data in the buffer array to the CAN communication interface, the default state for buffered data transmission is disabled. When the data transmission trigger condition is met, the buffered data transmission enable flag is set to 1, and the buffered data transmission function is enabled. The transmission enable flag remains at 1 until the buffered data transmission is complete. After the buffered data transmission is complete, the buffered data transmission enable flag is set to 0 to wait for the next data transmission trigger condition to be met. In the case of continuous triggering, the transmission enable flag will continue to be set to 1 in the next PWM cycle; in the case of single triggering, the data buffer is maintained until the next trigger condition is met, at which point the transmission enable flag is set to 1, enabling the transmission of the next buffered data. In other words, by default, buffered data transmission is disabled, like a closed "door." Only when the transmission condition is met (such as when the buffer is full) will this "door" be opened, that is, the transmission enable flag is set to 1, and the transmission of buffered data begins. Before the data transmission is complete, this "gate" remains open, and the transmit enable flag is kept at 1; once the data transmission is complete, the "gate" is closed, and the transmit enable flag is set to 0. In the case of continuous triggering, this "gate" will automatically open again in the next PWM cycle; in the case of single triggering, the data will be stored until the triggering condition is met again, at which point the "gate" will open again, and the next data transmission will begin.

[0085] As a concrete example, such as Figure 6 As shown, the cached data sending trigger of the present invention may include the following steps:

[0086] S601, the status of buffered data transmission is prohibited.

[0087] S602, determine whether the data transmission trigger condition is met. If yes, proceed to step S603; otherwise, return to step S601.

[0088] S603, the transmit enable flag remains at 1.

[0089] S604, determine whether the buffered data has been sent completely. If yes, proceed to step S605; otherwise, return to step S603.

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

[0091] Therefore, the control process or hardware fault triggering process of the electric vehicle drive system occurs within a very short time. Relevant signals can be cached and recorded in the PWM cycle for analysis. After caching is complete and the conditions are met, the data is sent to the bus via normal CAN messages. The selection of relevant signals is done through calibrated values, without the need to update the program. The transmission of cached data can be triggered once, such as by a fault, or continuously. After transmission is complete, the cached data is initialized and caching restarts until the next transmission condition is triggered. The default caching function is disabled and does not affect the normal CPU load rate. By caching process data, the efficiency and accuracy of fault and control process analysis are improved.

[0092] The data caching method for the electric vehicle drive system of this invention is implemented in software, requiring no additional hardware costs. The caching function is enabled by a calibrated value and is disabled by default, without affecting the CPU load rate during normal operation. The cached signal variables are selected by a calibrated value, eliminating the need for multiple program updates. The caching function can be triggered once or continuously. The cached data recording cycle is a PWM interrupt, which is the fastest operating cycle of the drive system, aiding in the analysis of the control process and occasional hardware faults in the vehicle. At the end of the caching, the data can be sent to the CAN bus through a normal message cycle, allowing message data to be collected on the vehicle's CAN bus, improving the efficiency and accuracy of drive problem analysis.

[0093] In summary, the data caching method for an electric vehicle drive system according to an embodiment of the present invention includes: in response to receiving an enable signal for the caching function, determining whether the activation mode of the caching function is a single-trigger mode; in response to the activation mode of the caching function being a single-trigger mode, determining whether a preset trigger condition is met; in response to meeting the preset trigger condition, determining to initiate a data caching counting operation; in response to determining to initiate the data caching counting operation, initializing a cache array, assigning a value to the cache array based on the data to be cached, and starting a first cache counter; determining whether the count value of the first cache counter reaches a first preset counting threshold; in response to the count value of the first cache counter reaching the first preset counting threshold, determining whether a preset transmission condition is met; in response to meeting the preset transmission condition, determining to initiate a cache data transmission trigger operation; in response to determining to initiate the cache data transmission trigger operation, starting a second cache counter within a PWM cycle; determining whether the count value of the second cache counter reaches a second preset counting threshold; in response to the count value of the second cache counter reaching the second preset counting threshold, updating the data to be cached in the cache array to the CAN communication interface. Therefore, this method enables the caching function through calibrated values ​​without affecting the CPU load rate during normal operation. It helps in analyzing the control process and occasional hardware faults in the vehicle. It can collect message data on the vehicle's CAN bus, improving the efficiency and accuracy of drive problem analysis and reducing usage costs.

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

[0095] It should be noted that the above description describes some embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0096] Corresponding to the above embodiments, the present invention also proposes a data caching device for an electric vehicle drive system.

[0097] like Figure 7As shown, the data caching device of the electric vehicle drive system in this embodiment of the invention includes: 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 enable signal for the buffer function, determine whether the buffer function's startup mode is a single-trigger mode; if the buffer function's startup mode is a single-trigger mode, determine whether a preset trigger condition is met; and if the preset trigger condition is met, determine to initiate a data buffer counting operation. The second response module 720 is configured to, in response to determining to initiate a data buffer counting operation, initialize a buffer array, assign values ​​to the buffer array based on the data to be buffered, and start a first buffer counter; determine whether the count value of the first buffer counter reaches a first preset counting threshold; if the count value of the first buffer counter reaches the first preset counting threshold, determine whether a preset transmission condition is met; and if the preset transmission condition is met, determine to initiate a buffer data transmission trigger operation. The third response module 730 is configured to, in response to determining to initiate a buffer data transmission trigger operation, start a second buffer counter within a PWM cycle; determine whether the count value of the second buffer counter reaches a second preset counting threshold; and if the count value of the second buffer counter reaches the second preset counting threshold, update the data to be buffered in the buffer array to the CAN communication interface.

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

[0100] In some embodiments of the present invention, after the count value of the first cache counter reaches the first preset count threshold, the second response module 720 is further configured to clear the count value of the first cache counter to zero.

[0101] In some embodiments of the present invention, after updating the data to be cached in the cache array to the CAN communication interface, the third response module 730 is further configured to clear the count value of the second cache counter to zero and increment the count value of the data transmission counter by one.

[0102] In some embodiments of the present invention, after incrementing the count value of the data transmission counter, the third response module 730 is further configured to determine whether the count value of the transmission counter has reached a third preset counting threshold, and initialize the buffer array in response to the count value of the transmission counter reaching the third preset counting threshold.

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

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

[0105] It should be noted that for details not disclosed in the data caching device of the electric vehicle drive system in this embodiment of the invention, please refer to the details disclosed in the data caching method of the electric vehicle drive system in this embodiment of the invention, which will not be repeated here.

[0106] In summary, the data caching device for an electric vehicle drive system according to an embodiment of the present invention includes: a first response module configured to, in response to receiving an enable signal for the caching function, determine whether the activation mode of the caching function is a single-trigger mode; in response to the activation mode of the caching function being a single-trigger mode, determine whether a preset trigger condition is met; and in response to meeting the preset trigger condition, determine to initiate a data caching counting operation; a second response module configured to, in response to determining to initiate the data caching counting operation, initialize a cache array, assign values ​​to the cache array based on the data to be cached, and start a first cache counter; determine whether the count value of the first cache counter reaches a first preset counting threshold; in response to the count value of the first cache counter reaching the first preset counting threshold, determine whether a preset transmission condition is met; and in response to meeting the preset transmission condition, determine to initiate a cache data transmission trigger operation; and a third response module configured to, in response to determining to initiate the cache data transmission trigger operation, start a second cache counter within a PWM cycle; determine whether the count value of the second cache counter reaches a second preset counting threshold; and in response to the count value of the second cache counter reaching the second preset counting threshold, update the data to be cached in the cache array to the CAN communication interface. Therefore, this device enables the caching function through a calibrated value, without affecting the CPU load rate during normal operation. This helps in analyzing the control process and occasional hardware faults in the vehicle. It can collect message data on the vehicle's CAN bus, improving the efficiency and accuracy of drive problem analysis and reducing usage costs.

[0107] For ease of description, the above system is described by dividing it into various modules based on their functions. Of course, in implementing this invention, the functions of each module can be implemented in one or more software and / or hardware components.

[0108] The system described in the above embodiments is used to implement the corresponding method in any of the foregoing embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0109] Corresponding to the above embodiments, the present invention also proposes an electronic device.

[0110] refer to Figure 8 The diagram below is a block diagram of an electronic device according to some embodiments of the present invention. It illustrates a more specific hardware structure of the electronic device provided in this embodiment. The device may include: a processor 810, a memory 820, an input / output interface 830, a communication interface 840, and a bus 850. The processor 810, memory 820, input / output interface 830, and communication interface 840 are interconnected internally via the bus 850.

[0111] The processor 810 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0112] The memory 820 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 820 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 820 and is called and executed by the processor 810.

[0113] The input / output interface 830 is used to connect input / output modules to enable information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0114] The communication interface 840 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (e.g., USB, Ethernet cable) or wireless means (e.g., mobile network, Wi-Fi, Bluetooth).

[0115] Bus 850 includes a pathway for transmitting information between various components of the device, such as processor 810, memory 820, input / output interface 830, and communication interface 840.

[0116] It should be noted that although the above-described device only shows the processor 810, memory 820, input / output interface 830, communication interface 840, and bus 850, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0117] The electronic devices described above are used to implement the corresponding methods in any of the foregoing embodiments and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0118] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, the present invention also provides a computer-readable storage medium storing computer instructions for causing a computer to perform the methods of any of the above embodiments.

[0119] The aforementioned computer-readable storage medium can be any available medium or data storage device that a computer can access, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).

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

[0121] Furthermore, although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Rather, the steps depicted in the flowchart may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0122] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0123] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this invention should have the ordinary meaning understood by those skilled in the art. The terms "first," "second," and similar terms used in the embodiments of this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0124] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention 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 interpreted in the broadest sense, thereby encompassing all such modifications and equivalent structures and functions.

Claims

1. A data caching method for an electric vehicle drive system, characterized in that, include: In response to receiving an enable signal for the caching function, determine whether the startup mode of the caching function is a single-trigger mode. In response to the startup mode of the caching function being a single-trigger mode, determine whether a preset trigger condition is met. In response to meeting the preset trigger condition, determine to start a data cache counting operation. In response to determining to start the data cache counting operation, the cache array is initialized, the cache array is assigned a value based on the data to be cached, and the first cache counter is started. It is determined whether the count value of the first cache counter reaches the first preset count threshold. In response to the first cache counter reaching the first preset count threshold, it is determined whether the preset sending condition is met. In response to meeting the preset sending condition, it is determined to start the cache data sending trigger operation. In response to the determination of the start of the buffer data transmission trigger operation, the second buffer counter is turned on during the PWM cycle, and it is determined whether the count value of the second buffer counter reaches the second preset count threshold. In response to the second buffer counter reaching the second preset count threshold, the data to be buffered in the buffer array is updated to the CAN communication interface.

2. The data caching method for an electric vehicle drive system according to claim 1, characterized in that, The method further includes: Determine the PWM period and the CAN message transmission period, calculate the quotient of the CAN message transmission period and the PWM period, and use the quotient as the second preset counting threshold.

3. The data caching method for an electric vehicle drive system according to claim 2, characterized in that, After the count value of the first cache counter reaches the first preset count threshold, the method further includes: Clear the count value of the first cache counter to zero.

4. The data caching method for an electric vehicle drive system according to claim 1, characterized in that, After updating the cached data in the cache array to the CAN communication interface, the method further includes: Clear the count value of the second buffer counter to zero, and increment the count value of the data transmission counter by one.

5. The data caching method for an electric vehicle drive system according to claim 4, characterized in that, After incrementing the data transmission counter by one, the method further includes: Determine whether the count value of the sending counter has reached a third preset counting threshold, and initialize the buffer array in response to the count value of the sending counter reaching the third preset counting threshold.

6. The data caching method for an electric vehicle drive system according to claim 1, characterized in that, The method further includes: Before updating the cached data in the cache array to the CAN communication interface is completed, the transmit enable flag remains at 1; after transmission is completed, the transmit enable flag is set to 0.

7. The data caching method for an electric vehicle drive system according to claim 1, characterized in that, The method further includes: If the caching function's startup mode is not a single-trigger mode, determine whether the caching function's startup mode is a continuous-trigger mode. In response to the continuous triggering mode of the caching function, the data to be cached in the cache array is updated to the CAN communication interface.

8. A data caching device for an electric vehicle drive system, characterized in that, include: The first response module is configured to, in response to receiving an enable signal for the caching function, determine whether the startup mode of the caching function is a single-trigger mode; in response to the startup mode of the caching function being a single-trigger mode, determine whether a preset trigger condition is met; and in response to meeting the preset trigger condition, determine to start a data cache counting operation. The second response module is configured to, in response to determining to start a data cache counting operation, initialize a cache array, assign values ​​to the cache array based on the data to be cached, start a first cache counter, determine whether the count value of the first cache counter reaches a first preset counting threshold, in response to the count value of the first cache counter reaching the first preset counting threshold, determine whether a preset sending condition is met, and in response to meeting the preset sending condition, determine to start a cache data sending trigger operation. The third response module is configured to, in response to the determined start-up buffer data transmission trigger operation, start the second buffer counter within the PWM cycle, determine whether the count value of the second buffer counter reaches the second preset count threshold, and, in response to the count value of the second buffer counter reaching the second preset count threshold, update the data to be cached in the buffer array to the CAN communication interface.

9. An electronic device, characterized in that, include: A processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the data caching method for an electric vehicle drive system as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The program or instructions are stored on the readable storage medium, and when the program or instructions are executed by a processor, they implement the steps of the data caching method for the electric vehicle drive system as described in 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

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

    CN119676064A