Function diagnosis method, device and system and processor management system

By introducing the first processing module and the second processing module into the processor function diagnosis system, using the different operating characteristics of the first processing module and the second processing module, effective diagnosis can be made without prohibiting interrupts during the processor function diagnosis process, and the performance impact and system overhead problems caused by prohibiting interrupts in the prior art are solved.

CN120045367APending Publication Date: 2025-05-27HANGZHOU HOLLYSYS AUTOMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411903169.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In the process of processor function diagnosis, prohibiting interrupts leads to a large impact on system performance and high system overhead.

Method used

By introducing a first processing module and a second processing module into the processor function diagnostic system, the first processing module is run in the user state and the second processing module is run in the kernel state. When the function to be diagnosed meets the target condition, the first processing module sends a diagnosis request to the second processing module to perform abnormal diagnosis, and prohibits task scheduling during the diagnosis process.

Benefits of technology

It effectively reduces the overall performance impact on the relevant system, reduces system overhead, and avoids the performance loss and overhead increase caused by prohibiting interrupts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045367A_ABST
    Figure CN120045367A_ABST
Patent Text Reader

Abstract

The invention provides a function diagnosis method, device and system and a processor management system.The function diagnosis method is applied to a first processing module in a function diagnosis system of a target processor, and the first processing module runs in a user mode of the function diagnosis system.The method comprises the steps that a to-be-diagnosed function of the target processor is obtained; when the to-be-diagnosed function meets the target condition, a diagnosis request is sent to a second processing module of the function diagnosis system, the diagnosis request is used for controlling the second processing module to carry out abnormity diagnosis on the to-be-diagnosed function of the target processor, and the second processing module runs in a kernel mode of the function diagnosis system; the target condition comprises forbidding task scheduling in the diagnosis process, so that in the process of performing function diagnosis on the processor, the influence on the overall performance of a related system can be effectively reduced, and the system overhead of the related system is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of processor management, and more specifically, to a function diagnosis method, device, system, and processor management system in the technical field of processor management. Background Art

[0002] A processor is the core component of systems such as computers and controllers, responsible for executing all computing and processing tasks. The performance of the processor directly affects the overall operation effect of the system. Therefore, performing function diagnosis on the processor is an important strategy to ensure the performance of the processor.

[0003] Currently, function diagnosis of a processor is usually performed through a functional safety system. During the process of performing function diagnosis on the processor, the functional safety system usually needs to disable interrupts to avoid the occurrence of task scheduling behavior during the function diagnosis of the processor, thereby ensuring the effective execution of the function diagnosis of the processor. However, disabling interrupts has a greater impact on the overall performance of the functional safety system and causes a large system overhead. Summary of the Invention

[0004] To solve the above technical problems, this application provides a function diagnosis method, device, system, and processor management system to reduce the impact on the overall performance of the relevant system and reduce the system overhead of the relevant system during the process of performing function diagnosis on the processor.

[0005] According to the first aspect of the embodiments of this application, a function diagnosis method is provided, which is applied to a first processing module in a function diagnosis system of a target processor. The first processing module runs in the user state of the function diagnosis system. The method includes:

[0006] Obtain the function to be diagnosed of the target processor;

[0007] When the function to be diagnosed meets the target conditions, send a diagnosis request to a second processing module of the function diagnosis system. The diagnosis request is used to control the second processing module to perform an abnormal diagnosis on the function to be diagnosed of the target processor. The second processing module runs in the kernel state of the function diagnosis system, and the target conditions include prohibiting task scheduling during the diagnosis process.

[0008] Optionally, the function diagnosis system further includes a function diagnosis interface module, and the function diagnosis interface module includes one or more diagnosis interfaces. The obtaining the function to be diagnosed of the target processor includes:

[0009] In response to a call operation and a parameter input operation on a diagnosis interface in the function diagnosis interface module, determine the function to be diagnosed of the target processor.

[0010] Optionally, the functional diagnosis interface module includes a plurality of the diagnosis interfaces corresponding one-to-one to a plurality of predetermined function types of the target processor; the function to be diagnosed includes sub-functions under at least one of the predetermined function types of the target processor.

[0011] Determining the function to be diagnosed of the target processor in response to a call operation and a parameter input operation on the diagnosis interface in the functional diagnosis interface module includes:

[0012] In response to a call operation on the diagnosis interface in the functional diagnosis interface module, determining a target diagnosis interface, and taking the predetermined function type corresponding to the target diagnosis interface as a target function type;

[0013] In response to a parameter input operation on the target diagnosis interface, determining a diagnosis parameter corresponding to the target function type;

[0014] Based on the diagnosis parameter corresponding to the target function type, determining a target sub-function under the target function type, and taking the target sub-function under the target function type as the function to be diagnosed of the target processor.

[0015] Optionally, after sending a diagnosis request to a second processing module of the functional diagnosis system, it further includes:

[0016] Obtaining abnormal diagnosis information returned by the second processing module;

[0017] Outputting the abnormal diagnosis information through the diagnosis interface corresponding to the function to be diagnosed.

