Abnormal reset processing method of microcontroller
By obtaining and displaying the previous information of the instrument cluster after the microcontroller is reset and updating it to the current information, the problem of delay in obtaining driving information caused by the vehicle instrument cluster reset is solved, and the convenience and driving safety of the driver are improved.
Patent Information
- Application Number
- CN202411148944.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-29
AI Technical Summary
When the main control chip of the car instrument cluster is reset abnormally, the driver cannot obtain driving information in time, affecting driving safety.
After the microcontroller resets, when the reset information is determined to be abnormal reset information, obtain and display the instrument cluster display information before reset, and update it to the current driving information after initialization, avoiding the return to zero action and startup animation, and directly displaying the latest driving information .
It reduces the time for the driver to obtain driving information after reset, improves driving safety, and avoids the problem of information loss during reset.
Smart Images

Figure CN119037136A_ABST
Abstract
Description
Technical Field
[0001] The embodiment of the present invention relates to the field of automobile control technology, and in particular to a method for processing abnormal reset of a microcontroller. Background Art
[0002] At present, there are two main types of automobile instrument clusters: mechanical pointer and LCD hybrid type and pure LCD type. When the main control chip of the instrument cluster is reset by severe electromagnetic interference, radiation interference or other unexpected factors, the main control chip needs to reinitialize the entire instrument before resuming work.
[0003] In current automotive instruments, most of them will reset the stepper motor that controls the mechanical pointer during the initialization task after the main control chip is reset, so that the pointer returns to the zero scale and resumes indication. The LCD screen will also be re-initialized and display the boot animation before it can resume normal driving information display. If this reset occurs during vehicle driving, the driver will not be able to obtain driving information such as vehicle speed from the instrument cluster for several seconds, which will cause inconvenience and affect driving safety. Summary of the invention
[0004] The invention provides a method for processing abnormal reset of a microcontroller, so as to avoid driving safety problems caused by abnormal reset of a combination instrument when the microcontroller is abnormally reset during driving.
[0005] In a first aspect, an embodiment of the present invention provides a method for handling abnormal reset of a microcontroller, comprising:
[0006] After the microcontroller is reset, determining reset information of the microcontroller, the reset information including one of the following: normal reset information and abnormal reset information;
[0007] If the reset information is abnormal reset information, obtaining display information displayed by the combination instrument before the microcontroller is reset;
[0008] During the initialization of the combined instrument, displaying the display information on the combined instrument;
[0009] After the combination meter is initialized, the display information displayed on the combination meter is changed to current driving information.
[0010] In a second aspect, an embodiment of the present invention provides an abnormal reset processing device for a microcontroller, comprising:
[0011] A reset information determination module, used to determine reset information of the microcontroller after the microcontroller is reset, wherein the reset information includes one of the following: normal reset information and abnormal reset information;
[0012] a display information acquisition module, configured to acquire display information displayed by the instrument cluster before the microcontroller is reset if the reset information is abnormal reset information;
[0013] A display information display module, used for displaying the display information on the combined instrument during the initialization of the combined instrument;
[0014] The driving information changing module is used to change the display information displayed on the combined instrument to the current driving information after the combined instrument is initialized.
[0015] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the abnormal reset processing method of the microcontroller as described in the first aspect.
[0019] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the abnormal reset processing method of the microcontroller as described in the first aspect when executed.
[0020] An embodiment of the present invention provides a method for handling abnormal reset of a microcontroller. The method comprises: after the microcontroller is reset, determining the reset information of the microcontroller, the reset information comprising one of the following: normal reset information and abnormal reset information; if the reset information is abnormal reset information, obtaining the display information displayed by the instrument cluster before the microcontroller is reset; during the initialization of the instrument cluster, displaying the display information on the instrument cluster; after the instrument cluster is initialized, changing the display information displayed on the instrument cluster to the current driving information. In the above technical scheme, by determining the reset information of the microcontroller after the microcontroller is reset, and then obtaining and displaying the display information displayed by the instrument cluster before the microcontroller is reset based on the abnormal reset information, and then changing the display information displayed on the instrument cluster to the current driving information, the problem that the driver cannot obtain driving information from the instrument cluster for several seconds after the microcontroller is abnormally reset is avoided, which provides convenience for the driver and improves driving safety.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0023] Figure 1 A flowchart of a method for handling abnormal reset of a microcontroller provided in Embodiment 1 of the present invention;
[0024] Figure 2 A flowchart of another abnormal reset processing method of a microcontroller provided in Embodiment 1 of the present invention;
[0025] Figure 3 A schematic diagram of the structure of an abnormal reset processing device for a microcontroller provided in Embodiment 2 of the present invention;
[0026] Figure 4 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0027] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. In addition, the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict. It should also be noted that, for ease of description, only the parts related to the present invention are shown in the accompanying drawings, rather than all structures.
[0028] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0029] It should be noted that the concepts such as "first" and "second" mentioned in the embodiments of the present invention are only used to distinguish different devices, modules, units or other objects, and are not used to limit the order or interdependence of the functions performed by these devices, modules, units or other objects.
[0030] Embodiment 1
[0031] Figure 1 The present invention provides a flowchart of a microcontroller abnormal reset processing method according to a first embodiment of the present invention. This embodiment can be applied to avoid driving safety problems caused by abnormal reset of the instrument cluster when the microcontroller is abnormally reset during driving. Specifically, the microcontroller abnormal reset processing method can be executed by a microcontroller abnormal reset processing device, which can be implemented by software and / or hardware and integrated in an electronic device. Furthermore, the electronic device includes but is not limited to: electronic devices such as desktop computers, laptop computers, vehicles, and servers.
[0032] like Figure 1 As shown, the method specifically comprises the following steps:
[0033] S110 . After the microcontroller is reset, reset information of the microcontroller is determined, where the reset information includes one of the following: normal reset information and abnormal reset information.
[0034] In this embodiment, the microcontroller can be understood as a single-chip microcomputer that integrates the main parts of the microcomputer on one chip. The reset information can be understood as the reset information corresponding to the microcontroller when it is reset, such as one of the following: normal reset information and abnormal reset information. Normal reset information can be understood as reset information corresponding to an expected or planned reset operation. Abnormal reset information can be understood as reset information corresponding to an unexpected or unplanned reset operation.
[0035] After the microcontroller is reset, the electronic device can determine whether the reset information of the microcontroller is normal reset information or abnormal reset information through relevant operations. The relevant operations can be operations for determining the reset information of the microcontroller according to the reset type.
[0036] This operation, by determining the reset information of the microcontroller, can perform subsequent operations based on the reset information, so as to ultimately improve driving safety.
[0037] S120: If the reset information is abnormal reset information, obtain display information displayed by the instrument cluster before the microcontroller is reset.
[0038] In this embodiment, the instrument cluster can be understood as an interactive interface between a person and a car, which can provide the driver with the required information such as the car's operating parameters, faults and mileage. The instrument cluster can be, for example, a hybrid type with a mechanical pointer and a liquid crystal screen, or a pure liquid crystal screen type. The display information can be understood as the driving information displayed on the instrument cluster before the microcontroller is reset. The display information can be displayed in the form of a pointer, or in the form of a numerical value and / or animation, and the present invention does not limit this. The display information can be stored in a random access memory. Among them, the random access memory can be understood as a memory that can be read at any time.
[0039] Among them, if the reset information is abnormal reset information, the display information displayed on the instrument cluster before the microcontroller is reset can be obtained through the electronic device, so as to perform the next operation based on the display information; if the reset information is normal reset information, the normal reset operation is performed. The normal reset operation can be understood as the reset operation performed in the prior art, such as the initialization task after the microcontroller is normally reset, which will perform a zero return action on the stepper motor that controls the mechanical pointer in the instrument cluster, so that the pointer returns to the zero scale and then resumes the indication. The LCD screen instrument cluster can also resume normal driving information display only after reinitialization and displaying the power-on animation.
[0040] S130: During the initialization of the instrument cluster, display the display information on the instrument cluster.
[0041] In this embodiment, the instrument cluster initialization may be understood as the operation of initializing the instrument cluster after the microcontroller is reset, so as to establish communication between the microcontroller and the instrument cluster and enable the instrument cluster to work normally.
[0042] After the microcontroller is reset, the instrument cluster needs to be reinitialized. During the initialization of the instrument cluster, the information displayed on the instrument cluster is still the same as the information displayed on the instrument cluster before the microcontroller is reset.
[0043] For example, the display information displayed by the instrument cluster before the microcontroller is reset is, for example, a vehicle speed of 80 km / h. After the microcontroller is reset, during the process of initializing the instrument cluster, the display information displayed by the instrument cluster is always 80 km / h.
[0044] This operation can provide the driver with driving information for reference during the initialization process by displaying information on the instrument cluster, thereby avoiding the problem of driving safety caused by the instrument cluster not displaying driving information during the initialization process in the prior art.
[0045] S140: After the instrument cluster is initialized, the display information displayed on the instrument cluster is changed to current driving information.
[0046] In this embodiment, the current driving information can be understood as the latest driving information during the driving process of the vehicle, that is, the driving information obtained for the first time after the microcontroller is reset and the combination instrument is initialized.
[0047] Among them, after the instrument cluster is initialized, the display information displayed on the instrument cluster is directly changed to the current driving information, avoiding the problem in the prior art that the information displayed on the instrument cluster needs to return to zero from the pointer and / or display the startup animation before displaying the current driving information.
[0048] This operation directly changes the information displayed on the instrument cluster to the current driving information, which can avoid the problem that the driver cannot obtain driving information such as vehicle speed from the instrument cluster for several seconds after the microcontroller is abnormally reset. This can provide convenience for the driver and improve driving safety.
[0049] A method for handling abnormal reset of a microcontroller provided in a first embodiment of the present invention comprises: after the microcontroller is reset, determining the reset information of the microcontroller, the reset information comprising one of the following: normal reset information and abnormal reset information; if the reset information is abnormal reset information, obtaining the display information displayed by the instrument cluster before the microcontroller is reset; during the initialization of the instrument cluster, displaying the display information on the instrument cluster; after the instrument cluster is initialized, changing the display information displayed on the instrument cluster to the current driving information. In the above technical scheme, by determining the reset information of the microcontroller after the microcontroller is reset, and then obtaining and displaying the display information displayed by the instrument cluster before the microcontroller is reset based on the abnormal reset information, and then changing the display information displayed on the instrument cluster to the current driving information, the problem that the driver cannot obtain driving information from the instrument cluster for several seconds after the microcontroller is abnormally reset is avoided, which provides convenience for the driver and improves driving safety.
[0050] Optionally, after the microcontroller is reset, determining reset information of the microcontroller includes:
[0051] After the microcontroller is reset, determining a reset type corresponding to the reset of the microcontroller;
[0052] The reset information of the microcontroller is determined according to the reset type.
[0053] In one embodiment, the reset type can be understood as the type of reset of the microcontroller, for example, it can include: power-on reset, software reset, watchdog reset and undervoltage reset, etc. Among them, the power-on reset can be understood as a series of operations automatically performed when the microcontroller is powered on, that is, the operation of restoring the microcontroller to the initial state after powering on; the software reset can be understood as the operation of using a series of instructions to imitate the hardware reset function; the watchdog reset can be understood as the reset operation automatically triggered when the microcontroller enters an abnormal state, that is, if the reset type is a watchdog reset, the reset information of the microcontroller is abnormal reset information; the undervoltage reset can be understood as the reset operation generated when an undervoltage condition occurs.
[0054] Exemplarily, after the microcontroller is reset, the reset type corresponding to the microcontroller reset can be read from the reset state register by an electronic device (such as a microcontroller), and then the reset type is analyzed to finally determine the reset information of the microcontroller.
[0055] Optionally, determining reset information of the microcontroller according to the reset type includes:
[0056] If the reset type is a normal reset type, determining that the reset information is normal reset information, the normal reset type at least includes: power-on reset and software reset;
[0057] If the reset type is an abnormal reset type, the reset information is determined by an abnormal reset flag variable, and the abnormal reset type at least includes: undervoltage reset and watchdog reset.
[0058] In one embodiment, the normal reset type can be understood as the reset type corresponding to the normal reset of the microcontroller, for example, it can include: power-on reset and software reset. The abnormal reset type can be understood as the reset type that needs further judgment. If further judgment satisfies relevant conditions (such as the abnormal reset flag variable corresponding to the microcontroller after the reset is equal to the abnormal reset flag variable corresponding to the microcontroller before the reset), it can be the reset type corresponding to the abnormal reset of the microcontroller. If the relevant conditions are not met, it can be a normal reset. The abnormal reset type can include: undervoltage reset and watchdog reset. The abnormal reset flag variable can be understood as a variable used to determine whether it is an abnormal reset.
[0059] Exemplarily, if the reset type is a power-on reset or a software reset, it can be determined that the reset information of the microcontroller is normal reset information. If the reset type is an undervoltage reset, the reset information of the microcontroller can be further determined by an abnormal reset flag variable, such as by whether the abnormal reset flag variable changes before and after the microcontroller is reset.
[0060] Optionally, the determining the reset information by using an abnormal reset flag variable includes:
[0061] Determine the abnormal reset flag variable corresponding to the microcontroller before resetting;
[0062] Determine the abnormal reset flag variable corresponding to the microcontroller after the microcontroller is reset;
[0063] If the abnormal reset flag variable corresponding to the microcontroller after the microcontroller is reset is equal to the abnormal reset flag variable corresponding to the microcontroller before the microcontroller is reset, the reset information is determined to be abnormal reset information; otherwise, the reset information is determined to be normal reset information.
[0064] Exemplarily, the abnormal reset flag variable corresponding to the microcontroller before the reset (such as AA55) can be configured and read by the electronic device, and the abnormal reset flag variable corresponding to the microcontroller after the reset can be read by the electronic device. If the abnormal reset flag variable corresponding to the microcontroller after the reset (such as AA55) is equal to the abnormal reset flag variable corresponding to the microcontroller before the reset (such as AA55), it can be determined that the reset information of the microcontroller is abnormal reset information; if the abnormal reset flag variable corresponding to the microcontroller after the reset (such as 0) is not equal to the abnormal reset flag variable corresponding to the microcontroller before the reset (such as AA55), it can be determined that the reset information of the microcontroller is normal reset information.
[0065] Optionally, after the microcontroller is reset, determining a reset type corresponding to the reset of the microcontroller includes:
[0066] After the microcontroller is reset, get the reset type stored in the reset status register.
[0067] In one embodiment, the reset status register may be used to store the reset type.
[0068] After the microcontroller is reset, the reset type corresponding to the reset of the microcontroller can be obtained from the reset state register by the electronic device (such as the microcontroller).
[0069] Optionally, after the microcontroller is reset, determining reset information of the microcontroller includes:
[0070] After the microcontroller is reset, the instrument cluster is initialized and reset information of the microcontroller is determined.
[0071] After the microcontroller is reset, the instrument cluster is initialized so that the microcontroller establishes communication with the instrument cluster and the instrument cluster can operate normally, and reset information of the microcontroller is determined.
[0072] Optionally, after the combination instrument is initialized, after the display information displayed on the combination instrument is changed to current driving information, the method further includes:
[0073] The abnormal reset flag variable is set to the abnormal reset flag variable corresponding to the microcontroller before being reset.
[0074] Among them, after changing the display information displayed on the instrument cluster to the current driving information, it is also necessary to reconfigure the abnormal reset flag variable and configure it to the abnormal reset flag variable corresponding to the microcontroller before the reset, so as to be used for identification after the next abnormal reset.
[0075] For example, Figure 2 This is a flow chart of another abnormal reset processing method of a microcontroller provided in Embodiment 1 of the present invention. Figure 2 As shown, after the microcontroller is reset, that is, after the reset is started, the reset type and abnormal reset flag variable in the reset status register are read, and the instrument cluster is initialized, and then it is determined whether the abnormal reset condition is met, that is, whether the reset type is an abnormal reset type and whether the abnormal reset flag variable changes before and after the microcontroller is reset. If the abnormal reset condition is met, that is, the reset information of the microcontroller is abnormal reset information, the display information displayed by the instrument cluster before the microcontroller is reset is obtained, and the display information is displayed on the instrument cluster, and then the display information displayed on the instrument cluster is changed to the current driving information, that is, it jumps directly from the display information before the microcontroller is reset to the current driving information, without the need to perform a zero return action, and indicates the corresponding scale based on the original indication scale according to the current latest driving information, and the LCD screen does not display the power-on animation, but directly displays the current driving information. In this way, the processing time of abnormal reset can be shortened to the level of 100 milliseconds, which will hardly affect the vehicle driver and avoid safety problems. The abnormal reset flag variable is then configured to generate the recognition after the next abnormal reset, and finally enter the normal working state; if the abnormal reset condition is not met, that is, the reset information of the microcontroller is the normal reset information, the stepper motor zeroing action and the LCD screen power-on animation action are executed to ensure that the pointer is at the 0 scale, and then the abnormal reset flag variable is configured to generate the recognition after the next abnormal reset, and finally enter the normal working state.
[0076] Embodiment 2
[0077] Figure 3 This is a schematic diagram of the structure of a microcontroller abnormal reset processing device provided in Embodiment 2 of the present invention, which can execute the microcontroller abnormal reset processing method provided in Embodiment 2 of the present invention. The microcontroller abnormal reset processing device provided in this embodiment includes:
[0078] The reset information determination module 210 is used to determine the reset information of the microcontroller after the microcontroller is reset, and the reset information includes one of the following: normal reset information and abnormal reset information;
[0079] A display information acquisition module 220, configured to acquire display information displayed by the instrument cluster before the microcontroller is reset if the reset information is abnormal reset information;
[0080] A display information display module 230, used for displaying the display information on the combination instrument during the initialization of the combination instrument;
[0081] The driving information changing module 240 is used to change the display information displayed on the combined instrument to the current driving information after the combined instrument is initialized.
[0082] Optionally, based on the above embodiment, the reset information determination module 210 includes:
[0083] A reset type determination unit, used to determine the reset type corresponding to the microcontroller reset after the microcontroller is reset;
[0084] A reset information determining unit is used to determine the reset information of the microcontroller according to the reset type.
[0085] Optionally, based on the above embodiment, the reset information determining unit includes:
[0086] A normal reset information determination subunit, configured to determine that the reset information is normal reset information if the reset type is a normal reset type, wherein the normal reset type includes at least: power-on reset and software reset;
[0087] The reset information determination subunit is used to determine the reset information through an abnormal reset flag variable if the reset type is an abnormal reset type, and the abnormal reset type at least includes: undervoltage reset and watchdog reset.
[0088] Optionally, based on the above embodiment, the reset information determination subunit is specifically used for:
[0089] Determine the abnormal reset flag variable corresponding to the microcontroller before resetting;
[0090] Determine the abnormal reset flag variable corresponding to the microcontroller after the microcontroller is reset;
[0091] If the abnormal reset flag variable corresponding to the microcontroller after the microcontroller is reset is equal to the abnormal reset flag variable corresponding to the microcontroller before the microcontroller is reset, the reset information is determined to be abnormal reset information; otherwise, the reset information is determined to be normal reset information.
[0092] Optionally, based on the above embodiment, the reset type determination unit includes:
[0093] The reset type acquisition subunit is used to obtain the reset type stored in the reset status register after the microcontroller is reset.
[0094] Optionally, based on the above embodiment, the reset information determination module 210 includes:
[0095] The instrument initialization unit is used to initialize the instrument cluster after the microcontroller is reset, and to determine the reset information of the microcontroller.
[0096] Optionally, based on the above embodiment, the device further includes:
[0097] The flag variable setting module is used to set the abnormal reset flag variable to the abnormal reset flag variable corresponding to the microcontroller before resetting after the combination instrument is initialized and the display information displayed on the combination instrument is changed to the current driving information.
[0098] The abnormal reset processing device for a microcontroller provided in the second embodiment of the present invention can be used to execute the abnormal reset processing method for a microcontroller provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0099] Embodiment 3
[0100] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 10 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, user equipment, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0101] like Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0102] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, wireless networks.
[0103] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an abnormal reset processing method of a microcontroller.
[0104] In some embodiments, the abnormal reset processing method of the microcontroller can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the abnormal reset processing method of the microcontroller by any other appropriate means (for example, by means of firmware).
[0105] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0106] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0107] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0108] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device 10 having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device 10. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0109] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0110] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0111] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0112] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for handling abnormal reset of a microcontroller, characterized in that: include: After the microcontroller is reset, determining reset information of the microcontroller, the reset information including one of the following: normal reset information and abnormal reset information; If the reset information is abnormal reset information, obtaining display information displayed by the combination instrument before the microcontroller is reset; During the initialization of the combined instrument, displaying the display information on the combined instrument; After the combination meter is initialized, the display information displayed on the combination meter is changed to current driving information.
2. The method according to claim 1, characterized in that After the microcontroller is reset, determining reset information of the microcontroller includes: After the microcontroller is reset, determining a reset type corresponding to the reset of the microcontroller; The reset information of the microcontroller is determined according to the reset type.
3. The method according to claim 2, characterized in that Determining reset information of the microcontroller according to the reset type includes: If the reset type is a normal reset type, determining that the reset information is normal reset information, the normal reset type at least includes: power-on reset and software reset; If the reset type is an abnormal reset type, the reset information is determined by an abnormal reset flag variable, and the abnormal reset type at least includes: undervoltage reset and watchdog reset.
4. The method according to claim 3, characterized in that The determining the reset information through an abnormal reset flag variable includes: Determine the abnormal reset flag variable corresponding to the microcontroller before resetting; Determine the abnormal reset flag variable corresponding to the microcontroller after the microcontroller is reset; If the abnormal reset flag variable corresponding to the microcontroller after the microcontroller is reset is equal to the abnormal reset flag variable corresponding to the microcontroller before the microcontroller is reset, the reset information is determined to be abnormal reset information; otherwise, the reset information is determined to be normal reset information.
5. The method according to claim 2, characterized in that: After the microcontroller is reset, determining the reset type corresponding to the reset of the microcontroller includes: After the microcontroller is reset, get the reset type stored in the reset status register.
6. The method according to claim 1, characterized in that After the microcontroller is reset, determining reset information of the microcontroller includes: After the microcontroller is reset, the instrument cluster is initialized and reset information of the microcontroller is determined.
7. The method according to claim 1, characterized in that After the combination instrument is initialized, after the display information displayed on the combination instrument is changed to the current driving information, the method further includes: The abnormal reset flag variable is set to the abnormal reset flag variable corresponding to the microcontroller before being reset.
8. An abnormal reset processing device for a microcontroller, characterized in that: include: A reset information determination module, used to determine reset information of the microcontroller after the microcontroller is reset, wherein the reset information includes one of the following: normal reset information and abnormal reset information; a display information acquisition module, configured to acquire display information displayed by the instrument cluster before the microcontroller is reset if the reset information is abnormal reset information; A display information display module, used for displaying the display information on the combined instrument during the initialization of the combined instrument; The driving information changing module is used to change the display information displayed on the combined instrument to the current driving information after the combined instrument is initialized.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the abnormal reset processing method for a microcontroller according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the abnormal reset processing method of a microcontroller according to any one of claims 1 to 7 when executed.
