Instrument embedded system self-recovery method and system and medium
By analyzing the operating status and parameter information of instruments and meters, calculating the state deviation rate and performing automatic recovery, the problem of instrument crashes is solved and the accuracy of data collection and system stability are improved.
Patent Information
- Application Number
- CN202411025233.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Instrumentation systems often crash due to software problems, hardware failures or user errors during operation. They lack an effective self-recovery mechanism, which affects the accuracy of data collection.
By analyzing the operating status of the instrument, obtain operating parameters and parameter information, calculate the status deviation rate, determine whether the set threshold is exceeded, generate abnormal information and perform automatic recovery, including obtaining operating parameters, analyzing cycle time, detecting pointer fluctuation information, and eliminating Noisy data, generate recovery data to achieve self-recovery.
It improves the data collection accuracy and system stability of instruments, quickly restores abnormal conditions, and avoids data loss and system crashes caused by crashes.
Smart Images

Figure CN118550756A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of instrument self-reset, and in particular to a self-recovery method, system and medium for an instrument embedded system. Background Art
[0002] During the operation of the instrumentation system, abnormalities often occur, causing the system to crash, such as due to the following reasons: Software problem: The instrument's software system may have loopholes or defects, causing the instrument to freeze during operation. This may be a local dead loop caused by unreasonable software design, programming errors, or insufficient system resources.
[0003] Hardware Issues: Hardware components of the meter may fail or become damaged, causing the meter to not function properly. For example, there may be issues with memory, storage, or other critical components, causing the meter to freeze.
[0004] Improper operation: The user may have performed an incorrect operation when using the instrument, causing the instrument to freeze. This may be due to the user's lack of understanding of the instrument's functions and operation methods, or setting illegal parameters. For the above problems, effective technical solutions are urgently needed. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a self-recovery method, system and medium for an instrument embedded system. Different instruments have different dials and pointers. The abnormal conditions of the instruments are judged by analyzing the operating status of the instruments, so that the instruments are automatically reset according to the abnormal conditions, thereby improving the accuracy of data collection of the instruments.
[0006] The present application also provides an instrumentation embedded system self-recovery method, including: Obtain operating parameters, and analyze the cycle time and parameters of the operating instrument based on the operating parameters; Analyze instrumentation operating status information based on cycle time and parameters; Compare the instrument running status information with the set status information to obtain the status deviation rate; Determining whether the state deviation rate is greater than or equal to a set state deviation rate threshold; If it is greater than or equal to, the instrument is judged to be operating abnormally, and abnormal information is generated. The instrument is automatically restored based on the abnormal information, and recovery data is generated; If it is less than, the instrument is judged to be operating normally.
[0007] Optionally, in the instrumentation embedded system self-recovery method described in the embodiment of the present application, before obtaining the operating parameters and analyzing the cycle time and parameters of the operating instrument based on the operating parameters, the method further includes: Acquire instrument parameter information, wherein the instrument parameter information includes instrument shape, dial size, pointer shape, and pointer size; Set the scale information on the table based on the shape of the instrument and the size of the dial; Analyze the position of the pointer on the dial based on the instrument parameter information and analyze the scale position corresponding to the pointer; The initial state of the pointer is analyzed based on the scale position corresponding to the pointer, the dial and pointer distribution information is obtained, and the operating parameters are set based on the dial and pointer distribution information.
[0008] Optionally, in the self-recovery method for the instrumentation embedded system described in the embodiment of the present application, obtaining operating parameters, analyzing the cycle time and parameters of the operating instrument based on the operating parameters, and analyzing the operating status information of the instrument based on the cycle time and parameters specifically include: Obtain operating parameters, and analyze the cycle time and parameters of the operating instrument based on the operating parameters; set several detection time nodes based on the cycle time, obtain the initial state of the pointer based on the dial and pointer distribution information, and obtain the initial data of the instrument based on the initial state of the pointer; Obtain pointer fluctuation information at different time nodes, and analyze the display data of instruments and meters at different time nodes based on the pointer fluctuation information; Analyze the data volatility of the instrument display data at different time points; Noise data is generated based on data volatility, and the noise data is eliminated to obtain the operating status information of the instrument.
[0009] Optionally, in the instrumentation embedded system self-recovery method described in the embodiment of the present application, comparing the instrumentation operation status information with the set status information to obtain the status deviation rate specifically includes: Acquire the instrument running status information, pre-process the instrument running status information, and obtain optimized instrument running status information, the pre-processing includes noise data elimination and noise feature normalization processing; Calculate the similarity between the optimized instrument running status information and the set status information to obtain the status similarity; If the state similarity is greater than a first similarity threshold and less than a second similarity threshold, generating a first state deviation rate; If the state similarity is greater than or equal to a second similarity threshold, generating a second state deviation rate; The final state deviation rate is obtained by performing an average calculation based on the first state deviation rate and the second state deviation rate.
[0010] Optionally, in the instrumentation embedded system self-recovery method described in the embodiment of the present application, the abnormal information analysis step is as follows: Obtain abnormal information, and analyze whether it exceeds a set abnormal range based on the abnormal information. The set abnormal range includes an upper limit value and a lower limit value of the abnormal range; If it exceeds the set abnormal interval, the abnormal information is analyzed to be greater than the upper limit of the abnormal interval or less than the lower limit of the abnormal interval; If it is greater than the upper limit of the abnormal interval, negative feedback information is generated, a reverse recovery coefficient is generated based on the negative feedback information, and reverse recovery is performed on the instrument based on the reverse recovery coefficient to obtain reverse recovery data; If it is less than the lower limit of the abnormal interval, positive feedback information is generated, a forward recovery coefficient is generated based on the positive feedback information, and the instrument is positively restored based on the forward recovery coefficient to obtain forward recovery data; Obtaining recovery data according to the forward recovery data and the reverse recovery data; If it exceeds the set abnormal range, the abnormal features are extracted based on the abnormal information and the abnormal features are eliminated.
[0011] Optionally, in the instrumentation embedded system self-recovery method described in the embodiment of the present application, if is less than , it is determined that the instrumentation is operating normally, specifically including: Obtain the operating status of the instrument, set the interval time based on the timing function cycle, and generate a timing interrupt signal based on the interval time; Based on the timed interrupt signal, the running status of the instrument is interrupted at a timed interval to obtain the interrupt information; Analyze the interruption time based on the interruption information and determine whether the interruption time reaches the set time threshold; If the set time threshold is reached, the instrument operation is restarted; If the set time threshold is not reached, the instrument operation will continue to be interrupted until the mid-time is reached.
[0012] In a second aspect, an embodiment of the present application provides an instrumentation embedded system self-recovery system, the system comprising: a memory and a processor, the memory comprising a program of an instrumentation embedded system self-recovery method, the program of the instrumentation embedded system self-recovery method being executed by the processor to implement the following steps: Obtain operating parameters, and analyze the cycle time and parameters of the operating instrument based on the operating parameters; Analyze instrumentation operating status information based on cycle time and parameters; Compare the instrument running status information with the set status information to obtain the status deviation rate; Determining whether the state deviation rate is greater than or equal to a set state deviation rate threshold; If it is greater than or equal to, the instrument is judged to be operating abnormally, and abnormal information is generated. The instrument is automatically restored based on the abnormal information, and recovery data is generated; If it is less than, the instrument is judged to be operating normally.
[0013] Optionally, in the instrumentation embedded system self-recovery system described in the embodiment of the present application, before obtaining the operating parameters and analyzing the cycle time and parameters of the operating instrument based on the operating parameters, the method further includes: Acquire instrument parameter information, wherein the instrument parameter information includes instrument shape, dial size, pointer shape, and pointer size; Set the scale information on the table based on the shape of the instrument and the size of the dial; Analyze the position of the pointer on the dial based on the instrument parameter information and analyze the scale position corresponding to the pointer; The initial state of the pointer is analyzed based on the scale position corresponding to the pointer, the dial and pointer distribution information is obtained, and the operating parameters are set based on the dial and pointer distribution information.
[0014] Optionally, in the instrumentation embedded system self-recovery system described in the embodiment of the present application, obtaining operating parameters, analyzing the cycle time and parameters of the operating instrument based on the operating parameters, and analyzing the instrumentation operating status information based on the cycle time and parameters specifically include: Obtain operating parameters, and analyze the cycle time and parameters of the operating instrument based on the operating parameters; set several detection time nodes based on the cycle time, obtain the initial state of the pointer based on the dial and pointer distribution information, and obtain the initial data of the instrument based on the initial state of the pointer; Obtain pointer fluctuation information at different time nodes, and analyze the display data of instruments and meters at different time nodes based on the pointer fluctuation information; Analyze the data volatility of the instrument display data at different time points; Noise data is generated based on data volatility, and the noise data is eliminated to obtain the operating status information of the instrument.
[0015] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes an instrument and meter embedded system self-recovery method program, and when the instrument and meter embedded system self-recovery method program is executed by a processor, the steps of the instrument and meter embedded system self-recovery method as described in any one of the above items are implemented.
[0016] As can be seen from the above, an instrument embedded system self-recovery method, system and medium provided in an embodiment of the present application obtain operating parameters, analyze the cycle time and parameters of the operating instrument based on the operating parameters; analyze the operating status information of the instrument based on the cycle time and parameters; compare the operating status information of the instrument with the set status information to obtain the status deviation rate; determine whether the status deviation rate is greater than or equal to the set status deviation rate threshold; if greater than or equal to, determine that the instrument is operating abnormally, and generate abnormal information, automatically restore the instrument based on the abnormal information, and generate recovery data; if less than, determine that the instrument is operating normally, and determine the abnormal situation of the instrument by analyzing the operating status of the instrument, so as to automatically reset the instrument according to the abnormal situation, thereby improving the accuracy of data collection of the instrument. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A flowchart of a self-recovery method for an instrumentation embedded system provided in an embodiment of the present application; Figure 2 A flow chart of a method for obtaining dial and pointer distribution information of a self-recovery method for an instrumentation embedded system provided in an embodiment of the present application; Figure 3 A flow chart of a method for acquiring instrument running status information of an instrument embedded system self-recovery method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the 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 of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0020] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0021] Please refer to Figure 1 , Figure 1 This is a flow chart of a self-recovery method for an instrumentation embedded system in some embodiments of the present application. The self-recovery method for an instrumentation embedded system is used in a terminal device, and the self-recovery method for an instrumentation embedded system includes the following steps: S101, obtaining operating parameters, analyzing the cycle time and parameters of the operating instrument based on the operating parameters; analyzing the operating status information of the instrument based on the cycle time and parameters; S102, comparing the instrument running status information with the set status information to obtain the status deviation rate; S103, determining whether the state deviation rate is greater than or equal to a set state deviation rate threshold; S104, if it is greater than or equal to, it is determined that the instrument is operating abnormally, and abnormal information is generated, the instrument is automatically restored based on the abnormal information, and recovery data is generated; S105, if it is less than, it is determined that the instrument is operating normally.
[0022] It should be noted that different parameters of instruments and meters cause distribution differences between the pointer and the dial. Different distribution differences set different operating parameters to obtain cycle time and parameters, and analyze the operating status of the instruments and meters. By analyzing the difference between the pointer and the dial, the operating status information of the instruments and meters is adjusted, thereby accurately analyzing the status deviation rate, improving the accuracy of abnormal operation analysis, ensuring the self-recovery time node of the instruments and meters, and improving the accuracy of self-recovery.
[0023] Please refer to Figure 2 , Figure 2 The present invention is a flowchart of a dial and pointer distribution information acquisition method of an instrumentation embedded system self-recovery method in some embodiments of the present application. According to an embodiment of the present invention, before obtaining the operating parameters and analyzing the cycle time and parameters of the operating instrument based on the operating parameters, it also includes: S201, obtaining instrument parameter information, wherein the instrument parameter information includes instrument shape, dial size, pointer shape, and pointer size; S202, setting scale information on the table based on the shape of the instrument and the size of the dial; S203, analyzing the position of the pointer on the dial based on the instrument parameter information, and analyzing the scale position corresponding to the pointer; S204, analyzing the initial state of the pointer based on the scale position corresponding to the pointer, obtaining dial and pointer distribution information, and setting operating parameters based on the dial and pointer distribution information.
[0024] It should be noted that the size of different instruments and pointer sizes will affect the analysis accuracy of the initial state of the pointer. The initial state of the pointer can be accurately positioned according to the dial scale distribution and the pointer size to improve the analysis accuracy of the instrument.
[0025] Please refer to Figure 3 , Figure 3 The present invention is a flowchart of a method for obtaining instrument and meter operating status information in a self-recovery method for an instrument and meter embedded system in some embodiments of the present application. According to an embodiment of the present invention, obtaining operating parameters, analyzing the cycle time and parameters of the operating instrument based on the operating parameters; analyzing the instrument and meter operating status information based on the cycle time and parameters specifically includes: S301, obtaining operating parameters, analyzing the cycle time and parameters of the operating instrument based on the operating parameters; setting a number of detection time nodes based on the cycle time; S302, acquiring an initial state of the pointer based on the dial and pointer distribution information, and acquiring initial data of the instrument based on the initial state of the pointer; S303, acquiring pointer fluctuation information at different time nodes, and analyzing display data of instruments and meters at different time nodes based on the pointer fluctuation information; S304, analyzing the data fluctuation rate of the display data of the instruments at different time points; S305, generating noise data based on the data fluctuation rate, removing the noise data, and obtaining the operation status information of the instrument.
[0026] It should be noted that during the instrument display process, the operating status will have a certain impact on the pointer, causing the pointer to fluctuate. By analyzing the volatility of the display data corresponding to the pointer, it is possible to analyze whether there is noise influence during the instrument display process, thereby eliminating the noise data and reducing the interference of noise on the pointer.
[0027] According to an embodiment of the present invention, the instrument running status information is compared with the set status information to obtain the status deviation rate, which specifically includes: Acquire the instrument running status information, pre-process the instrument running status information, and obtain optimized instrument running status information, the pre-processing includes noise data elimination and noise feature normalization processing; Calculate the similarity between the optimized instrument running status information and the set status information to obtain the status similarity; If the state similarity is greater than a first similarity threshold and less than a second similarity threshold, generating a first state deviation rate; If the state similarity is greater than or equal to a second similarity threshold, generating a second state deviation rate; The final state deviation rate is obtained by performing an average calculation based on the first state deviation rate and the second state deviation rate.
[0028] It should be noted that by analyzing the similarity between the operating status of the instrument and the set status information, different similarities result in different status deviation rates, and then the average of all status deviation rates is calculated to obtain an accurate status deviation rate, thereby accurately analyzing the abnormal operation information of the instrument.
[0029] According to an embodiment of the present invention, the abnormal information analysis steps are as follows: Obtain abnormal information, and analyze whether it exceeds a set abnormal range based on the abnormal information. The set abnormal range includes an upper limit value and a lower limit value of the abnormal range; If it exceeds the set abnormal interval, the abnormal information is analyzed to be greater than the upper limit of the abnormal interval or less than the lower limit of the abnormal interval; If it is greater than the upper limit of the abnormal interval, negative feedback information is generated, a reverse recovery coefficient is generated based on the negative feedback information, and reverse recovery is performed on the instrument based on the reverse recovery coefficient to obtain reverse recovery data; If it is less than the lower limit of the abnormal interval, positive feedback information is generated, a forward recovery coefficient is generated based on the positive feedback information, and the instrument is positively restored based on the forward recovery coefficient to obtain forward recovery data; Obtaining recovery data according to the forward recovery data and the reverse recovery data; If it exceeds the set abnormal range, the abnormal features are extracted based on the abnormal information and the abnormal features are eliminated.
[0030] It should be noted that by analyzing the difference between the abnormal information and the set abnormal interval, different feedback information is obtained, and the instrument is restored according to the different feedback information to improve the self-recovery accuracy of the instrument.
[0031] According to an embodiment of the present invention, if is less than , it is determined that the instrument is operating normally, specifically including: Obtain the operating status of the instrument, set the interval time based on the timing function cycle, and generate a timing interrupt signal based on the interval time; Analyze the legitimacy of data bytes during instrument operation based on timing interrupt signals; The legality of the data bytes is determined based on the analysis results. If all bytes are legal, the instrument is considered to be operating normally and the dog is fed when operating normally. If one or more bytes are illegal, the dog will no longer be fed to allow it to reset.
[0032] It should be noted that, according to the timing function cycle, different interval times are set to set multiple timing interrupt signals during the operation of the instrument, so as to judge the legality of the data bytes in the operation of the instrument. Only when all bytes are legal, it means that the instrument is operating normally. When at least one byte is illegal, it will no longer be reset.
[0033] According to an embodiment of the present invention, the method further includes: setting N counting registers, each counting register having 4 bytes, The upper 3 bytes of the count register are fixed numbers, and the lower 1 byte is the count (0xA53C5AD0). The fixed number is used to determine whether the RAM data of the count register is abnormal. The lower 1 byte is set to a legal value between 220 and 150 (set according to the specific function running cycle); The N functions of the main program perform assignment operations on the corresponding counting registers (the assignment time is determined by the program running cycle); At the same time, set a 1s interrupt timing function (the timing function period can be set according to the minimum number of monitoring cycles); In the 1-second timer interrupt, each of the N counting registers is decremented by 1; In the 1-second timer interrupt, determine whether all N bytes are legal values designed. If any of them is illegal, stop feeding the dog and let it reset; if all are legal values, feed the dog normally; Under abnormal circumstances, the watchdog cannot operate normally and the system will reset through the watchdog.
[0034] It should be noted that a counting register will be set in each periodically running function and assigned a value, and the watchdog feeding function will only be designed in the 1-second timing interrupt. Before the watchdog feeding, all counting registers are decremented and conditional judgments are performed. If any condition is not met, the watchdog feeding will not be processed, so that the system is reset. The relevant function functions are monitored through the counting register, and then the legality of all counting registers is judged in the timing interrupt, and then the watchdog is cleared. In this way, the relevant functional modules are monitored. If one or more modules are abnormal, the watchdog is reset through the watchdog. In this way, the system stability can be greatly improved, and the normal operation of the system can be quickly restored in abnormal situations. It is particularly suitable for use in the scenario of embedded software system design of instrumentation. By monitoring the running cycle time of each function, the reliability of the program operation can be judged, and the system can be restored by resetting in abnormal situations to improve the stability of the system.
[0035] According to an embodiment of the present invention, if is less than , it is determined that the instrument is operating normally, and further includes: Obtain the operating status of the instrument, set the interval time based on the timing function cycle, and generate a timing interrupt signal based on the interval time; Based on the timed interrupt signal, the running status of the instrument is interrupted at a timed interval to obtain the interrupt information; Analyze the interruption time based on the interruption information and determine whether the interruption time reaches the set time threshold; If the set time threshold is reached, the instrument operation is restarted; If the set time threshold is not reached, the instrument operation will continue to be interrupted until the mid-time is reached.
[0036] In a second aspect, an embodiment of the present application provides an instrumentation embedded system self-recovery system, the system comprising: a memory and a processor, the memory comprising a program of an instrumentation embedded system self-recovery method, and when the program of the instrumentation embedded system self-recovery method is executed by the processor, the following steps are implemented: Obtain operating parameters, analyze the cycle time and parameters of the operating instrument based on the operating parameters; analyze the operating status information of the instrument based on the cycle time and parameters; Compare the instrument running status information with the set status information to obtain the status deviation rate; Determine whether the state deviation rate is greater than or equal to a set state deviation rate threshold; If it is greater than or equal to, the instrument is judged to be operating abnormally, and abnormal information is generated. The instrument is automatically restored based on the abnormal information, and recovery data is generated; If it is less than, the instrument is judged to be operating normally.
[0037] It should be noted that different parameters of instruments and meters cause distribution differences between the pointer and the dial. Different distribution differences set different operating parameters to obtain cycle time and parameters, and analyze the operating status of the instruments and meters. By analyzing the difference between the pointer and the dial, the operating status information of the instruments and meters is adjusted, thereby accurately analyzing the status deviation rate, improving the accuracy of abnormal operation analysis, ensuring the self-recovery time node of the instruments and meters, and improving the accuracy of self-recovery.
[0038] According to an embodiment of the present invention, before obtaining the operating parameters and analyzing the cycle time and parameters of the operating instrument based on the operating parameters, the method further includes: Acquire instrument parameter information, wherein the instrument parameter information includes instrument shape, dial size, pointer shape, and pointer size; Set the scale information on the table based on the shape of the instrument and the size of the dial; Analyze the position of the pointer on the dial based on the instrument parameter information and analyze the scale position corresponding to the pointer; The initial state of the pointer is analyzed based on the scale position corresponding to the pointer, the dial and pointer distribution information is obtained, and the operating parameters are set based on the dial and pointer distribution information.
[0039] It should be noted that the size of different instruments and pointer sizes will affect the analysis accuracy of the initial state of the pointer. The initial state of the pointer can be accurately positioned according to the dial scale distribution and the pointer size to improve the analysis accuracy of the instrument.
[0040] According to an embodiment of the present invention, the operation parameters are obtained, and the cycle time and parameters of the operation instrument are analyzed based on the operation parameters; and the operation status information of the instrument is analyzed based on the cycle time and the parameters, specifically including: Obtain operating parameters, and analyze the cycle time and parameters of the operating instrument based on the operating parameters; set several detection time nodes based on the cycle time, obtain the initial state of the pointer based on the dial and pointer distribution information, and obtain the initial data of the instrument based on the initial state of the pointer; Obtain pointer fluctuation information at different time nodes, and analyze the display data of instruments and meters at different time nodes based on the pointer fluctuation information; Analyze the data volatility of the instrument display data at different time points; Noise data is generated based on data volatility, and the noise data is eliminated to obtain the operating status information of the instrument.
[0041] It should be noted that during the instrument display process, the operating status will have a certain impact on the pointer, causing the pointer to fluctuate. By analyzing the volatility of the display data corresponding to the pointer, it is possible to analyze whether there is noise influence during the instrument display process, thereby eliminating the noise data and reducing the interference of noise on the pointer.
[0042] According to an embodiment of the present invention, the instrument running status information is compared with the set status information to obtain the status deviation rate, which specifically includes: Acquire the instrument running status information, pre-process the instrument running status information, and obtain optimized instrument running status information, the pre-processing includes noise data elimination and noise feature normalization processing; Calculate the similarity between the optimized instrument running status information and the set status information to obtain the status similarity; If the state similarity is greater than a first similarity threshold and less than a second similarity threshold, generating a first state deviation rate; If the state similarity is greater than or equal to a second similarity threshold, generating a second state deviation rate; The final state deviation rate is obtained by performing an average calculation based on the first state deviation rate and the second state deviation rate.
[0043] It should be noted that by analyzing the similarity between the operating status of the instrument and the set status information, different similarities result in different status deviation rates, and then the average of all status deviation rates is calculated to obtain an accurate status deviation rate, thereby accurately analyzing the abnormal operation information of the instrument.
[0044] According to an embodiment of the present invention, the abnormal information analysis steps are as follows: Obtain abnormal information, and analyze whether it exceeds a set abnormal range based on the abnormal information. The set abnormal range includes an upper limit value and a lower limit value of the abnormal range; If it exceeds the set abnormal interval, the abnormal information is analyzed to be greater than the upper limit of the abnormal interval or less than the lower limit of the abnormal interval; If it is greater than the upper limit of the abnormal interval, negative feedback information is generated, a reverse recovery coefficient is generated based on the negative feedback information, and reverse recovery is performed on the instrument based on the reverse recovery coefficient to obtain reverse recovery data; If it is less than the lower limit of the abnormal interval, positive feedback information is generated, a forward recovery coefficient is generated based on the positive feedback information, and the instrument is positively restored based on the forward recovery coefficient to obtain forward recovery data; Obtaining recovery data according to the forward recovery data and the reverse recovery data; If it exceeds the set abnormal range, the abnormal features are extracted based on the abnormal information and the abnormal features are eliminated.
[0045] It should be noted that by analyzing the difference between the abnormal information and the set abnormal interval, different feedback information is obtained, and the instrument is restored according to the different feedback information to improve the self-recovery accuracy of the instrument.
[0046] According to an embodiment of the present invention, if is less than , it is determined that the instrument is operating normally, specifically including: Obtain the operating status of the instrument, set the interval time based on the timing function cycle, and generate a timing interrupt signal based on the interval time; Analyze the legitimacy of data bytes during instrument operation based on timing interrupt signals; The legality of the data bytes is determined based on the analysis results. If all bytes are legal, the instrument is considered to be operating normally and the dog is fed when operating normally. If one or more bytes are illegal, the dog will no longer be fed to allow it to reset.
[0047] It should be noted that, according to the timing function cycle, different interval times are set to set multiple timing interrupt signals during the operation of the instrument, so as to judge the legality of the data bytes in the operation of the instrument. Only when all bytes are legal, it means that the instrument is operating normally. When at least one byte is illegal, it will no longer be reset.
[0048] According to an embodiment of the present invention, the method further includes: setting N counting registers, each counting register having 4 bytes, The upper 3 bytes of the count register are fixed numbers, and the lower 1 byte is the count (0xA53C5AD0). The fixed number is used to determine whether the RAM data of the count register is abnormal. The lower 1 byte is set to a legal value between 220 and 150 (set according to the specific function running cycle); The N functions of the main program perform assignment operations on the corresponding counting registers (the assignment time is determined by the program running cycle); At the same time, set a 1s interrupt timing function (the timing function period can be set according to the minimum number of monitoring cycles); In the 1-second timer interrupt, each of the N counting registers is decremented by 1; In the 1-second timer interrupt, determine whether all N bytes are legal values designed. If any of them is illegal, stop feeding the dog and let it reset; if all are legal values, feed the dog normally; Under abnormal circumstances, the watchdog cannot operate normally and the system will reset through the watchdog.
[0049] It should be noted that the relevant function is monitored through the counting register, and then the legality of all counting registers is judged in the timing interrupt, and then the watchdog is cleared. In this way, the relevant functional modules are monitored. If one or more modules are abnormal, the microcontroller is reset through the watchdog. This method can greatly improve the stability of the system and quickly restore the normal operation of the system under abnormal conditions. It is particularly suitable for use in the context of instrumentation embedded software system design. By monitoring the operating cycle time of each function, the reliability of the program operation can be judged, and the system can be restored by resetting under abnormal conditions to improve the stability of the system.
[0050] A third aspect of the present invention provides a computer-readable storage medium, which includes an instrument and meter embedded system self-recovery method program. When the instrument and meter embedded system self-recovery method program is executed by a processor, the steps of the instrument and meter embedded system self-recovery method as described in any of the above items are implemented.
[0051] The present invention discloses a self-recovery method, system and medium for an instrumentation embedded system. The method comprises the following steps: obtaining operation parameters, analyzing the cycle time and parameters of the operation instrumentation based on the operation parameters; analyzing the operation status information of the instrumentation based on the cycle time and parameters; comparing the operation status information of the instrumentation with the set status information to obtain the state deviation rate; judging whether the state deviation rate is greater than or equal to the set state deviation rate threshold; if greater than or equal to the set state deviation rate threshold, judging that the operation of the instrumentation is abnormal, generating abnormal information, automatically recovering the instrumentation based on the abnormal information, and generating recovery data; if less than the set state deviation rate, judging that the operation of the instrumentation is normal, judging the abnormal situation of the instrumentation by analyzing the operation status of the instrumentation, and automatically resetting the instrumentation according to the abnormal situation, thereby improving the accuracy of data collection of the instrumentation.
[0052] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0053] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0054] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0055] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, the aforementioned program can be stored in a readable storage medium, and when the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.
[0056] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
Claims
1. A self-recovery method for an instrumentation embedded system, characterized in that: include: Obtain operating parameters, and analyze the cycle time and parameters of the operating instrument based on the operating parameters; Analyze instrumentation operating status information based on cycle time and parameters; Compare the instrument running status information with the set status information to obtain the status deviation rate; Determining whether the state deviation rate is greater than or equal to a set state deviation rate threshold; If it is greater than or equal to, the instrument is judged to be operating abnormally, and abnormal information is generated. The instrument is automatically restored based on the abnormal information, and recovery data is generated; If it is less than, the instrument is judged to be operating normally.
2. The self-recovery method for an instrumentation embedded system according to claim 1, characterized in that: Before obtaining the operating parameters and analyzing the cycle time and parameters of the operating instrument based on the operating parameters, the following is also included: Acquire instrument parameter information, wherein the instrument parameter information includes instrument shape, dial size, pointer shape, and pointer size; Set the scale information on the table based on the shape of the instrument and the size of the dial; Analyze the position of the pointer on the dial based on the instrument parameter information and analyze the scale position corresponding to the pointer; The initial state of the pointer is analyzed based on the scale position corresponding to the pointer, the dial and pointer distribution information is obtained, and the operating parameters are set based on the dial and pointer distribution information.
3. The self-recovery method for an instrumentation embedded system according to claim 2, characterized in that: Obtain operating parameters, and analyze the cycle time and parameters of the operating instrument based on the operating parameters; Analyze the operating status of instruments based on cycle time and parameters, including: Obtain operating parameters, and analyze the cycle time and parameters of the operating instrument based on the operating parameters; set several detection time nodes based on the cycle time, obtain the initial state of the pointer based on the dial and pointer distribution information, and obtain the initial data of the instrument based on the initial state of the pointer; Obtain pointer fluctuation information at different time nodes, and analyze the display data of instruments and meters at different time nodes based on the pointer fluctuation information; Analyze the data volatility of the instrument display data at different time points; Noise data is generated based on data volatility, and the noise data is removed to obtain the operating status information of the instrument.
4. The self-recovery method for an instrumentation embedded system according to claim 3, characterized in that: Compare the instrument running status information with the set status information to obtain the status deviation rate, including: Acquire the instrument running status information, pre-process the instrument running status information, and obtain optimized instrument running status information, the pre-processing includes noise data elimination and noise feature normalization processing; Calculate the similarity between the optimized instrument running status information and the set status information to obtain the status similarity; If the state similarity is greater than a first similarity threshold and less than a second similarity threshold, generating a first state deviation rate; If the state similarity is greater than or equal to a second similarity threshold, generating a second state deviation rate; The final state deviation rate is obtained by performing an average calculation based on the first state deviation rate and the second state deviation rate.
5. The self-recovery method for an instrumentation embedded system according to claim 4, characterized in that: The abnormal information analysis steps are as follows: Obtain abnormal information, and analyze whether it exceeds a set abnormal range based on the abnormal information. The set abnormal range includes an upper limit value and a lower limit value of the abnormal range; If it exceeds the set abnormal interval, the abnormal information is analyzed to be greater than the upper limit of the abnormal interval or less than the lower limit of the abnormal interval; If it is greater than the upper limit of the abnormal interval, negative feedback information is generated, a reverse recovery coefficient is generated based on the negative feedback information, and reverse recovery is performed on the instrument based on the reverse recovery coefficient to obtain reverse recovery data; If it is less than the lower limit of the abnormal interval, positive feedback information is generated, a forward recovery coefficient is generated based on the positive feedback information, and the instrument is positively restored based on the forward recovery coefficient to obtain forward recovery data; Obtaining recovery data according to the forward recovery data and the reverse recovery data; If it exceeds the set abnormal range, the abnormal features are extracted based on the abnormal information and the abnormal features are eliminated.
6. The self-recovery method for an instrumentation embedded system according to claim 5, characterized in that: If it is less than, the instrument is judged to be operating normally, including: Obtain the operating status of the instrument, set the interval time based on the timing function cycle, and generate a timing interrupt signal based on the interval time; Based on the timed interrupt signal, the running status of the instrument is interrupted at a timed interval to obtain the interrupt information; Analyze the interruption time based on the interruption information and determine whether the interruption time reaches the set time threshold; If the set time threshold is reached, the instrument operation is restarted; If the set time threshold is not reached, the instrument operation will continue to be interrupted until the mid-time is reached.
7. An instrumentation embedded system self-recovery system, characterized in that: The system includes: a memory and a processor, wherein the memory includes a program of a self-recovery method for an instrumentation embedded system, and when the program of the self-recovery method for an instrumentation embedded system is executed by the processor, the following steps are implemented: Obtain operating parameters, analyze the cycle time and parameters of the operating instrument based on the operating parameters; analyze the operating status information of the instrument based on the cycle time and parameters; Compare the instrument running status information with the set status information to obtain the status deviation rate; Determining whether the state deviation rate is greater than or equal to a set state deviation rate threshold; If it is greater than or equal to, the instrument is judged to be operating abnormally, and abnormal information is generated. The instrument is automatically restored based on the abnormal information, and recovery data is generated; If it is less than, the instrument is judged to be operating normally.
8. The instrumentation embedded system self-recovery system according to claim 7, characterized in that: Before obtaining the operating parameters and analyzing the cycle time and parameters of the operating instrument based on the operating parameters, the following is also included: Acquire instrument parameter information, wherein the instrument parameter information includes instrument shape, dial size, pointer shape, and pointer size; Set the scale information on the table based on the shape of the instrument and the size of the dial; Analyze the position of the pointer on the dial based on the instrument parameter information and analyze the scale position corresponding to the pointer; The initial state of the pointer is analyzed based on the scale position corresponding to the pointer, the dial and pointer distribution information is obtained, and the operating parameters are set based on the dial and pointer distribution information.
9. The instrumentation embedded system self-recovery system according to claim 8, characterized in that: Obtain operating parameters, analyze the cycle time and parameters of the operating instrument based on the operating parameters, and analyze the operating status information of the instrument based on the cycle time and parameters, including: Obtain operating parameters, and analyze the cycle time and parameters of the operating instrument based on the operating parameters; set several detection time nodes based on the cycle time, obtain the initial state of the pointer based on the dial and pointer distribution information, and obtain the initial data of the instrument based on the initial state of the pointer; Obtain pointer fluctuation information at different time nodes, and analyze the display data of instruments and meters at different time nodes based on the pointer fluctuation information; Analyze the data volatility of the instrument display data at different time points; Noise data is generated based on data volatility, and the noise data is removed to obtain the operating status information of the instrument.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes an instrumentation embedded system self-recovery method program, and when the instrumentation embedded system self-recovery method program is executed by a processor, the steps of the instrumentation embedded system self-recovery method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Operational condition displaying method of equipment and electronic equipment
CN104424074A
Water quality detection method and system based on unmanned aerial vehicle and medium
CN116698762A
Deep learning-based pointer instrument identification and abnormity alarm method
CN116844147A
Remote fault diagnosis method and system for energy storage inverter, and medium
CN117290803A
Meter calibration method and system based on holder inspection robot, and medium
CN117589198A