[0018] Optionally, sending a diagnosis request to a second processing module of the functional diagnosis system includes:

[0019] Sending a diagnosis request to the second processing module through a system call interface of the functional diagnosis system.

[0020] Optionally, the target condition further includes that the second processing module has access rights to the function to be diagnosed.

[0021] Optionally, it includes:

[0022] When the function to be diagnosed does not meet the target condition, performing an abnormal diagnosis on the function to be diagnosed of the target processor.

[0023] According to a second aspect of the embodiments of the present application, a functional diagnosis device is provided, which is applied to a first processing module in a functional diagnosis system of a target processor. The first processing module runs in the user state of the functional diagnosis system. The device includes:

[0024] A data acquisition module, configured to acquire the function to be diagnosed of the target processor;

[0025] A data processing module, configured to send a diagnosis request to the second processing module of the function diagnosis system when the function to be diagnosed meets the target conditions, where the diagnosis request is used to control the second processing module to perform an abnormality diagnosis on the function to be diagnosed of the target processor; the second processing module runs in the kernel mode of the function diagnosis system, and the target conditions include prohibiting task scheduling during the diagnosis process.

[0026] According to the third aspect of the embodiments of the present application, a function diagnosis system is provided, including a first processing module and a second processing module, where the first processing module runs in the user mode of the function diagnosis system, and the second processing module runs in the kernel mode of the function diagnosis system;

[0027] The first processing module is configured to acquire the function to be diagnosed of the target processor, and send a diagnosis request to the second processing module when the function to be diagnosed meets the target conditions, where the target conditions include prohibiting task scheduling during the diagnosis process;

[0028] The second processing module is configured to perform an abnormality diagnosis on the function to be diagnosed of the target processor based on the diagnosis request.

[0029] According to the fourth aspect of the embodiments of the present application, a processor management system is provided, including the function diagnosis system as described above.

[0030] According to the fifth aspect of the embodiments of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is run by a processor, the function diagnosis method as described in any one of the above is implemented.

[0031] According to the sixth aspect of the embodiments of the present application, a computer program product or a computer program is provided. The computer program product includes a computer program, and the computer program is stored in a computer-readable storage medium; a processor of the computer device reads the computer program from the computer-readable storage medium, and when the processor executes the computer program, the function diagnosis method as described in any one of the above is implemented.

[0032] As can be seen from the above technical solutions, the embodiments of the present application provide a function diagnosis method, apparatus, system and processor management system. The function diagnosis method is applied to a first processing module in the function diagnosis system of a target processor. The first processing module runs in the user mode of the function diagnosis system. The method obtains the function to be diagnosed of the target processor, and when the function to be diagnosed meets the target condition, sends a diagnosis request to the second processing module of the function diagnosis system. The diagnosis request is used to control the second processing module to perform an abnormality diagnosis on the function to be diagnosed of the target processor. The second processing module runs in the kernel mode of the function diagnosis system. The target condition includes prohibiting task scheduling during the diagnosis process. Thus, by setting up the function diagnosis system corresponding to the target processor, and when it is necessary to prohibit task scheduling during the diagnosis process of the function to be diagnosed of the target processor, the second processing module running in the kernel mode of the function diagnosis system is requested to execute the function diagnosis. There is no need to prohibit interrupts for the function diagnosis system or the system in which the function diagnosis system runs, which avoids the situation that the function diagnosis system or the system in which the function diagnosis system runs cannot respond in time to tasks other than the function diagnosis of the target processor due to prohibiting interrupts. Furthermore, during the process of performing function diagnosis on the target processor, the impact on the overall performance of the relevant systems can be effectively reduced; at the same time, there is no need to prohibit interrupts, so there is no need to save the task processing status before the interrupt, etc., reducing the system overhead of the relevant systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.

[0034] Figure 1 It is a flowchart of a function diagnosis method provided by an embodiment of this specification.

[0035] Figure 2 It is a structural diagram of a function diagnosis apparatus provided by an embodiment of this specification.

[0036] Figure 3 It is a structural diagram of a function diagnosis system provided by an embodiment of this specification.

[0037] Figure 4 It is a structural diagram of another function diagnosis system provided by an embodiment of this specification.

[0038] Figure 5 It is a structural diagram of yet another function diagnosis system provided by an embodiment of this specification. Detailed implementation mode

[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0040] Overview

[0041] As described in the background art, the processor is the core component of systems such as computers and controllers, responsible for executing all computing and processing tasks. The performance of the processor directly affects the overall operation effect of the system. Therefore, functional diagnosis of the processor is an important strategy to ensure the performance of the processor.

[0042] Currently, the processor is usually functionally diagnosed through a functional safety system. During the process of functionally diagnosing the processor, the functional safety system usually needs to disable interrupts to avoid the occurrence of task scheduling behaviors during the process of functionally diagnosing the processor, thereby ensuring the effective execution of the functional diagnosis of the processor. However, disabling interrupts makes the functional safety system unable to respond to tasks other than the functional diagnosis of the processor in a timely manner, which has a greater impact on the overall performance of the functional safety system; at the same time, during the process of disabling interrupts, it is necessary to save the task processing status before the interrupt, resulting in a large system overhead.

