Operation Status Monitoring Method, Device, Storage Medium and Equipment for Multi-Processing Unit
By using shared memory to realize real-time monitoring of operating status information in the multi-processing unit of the embedded processor chip, the problem of inefficient monitoring in the prior art is solved, and precise monitoring and efficient management of the operating status of the multi-processing unit is realized.
Patent Information
- Application Number
- CN202210055503.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-18
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-01-18
AI Technical Summary
The prior art is inefficient when monitoring the operation status of multi-processing units in embedded processor chips, especially in the long-running equipment, and it is difficult to detect the progress of each operation stage. The scenario of using a debugger or a log system has limitations.
By determining the operating status of the target application when it enters the target operation stage, it generates the operating status information and writing it to shared memory, the monitoring processing unit reads this information from the shared memory to realize the status monitoring of the monitored processing unit, avoiding the use of a debugger or log system.
The monitoring conditions are simplified, monitoring efficiency is improved, cost is reduced, and accurate monitoring of the operating status of multi-processing units is achieved.
Smart Images

Figure CN114416483B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a method, apparatus, chip, computer-readable storage medium, and electronic device for monitoring the operating states of multiple processing units. Background Art
[0002] With the continuous development of computer technologies, more and more application programs are running on electronic devices. Therefore, the requirement for real-time monitoring of the operating states of application programs is gradually increasing. For example, in the field of embedded processor chips, the structure of embedded processor chips is becoming increasingly complex. In common architectures, in addition to a main processing unit with high performance, such as an ARM cortex-a, there are also configured slave processing units, such as cortex-m processing units, DSP processing units, RISC-V processing units, cortex-r processing units, etc., to undertake functions such as functional safety, real-time computing, peripheral control, and data processing. Currently, a relatively typical main processing unit, such as the ARM cortex-a architecture, generally uses a high-level operating system such as Linux, while the slave processing units generally use a low-level operating system or do not use an operating system. The performance of the main processing unit is superior to that of the slave processing units. Therefore, a relatively large number of application programs with complex functions are set on it, and the slave processing units run some application programs with relatively simple functions. In order to reduce the probability of exceptions occurring during the operation of the main processing unit, it is necessary to monitor the operating states of these application programs. Summary of the Invention
[0003] Embodiments of the present disclosure provide a method, apparatus, chip, computer-readable storage medium, and electronic device for monitoring the operating states of multiple processing units on a chip.
[0004] Embodiments of the present disclosure provide a method for monitoring the operating states of multiple processing units. The method is applied to a monitored processing unit in the multiple processing units, and the method includes: in response to a target application program entering a target operating stage, determining the operating state of the target application program in the target operating stage; generating operating state information representing the operating state; and writing the operating state information into a shared memory for a monitoring processing unit in the multiple processing units to read the operating state information from the shared memory and monitor the operating state of the monitored processing unit.
[0005] According to another aspect of the embodiments of the present disclosure, there is provided a method for monitoring the operating states of multiple processing units. The method is applied to a monitoring processing unit in the multiple processing units, and the method includes: in response to an operation of triggering the reading of operating state information, reading the operating state information from the shared memory, where the operating state information is generated by a target application program of a monitored processing unit running in the multiple processing units in a target operating stage; and determining the current operating state of the target operating stage based on the operating state information.
[0006] According to another aspect of the embodiments of the present disclosure, a running state monitoring device for a multi - processing unit is provided. The device is applied to a monitored processing unit in the multi - processing unit, and the device includes: a first determination module, configured to determine the running state of a target application program in a target running stage in response to the target application program entering the target running stage; a first generation module, configured to generate running state information representing the running state; and a writing module, configured to write the running state information into a shared memory for a monitoring processing unit in the multi - processing unit to read the running state information from the shared memory and monitor the running state of the monitored processing unit.
[0007] According to another aspect of the embodiments of the present disclosure, a running state monitoring device for a multi - processing unit is provided. The device is applied to a monitoring processing unit in the multi - processing unit, and the device includes: a reading module, configured to read running state information from the shared memory in response to an operation of triggering the reading of the running state information, where the running state information is generated by a target application program of a monitored processing unit running in the multi - processing unit in a target running stage; and a second determination module, configured to determine the current running state of the target running stage based on the running state information.
[0008] According to another aspect of the embodiments of the present disclosure, a chip is provided, which is connected to a memory or includes a memory. The chip further includes at least one monitored processing unit and a monitoring processing unit; each monitored processing unit in the at least one monitored processing unit is configured to read and execute corresponding executable instructions stored in the memory to implement the method described in the first aspect above; and the monitoring processing unit is configured to read and execute corresponding executable instructions stored in the memory to implement the method described in the second aspect above.
[0009] According to another aspect of the embodiments of the present disclosure, a computer - readable storage medium is provided. The computer - readable storage medium stores a computer program, and the computer program is used to execute the running state monitoring method for the multi - processing unit described above.
[0010] According to another aspect of the embodiments of the present disclosure, an electronic device is provided. The electronic device includes: a monitored processing unit, at least one monitoring processing unit, a shared memory, and a memory for storing executable instructions of the monitored processing unit and the at least one monitoring processing unit; the monitored processing unit is configured to read corresponding executable instructions from the memory and execute the read executable instructions to implement the method described in the first aspect above; and each monitoring processing unit in the at least one monitoring processing unit is configured to read corresponding executable instructions from the memory and execute the read executable instructions to implement the method described in the second aspect above.
[0011] Based on the method, device, chip, computer-readable storage medium, and electronic device for monitoring the operating state of a multi-processing unit provided in the above embodiments of the present disclosure, when a target application enters a target operating stage, the operating state of the target application in the target operating stage is determined and operating state information is generated, and then the operating state information is written into a shared memory for a monitoring processing unit in the multi-processing unit to read the operating state information from the shared memory and monitor the operating state of the monitored processing unit. Thus, it is realized that the monitored processing unit only needs to write the operating state information of the target application in the target operating stage into the shared memory, and the monitoring processing unit reads the operating state information from the shared memory to monitor the monitored processing unit, without using a debugger or a logging system to monitor the monitored processing unit, simplifying the observation conditions for monitoring the operating state of the multi-processing unit, improving the monitoring efficiency, and reducing the monitoring cost.
[0012] The technical solution of the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] By describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings, the above and other objects, features, and advantages of the present disclosure will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure, and constitute a part of the specification, and are used to explain the present disclosure together with the embodiments of the present disclosure, and do not constitute a limitation to the present disclosure. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0014] Figure 1 It is a system diagram applicable to the present disclosure.
[0015] Figure 2 It is a schematic flowchart of a method for monitoring the operating state of a monitored processing unit in a multi-processing unit provided in an exemplary embodiment of the present disclosure.
[0016] Figure 3 It is a schematic flowchart of a method for monitoring the operating state of a monitoring processing unit in a multi-processing unit provided in an exemplary embodiment of the present disclosure.
[0017] Figure 4 It is a schematic structural diagram of a shared memory provided in an embodiment of the present disclosure.
[0018] Figure 5 It is a schematic flowchart of a method for monitoring the operating state of a monitoring processing unit in a multi-processing unit provided in an exemplary embodiment of the present disclosure.
[0019] Figure 6 It is a schematic flowchart of a method for monitoring the operating state of a monitoring processing unit in a multi-processing unit provided in another exemplary embodiment of the present disclosure.
[0020] Figure 7 It is a schematic flowchart of a method for monitoring the operating state of a monitoring processing unit applied to a multi-processing unit provided by another exemplary embodiment of the present disclosure.
[0021] Figure 8 It is a schematic structural diagram of a device for monitoring the operating state of a monitored processing unit applied to a multi-processing unit provided by an exemplary embodiment of the present disclosure.
[0022] Figure 9 It is a schematic structural diagram of a device for monitoring the operating state of a monitored processing unit applied to a multi-processing unit provided by another exemplary embodiment of the present disclosure.
[0023] Figure 10 It is a schematic structural diagram of a device for monitoring the operating state of a monitoring processing unit applied to a multi-processing unit provided by an exemplary embodiment of the present disclosure.
[0024] Figure 11 It is a schematic structural diagram of a device for monitoring the operating state of a monitoring processing unit applied to a multi-processing unit provided by another exemplary embodiment of the present disclosure.
[0025] Figure 12 It is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. Detailed implementation manners
[0026] Next, exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments of the present disclosure. It should be understood that the present disclosure is not limited by the exemplary embodiments described herein.
[0027] It should be noted that: Unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and values set forth in these embodiments do not limit the scope of the present disclosure.
[0028] Those skilled in the art can understand that terms such as "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate an inevitable logical order between them.
[0029] It should also be understood that in the embodiments of the present disclosure, "a plurality of" may refer to two or more, and "at least one" may refer to one, two or more.
[0030] It should also be understood that for any component, data or structure mentioned in the embodiments of the present disclosure, unless clearly defined or given a contrary indication in the context, it can generally be understood as one or more.
[0031] In addition, the term "and / or" in this disclosure is merely an association relationship describing associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this disclosure generally represents an "or" relationship between the associated objects before and after.
[0032] It should also be understood that the descriptions of the various embodiments in this disclosure emphasize the differences between the various embodiments, and their similarities can be referred to each other. For the sake of brevity, they will not be elaborated one by one.
[0033] Meanwhile, it should be understood that for the convenience of description, the dimensions of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0034] The following description of at least one exemplary embodiment is actually merely illustrative and in no way restricts this disclosure or its application or use.
[0035] Techniques, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the said techniques, methods, and devices should be regarded as part of the specification.
[0036] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0037] Overview of the Application
[0038] In order to monitor the application programs running on an electronic device, the related technical solutions generally directly use a debugger to debug the device to be monitored, or use a logging system to monitor various running stages of the device to be monitored, such as startup, sleep, and wake-up. For example, in a SOC (System on Chip), which includes multiple processing units, the multiple processing units further include a main processing unit (also known as the main core) and multiple slave processing units (also known as slave cores). The application programs running on the main processing unit usually use a debugger or a logging system for monitoring. Such a monitoring method is inefficient, and the observable conditions are even worse after mass production of the product. For a device running for a long time, it is more difficult to detect the progress of its various running stages, and the usage scenarios have great limitations.
[0039] Exemplary System
[0040] Figure 1 Exemplary system architecture 100 of a method for monitoring the running state of a multi-processing unit or a device for monitoring the running state of a multi-processing unit to which the embodiments of this disclosure can be applied is shown.
[0041] The system architecture 100 may include at least one monitored processing unit 101, a monitoring processing unit 102, and a shared memory 103. This system is typically applied in a SOC, that is, integrated in one chip, and can also be set in different chips or circuit boards, and data communication links can be established between these chips or circuit boards.
[0042] In a heterogeneous multi-core SOC, it usually includes a high-performance main processing unit (such as an ARM cortex-a processing unit) and a lower-performance slave processing unit. Since the main processing unit usually runs more and more complex application programs, at least one monitored processing unit 101 usually includes the main processing unit. At least one monitored processing unit 101 may also include a lower-performance slave processing unit.
[0043] The monitoring processing unit 102 is usually a slave processing unit, such as an ARM cortex-m processing unit, a DSP processing unit, a risc-v processing unit, an ARM cortex-r processing unit, etc. The monitoring processing unit 102 is used to undertake the function of monitoring the state of the application programs running on at least one monitored processing unit 101, and can also be used for functions such as functional safety, real-time computing, peripheral control, data processing, etc. It should be noted that the types of the above monitoring processing unit 102 and monitored processing unit 101 are only exemplary, and the embodiments of the present disclosure do not limit the types of the monitoring processing unit 102 and monitored processing unit 101, that is, the main processing unit can be used as the monitored processing unit 101 or the monitoring processing unit 102. Also, the slave processing unit can be used as the monitored processing unit 101 or the monitoring processing unit 102.
[0044] The shared memory 103 is used to temporarily store the running state information of the target application program in the target running stage written by at least one monitored processing unit 101. The monitoring processing unit 102 can read the running state information from the shared memory 103, so as to realize the monitoring of at least one monitored processing unit 101.
[0045] It should be noted that the embodiments of the present disclosure provide two methods for monitoring the running states of multi-processing units, which are respectively executed by at least one monitored processing unit 101 and the monitoring processing unit 102. Correspondingly, the embodiments of the present disclosure provide two devices for monitoring the running states of multi-processing units, which are respectively located in at least one monitored processing unit 101 and the monitoring processing unit 102.
[0046] Exemplary Method
[0047] Figure 2It is a schematic flowchart of a method for monitoring the operating state of a multi - processing unit provided by an exemplary embodiment of the present disclosure. The method of this embodiment can be applied to a monitored processing unit 101 as shown in Figure 1 and the method is executed by the monitored processing unit 101. As shown in Figure 2 , the method includes the following steps:
[0048] Step 201: In response to a target application entering a target operating stage, determine the operating state of the target application in the target operating stage.
[0049] In this embodiment, the monitored processing unit 101 can determine the operating state of the target application in the target operating stage in response to the target application entering the target operating stage. Among them, the target application can be an application specified to monitor its operating state among the applications running on the monitored processing unit 101. For example, the target application can be a program module of software that executes a certain function, such as a Uboot (Universal Boot Loader, general startup bootloader) bootloader module, a file system mounting program module, a face recognition module, a voice recognition module, etc. The target application can also be a program module that drives a certain hardware module, such as an SPI (Serial Peripheral Interface) bus driver module, an I2C (Inter - Integrated Circuit) bus driver module, and / or a UART (Universal Asynchronous Receiver / Transmitter) driver module, etc.
[0050] The target operating stage can be an operating stage specified to monitor the target application during its operation. Optionally, the target operating stage includes but is not limited to any one of the following: the program startup stage, the sleep startup stage, and the wake - up startup stage of the target application. The above various operating stages involve key monitoring stages of the target application. Monitoring these operating stages can ensure that when an abnormality occurs during the program startup, sleep, wake - up, etc. of the target application, the monitoring processing unit 102 can locate and record the occurring abnormal conditions in real time, which is beneficial to improving the operating stability of the target application.
[0051] The operating state of the target operating stage can be determined in various ways. For example, when an abnormality occurs in the target operating stage, an error code is automatically output, thereby determining that the operating state of the target operating stage is an abnormal state. Or, when the target operating stage is not completed within a set time, it is determined that the operating state of the target operating stage is an abnormal state.
[0052] Step 202: Generate running status information indicating the running status.
[0053] In this embodiment, the monitored processing unit 101 can generate running status information indicating the running status. Among them, the running status information can be various forms of information, such as numbers, texts, or identifiers, etc. When the running status information is represented by numbers, "1" indicates that the running status is normal, and "0" indicates that the running status is abnormal. The running status information can also include at least one sub-information. For example, it can include the generation time of the running status information, the node mark currently executed in the target running stage, the running status code, etc.
[0054] Step 203: Write the running status information into the shared memory for the monitoring processing unit in the multi-processing unit to read the running status information from the shared memory and monitor the running status of the monitored processing unit.
[0055] In this embodiment, the monitored processing unit 101 can write the running status information into the shared memory 103 for the monitoring processing unit 102 to read the running status information from the shared memory 103 and monitor the running status of the monitored processing unit.
[0056] The monitoring processing unit 102 can perform information output in a corresponding form according to the running status information. For example, when the running status information indicates an abnormality, an abnormality prompt message can be generated and displayed on the display, or the abnormality prompt message can be sent to the terminal used by the relevant personnel.
[0057] The method provided by the above embodiment of the present disclosure, when the target application enters the target running stage, determines the running status of the target application in the target running stage and generates running status information, and then writes the running status information into the shared memory for the monitoring processing unit in the multi-processing unit to read the running status information from the shared memory and monitor the running status of the monitored processing unit. Thus, only the monitored processing unit needs to write the running status information of the target application in the target running stage into the shared memory, and the monitoring processing unit can read the running status information from the shared memory for monitoring the monitored processing unit, without using a debugger or a logging system to monitor the monitored processing unit, simplifying the observation conditions for monitoring the running status of the chip, improving the monitoring efficiency, and reducing the monitoring cost.
[0058] In some alternative implementation manners, the target running stage includes at least one running node. Among them, a running node represents a marked code position point in the code corresponding to the target running stage. For example, when the target running stage is the startup stage of the SPI driver module, the running nodes include: a clock register setting node, a power register setting node, a working mode register setting node, a working frequency register setting node, a software buffer setting node, an interrupt setting node, etc.
[0059] As Figure 3 shown, based on the above at least one running node, step 201 may include:
[0060] Step 2011, determine the running state of the current running node of the target application in the target running stage.
[0061] Continuing with the above example, the current running node may be the software buffer setting node, that is, when the target running stage runs to the software buffer setting node, determine the running state of the software buffer setting node. For example, when an exception occurs when running to the software buffer setting node, an exception code may be output, thereby determining that the running state of the software buffer setting node is an abnormal state; or, when running to the software buffer setting node, if the next running node (i.e., the interrupt setting node) is not executed after a preset duration, then determine that the running state of the software buffer setting node is an abnormal state.
[0062] Based on this, step 202 may include:
[0063] Step 2021, generate running state information of the target running stage based on the running state of the current running node.
[0064] Continuing with the above example, the running nodes included in the startup stage of the SPI driver module each correspond to a status code. For example, the status code of the clock register setting node is 1, the status code of the power register setting node is 2, the status code of the working mode register setting node is 3, the status code of the working frequency register setting node is 4, the status code of the software buffer setting node is 5, the status code of the interrupt setting node is 6, etc.
[0065] As another example, when the target running stage represents the sleep stage of the UART driver module, the running nodes and the corresponding running state information include: receiving a sleep command, status code 0; clearing registers, status code 1; turning off the clock, status code 2; turning off the module power supply, status code 3; notifying the operating system that the UART can sleep, status code 4.
[0066] When the target running stage represents the wake-up stage of the UART driver module, the running nodes and the corresponding running status information include: receiving a wake-up command, status code 0; turning on the module power supply, status code 1; turning on the clock, status code 2; notifying the operating system that the UART has been woken up, status code 3.
[0067] In this implementation manner, by determining the running status of the running nodes in the target running stage of the target application program and generating the running status information, it is possible to store each piece of running status information generated during the target running stage into the shared memory in real time. The monitoring processing unit monitors the execution process of the target running stage in real time, and can more accurately monitor the execution process of the target running stage of the target application program, which helps to more accurately locate the abnormal point when an abnormality occurs in the target running stage.
[0068] In some optional implementation manners, in step 201, the monitored processing unit may generate the initial running status information of the target running stage in response to the target application program entering the target running stage.
[0069] Based on this, in the above optional embodiment, generating the running status information of the target running stage based on the running status of the current running node may include:
[0070] First, in response to determining that the running status of the current running node is abnormal, exit the running of the target running stage. It should be noted that if the current running node is abnormal, directly exit the running of the target application program and do not generate subsequent running status information. Correspondingly, if the current running node runs successfully, generate the corresponding running status information.
[0071] Then, when it is determined that the current running node is the first running node of the target running stage, determine the initial running status information as the running status information of the target running stage; when it is determined that the current running node is a non-first running node in the target running stage, determine the running status information corresponding to the previous running node of the current running node as the running status information of the target running stage.
[0072] Taking the sleep stage of the UART driver module as the target running stage in the above optional embodiment as an example, the initial running status information may be status code 0, that is, after receiving the sleep command, enter the sleep stage and generate the initial status code 0. The first running node may be to clear the register. If an abnormality occurs when clearing the register, immediately exit the sleep stage of the UART driver module, and determine the initial status code 0 as the running status information of the sleep stage of the UART driver module.
[0073] If an exception occurs when the clock node is closed, the UART driver module immediately exits the sleep phase, and determines the status code 1 corresponding to the previous running node (i.e., the cleaning register) as the running status information of the target running phase. Since the previous running node wrote the status code 1 into the shared memory after successful operation, at this time, the status code 2 corresponding to the current running node will not be written into the shared memory. If the monitoring and processing unit 102 reads from the shared memory that the running status information of the sleep phase of the UART driver module is the status code 1, it can be determined that an exception occurred when the sleep phase of the UART driver module ran to the clock closing node. It should be noted that the monitoring and processing unit 102 can determine whether an exception occurs in the current running node according to the pre-set rules, and then determine the running node where the exception occurred according to the read running status information. For example, a reading time point can be set, which is the expected time point pre-set to represent the successful end of the target running phase. If the running status information read at the reading time point is not the running status information of the last running node of the target running phase, it is determined that the running node corresponding to the read running status information has an exception.
[0074] This implementation method realizes that when an exception occurs in a certain running node of the target running phase of the target application program, the monitoring and processing unit can accurately locate the running node where the exception occurred according to the running status information read from the shared memory, thereby improving the accuracy of monitoring the target running phase of the target application program. In addition, since this implementation method does not need to store the information indicating that an exception occurred in the running node separately, the storage resources of the shared memory can be saved.
[0075] In some optional implementation methods, in the above optional embodiments, generating the running status information of the target running phase based on the running status of the current running node includes:
[0076] In response to determining that the running status of the current running node is normal operation, generate the running normal information indicating the running status of the current running node, and determine the running normal information as the running status information of the target running phase.
[0077] Taking the sleep phase of the above UART driver module as an example, if the cleaning register is executed normally, the corresponding status code 1 is generated, and the status code 1 is determined as the current running status information of the sleep phase of the UART driver module. The UART driver module continues to execute the clock closing node. If the clock closing node is executed normally, the current running status information of the sleep phase of the UART driver module is updated to the status code 2.
[0078] This implementation method can realize that the monitoring and processing unit can monitor in real time which running node the target running phase of the target application program is currently running normally to according to the running status information read from the shared memory, improving the accuracy of monitoring.
[0079] In some optional implementations, in the above optional embodiment, generating the operating status information of the target operating stage based on the operating status of the current operating node may include:
[0080] First, in response to determining that the running state of the current running node is abnormal, the running of the target running phase is exited.
[0081] Then, operation abnormality information indicating the operation status of the current operation node is generated, and the operation abnormality information is determined as the operation status information of the target operation stage.
[0082] Taking the sleep phase of the above-mentioned UART driver module as an example, if an exception occurs when the clock node is closed, the sleep phase of the UART driver module is immediately exited, and operation exception information "2, -1" corresponding to the exception occurring when the clock node is closed is generated.
[0083] This implementation method generates operation exception information of the operation node where the exception occurs, so that the monitoring processing unit can clearly determine the operation node where the exception occurs based on the operation exception information read from the shared memory, thereby achieving accurate positioning of the abnormal node.
[0084] In some optional implementations, step 203 may be performed as follows:
[0085] The running status information is written into the target storage area corresponding to the target running stage in the shared memory.
[0086] like Figure 4 As shown, tables 1031, 1032, and 1033 are pre-set in the shared memory 103, and each cell in the table corresponds to a running stage of an application. Figure 4 As shown, table 1031 is used to record the startup status of each application, table 1032 is used to record the sleep status of each application, and table 1033 is used to record the wake-up status of each application. As an example, if the target application is an SPI driver module and the target operation phase is the program startup phase, then the cell in row 5 of table 1031 is used to store the operation status information of the SPI driver module during the startup phase, that is, this cell is the target storage area.
[0087] It should be noted that Figure 4 The form and number of the various tables shown are only schematic and can be set arbitrarily according to actual needs. For example, since the sleep state and the wake-up state will not occur at the same time, Figure 4 Tables 1032 and 1033 are merged into one table, in which each cell is used to record the dormant state or awake state of the corresponding application.
[0088] In this implementation manner, by pre - allocating a target storage area for the target running stage of the target application, the monitoring processing unit can quickly and accurately read the running state information of the target running stage of the target application from the target storage area, which helps to improve the accuracy and efficiency of monitoring.
[0089] Figure 5 It is a schematic flowchart of a method for monitoring the running state of a multi - processing unit provided by an exemplary embodiment of the present disclosure. This embodiment can be applied to a monitoring processing unit 102 as shown in Figure 1 shown, as shown in Figure 5 shown, the method includes the following steps:
[0090] Step 501, in response to an operation of triggering the reading of the running state information, read the running state information from the shared memory.
[0091] In this embodiment, the monitoring processing unit 102 can, in response to an operation of triggering the reading of the running state information, read the running state information from the shared memory. Among them, the running state information is generated by the target application of the monitored processing unit 101 running in the multi - processing unit during the target running stage.
[0092] The execution of the above - mentioned reading of the running state information can be automatically performed by the monitoring processing unit 102. For example, it can detect in real - time or periodically whether the running state information in the shared memory has been updated. If an update event occurs, it reads the updated running state information; the reading of the running state information can also be performed under the manual operation of the user.
[0093] Step 502, based on the running state information, determine the current running state of the target running stage.
[0094] In this embodiment, the monitoring processing unit 102 can, based on the running state information, determine the current running state of the target running stage. Specifically, the monitoring processing unit 102 can determine the current running state of the target running stage according to the pre - set correspondence between the running state information and the running state. For example, if the running state information is the preset information, it is determined that the current running state of the target running stage is the normal state; if the running state information is not the preset information, it is determined that the current running state of the target running stage is the abnormal state.
[0095] The method provided by the above embodiments of the present disclosure reads the running status information generated by the target application in the target running stage from the shared memory, and determines the current running status of the target running stage according to the read running status information, thereby realizing the monitoring of the monitored processing unit by the monitoring processing unit without using a debugger or a logging system to monitor the monitored processing unit, simplifying the observation conditions for monitoring the running status of the chip, improving the monitoring efficiency, and reducing the monitoring cost.
[0096] In some alternative implementation manners, as Figure 6 shown, step 502 may include the following sub-steps:
[0097] Step 5021, in response to determining that the running status information is inconsistent with the preset running status information, determine that the current running status is an abnormal running status.
[0098] Wherein, the preset running status information indicates that the target running stage is in normal operation. The preset running status information may correspond to the entire normal operation of the target running stage, or may correspond to the normal operation of a certain running node in the target running stage. When the read running status information is consistent with the preset running status information, it indicates that the entire target running stage is in normal operation, or that the current running node is in normal operation.
[0099] Step 5022, generate an exception prompt information for prompting the abnormal running status.
[0100] As an example, the exception prompt information may include the identifier of the target application, the identifier of the target running stage, the time of the occurrence of the exception, the reason for the occurrence of the exception, etc.
[0101] Generally, the exception prompt information may be further output in various ways. For example, the exception prompt information may be displayed on a display, or the exception prompt information may be sent to a remote terminal.
[0102] This implementation manner can realize the real-time and accurate monitoring of the exception by the monitoring processing unit when an exception occurs in the target running stage of the target application running on the monitored processing unit by comparing the read running status information with the preset status information, which helps to process the exception in a timely manner.
[0103] In some alternative implementation manners, as Figure 7 shown, step 5022 may include the following sub-steps:
[0104] Step 50221, determine the current running node in the target running stage corresponding to the running status information.
[0105] Among them, the current running node is the running node that is currently being executed among at least one running node included in the target running phase of the target application. For the description of at least one running node, reference can be made to the optional implementation manners in the corresponding embodiments above, which will not be elaborated here. Figure 2 Corresponding to the optional implementation manners in the corresponding embodiments, they will not be elaborated here.
[0106] Step 50222: Generate an exception prompt message indicating that a running exception has occurred when running to the current running node.
[0107] As an example, when the target running phase is the sleep phase of the UART driver module, the running nodes and the corresponding running status information include: receiving a sleep command, status code 0; clearing registers, status code 1; turning off the clock, status code 2; turning off the module power supply, status code 3; notifying the operating system that the UART can sleep, status code 4. The monitoring and processing unit 102 can determine the current running node where the exception occurs according to the status code, and then generate an exception prompt message corresponding to the current running node. For example, if an exception occurs at the node of clearing registers, an exception prompt message in text form "UART sleep exception, exception node: clearing registers" can be generated.
[0108] This implementation manner can accurately prompt the user of the exception node where the exception occurs by generating an exception prompt message indicating that a running exception has occurred when running to the current running node, which helps the user to accurately locate the exception node and improve the efficiency of handling the exception.
[0109] In some optional implementation manners, the above step 501 includes:
[0110] In response to the current time reaching the expected running completion time corresponding to the target running phase, read the running status information from the shared memory.
[0111] Among them, the expected running completion time can be determined according to a preset duration. Usually, the target running phase will normally end within the preset duration, so the running status information read from the shared memory at the expected running completion time can indicate whether the target running phase has ended normally. When the number of target applications is multiple, these target applications enter the corresponding target running phases in sequence. The monitoring and processing unit reads the corresponding running status information from the shared memory at the corresponding expected running completion times in sequence according to the order in which these target applications enter the corresponding target running phases, thus realizing the monitoring of the target running phases of multiple target applications.
[0112] This implementation manner can realize the non-real-time reading of the running status information by reading the running status information from the shared memory at the expected running completion time, thereby simplifying the monitoring steps of the monitoring and processing unit and helping to improve the running efficiency of the monitoring and processing unit.
[0113] In some alternative implementation manners, step 502 may be executed as follows:
[0114] If the running status information is the same as the running status information corresponding to the last running node in the target running phase, determine that the current running status of the target running phase is the normal status.
[0115] If the running status information is not the same as the running status information corresponding to the last running node in the target running phase, determine that the current running status of the target running phase is the abnormal status.
[0116] For example, taking the sleep phase of the UART driver module in the above example as an illustration, if the running status information read by the monitoring processing unit 102 at the expected running completion time is status code 4, it indicates that the sleep phase ends normally; if the read running status information is not status code 4, it indicates that an abnormality occurs in the sleep phase.
[0117] Optionally, when the running status information indicates that the current running status of the target running phase is the abnormal status, the monitoring processing unit may further determine the running node where the abnormality occurs in the target running phase according to the running status information. For example, continuing with the above example, if the running status information is status code 2 and the corresponding running node is the clock closing node, it can be determined that the clock closing node runs normally and an abnormality occurs in the next node of the clock closing node (i.e., the module power supply closing node).
[0118] In some alternative implementation manners, in step 501, the monitoring processing unit 102 may read the running status information from the shared memory according to the following steps:
[0119] Read the running status information from the target storage area in the shared memory corresponding to the target application.
[0120] As an example, as Figure 4 shown, if the target application is the SPI driver program module and the target running phase is the program startup phase, the 5th row cell in Table 1031 is used to store the running status information of the startup phase of the SPI driver program module, that is, this cell is the target storage area. The monitoring processing unit 102 may read the running status information of the program startup phase of the SPI driver program module from this cell.
[0121] This implementation manner enables the monitoring processing unit to quickly and accurately read the running status information of the target running phase of the target application from the target storage area, which helps to improve the accuracy and efficiency of monitoring.
[0122] Exemplary Device
[0123] Figure 8It is a schematic structural diagram of an operating state monitoring device for a multi - processing unit provided by an exemplary embodiment of the present disclosure. This embodiment can be applied to the monitored processing unit 101 as shown in Figure 1 shown, and as shown in Figure 8 the device includes: a first determination module 801, configured to determine the operating state of a target application in a target operating stage in response to the target application entering the target operating stage; a first generation module 802, configured to generate operating state information representing the operating state; and a writing module 803, configured to write the operating state information into a shared memory for a monitoring processing unit in the multi - processing unit to read the operating state information from the shared memory and monitor the operating state of the monitored processing unit.
[0124] In this embodiment, the first determination module 801 can determine the operating state of the target application in the target operating stage in response to the target application entering the target operating stage. Among them, the target application can be an application specified to monitor its operating state among the applications running on the monitored processing unit 101. For example, the target application can be a program module of software that executes a certain function, such as a Uboot bootloader module, a file system mounting program module, a face recognition module, a voice recognition module, etc. The target application can also be a program module that drives a certain hardware module, such as an SPI (Serial Peripheral Interface) bus driver module, an I2C (Inter - Integrated Circuit) bus driver module, a UART (Universal Asynchronous Receiver / Transmitter) driver module, etc.
[0125] The target operating stage can be an operating stage specified to be monitored during the running process of the target application.
[0126] The operating state of the target operating stage can be determined in various ways. For example, when an exception occurs in the target operating stage, an exception code is automatically output, thereby determining that the operating state of the target operating stage is an abnormal state. Or, when the target operating stage has not been completed within a set time, it is determined that the operating state of the target operating stage is an abnormal state.
[0127] In this embodiment, the first generation module 802 can generate operating state information representing the operating state. Among them, the operating state information can be various forms of information, such as numbers, text, sound signals, etc. For example, the number 1 represents a normal operating state, and the number 0 represents an abnormal operating state.
[0128] In this embodiment, the writing module 803 can write the operation status information into the shared memory 103 for the monitoring processing unit 102 to read the operation status information from the shared memory 103 and monitor the operation status of the monitored processing unit.
[0129] For example, the operation status information may include the generation time of the operation status information, the node mark currently executed in the target operation stage, the operation status code, etc. The monitoring processing unit 102 can perform various forms of information output according to the operation status information. For example, when the operation status information indicates an abnormality, an abnormality prompt message can be generated and displayed on the display, or the abnormality prompt message can be sent to the terminal used by the relevant personnel.
[0130] Refer to Figure 9 , Figure 9 which is a schematic structural diagram of an operation status monitoring device for a multi-processing unit provided in another exemplary embodiment of the present disclosure.
[0131] In some optional implementation manners, the target operation stage includes at least one operation node; the first determination module 801 is further configured to: determine the operation status of the current operation node of the target application program in the target operation stage; the first generation module 802 is further configured to: generate the operation status information of the target operation stage based on the operation status of the current operation node.
[0132] In some optional implementation manners, the first determination module 801 is further configured to generate the initial operation status information of the target operation stage; the first generation module 802 includes: a first exit unit 8021, configured to exit the operation of the target operation stage in response to determining that the operation status of the current operation node is abnormal; a first determination unit 8022, configured to determine the initial operation status information as the operation status information of the target operation stage when determining that the current operation node is the first operation node of the target operation stage; a second determination unit 8023, configured to determine the operation status information corresponding to the previous operation node of the current operation node as the operation status information of the target operation stage when determining that the current operation node is a non-first operation node in the target operation stage.
[0133] In some optional implementation manners, the first generation module 802 is further configured to: generate operation normal information indicating the operation status of the current operation node in response to determining that the operation status of the current operation node is normal operation, and determine the operation normal information as the operation status information of the target operation stage.
[0134] In some alternative implementations, the first generation module 802 includes: a second exit unit 8024, configured to exit the operation of the target operation phase in response to determining that the operation state of the current running node is abnormal; a third determination unit 8025, configured to generate operation exception information representing the operation state of the current running node, and determine the operation exception information as the operation state information of the target operation phase.
[0135] In some alternative implementations, the writing module 803 is further configured to: write the operation state information into a target storage area corresponding to the target operation phase in the shared memory.
[0136] In some alternative implementations, the target operation phase includes any one of the following: the program startup phase of the target application, the sleep startup phase, and the wake-up startup phase.
[0137] The operation state monitoring device for the multi-processing units on the chip provided in the foregoing embodiments of the present disclosure determines the operation state of the target application in the target operation phase and generates operation state information when the target application enters the target operation phase, and then writes the operation state information into the shared memory, so that the monitoring processing unit in the multi-processing units can read the operation state information from the shared memory and monitor the operation state of the monitored processing unit. Thus, it is realized that the monitored processing unit only needs to write the operation state information of the target application in the target operation phase into the shared memory, and the monitoring processing unit reads the operation state information from the shared memory to monitor the monitored processing unit, without using a debugger or a logging system to monitor the monitored processing unit, simplifies the observation conditions for monitoring the operation state of the chip, improves the monitoring efficiency, and reduces the monitoring cost.
[0138] Figure 10 It is a schematic structural diagram of an operation state monitoring device for multi-processing units provided by an exemplary embodiment of the present disclosure. This embodiment can be applied to a monitoring processing unit 102 as shown in Figure 1 shown. As shown in Figure 10 shown, the device includes: a reading module 1001, configured to read operation state information from the shared memory in response to an operation of triggering the reading of the operation state information, where the operation state information is generated by a target application of a monitored processing unit running in the multi-processing units in a target operation phase; a second determination module 1002, configured to determine the current operation state of the target operation phase based on the operation state information.
[0139] In this embodiment, the reading module 1001 can read operation state information from the shared memory in response to an operation of triggering the reading of the operation state information. Wherein, the operation state information is generated by a target application of the monitored processing unit 101 running in the multi-processing units in a target operation phase.
[0140] The operation of reading the running status information described above can be automatically performed by the monitoring processing unit 102 (for example, detecting in real time or periodically whether the running status information in the shared memory has been updated, and if so, reading the updated running status information), or can be performed under the manual operation of the user.
[0141] In this embodiment, the second determination module 1002 may determine the current running status of the target running stage based on the running status information. Specifically, the second determination module 1002 may determine the current running status of the target running stage according to the pre-set correspondence between the running status information and the running status. For example, if the running status information is the preset information, it is determined that the current running status of the target running stage is the normal status, and if the running status information is not the preset information, it is determined that the current running status of the target running stage is the abnormal status.
[0142] Referring to Figure 11 , Figure 11 is a schematic structural diagram of a running status monitoring device for multiple processing units provided by another exemplary embodiment of the present disclosure.
[0143] In some optional implementation manners, the second determination module 1002 includes: a fourth determination unit 10021, configured to determine that the current running status is the running abnormal status in response to determining that the running status information is inconsistent with the preset running status information; and a generation unit 10022, configured to generate an abnormal prompt information for prompting the running abnormal status.
[0144] In some optional implementation manners, the generation unit 10022 includes: a determination subunit 100221, configured to determine the current running node in the target running stage corresponding to the running status information; and a generation subunit 100222, configured to generate an abnormal prompt information indicating that a running abnormality occurs when running to the current running node.
[0145] In some optional implementation manners, the reading module 1001 is further configured to: in response to the current time reaching the expected running completion time corresponding to the target running stage, read the running status information from the shared memory.
[0146] In some optional implementation manners, the second determination module 1002 includes: a fifth determination unit 10023, configured to determine that the current running status of the target running stage is the normal status if the running status information is consistent with the running status information corresponding to the last running node in the target running stage; and a sixth determination unit 10024, configured to determine that the current running status of the target running stage is the abnormal status if the running status information is inconsistent with the running status information corresponding to the last running node in the target running stage.
[0147] In some alternative implementations, the reading module is further configured to: read the running status information from a target storage area corresponding to the target application program in the shared memory.
[0148] The running status monitoring device for multi-processing units provided in the above embodiments of the present disclosure reads the running status information generated by the target application program in the target running stage from the shared memory, and determines the current running status of the target running stage according to the read running status information, thereby realizing the monitoring of the monitored processing unit by the monitoring processing unit, without using a debugger or a logging system to monitor the monitored processing unit, simplifying the observation conditions for monitoring the running status of the chip, improving the monitoring efficiency, and reducing the monitoring cost.
[0149] Exemplary Chip
[0150] An exemplary embodiment of the present disclosure further provides a chip, which is connected to a memory or includes a memory. The chip further includes at least one monitored processing unit and a monitoring processing unit. Generally, the chip may be a SOC (System on Chip), and the SOC includes a plurality of heterogeneous processing units, including a main processing unit (also known as a main core) and at least one slave processing unit (also known as a slave core). Since the main processing unit usually runs more and more complex application programs, at least one monitored processing unit usually includes the main processing unit and may also include a slave processing unit. The monitoring processing unit may be a slave processing unit or a main processing unit. In short, the main processing unit may serve as the monitored processing unit 101 or the monitoring processing unit 102. And, the slave processing unit may serve as the monitored processing unit 101 or the monitoring processing unit 102.
[0151] Each of the at least one monitored processing units is configured to read and execute the corresponding executable instructions stored in the memory to implement the Figure 2 method described in any of the corresponding embodiments and their alternative implementations.
[0152] The monitoring processing unit is configured to read and execute the corresponding executable instructions stored in the memory to implement the Figure 5 method described in any of the corresponding embodiments and their alternative implementations.
[0153] It should be noted that the shared memory used by the monitored processing unit and the monitoring processing unit in the chip to monitor the target running stage of the target application program may be set outside the chip. Optionally, the chip may further include a shared memory for storing the running status information generated by the monitored processing unit.
[0154] Exemplary Electronic Device
[0155] Next, with reference to Figure 12 the electronic device according to an embodiment of the present disclosure will be described. Figure 12 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0156] As Figure 12 shown, the electronic device 1200 includes at least one monitored processing unit 1201, a monitoring processing unit 1202, a shared memory 1203, and a memory 1204 for storing executable instructions of the at least one monitored processing unit 1201 and the monitoring processing unit 1202.
[0157] The at least one monitored processing unit 1201 and the monitoring processing unit 1202 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 1200 to perform desired functions.
[0158] The memory 1204 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium.
[0159] Each monitored processing unit in the at least one monitored processing unit 1201 is configured to read corresponding executable instructions from the memory 1204 and execute the read executable instructions to implement the Figure 2 monitoring method for the multi-processing units on the chip and / or other desired functions provided by the corresponding embodiments and their optional implementations.
[0160] The monitoring processing unit is configured to read corresponding executable instructions from the memory 1204 and execute the read executable instructions to implement the Figure 5 monitoring method for the multi-processing units on the chip and / or other desired functions provided by the corresponding embodiments and their optional implementations.
[0161] In one example, the electronic device 1200 may further include: an input device 1205 and an output device 1206, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown).
[0162] For example, the input device 1205 can be a device such as a mouse or a keyboard, which is used to input various commands and the like for monitoring the target running stage of the target application. The input device 1205 can also be a communication network connector, which is used to receive from a remote end various commands and the like for monitoring the target running stage of the target application.
[0163] The output device 1206 can output various information to the outside, including operation status information and the like. The output device 1206 can include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, and so on.
[0164] Of course, for the sake of simplicity, Figure 12 only some of the components related to the present disclosure in the electronic device 1200 are shown in [the figure], and components such as a bus, an input / output interface, and so on are omitted. In addition, according to specific application scenarios, the electronic device 1200 may further include any other appropriate components.
[0165] Exemplary Computer Program Product and Computer Readable Storage Medium
[0166] In addition to the above methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions. When the computer program instructions are run by a processor, the processor is caused to execute the steps in the operation state monitoring method of a multi-processing unit according to various embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.
[0167] The computer program product can be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The programming code can be executed completely on a user computing device, partially on a user device, executed as an independent software package, partially on a user computing device and partially on a remote computing device, or completely on a remote computing device or server.
[0168] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are run by a processor, the processor is caused to execute the steps in the operation state monitoring method of a multi-processing unit according to various embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.
[0169] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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 above.
[0170] The basic principles of the present disclosure have been described in conjunction with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are only examples and not limitations. It cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present disclosure. In addition, the above-mentioned specific details are only for illustrative and facilitating understanding purposes, rather than limitations. The above details do not limit the present disclosure to necessarily adopt the above specific details for implementation.
[0171] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For system embodiments, since they basically correspond to method embodiments, the description is relatively simple. For relevant parts, reference can be made to the partial description of the method embodiments.
[0172] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are only illustrative examples and do not intend to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any way. Words such as "including", "comprising", "having", etc. are open-ended terms, meaning "including but not limited to", and can be used interchangeably with each other. The word "or" and "and" used herein refer to the word "and / or", and can be used interchangeably with each other, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to", and can be used interchangeably with each other.
[0173] The methods and apparatuses of the present disclosure may be implemented in many ways. For example, the methods and apparatuses of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of the steps for the method is for illustration only. The steps of the method of the present disclosure are not limited to the specific order described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0174] It should also be noted that in the apparatuses, devices, and methods of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present disclosure.
[0175] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0176] The above description has been given for purposes of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.
Claims
1. A method for monitoring the operating state of a multi - processing unit, which is applied to the monitored processing unit in the multi - processing unit. The method includes: Responding to the target application entering the target running stage, determining the running state of the target application in the target running stage, where the target application is an application running on the monitored processing unit; Generating running state information representing the running state; Writing the running state information into the shared memory for the monitoring processing unit in the multi - processing unit to read the running state information from the shared memory and monitor the running state of the monitored processing unit; Wherein, the target running stage includes multiple running nodes, and the running node represents the marked code position point in the code corresponding to the target running stage; The determining the running state of the target application in the target running stage includes: Determining the running state of the current running node of the target application in the target running stage; The generating the running state information representing the running state includes: Generating the running state information of the target running stage based on the running state of the current running node, and the running state information includes the node mark currently executed in the target running stage.
2. The method according to claim 1, wherein, Before the determining the running state of the target application in the target running stage, the method further includes: Generating the initial running state information of the target running stage; The generating the running state information of the target running stage based on the running state of the current running node includes: Responding to determining that the running state of the current running node is abnormal, exiting the running of the target running stage; When determining that the current running node is the first running node of the target running stage, determining the initial running state information as the running state information of the target running stage; When determining that the current running node is a non - first running node of the target running stage, determining the running state information corresponding to the previous running node of the current running node as the running state information of the target running stage.
3. The method according to claim 2, wherein, The generating the running state information of the target running stage based on the running state of the current running node includes: Responding to determining that the running state of the current running node is normal running, generating running normal information representing the running state of the current running node, and determining the running normal information as the running state information of the target running stage.
4. The method according to claim 2, wherein, The generating the running state information of the target running stage based on the running state of the current running node includes: Responding to determining that the running state of the current running node is abnormal, exiting the running of the target running stage; Generating running abnormal information representing the running state of the current running node, and determining the running abnormal information as the running state information of the target running stage.
5. The method according to any one of claims 1-4, wherein, The target running stage includes any one of the following: the program startup stage, the sleep startup stage, and the wake - up startup stage of the target application.
6. A method for monitoring the running state of a multi - processing unit, which is applied to a monitoring processing unit in the multi - processing unit. The method includes: Responding to an operation of triggering the reading of running state information, reading the running state information from a shared memory, where the running state information is generated by a monitored processing unit running in the multi - processing unit based on the running state of the current running node of a target application in a target running phase. The target running phase includes multiple running nodes, and the running node represents a marked code position point in the code corresponding to the target running phase. The running state information includes the node mark currently executed in the target running phase; Based on the running state information, monitoring the current running state of the target running phase.
7. The method according to claim 6, wherein, The step of "Based on the running state information, monitoring the current running state of the target running phase" includes: Responding to determining that the running state information is inconsistent with preset running state information, determining that the current running state is an abnormal running state; Generating an abnormal prompt information for prompting the abnormal running state.
8. The method according to claim 7, wherein, The step of "Generating an abnormal prompt information for prompting the abnormal running state" includes: Determining the current running node in the target running phase corresponding to the running state information; Generating an abnormal prompt information indicating that an abnormal running occurs when running to the current running node.
9. The method according to claim 6, wherein, The step of "Responding to an operation of triggering the reading of running state information, reading the running state information from a shared memory" includes: Responding to the current time reaching the expected running completion time corresponding to the target running phase, reading the running state information from the shared memory.
10. The method according to claim 9, wherein, The step of "Based on the running state information, monitoring the current running state of the target running phase" includes: If the running state information is consistent with the running state information corresponding to the last running node in the target running phase, determining that the current running state of the target running phase is a normal state; If the running state information is inconsistent with the running state information corresponding to the last running node in the target running phase, determining that the current running state of the target running phase is an abnormal state.
11. A device for monitoring the running state of a multi - processing unit, which is applied to a monitored processing unit in the multi - processing unit. The device includes: A first determination module, configured to determine the running state of a target application in a target running phase in response to the target application entering the target running phase, where the target application is an application running on the monitored processing unit; A first generation module, configured to generate running state information representing the running state; A writing module, configured to write the running state information into a shared memory for a monitoring processing unit in the multi - processing unit to read the running state information from the shared memory and monitor the running state of the monitored processing unit; where the target running phase includes multiple running nodes, and the running node represents a marked code position point in the code corresponding to the target running phase; The first determination module is further configured to: Determine the running status of the current running node of the target application in the target running phase; The first generation module is further configured to: Generate the running status information of the target running phase based on the running status of the current running node, where the running status information includes the node mark currently executed in the target running phase.
12. A running status monitoring device for a multi-processing unit, the device is applied to a monitoring processing unit in the multi-processing unit, and the device includes: A reading module, configured to read the running status information from the shared memory in response to an operation of triggering the reading of the running status information, where the running status information is generated by a monitored processing unit running in the multi-processing unit based on the running status of the current running node of the target application in the target running phase, the target running phase includes a plurality of running nodes, the running node represents a marked code position point in the code corresponding to the target running phase, and the running status information includes the node mark currently executed in the target running phase; A second determination module, configured to monitor the current running status of the target running phase based on the running status information.
13. A computer-readable storage medium, the storage medium stores a computer program, and the computer program is used to execute the method according to any one of claims 1-10 above.
14. An electronic device, the electronic device includes at least one monitored processing unit, a monitoring processing unit, a shared memory, and a memory for storing executable instructions of the at least one monitored processing unit and the monitoring processing unit; Each monitored processing unit in the at least one monitored processing unit is configured to read the corresponding executable instructions from the memory and execute the read executable instructions to implement the method according to any one of claims 1-5 above; The monitoring processing unit is configured to read the corresponding executable instructions from the memory and execute the read executable instructions to implement the method according to any one of claims 6-10 above.
Citation Information
Patent Citations
Monitoring method for multi-core processor and system thereof
CN102073572A