Multi-core processors, controllers and new energy vehicles
By deploying data collection and algorithm control tasks separately in multi-core processors and interacting through shared memory, combined with locking and water level control algorithms, the low efficiency and delay problems caused by multi-core processor resource sharing are solved and the reliability of the system is improved. sex and performance.
Patent Information
- Application Number
- CN202311080038.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-24
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2043-08-24
AI Technical Summary
In a symmetric multi-processing architecture, resource sharing between multi-core processors leads to reduced system execution efficiency, increased load, performance fragmentation and data delays, which cannot meet low-latency requirements.
By deploying data collection tasks and algorithm control tasks in different cores, and performing data interaction through shared memory, a locking mechanism is used to ensure the mutual exclusivity of data access, and periodic interrupt signals and water level control algorithms are used to optimize tasks. Collaboration.
It improves the reliability and performance of the system architecture, realizes effective differentiation and data interaction of different tasks, reduces the risk of delay, and improves the stability and reliability of the vehicle control system.
Smart Images

Figure CN117807015B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of multi-core processing technology, and in particular to a multi-core processor, a controller and a new energy vehicle. Background Art
[0002] In order to meet the intelligent control requirements of electronic products (such as new energy automotive electronic products), the relevant technology proposes to use MCU with symmetric multiprocessing (SMP) architecture for control. In this technology, an operating system (OS) is deployed on multiple cores of the MCU, and a large number of tasks are assigned to each OS to meet the requirements of functional and performance indicators. Since resources such as memory and serial peripheral interface (SPI) are shared in the symmetric multiprocessing architecture, resource protection or strict time division multiplexing is required when multiple cores access the same resource. However, this will bring the following problems:
[0003] (1) When each core deployment task uses inter-core communication to exchange data, shared memory, shared SPI interface, etc. may be used. When shared memory is used, resource sharing mechanisms such as spin locks are required. When shared SPI interface is used, additional time slice rotation or resource allocation mechanism is required for multi-core tasks, which will reduce the execution efficiency of the system and increase the load.
[0004] (2) When each core deploys tasks to access hardware resources, it cannot determine whether other cores have accessed the resources. Therefore, it is necessary to use certain methods to avoid multiple cores from accessing the shared hardware resources at the same time. This will lead to performance fragmentation and low system robustness.
[0005] (3) Since the time for multi-cores to access shared resources is uncertain, it is easy to cause data or control delay operations, which cannot meet the low latency requirements of the system. Summary of the invention
[0006] The present invention aims to solve one of the technical problems in the related art at least to a certain extent. To this end, the purpose of the present invention is to propose a multi-core processor, a controller and a new energy vehicle to improve the reliability of the entire system architecture and enhance the system performance.
[0007] To solve the above technical problems, an embodiment of the first aspect of the present invention proposes a multi-core processor, including a first core, a second core and a shared memory; the first core is configured to deploy data acquisition tasks and write the collected data into the shared memory; the second core is configured to deploy algorithm control tasks and read data from the shared memory for processing.
[0008] The multi-core processor of an embodiment of the present invention can effectively distinguish different tasks and enable data exchange between the first core and the second core by deploying data acquisition tasks and algorithm control tasks in the first core and the second core respectively, and storing the collected data in a shared memory through the first core and reading the data from the shared memory for processing through the second core. This can improve the reliability of the entire system architecture and enhance system performance.
[0009] In addition, the multi-core processor of the embodiment of the present invention may also have the following additional technical features:
[0010] According to one embodiment of the present invention, the first core is used to respond to a first interrupt signal to put the data acquisition task into a running state; the second core is used to respond to a second interrupt signal to put the algorithm control task into a running state; wherein the first interrupt signal and the second interrupt signal are periodic signals.
[0011] According to an embodiment of the present invention, the first kernel writes the collected data into the shared memory in an I / O control manner, and the second kernel reads the data from the shared memory in an I / O control manner.
[0012] According to an embodiment of the present invention, when the first kernel or the second kernel accesses the memory space in the shared memory, the first kernel or the second kernel locks the accessed memory space, and unlocks the accessed memory space after the access is completed.
[0013] According to an embodiment of the present invention, the first kernel or the second kernel is locked using a spin lock mechanism or a mutex lock mechanism.
[0014] According to an embodiment of the present invention, the second kernel is further configured to control the first kernel to restart when it is detected that the first kernel no longer writes data to the shared memory.
[0015] According to one embodiment of the present invention, the second kernel is also used to: determine, in the current task cycle, whether the timestamp carried by the data read from the shared memory is within the target data reading time range of the current task cycle; if the timestamp is earlier than the lower limit of the target data reading time range, reduce the delay time of the algorithm control task; if the timestamp is later than the upper limit of the target data reading time range, increase the delay time of the algorithm control task; and determine the target data reading time range of the next task cycle based on the timestamp.
[0016] According to one embodiment of the present invention, when the second kernel determines the target data reading time range of the next task cycle according to the timestamp, it is used to: calculate a first sum of the timestamp and the task cycle, and use the first sum as a reference time; calculate the difference between the reference time and a first preset threshold, and calculate a second sum of the reference time and a second preset threshold; use the time interval composed of the difference and the second sum as the target data reading time range of the next task cycle.
[0017] In order to solve the above technical problem, a second embodiment of the present invention proposes a controller, including the multi-core processor described in the above first embodiment.
[0018] The controller of the embodiment of the present invention can effectively distinguish different tasks through the setting of a multi-core processor, and can interact with data between the first core and the second core, thereby improving the reliability of the entire system architecture and enhancing system performance.
[0019] In order to solve the above technical problems, a third embodiment of the present invention proposes a new energy vehicle, including the controller described in the above second embodiment.
[0020] The new energy vehicle of the embodiment of the present invention can effectively distinguish different tasks and interact with data between the first core and the second core by setting up a controller including a multi-core processor, thereby improving the reliability of the vehicle control system architecture (such as an intelligent power distribution control system) and enhancing system performance.
[0021] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a structural block diagram of a multi-core processor according to an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of a multi-core multi-tasking system architecture according to an embodiment of the present invention;
[0024] Figure 3 It is a schematic diagram of water level division of an example of the present invention;
[0025] Figure 4 It is a flow chart of a water level control principle of an example of the present invention;
[0026] Figure 5 is a flow chart of a water level control algorithm of an example of the present invention;
[0027] Figure 6 is a structural block diagram of a controller according to an embodiment of the present invention;
[0028] Figure 7 is a schematic diagram of the structure of an intelligent power distribution controller according to an embodiment of the present invention;
[0029] Figure 8 It is a structural block diagram of a new energy vehicle according to an embodiment of the present invention.
[0030] Reference numerals:
[0031] 100, multi-core processor, 200 controller, 300, new energy vehicle;
[0032] 110, a first kernel, 120, a second kernel, 130, a shared memory. DETAILED DESCRIPTION
[0033] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0034] The multi-core processor, controller and new energy vehicle according to the embodiments of the present invention are described below with reference to the accompanying drawings.
[0035] Figure 1 4 is a structural block diagram of a multi-core processor according to an embodiment of the present invention.
[0036] like Figure 1 As shown, the multi-core processor 100 includes a first core 110, a second core 120 and a shared memory 130. The first core 110 is configured to deploy data collection tasks and write the collected data into the shared memory 130. The second core 120 is configured to deploy algorithm control tasks and read data from the shared memory 130 for processing.
[0037] The first core 110 can write the collected data into the shared memory 130 by using an input / output (I / O) control method, and the second core 120 can read the data from the shared memory 130 by using an input / output (I / O) control method, and can read the data into a corresponding address for calculation or processing. In addition, the number of the first core 110 and the second core 120 can be one or more. Figure 1 In the figure, it is taken as an example that the number of the first core 110 and the second core 120 is one.
[0038] The multi-core processor can effectively distinguish different tasks and realize data interaction between the first core and the second core by deploying data acquisition tasks and algorithm control tasks in the first core and the second core respectively, and storing the collected data in a shared memory through the first core and reading the data from the shared memory for processing through the second core. This can improve the reliability of the entire system architecture and enhance the system performance.
[0039] In some embodiments of the present invention, the first core 110 is used to respond to the first interrupt signal to put the data acquisition task into operation; the second core 120 is used to respond to the second interrupt signal to put the algorithm control task into operation. The first interrupt signal and the second interrupt signal may be periodic signals.
[0040] Specifically, the multi-core processor 100 may be a symmetric multi-processor. Figure 2 The multi-task cooperative system architecture based on symmetric multiprocessors is shown. Taking the multi-core processor 100 used in new energy vehicles as an example, according to the rules of automotive electronics, the software part is abstracted into three levels: microcontroller abstraction layer (Microcontroller Abstraction Layer, MCAL), basic software layer (Basic Software, BSW), and application layer (Application Software Layer, ASW), such as Figure 2 As shown. In the BSW layer, there are two cores, Core0 (i.e., the second core 120) and Core1 (i.e., the first core 110). Both Core0 and Core1 are deployed with OS, the OS of Core0 is assigned algorithm control tasks, and the OS of Core1 is assigned data collection tasks.
[0041] When the system is running, MCAL will generate two timer interrupts, TIMER1 and TIMER2. The generated alarm signal is used to activate the task periodically (such as every 10ms) to keep the task in running state. When the data acquisition task deployed in Core1 is in running state, it executes data acquisition tasks, such as collecting voltage, temperature, current and other data of the high side drive (High Side Drive, HSD) unit in the power distribution control system. When the algorithm control task deployed in Core0 is in running state, it executes algorithm control tasks, such as determining whether the load driven by the HSD unit has overvoltage, undervoltage, overcurrent, overtemperature and other faults based on the collected data, and when the above faults exist, the fault information is sent to the controller area network (Controller Area Network, CAN) bus, and the HSD unit is controlled to disconnect the load. When the data returns to normal, the HSD is controlled to continue to supply power to the load to realize the functions of intelligent diagnosis and intelligent power distribution.
[0042] It should be noted that see Figure 2 MCAL will also generate other interrupts besides the timer interrupt. For example, when a fault occurs, a fault handling interrupt (ISR_CallBack) is generated to the interrupt handling function (ISR_SetEvent). ISR_SetEvent sends an Event and activates the AppTask_ISR_Handler task in Core0 for control callback to achieve the purpose of quickly handling the fault.
[0043] In the embodiments of the present invention, see Figure 2 , Core0 and Core1 use the shared memory method to communicate between cores to complete data interaction. Figure 2 The data interaction between the two cores is achieved through shared memory, that is, both cores can access the same memory segment. By deploying data acquisition tasks and algorithm control tasks in different cores, physical space isolation can be achieved when accessing hardware resources. However, shared memory resources require a mutual exclusion mechanism (i.e. locking) to achieve safe access.
[0044] In order to prevent multiple cores from accessing the shared memory 130 at the same time and ensure data mutual exclusivity, in some embodiments of the present invention, the first core 110 or the second core 120 locks the accessed memory space when accessing the memory space in the shared memory 130, and unlocks the accessed memory space after the access is completed.
[0045] The first core 110 or the second core 120 may use a spin lock mechanism or a mutex lock mechanism for locking. When using a spin lock, if a core acquires a spin lock and no other core holds the lock, the lock will be acquired immediately; if the lock already has a holder when acquiring the spin lock, the lock acquisition operation will spin there until the holder of the spin lock releases the lock. When using a mutex lock, if a core locks a resource, the other core will actively give up the CPU when accessing it and wait for the next task scheduling.
[0046] In some embodiments of the present invention, the second kernel 120 is further configured to control the first kernel 110 to restart when it is detected that the first kernel 110 no longer writes data to the shared memory 130 .
[0047] Specifically, multi-task collaboration runs periodically. When the system fails, the timing of task execution between the first core 110 and the second core 120 is no longer synchronized, or the first core 110 runs away and the second core 120 cannot receive feedback information on the task synchronization of the second core 120, the second core 120 can forcefully kick off the first core 110 and restart the first core 110 to synchronize the task execution timing again.
[0048] Among them, see Figure 2 The KickOff function is a method for Core1 to restart Core0 when Core0 is in an abnormal operating state. When Core1 detects that Core0 is no longer generating data, that is, Core1 may have run away and no longer collects data and writes it into the shared memory 130, Core0 can KickOff Core0 to restart Core0.
[0049] Although task collaboration can solve some problems in a multi-core multi-tasking system, in the actual operation process, when task preemption occurs, data sampling performance changes, etc., the time point of data transmission will change. Even slight time fluctuations, after a certain period of accumulation, will cause task collaboration failure, and then cause data processing delays, affecting the function of the entire system. To this end, the present invention performs effective closed-loop control of the task collaboration mechanism, so that algorithm control tasks can read data and complete processing within a certain time threshold range, so as to achieve the purpose of relatively controllable delay time, thereby making task collaboration stable and reliable.
[0050] To achieve the above-mentioned purpose, in some embodiments of the present invention, the second kernel 120 is also used to: in the current task cycle, determine whether the timestamp carried by the data read from the shared memory 130 is within the target data reading time range of the current task cycle; if the timestamp is earlier than the lower limit of the target data reading time range, reduce the delay time of the algorithm control task; if the timestamp is later than the upper limit of the target data reading time range, increase the delay time of the algorithm control task; and determine the target data reading time range of the next task cycle according to the timestamp.
[0051] Specifically, when the second kernel 120 determines the target data reading time range of the next task cycle according to the timestamp, it is used to: calculate a first sum of the timestamp and the task cycle, and use the first sum as a reference time; calculate the difference between the reference time and a first preset threshold, and calculate a second sum of the reference time and a second preset threshold; use the time interval composed of the difference and the second sum as the target data reading time range of the next task cycle.
[0052] The task period can be a fixed value, such as 10ms, or a calculated value, such as when the second core 120 starts a task, the start time point start_tick is saved, and when the valid data of the first core 110 is read for the first time, the end time point end_tick is saved, and the task period can be calculated by end_tick-start_tick. The first preset threshold value and the second preset threshold value can be the same.
[0053] In this embodiment, the timestamp in the data read by the second kernel 120 can be abstracted into water level data, and the time point when the first timestamp is read is used as the central water level, and then the low warning water level and the high warning water level line are calculated according to the threshold in the calibrated parameters combined with the reference time (i.e., the central water level). When the time point when the second kernel 120 reads the data of the first kernel 110 is later than the high warning water level or earlier than the low warning water level line, the task delay time is reduced or increased by adjusting the water level control algorithm, thereby maintaining the time point of reading the data to float near the central water level line, not higher than the high warning water level line, and not lower than the low water level warning line, to achieve an adaptive equilibrium state, that is, the second kernel 120 can receive the data collected by the first kernel 110 within the time range controlled by the upper and lower water level lines, so that the two tasks running on the multi-core can interact with each other very smoothly, reducing or avoiding delays with large fluctuations.
[0054] Specifically, if Figure 4 As shown in Figure 1, task coordination is based on inter-core communication. Inter-core communication not only exchanges data information, but also exchanges the timestamp information of Core1. Figure 2, Timer1 and Timer2 are used for Core0 and Core1 respectively, so Core0 and Core1 can obtain system time respectively to facilitate subsequent synchronization.
[0055] like Figure 4 , Figure 5 As shown, when the system starts running, Core0 sets the initial waiting time and prepares for synchronization between its own task and Core1 task. Core1 collects data, writes the timestamp and collected data into the shared memory 130, and Core0 reads the data and timestamp from Core1 through inter-core communication. According to the timestamp, the approximate time when Core1 sends data next time can be obtained, that is, the task running status of Core1 can be known. At the same time, locking (such as spin lock mechanism) is required to ensure the mutual exclusion of data access. After that, Core0 calculates the waiting time through the timestamp (which can be the sum of the timestamp and the task cycle), and uses the waiting time as the reference time to calculate the range of the waiting time (i.e., the upper and lower water levels) as the water level information of the task that reads data next time; the water level information is sent to the comparator for comparison with the water level line threshold calibrated by the calibration tool, and the comparison result is sent to the adjustment selector to select the adjustment mode, and the water level adjustment control is performed using the selected adjustment mode. In this way, the stability and reliability of multi-core task collaboration can be improved.
[0056] The multi-core processor of the embodiment of the present invention can effectively distinguish different tasks and enable data exchange between the first core and the second core, thereby improving the reliability of the vehicle control system architecture (such as an intelligent power distribution control system) and enhancing system performance; by setting a water level control algorithm, the stability and reliability of task coordination can be improved.
[0057] Figure 6 4 is a structural block diagram of a controller according to an embodiment of the present invention.
[0058] like Figure 6 As shown, the controller 200 includes the multi-core processor 100 of the above embodiment.
[0059] In some embodiments of the present invention, the controller 200 may include an intelligent power distribution controller. Figure 7 The working principle of the controller 200 according to the embodiment of the present invention is described as follows:
[0060] like Figure 7 As shown, the intelligent power distribution controller includes:
[0061] DC voltage conversion module (DCDC), power battery (BATTERY), power module composed of MOSFET tubes, back-to-back (BACKTOBACK) module. BATTERY and DCDC can supply power to the load (Load) through the corresponding power modules respectively. DCDC can also charge BATTERY through BACKTOBACK to realize the function of intelligent power replenishment. BACKTOBACK can be composed of two groups of back-to-back MOSFET tubes. When the load on the BATTERY or DCDC side is short-circuited, BACKTOBACK is instantly disconnected to reduce the impact;
[0062] A power management module can provide 3.3V and 0.8V voltages to the control module (which may include the multi-core processor 100). In order to meet the functional safety level of ASIL D, the power management module can integrate a watchdog (WD) module to monitor the control module for faults;
[0063] A storage module, used for storing diagnostic data and calibration data;
[0064] A / D expansion unit, through time division multiplexing, to collect more analog signals, such as load voltage, current, temperature and other analog signals;
[0065] High-precision current acquisition unit, used to collect the battery charge and discharge current with an error range of ±1%, so as to achieve accurate control of intelligent power replenishment by the control module;
[0066] The HSD unit is connected to the control module through a general-purpose input / output (GPIO) so that the control module can control the HSD unit and A / D collect analog data such as voltage, current, temperature, etc. to the control unit;
[0067] The electronic fuse EFUSE unit is connected to the control module through a serial peripheral interface (SPI) and has a built-in watchdog to monitor the working status of EFUSE. EFUSE has overcurrent protection, I2t protection (that is, the square of the sum of the three-phase current of the motor exceeds a certain current threshold and maintains it for a period of time, triggering the i2t alarm), overtemperature, hard short-circuit protection and other functions. It can also have a load low current wake-up function to realize the wake-up of the control module.
[0068] See also Figure 7, up to 12 HSDs and 13 Efuses will be deployed on the intelligent power distribution controller. The work of collecting data such as voltage, temperature, and current of HSD is deployed in the first core 110. The first core 110 runs tasks according to a certain period and sends the collected data to the second core 120 through the shared memory 130. The algorithm control tasks on the second core 120 can determine whether the load driven by the HSD (high-side driver) has overvoltage, undervoltage, overcurrent, overtemperature and other faults based on these data. If at least one of the above faults exists, the second core 120 can send the fault information to the CAN bus and control the HSD unit to disconnect the load. When the data returns to normal, the HSD is controlled to continue to supply power to the load to achieve the functions of intelligent diagnosis and intelligent power distribution.
[0069] The controller of the embodiment of the present invention can effectively distinguish different tasks through the setting of a multi-core processor, and can interact with data between the first core and the second core, so as to improve the reliability of the vehicle control system architecture (such as an intelligent power distribution control system) and enhance system performance; through the setting of a water level control algorithm, the stability and reliability of task coordination can be improved.
[0070] Figure 7 It is a structural block diagram of a new energy vehicle according to an embodiment of the present invention.
[0071] like Figure 7 As shown, the new energy vehicle 300 includes the controller 200 of the above embodiment.
[0072] The new energy vehicle of the embodiment of the present invention can effectively distinguish different tasks and exchange data between the first core and the second core through the setting of a controller including a multi-core processor, thereby improving the reliability of the whole vehicle control system architecture (such as an intelligent power distribution control system) and enhancing system performance; through the setting of a water level control algorithm, the stability and reliability of task coordination can be improved.
[0073] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0074] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0075] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0076] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0077] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0078] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0079] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0080] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A multi-core processor, It is characterized in that Includes a first kernel, a second kernel and a shared memory; The first kernel is configured to deploy data collection tasks and write the collected data into the shared memory; The second kernel is configured to deploy algorithm control tasks and read data from the shared memory for processing; The second kernel is further configured to: In the current task cycle, determining whether the timestamp carried by the data read from the shared memory is within the target data reading time range of the current task cycle; If the timestamp is earlier than the lower limit of the target data reading time range, the delay time of the algorithm control task is reduced; If the timestamp is later than the upper limit of the target data reading time range, increasing the delay time of the algorithm control task; and The target data reading time range of the next task cycle is determined according to the timestamp.
2. The multi-core processor according to claim 1, It is characterized in that The first core is used to respond to the first interrupt signal to put the data acquisition task into a running state; The second core is used to respond to the second interrupt signal to put the algorithm control task into a running state; The first interrupt signal and the second interrupt signal are periodic signals.
3. The multi-core processor according to claim 1, It is characterized in that The first kernel writes the collected data into the shared memory in an I / O control manner, and the second kernel reads the data from the shared memory in an I / O control manner.
4. The multi-core processor according to claim 1, It is characterized in that When accessing the memory space in the shared memory, the first kernel or the second kernel locks the accessed memory space, and unlocks the accessed memory space after the access is completed.
5. The multi-core processor according to claim 4, It is characterized in that The first kernel or the second kernel is locked using a spin lock mechanism or a mutex lock mechanism.
6. The multi-core processor according to claim 1, It is characterized in that The second kernel is further configured to control the first kernel to restart when it is detected that the first kernel no longer writes data to the shared memory.
7. The multi-core processor according to claim 1, It is characterized in that When determining the target data reading time range of the next task cycle according to the timestamp, the second kernel is used to: Calculating a first sum of the timestamp and the task period, and using the first sum as a reference time; Calculating a difference between the reference time and a first preset threshold, and calculating a second sum of the reference time and a second preset threshold; The time interval consisting of the difference value and the second sum value is used as the target data reading time range of the next task cycle.
8. A controller, It is characterized in that Comprising a multi-core processor according to any one of claims 1-7.
9. A new energy vehicle, It is characterized in that Comprising a controller according to claim 8.