[0043] To solve the problem that the traditional method has a great impact on the overall performance of the functional safety system by prohibiting interrupts and causes a large system overhead, in the technical solution of this application, the function diagnosis method is applied to the first processing module in the function diagnosis system of the target processor. The first processing module runs in the user mode of the function diagnosis system. This method obtains the function to be diagnosed of the target processor and, when the function to be diagnosed meets the target conditions, sends a diagnosis request to the second processing module of the function diagnosis system. The diagnosis request is used to control the second processing module to perform an abnormal diagnosis on the function to be diagnosed of the target processor. The second processing module runs in the kernel mode of the function diagnosis system. The target conditions include prohibiting task scheduling during the diagnosis process. Thus, by setting up the function diagnosis system corresponding to the target processor and, when task scheduling needs to be prohibited during the diagnosis of the function to be diagnosed of the target processor, requesting the second processing module running in the kernel mode of the function diagnosis system to perform this function diagnosis, there is no need to prohibit interrupts for the function diagnosis system or the system in which the function diagnosis system runs, thereby avoiding the situation that the function diagnosis system or the system in which the function diagnosis system runs cannot respond in time to tasks other than the function diagnosis of the target processor due to prohibiting interrupts. Furthermore, during the process of performing function diagnosis on the target processor, the impact on the overall performance of the relevant system can be effectively reduced; at the same time, without prohibiting interrupts, there is no need to save the task processing state before the interrupt, etc., reducing the system overhead of the relevant system.

[0044] Based on the above inventive concept, the function diagnosis method provided in the embodiments of this specification will be described exemplarily below.

[0045] Exemplary Method

[0046] Please refer to Figure 1 , in an exemplary embodiment, a function diagnosis method is provided, which is applied to the first processing module in the function diagnosis system of the target processor. The first processing module runs in the user mode of the function diagnosis system. The method includes:

[0047] S101. Obtain the function to be diagnosed of the target processor.

[0048] Specifically, the target processor is the processor that needs to perform function diagnosis. The function diagnosis system of the target processor can be used to perform function diagnosis on various resource components of the target processor.

[0049] During implementation, the functional diagnosis system may adopt a microkernel operating system. Among them, the functional diagnosis system can be an independent system or a module in the microkernel operating system. For example, the functional diagnosis system can be a module added to a functional safety system or a processor management system that adopts a microkernel operating system. The functional diagnosis system may include a first processing module, and the first processing module can run in the user state of the functional diagnosis system.

[0050] The functions to be diagnosed of the target processor may include the functions to be abnormally diagnosed among the multiple functions of the target processor. Taking the target processor with the ARMv8-A architecture as an example, the multiple functions of the target processor may include various different types of functions, such as instruction pipelines, registers, interrupts, instruction sets, instruction caches, data caches, MMU (Memory Management Unit), data lines, and address lines. At the same time, each type of function may include at least one sub-function.

[0051] The first processing module can obtain the functions to be diagnosed of the target processor in real time. For example, the application side (such as the application layer of the functional safety system) can send functional diagnosis instructions to the functional diagnosis system according to a predetermined diagnosis cycle or other diagnosis requirements. The functional diagnosis instructions can be sent through data communication, or a diagnosis interface can be set in the functional diagnosis system to send functional diagnosis instructions to the functional diagnosis system by calling the diagnosis interface.

[0052] Optionally, the functions that need to be abnormally diagnosed among the functions of the target processor can also be pre-configured in the first processing module, and the diagnosis cycle and / or diagnosis order, etc. can be configured for each function that needs to be abnormally diagnosed. The first processing module can automatically determine the functions to be diagnosed of the target processor according to the pre-configured information.

[0053] S102. When the function to be diagnosed meets the target conditions, send a diagnosis request to the second processing module of the functional diagnosis system. The diagnosis request is used to control the second processing module to perform abnormal diagnosis on the function to be diagnosed of the target processor; the second processing module runs in the kernel state of the functional diagnosis system, and the target conditions include prohibiting task scheduling during the diagnosis process.

[0054] Specifically, the number of functions to be diagnosed of the target processor can be one or more. For any function to be diagnosed, the target conditions corresponding to the function to be diagnosed may include prohibiting task scheduling during the diagnosis process of the function to be diagnosed, that is, during the abnormal diagnosis process of the function to be diagnosed of the target processor, task switching is prohibited to ensure the effective diagnosis of the function to be diagnosed of the target processor.

[0055] The function diagnosis system may further include a second processing module, which may run in the kernel state of the function diagnosis system.

[0056] In implementation, when the function to be diagnosed meets the target conditions, a diagnosis request may be sent to the second processing module of the function diagnosis system. The diagnosis request may be used to control the second processing module to perform an abnormal diagnosis on the function to be diagnosed of the target processor, without disabling interrupts for the function diagnosis system or the system in which the function diagnosis system runs. Thus, it is avoided that disabling interrupts causes the function diagnosis system or the system in which the function diagnosis system runs to be unable to respond in time to tasks other than the function diagnosis of the target processor. Furthermore, during the process of performing function diagnosis on the target processor, the impact on the overall performance of the relevant system can be effectively reduced; at the same time, without disabling interrupts, there is no need to save the task processing state before the interrupt, etc., reducing the system overhead of the relevant system.

[0057] In an exemplary embodiment, the function diagnosis system further includes a function diagnosis interface module, and the function diagnosis interface module includes one or more diagnosis interfaces; obtaining the function to be diagnosed of the target processor includes:

[0058] Responding to a call operation and a parameter input operation on the diagnosis interface in the function diagnosis interface module, determining the function to be diagnosed of the target processor.

[0059] Specifically, the function diagnosis system may further include a function diagnosis interface module, and the diagnosis interface module may be used to receive a function diagnosis request sent by the application side. Among them, the function diagnosis interface module may include one or more diagnosis interfaces, which may be specifically set according to actual requirements.

[0060] For example, the function diagnosis interface module may include one diagnosis interface. The application side may request function diagnosis of the target processor by calling this diagnosis interface. At the same time, parameter data for characterizing the function to be diagnosed may be input to this diagnosis interface to request an abnormal diagnosis of the function to be diagnosed of the target processor. In addition, the function diagnosis interface may further include multiple diagnosis interfaces, and the multiple function diagnosis interfaces may correspond one-to-one to multiple predetermined function types of the target processor. In implementation, the application side may call the corresponding diagnosis interface according to the function diagnosis requirements and input parameter data for characterizing the sub-functions under the corresponding function type to the corresponding diagnosis interface to request an abnormal diagnosis of the sub-functions under the corresponding function type of the target processor.

[0061] In implementation, the application side can call the corresponding diagnostic interface in the function diagnostic interface module according to the function diagnosis requirements, and input parameter data to the corresponding diagnostic interface to request the function diagnostic system to perform an anomaly diagnosis on the corresponding function of the target processor. Among them, the application side can request the function diagnostic system to perform an anomaly diagnosis on the corresponding function of the target processor based on a predetermined diagnosis cycle. The predetermined diagnosis cycle can be determined according to the relevant function requirements of the application side, or can be the diagnosis cycle pre-configured in the application side. For example, the application side can request the function diagnostic system to perform an anomaly diagnosis on the corresponding function of the target processor after each power-on startup, and can also request the function diagnostic system to perform an anomaly diagnosis on the corresponding function of the target processor at intervals of a predetermined duration during operation. It can be understood that the application side can also request the function diagnostic system to perform an anomaly diagnosis on different functions of the target processor at different call times.

[0062] Thus, the diagnostic interface provides a unique access interface for the application side, shielding the differences in the hardware platforms of the processors from the application side, so that it can be applicable to the function diagnosis of processors of the same architecture located on different hardware platforms. That is, when processors of the same architecture are applied to different hardware platforms, there is no need to re-develop the function diagnostic system, which greatly saves human and material resources and shortens the development cycle of the function diagnostic system.

[0063] The first processing module can determine the function to be diagnosed of the target processor in response to the call operation and parameter input operation of the diagnostic interface in the function diagnostic interface module, so as to quickly and effectively determine the function to be diagnosed of the target processor. At the same time, through the call operation and parameter input operation of the diagnostic interface in the function diagnostic interface module, the function that needs to be diagnosed for the target processor can be flexibly selected according to the function diagnosis requirements, and the timing of performing the function diagnosis on the target processor can be flexibly configured. Furthermore, different function diagnosis requirements for the target processor can be met, and there is no need to perform an anomaly diagnosis on each function of the target processor in a fixed execution order every time the function diagnosis of the target processor is performed, improving the diagnosis efficiency.

[0064] In an exemplary embodiment, the function diagnostic interface module includes a plurality of the diagnostic interfaces corresponding one-to-one to a plurality of predetermined function types of the target processor; the function to be diagnosed includes sub-functions under at least one of the predetermined function types of the target processor;

[0065] The determining the function to be diagnosed of the target processor in response to the call operation and parameter input operation of the diagnostic interface in the function diagnostic interface module includes:

[0066] In response to a call operation on the diagnostic interface in the function diagnostic interface module, determine a target diagnostic interface, and use the predetermined function type corresponding to the target diagnostic interface as the target function type;

[0067] In response to a parameter input operation on the target diagnostic interface, determine the diagnostic parameters corresponding to the target function type;

[0068] Based on the diagnostic parameters corresponding to the target function type, determine the target sub-function under the target function type, and use the target sub-function under the target function type as the function to be diagnosed of the target processor.

[0069] Specifically, the function diagnostic interface module may include multiple diagnostic interfaces corresponding one by one to multiple predetermined function types of the target processor. The predetermined function type may be the function type that needs to be diagnosed for the processor of the corresponding architecture. For example, taking the processor of the ARMv8-A architecture as an example, the predetermined function types of the target processor may include instruction pipeline, register, interrupt, instruction set, instruction cache, data cache, MMU, data line, and address line, etc.

[0070] The function type of the function to be diagnosed may be one or more. For any function type, the function to be diagnosed may further include at least one sub-function under the function type.

[0071] In implementation, a target diagnostic interface may be determined in response to a call operation on the diagnostic interface in the function diagnostic interface module. That is, the target diagnostic interface may be the diagnostic interface called in the function diagnostic interface module. At the same time, the predetermined function type corresponding to the target diagnostic interface may be used as the target function type.

[0072] Among them, the number of target diagnostic interfaces may be one or more. That is, one diagnostic interface may be called at a time, or multiple diagnostic interfaces may be called simultaneously. For any target diagnostic interface, the diagnostic parameters corresponding to the corresponding target function type may be determined in response to a parameter input operation on the target diagnostic interface. The diagnostic parameters may include parameters representing sub-functions under the corresponding target function type. In addition, the diagnostic parameters may further include parameters representing the diagnostic conditions and / or diagnostic attributes of the corresponding sub-functions, etc. For example, the diagnostic condition may include abnormal diagnosis of the sub-function after the target processor reaches the target state, and the diagnostic attribute may include the diagnostic order.

[0073] During implementation, for any target function type, the target sub - functions under the target function type can be determined based on the diagnostic parameters corresponding to the target function type. Thus, the target sub - functions under each target function type can be obtained, and all the target sub - functions under each target function type are used as the functions to be diagnosed for the target processor, so that the functions that need to be diagnosed for the target processor can be flexibly selected.

[0074] In an exemplary embodiment, after sending the diagnostic request to the second processing module of the function diagnostic system, it further includes:

[0075] Obtain the abnormal diagnostic information returned by the second processing module;

[0076] Output the abnormal diagnostic information through the diagnostic interface corresponding to the function to be diagnosed.

[0077] Specifically, after sending the diagnostic request to the second processing module of the function diagnostic system, the abnormal diagnostic information returned by the second processing module can also be obtained. The abnormal diagnostic information can include the abnormal diagnostic result, and can also include the diagnostic process data and the module information of the corresponding function module in the target processor. Among them, the abnormal diagnostic result can include function abnormality and function normality; the diagnostic process data can include the intermediate data generated during the function diagnosis of the corresponding function module in the target processor.

[0078] During implementation, after receiving the diagnostic request, the second processing module can perform an abnormal diagnosis on the function to be diagnosed of the target processor based on the diagnostic program of the corresponding function pre - configured by itself, and return the abnormal diagnostic information to the first processing module.

[0079] After receiving the abnormal diagnostic information returned by the second processing module, the first processing module can output the abnormal diagnostic information of the function to be diagnosed to the application side through the diagnostic interface corresponding to the function type of the function to be diagnosed in the function diagnostic interface module, so that the application side can execute the corresponding control logic according to the abnormal diagnostic information of each function to be diagnosed of the target processor, thus ensuring the safe and reliable operation of the target processor, and when there is a function abnormality in the target processor, the abnormal condition of the target processor can be captured in time.

[0080] It can be understood that when the function diagnostic result is function abnormality, the application side can also call the corresponding fault handling process according to the diagnostic process data in the abnormal diagnostic information and the module information of the function module with function abnormality in the target processor, such as controlling the relevant relay to disconnect, etc., to perform the corresponding fault handling.

[0081] In an exemplary embodiment, sending the diagnostic request to the second processing module of the function diagnostic system includes:

[0082] Send a diagnostic request to the second processing module through the system call interface of the function diagnosis system.

[0083] Specifically, in the process of sending a diagnostic request to the second processing module, the first processing module can be implemented by means of system calls. For example, the first processing module can initiate a system call interrupt through the system call interface of the function diagnosis system. At the same time, the function type and diagnostic parameters of the function to be diagnosed are passed in through the system call interface parameters, so as to request the second processing module to perform a function diagnosis on the target processor according to the function type and diagnostic parameters. In implementation, the second processing module can obtain the function type and diagnostic parameters by querying the received call number, and determine the function to be diagnosed according to the function type and diagnostic parameters.

[0084] Thus, when the first processing module determines that the function to be diagnosed meets the target conditions, it can quickly and effectively request the second processing module to perform an abnormal diagnosis on the function to be diagnosed of the target processor, so as to effectively perform a function diagnosis on the target processor.

[0085] In an exemplary embodiment, the target conditions further include that the second processing module has access rights to the function to be diagnosed.

[0086] Specifically, the first processing module and the second processing module can be configured with different access rights to the target processor. For example, the first processing module cannot access the hardware resources of the target processor or execute privileged instructions, while the second processing module can access all the hardware resources of the target processor and can execute all instructions.

[0087] In implementation, for any function to be diagnosed, when the second processing module has access rights to the function to be diagnosed and the first processing module does not have access rights to the function to be diagnosed, it is determined that the function to be diagnosed meets the target conditions. When both the first processing module and the second processing module have access rights to the function to be diagnosed, it can be further determined whether task scheduling needs to be prohibited during the diagnosis process of the function to be diagnosed. If so, it is determined that the function to be diagnosed meets the target conditions. If not, it is determined that the function to be diagnosed does not meet the target conditions, so as to effectively perform a function diagnosis on the target processor.

[0088] In an exemplary embodiment, it further includes:

[0089] When the function to be diagnosed does not meet the target conditions, perform an abnormal diagnosis on the function to be diagnosed of the target processor.

[0090] Specifically, when the first processing module determines that the function to be diagnosed does not meet the target conditions, it can perform an abnormal diagnosis on the function to be diagnosed of the target processor through the corresponding diagnostic program of the function pre-configured by itself, and output the abnormal diagnosis information of the function to be diagnosed to the application side through the diagnostic interface corresponding to the function type of the function to be diagnosed in the function diagnostic interface module, so that the application side can execute the corresponding control logic according to the abnormal diagnosis information of each function to be diagnosed of the target processor, thereby ensuring the safe and reliable operation of the target processor, and when there is a function abnormality in the target processor, the abnormal condition of the target processor can be captured in time.

[0091] Among them, the abnormal diagnosis information may include an abnormal diagnosis result, and may also include diagnostic process data and module information of the corresponding function module in the target processor.

[0092] In an exemplary embodiment, another function diagnosis method is provided, which is applied to the second processing module in the function diagnosis system of the target processor. The second processing module runs in the kernel state of the function diagnosis system. The method includes:

[0093] When receiving the diagnosis request sent by the first processing module in the function diagnosis system, based on the diagnosis request, perform an abnormal diagnosis on the function to be diagnosed of the target processor;

[0094] Among them, the first processing module runs in the user state of the function diagnosis system. The first processing module is used to obtain the function to be diagnosed of the target processor, and when the function to be diagnosed meets the target conditions, send the diagnosis request to the second processing module; the target conditions include prohibiting task scheduling during the diagnosis process.

[0095] In an exemplary embodiment, after performing an abnormal diagnosis on the function to be diagnosed of the target processor, it further includes:

[0096] Return the abnormal diagnosis information corresponding to the function to be diagnosed to the first processing module, so as to control the first processing module to output the abnormal diagnosis information through the diagnostic interface corresponding to the function to be diagnosed.

[0097] Exemplary Apparatus

[0098] Correspondingly, an embodiment of the present application further provides a function diagnosis device 200, which is applied to the first processing module in the function diagnosis system of the target processor. The first processing module runs in the user state of the function diagnosis system. Refer to Figure 2 , the device includes:

[0099] A data acquisition module 201, configured to acquire the function to be diagnosed of the target processor;

[0100] A data processing module 202, configured to send a diagnostic request to a second processing module of the function diagnostic system when the to-be-diagnosed function meets a target condition, where the diagnostic request is used to control the second processing module to perform an abnormality diagnosis on the to-be-diagnosed function of the target processor; the second processing module runs in the kernel mode of the function diagnostic system, and the target condition includes prohibiting task scheduling during the diagnosis process.

[0101] Exemplarily, the function diagnostic system further includes a function diagnostic interface module, and the function diagnostic interface module includes one or more diagnostic interfaces;

[0102] The data acquisition module 201 is specifically configured to: in response to a call operation and a parameter input operation on a diagnostic interface in the function diagnostic interface module, determine the to-be-diagnosed function of the target processor.

[0103] Exemplarily, the function diagnostic interface module includes a plurality of the diagnostic interfaces corresponding one-to-one to a plurality of predetermined function types of the target processor; the to-be-diagnosed function includes sub-functions under at least one of the predetermined function types of the target processor;

[0104] The data acquisition module 201 is specifically configured to: in response to a call operation on a diagnostic interface in the function diagnostic interface module, determine a target diagnostic interface, and use the predetermined function type corresponding to the target diagnostic interface as a target function type;

[0105] In response to a parameter input operation on the target diagnostic interface, determine diagnostic parameters corresponding to the target function type;

[0106] Based on the diagnostic parameters corresponding to the target function type, determine a target sub-function under the target function type, and use the target sub-function under the target function type as the to-be-diagnosed function of the target processor.

[0107] Exemplarily, the data processing module 202 is further configured to:

[0108] After sending a diagnostic request to the second processing module of the function diagnostic system, obtain abnormality diagnosis information returned by the second processing module;

[0109] Output the abnormality diagnosis information through a diagnostic interface corresponding to the to-be-diagnosed function.

[0110] Exemplarily, the data processing module 202 is specifically configured to: send a diagnostic request to the second processing module through a system call interface of the function diagnostic system.

[0111] Exemplarily, the target condition further includes that the second processing module has access rights to the function to be diagnosed.

[0112] Exemplarily, the data processing module 202 is further configured to: when the function to be diagnosed does not meet the target condition, perform an abnormal diagnosis on the function to be diagnosed of the target processor.

[0113] The function diagnosis device provided in this embodiment belongs to the same inventive concept as the function diagnosis method provided in the above embodiments of the present application, can execute the function diagnosis method provided in any of the above embodiments of the present application, and has the corresponding function modules and beneficial effects for executing the function diagnosis method. For technical details not described in detail in this embodiment, reference may be made to the specific processing content of the function diagnosis method provided in the above embodiments of the present application, which will not be elaborated here.

[0114] Exemplary System

[0115] Correspondingly, an embodiment of the present application further provides a function diagnosis system 300. Refer to Figure 3 , the system includes: a first processing module 301 and a second processing module 302. The first processing module 301 runs in the user state of the function diagnosis system, and the second processing module 302 runs in the kernel state of the function diagnosis system;

[0116] The first processing module 301 is configured to obtain the function to be diagnosed of the target processor, and when the function to be diagnosed meets the target condition, send a diagnosis request to the second processing module 302. The target condition includes prohibiting task scheduling during the diagnosis process;

[0117] The second processing module 302 is configured to perform an abnormal diagnosis on the function to be diagnosed of the target processor based on the diagnosis request.

[0118] Exemplarily, refer to Figure 4 , the system further includes a function diagnosis interface module 303. The function diagnosis interface module 303 includes one or more diagnosis interfaces;

[0119] The first processing module 301 is specifically configured to:

[0120] In response to a call operation and parameter input operation on the diagnosis interface in the function diagnosis interface module 303, determine the function to be diagnosed of the target processor.

[0121] Exemplarily, the function diagnosis interface module 303 includes a plurality of the diagnosis interfaces corresponding one-to-one to a plurality of predetermined function types of the target processor; the function to be diagnosed includes sub-functions under at least one of the predetermined function types of the target processor;

[0122] The first processing module 301 is specifically configured to:

[0123] In response to a call operation on the diagnostic interface in the function diagnostic interface module 303, determine a target diagnostic interface, and use the predetermined function type corresponding to the target diagnostic interface as the target function type;

[0124] In response to a parameter input operation on the target diagnostic interface, determine the diagnostic parameters corresponding to the target function type;

[0125] Based on the diagnostic parameters corresponding to the target function type, determine the target sub-function under the target function type, and use the target sub-function under the target function type as the function to be diagnosed by the target processor.

[0126] Taking the target processor adopting the ARMv8-A architecture as an example, the structure of the function diagnostic system 300 is illustrated as follows.

[0127] Reference Figure 5 , the function diagnostic interface module 303 includes a plurality of diagnostic interfaces corresponding one-to-one to a plurality of predetermined function types of the target processor, specifically: a register diagnostic interface 3031, an instruction set diagnostic interface 3032, an interrupt and exception diagnostic interface 3033, an instruction pipeline diagnostic interface 3034, an instruction cache diagnostic interface 3035, a data cache diagnostic interface 3036, an MMU diagnostic interface 3037, and a data line and address line diagnostic interface 3038.

[0128] The first processing module 301 includes a plurality of first sub-modules, and the plurality of first sub-modules correspond one-to-one to a plurality of first function types. The first function type may include the function types that the first processing module 301 has access rights among the plurality of predetermined function types. The first sub-module may include: an instruction pipeline diagnostic sub-module 3011, a first register diagnostic sub-module 3012, a first instruction set diagnostic sub-module 3013, a first interrupt and exception diagnostic sub-module 3014, a first instruction cache diagnostic sub-module 3015, a first data cache diagnostic sub-module 3016, and a first data line and address line diagnostic sub-module 3017. For any first sub-module, the first sub-module can be used to perform abnormal diagnosis of the sub-functions under the corresponding function type, that is, the diagnostic programs of the sub-functions under the corresponding function type can be pre-configured in the first sub-module.

[0129] The second processing module 302 includes a plurality of second sub-modules, which correspond one-to-one with a plurality of second function types. The second function types may include function types that the second processing module 302 has access rights among a plurality of predetermined function types. The second sub-modules may include: an MMU diagnosis sub-module 3021, a second register diagnosis sub-module 3022, a second instruction set diagnosis sub-module 3023, a second interrupt and exception diagnosis sub-module 3024, a second instruction cache diagnosis sub-module 3025, a second data cache diagnosis sub-module 3026, and a second data line and address line diagnosis sub-module 3027. For any second sub-module, the second sub-module can be used to perform abnormal diagnosis of sub-functions under the corresponding function type, that is, diagnosis programs of each sub-function under the corresponding function type can be pre-configured in the second sub-module.

[0130] Correspondingly, an embodiment of the present application further provides a processor management system, including the function diagnosis system 300 described in any of the above embodiments.

[0131] Among them, the processor management system can be used to perform task management and / or process management on the target processor to achieve management and invocation of the target processor resources.

[0132] In implementation, the function diagnosis system 300 can be added to the processor management system, and the function diagnosis system 300 is used to perform function diagnosis on various resource components of the target processor, so as to ensure that various resource components of the target processor can correctly execute the corresponding functions. At the same time, it can timely capture the abnormalities of each resource component of the target processor and perform corresponding fault handling.

[0133] Exemplary Computer Program Product and Storage Medium

[0134] In addition to the above methods and devices, the function diagnosis method provided in the embodiments of this specification 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 function diagnosis method according to various embodiments of this specification described in the "Exemplary Method" section above.

[0135] 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 this specification. 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 program code can be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0136] In addition, an embodiment of the present specification also provides a computer-readable storage medium, on which a computer program is stored. The computer program is executed by a processor to perform the steps in the function diagnosis method according to various embodiments of the present specification described in the above "exemplary method" section.

[0137] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present specification can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0138] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0139] The above-described embodiments only represent several implementation manners of the present specification. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the solutions provided by the embodiments of the present specification. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present specification, several deformations and improvements can still be made, and these all belong to the protection scope of the present specification. Therefore, the protection scope of the patent of the present specification should be subject to the appended claims.

Claims

1. A functional diagnosis method, characterized in that: A first processing module in a functional diagnosis system applied to a target processor, wherein the first processing module runs in a user state of the functional diagnosis system, and the method comprises: Obtaining a function to be diagnosed of the target processor; When the function to be diagnosed meets the target condition, a diagnostic request is sent to the second processing module of the functional diagnosis system, and the diagnostic request is used to control the second processing module to perform abnormal diagnosis on the function to be diagnosed of the target processor; the second processing module runs in the kernel state of the functional diagnosis system, and the target condition includes prohibiting task scheduling during the diagnosis process.

2. The method according to claim 1, characterized in that The functional diagnosis system further includes a functional diagnosis interface module, and the functional diagnosis interface module includes one or more diagnostic interfaces; the step of obtaining the function to be diagnosed of the target processor includes: In response to a calling operation and a parameter input operation on a diagnostic interface in the functional diagnostic interface module, a function to be diagnosed of the target processor is determined.

3. The method according to claim 2, characterized in that The functional diagnosis interface module includes a plurality of the diagnostic interfaces corresponding to a plurality of predetermined function types of the target processor; the function to be diagnosed includes a sub-function of at least one of the predetermined function types of the target processor; The step of determining the function to be diagnosed of the target processor in response to the calling operation and the parameter input operation of the diagnostic interface in the functional diagnostic interface module comprises: In response to a calling operation of a diagnostic interface in the functional diagnostic interface module, determining a target diagnostic interface, and taking a predetermined function type corresponding to the target diagnostic interface as a target function type; In response to a parameter input operation on the target diagnostic interface, determining a diagnostic parameter corresponding to the target function type; Based on the diagnosis parameters corresponding to the target function type, a target sub-function under the target function type is determined, and the target sub-function under the target function type is used as the function to be diagnosed of the target processor.

4. The method according to claim 3, characterized in that After sending the diagnosis request to the second processing module of the functional diagnosis system, the method further includes: Obtaining abnormal diagnosis information returned by the second processing module; The abnormal diagnosis information is outputted through a diagnosis interface corresponding to the function to be diagnosed.

5. The method according to any one of claims 1 to 4, characterized in that: The step of sending the diagnosis request to the second processing module of the functional diagnosis system includes: A diagnosis request is sent to the second processing module through the system call interface of the functional diagnosis system.

6. The method according to any one of claims 1 to 4, characterized in that: The target condition also includes that the second processing module has access rights to the function to be diagnosed.

7. The method according to any one of claims 1 to 4, characterized in that: Also includes: When the function to be diagnosed does not satisfy the target condition, abnormality diagnosis is performed on the function to be diagnosed of the target processor.

8. A functional diagnostic device, characterized in that: A first processing module in a functional diagnosis system applied to a target processor, wherein the first processing module runs in a user state of the functional diagnosis system, and the device comprises: A data acquisition module, used for acquiring the function to be diagnosed of the target processor; A data processing module is used to send a diagnostic request to a second processing module of the functional diagnosis system when the function to be diagnosed meets the target condition, and the diagnostic request is used to control the second processing module to perform abnormal diagnosis on the function to be diagnosed of the target processor; the second processing module runs in the kernel state of the functional diagnosis system, and the target condition includes prohibiting task scheduling during the diagnosis process.

9. A functional diagnosis system, characterized in that: It includes a first processing module and a second processing module, wherein the first processing module runs in the user state of the functional diagnosis system, and the second processing module runs in the kernel state of the functional diagnosis system; The first processing module is used to obtain the function to be diagnosed of the target processor, and send a diagnosis request to the second processing module when the function to be diagnosed meets the target condition, and the target condition includes prohibiting task scheduling during the diagnosis process; The second processing module is used to perform abnormality diagnosis on the to-be-diagnosed function of the target processor based on the diagnosis request.

10. A processor management system, characterized in that: Comprising the functional diagnostic system as claimed in claim 9.