Self-recovery method, device and computer equipment of dual-core smart meter management unit
By monitoring the operating status outside the dual-core smart meter management unit and implementing troubleshooting strategies, the long self-recovery time and data loss caused by software failures in traditional technologies are solved, and fast self-recovery and efficient programming are achieved.
Patent Information
- Application Number
- CN202110175332.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-07
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-02-07
AI Technical Summary
When a traditional dual-core smart meter fails, restarting the management unit through the hardware watchdog causes the system to recover for a long time, which may cause loss or confusion in business data.
Instead of restarting the entire snap-in, avoid reinitializing the operating system and reinstantly and re-initializing the operating system and Business applications.
It greatly shortens the self-recovery time of the meter management core system, avoids the loss or confusion of business data, reduces the difficulty and complexity of software programming, and improves the software programming efficiency of the meter management unit.
Smart Images

Figure CN112905375B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software fault recovery, and in particular to a self-recovery method, device, computer equipment and storage medium for a dual-core smart meter management unit. Background Art
[0002] With the development of smart meters, dual-core smart meters have emerged that separate the legal metering function and the management function, including a metering core for the legal metering function and a management core for the software management function; wherein, the management unit of the smart meter corresponding to the management core can be equipped with a software operating system, on which multiple different business applications can run, to realize functions such as meter display, communication, and online upgrade of multiple applications.
[0003] In the conventional technology, a hardware watchdog is generally used to restart the entire management unit when a software failure occurs in the management unit, so as to realize self-recovery of the software operating system.
[0004] However, the above restart operation will lead to re-initialization of the software operating system and hardware peripherals, as well as reloading of various business applications, resulting in a slow self-recovery time of the system, and further causing loss or confusion of meter business data. Summary of the invention
[0005] Based on this, it is necessary to provide a self-recovery method, device, computer equipment and storage medium for a dual-core smart meter management unit that can reduce the self-recovery time of the system in response to the above technical problems.
[0006] In a first aspect, a self-recovery method of a dual-core smart meter management unit is provided, the method comprising:
[0007] Reading the running status information of each business application stored in the shared pipe file, wherein the shared pipe file is used for each business application installed in the power meter to write the running status information of each business application into the shared pipe file;
[0008] Determine whether each business application has an operation failure according to the read operation status information;
[0009] In the event that a target business application among the business applications has an operation failure, determining a fault elimination strategy according to the read operation status information of the target business application;
[0010] The target business application is repaired according to the troubleshooting strategy.
[0011] In one embodiment, before reading the running status information of each business application stored in the shared pipeline file, the method further includes:
[0012] After the electric meter is powered on, each business application is controlled to start; the startup status information of each business application is read from a preset storage location, wherein the storage location is used for each business application to write the startup status information of each business application into the storage location; based on the read startup status information, it is determined whether there is a business application that has not been successfully started among the business applications; if there is a business application that has not been successfully started, the business application that has not been successfully started is controlled to be restarted.
[0013] In one embodiment, determining whether each business application has an operation failure based on the read operation status information includes:
[0014] Determine whether the read running status information contains fault status information, where the fault status information is used to characterize a fault that occurs in the business application during operation; if the read running status information contains the fault status information, use the business application corresponding to the fault status information as the target business application that has failed.
[0015] In one embodiment, determining a troubleshooting strategy based on the read operation status information of the target business application program includes:
[0016] In the case where the fault status information corresponding to the target business application includes a restart identifier, restarting the target business application is used as the troubleshooting strategy; correspondingly, repairing the target business application according to the troubleshooting strategy includes: restarting the target business application.
[0017] In one embodiment, determining a troubleshooting strategy based on the read operation status information of the target business application includes:
[0018] When the fault status information corresponding to the target business application includes a file error identifier, a repair file is used as the troubleshooting strategy; correspondingly, the target business application is repaired according to the troubleshooting strategy, including: repairing target files related to the operation of the target business application.
[0019] In one embodiment, the method further comprises:
[0020] Check whether the target file is repaired successfully; if the target file fails to be repaired, delete the target file and restart the target business application.
[0021] In one embodiment, determining a troubleshooting strategy based on the read operation status information of the target business application includes:
[0022] In the case that the fault status information corresponding to the target business application includes a hardware component error identifier, initializing the hardware component and restarting the target business application are used as the troubleshooting strategy; correspondingly, the target business application is repaired according to the troubleshooting strategy, including: initializing the hardware component called by the target business application, and restarting the target business application.
[0023] In a second aspect, a self-recovery device of a dual-core smart meter management unit is provided, the device comprising:
[0024] The first reading module is used to read the running status information of each business application stored in the shared pipe file, wherein the shared pipe file is used for each business application installed in the power meter to write the running status information of each business application into the shared pipe file.
[0025] The first determination module is used to determine whether each business application has an operation failure according to the read operation status information.
[0026] The second determination module is used to determine a fault elimination strategy according to the read operation status information of the target business application program when an operation fault occurs in the target business application program among the business applications.
[0027] The repair module is used to repair the target business application according to the troubleshooting strategy.
[0028] In a fourth aspect, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements a self-recovery method of a dual-core smart meter management unit as described in any one of the first aspects above when executing the computer program.
[0029] In a fifth aspect, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the computer program is executed by a processor, a self-recovery method of a dual-core smart meter management unit as described in any one of the first aspects above is implemented.
[0030] The self-recovery method, device, computer equipment and storage medium of the dual-core smart meter management unit read the running status information of each business application stored in the shared pipeline file, and determine whether each business application has an operating failure based on the read running status information; in the case of an operating failure of a target business application among the business applications, a troubleshooting strategy is determined based on the read running status information of the target business application, and the target business application is repaired based on the troubleshooting strategy; that is, in the embodiment of the present application, the running status of each business application can be monitored to determine whether each business application is running normally, and in the case of a business application failure, the corresponding fault can be determined based on the running status information of the business application. A troubleshooting strategy is adopted, and the target business application with a fault is repaired according to the troubleshooting strategy, instead of restarting the entire management unit to achieve self-repair of the software fault. Therefore, the embodiment of the present application does not need to perform the operations of reinitializing the operating system and peripherals, and reloading each business application, which greatly shortens the self-recovery time of the meter management core system and avoids the loss or confusion of the meter business data. In addition, in the program programming process of the meter management unit, the difficulty of program programming can also be reduced. There is no need to accurately calculate the running time of each business application, nor is there any need to always consider the problem of calling the dog feeding function, and there is no need to worry about the restart problem when using the more time-consuming business functions. Only the business logic of each business application needs to be considered, which greatly improves the software programming efficiency of the meter management unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 An application environment diagram of a self-recovery method of a dual-core smart meter management unit in an embodiment;
[0032] Figure 2 A schematic diagram of a process flow of a self-recovery method of a dual-core smart meter management unit in one embodiment;
[0033] Figure 3 A schematic flow chart of a self-recovery method of a dual-core smart meter management unit in another embodiment;
[0034] Figure 4 A schematic flow chart of a self-recovery method of a dual-core smart meter management unit in another embodiment;
[0035] Figure 5 A schematic flow chart of a self-recovery method of a dual-core smart meter management unit in another embodiment;
[0036] Figure 6 A schematic flow chart of a self-recovery method of a dual-core smart meter management unit in another embodiment;
[0037] Figure 7 It is a structural block diagram of a self-recovery device of a dual-core smart meter management unit in one embodiment;
[0038] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0040] At present, when a software failure occurs in the management core of a dual-core smart meter, most of them use a hardware watchdog method, that is, the frequency of feeding the hardware watchdog is calculated in the business application carried by the management unit corresponding to the management core, and the feeding function is periodically called to clear the count.
[0041] If a business application does not call the watchdog function within the expected time period, causing the watchdog timer count to reach the maximum limit, the business application is considered to have failed and failed to execute according to the expected process; after this happens, at the hardware layer of the smart meter, the hardware watchdog will restart the entire management unit of the meter, that is, reinitialize the operating system and peripherals, and reload the application. This self-recovery method requires high requirements for the writing of business applications, and requires precise calculation of business applications to ensure that the watchdog function is actively called within a fixed time.
[0042] If a business application takes too long to call other peripherals, it may be unexpectedly restarted by the watchdog. If the watchdog is not turned off after the business application exits, it may be bitten by the watchdog. In addition, with this method, the system must be restarted for various software failures, and various hardware peripherals need to be initialized and business applications need to be loaded, which will result in the smart meter management unit being unable to quickly achieve self-recovery, affecting the use of the smart meter and causing loss or confusion of business data.
[0043] The self-recovery method of the dual-core smart meter management unit provided in the present application starts a supervision program outside the business application of the smart meter management core, and the supervision program monitors the running status of each business application. When a business application is found to be running abnormally, corresponding fault processing can be performed according to the type of abnormality, avoiding the complicated operations of restarting the system and reloading the business application, and can improve the self-recovery time when a software failure occurs.
[0044] The self-recovery method of the dual-core smart meter management unit provided in this application can be applied to Figure 1 In the application environment shown in FIG. 1 , the computer device can be a dual-core smart meter, and its internal structure diagram can be as shown in FIG. Figure 1 As shown. The computer device includes a processor, a memory, a communication interface and a display screen connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program, and the computer program includes a supervisory program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a self-recovery method of a dual-core smart meter management unit is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen.
[0045] In one embodiment, Figure 2 As shown, a self-recovery method for a dual-core smart meter management unit is provided, and the method is applied to Figure 1 The supervision procedure in the computer equipment in the example is explained, which includes the following steps:
[0046] Step 201 , the supervisory program reads the running status information of each business application stored in a shared pipe file, wherein the shared pipe file is used for each business application installed in the power meter to write the running status information of each business application into the shared pipe file.
[0047] In the process of implementing self-recovery of the dual-core smart meter management unit when a software failure occurs, the embodiment of the present application can add a supervision program in addition to the business applications of the dual-core smart meter management unit. The supervision program can monitor the running status of each business application, and can also implement self-recovery of the failure when a software failure occurs in the business application. Optionally, the supervision program can monitor the running status of each business application by establishing a shared pipe file between the supervision program and each business application, so that each business application can write its own running status information into the shared pipe file, and the supervision program can read the running status information of each business application from the shared pipe file. By establishing a shared pipe file, the supervision program can monitor the running status of each business application.
[0048] In an optional implementation of the present embodiment, each business application may pre-store an identifier of the shared pipe file, which may be the file name of the shared pipe file or the path name of the shared pipe file; after each business application is started and runs normally, the running status information of the business application may be written into the shared pipe file at regular intervals according to the identifier of the shared pipe file, and the running status information may be running status information during normal operation or fault status information when a fault occurs; optionally, in the event that a software fault occurs in the business application, the fault status information of the business application may also be written into the shared pipe file at the time when the software fault occurs; the supervisory program may read the running status information of each business application stored in the shared pipe file.
[0049] Step 202: Determine whether each business application has an operation failure based on the read operation status information.
[0050] In an optional implementation of the present embodiment, the supervisory program may determine whether each business application has an operational failure based on the operational status information of each business application stored in the shared pipeline file; optionally, it may determine whether the operational status information read contains fault status information, the fault status information being used to characterize that a fault has occurred in the business application during operation; if the operational status information read contains the fault status information, it may be determined that the business application has an operational failure, and the business application corresponding to the fault status information may be used as the target business application that has failed.
[0051] Step 203 : when a target business application among the business applications has an operation failure, a fault elimination strategy is determined according to the read operation status information of the target business application.
[0052] In an optional implementation of the present embodiment, for different software failures, the management unit of the smart meter may be allowed to execute self-recovery processes corresponding to different software failures, rather than simply recovering various types of software failures by restarting the entire management unit; that is, different troubleshooting strategies may be set for different operating status information. For example, for a business application with an infinite loop, the business application may be repaired by restarting the business application; optionally, the operating status information may include an identifier of the business application and a current operating status identifier of the business application. According to the correspondence between a preset operating status identifier and a troubleshooting strategy, the troubleshooting strategy corresponding to the current operating status identifier in the operating status information of the target business application may be determined.
[0053] Step 204: repair the target business application according to the troubleshooting strategy.
[0054] In the self-recovery method of the dual-core smart meter management unit, the operating status information of each business application stored in the shared pipeline file is read, and based on the read operating status information, it is determined whether each business application has an operating failure; in the case of an operating failure of a target business application among the business applications, a troubleshooting strategy is determined based on the read operating status information of the target business application, and the target business application is repaired based on the troubleshooting strategy; that is, in the embodiment of the present application, the operating status of each business application can be monitored to determine whether each business application is running normally, and in the case of a failure in the business application, the corresponding troubleshooting strategy can be determined based on the operating status information of the business application. According to the troubleshooting strategy, the faulty target business application is repaired instead of restarting the entire management unit to achieve self-repair of the software fault. Therefore, the embodiment of the present application does not need to perform re-initialization of the operating system and peripherals, and reload each business application, which greatly shortens the self-recovery time of the meter management core system and avoids the loss or confusion of the meter business data. In addition, in the program programming process of the meter management unit, the difficulty of program programming can also be reduced. There is no need to accurately calculate the running time of each business application, nor is there any need to always consider the problem of calling the dog feeding function, and there is no need to worry about the restart problem when using more time-consuming business functions. Only the business logic of each business application needs to be considered, which greatly improves the software programming efficiency of the meter management unit.
[0055] Figure 3 FIG. 1 is a flow chart of a self-recovery method of a dual-core smart meter management unit in another embodiment. This embodiment relates to an optional implementation process for ensuring that all business applications are started and run normally after the meter is powered on. Figure 3 As shown, the above method also includes:
[0056] Step 301: After the electric meter is powered on, control each service application to start.
[0057] In an optional implementation of this embodiment, after the electric meter is powered on, operations of starting the operating system of the meter management chip, initializing hardware peripherals, and controlling the startup of various business applications can be executed. In addition, operations of creating the above-mentioned shared pipe file and starting the above-mentioned supervision program can also be executed.
[0058] Step 302: read the startup status information of each business application program from a preset storage location, wherein the storage location is used for each business application program to write the startup status information of each business application program into the storage location.
[0059] In an optional implementation of the present embodiment, after each business application is successfully started, each business application may also write the startup status information of each business application into a preset storage location so that the supervisory program can read the startup status information of each business application from the storage location; optionally, the startup status information may include an identifier of the business application and the startup status of the business application, and the identifier of the business application may be the name of the business application or the ID of the business application; for a business application that is not successfully started, the storage location will not include the startup status information of the business application that is not successfully started.
[0060] Step 303: Determine whether there is any business application program that has not been successfully started among the business applications according to the read start status information.
[0061] In an optional implementation of the present embodiment, the supervisory program can read the startup status information of each business application from the storage location, determine the identification of each successfully started business application based on the startup status information of each business application, and determine the identification of the business application that failed to start successfully based on the identification of each successfully started business application and the identification of all business applications pre-stored in the supervisory program; since the storage location does not include the startup status information of the business application that failed to start successfully, that is, the storage location does not include the identification of the business application that failed to start successfully, then by comparing the identification of each successfully started business application with the identification of all business applications, it can be determined whether there is a business application that failed to start successfully among the successfully started business applications.
[0062] Step 304: If there is a business application that has not been successfully started, control the business application that has not been successfully started to be restarted.
[0063] After step 303, in the case that there is a service application that has not been successfully started, the service application that has not been successfully started can be controlled to be restarted according to the identifier of the service application that has not been successfully started.
[0064] In this embodiment, after the electric meter is powered on, each business application is controlled to start, and the startup status information of each business application is read from a preset storage location. Based on the read startup status information, it is determined whether there is any business application that has not been successfully started among the business applications; and in the case where there is a business application that has not been successfully started, the business application that has not been successfully started is controlled to be restarted. This can ensure that all business applications can start and run normally during the initial startup process after the electric meter is powered on, and can improve the accuracy of the supervision program in monitoring the running status of each business application.
[0065] Figure 4 FIG. 1 is a flow chart of a self-recovery method of a dual-core smart meter management unit in another embodiment. This embodiment involves an optional implementation process of determining a troubleshooting strategy based on the read operation status information of the target business application. Figure 4 As shown, the above step 203 includes:
[0066] Step 401 : when the fault status information corresponding to the target service application includes a restart flag, restarting the target service application is used as the fault elimination strategy.
[0067] In an optional implementation of the present embodiment, when the current running status identifier in the fault status information corresponding to the target business application is a restart identifier, restarting the target business application can be used as the troubleshooting strategy, and the restart identifier corresponding to the fault can be written into the above-mentioned shared pipe file as fault status information to instruct the supervisory program to restart the target business application according to the restart identifier; optionally, in the event of a fault such as an infinite loop or an error in the program itself occurring in the target business application, the target business application can be restarted, and the restart identifier can be written into the above-mentioned shared pipe file to instruct the supervisory program to restart the target business application.
[0068] Correspondingly, the above step 204 includes:
[0069] Step 402: restart the target business application.
[0070] In this embodiment, by determining that the fault status information corresponding to the target business application includes a restart identifier, restarting the target business application is used as the troubleshooting strategy, and the target business application is restarted according to the troubleshooting strategy; the restart operation can be performed on the faulty business application without affecting the normal use of other business applications, thereby avoiding the operation of restarting the entire meter management unit, greatly speeding up the self-recovery time of the software fault of the meter management unit, and improving the self-recovery efficiency of the software fault of the meter management unit.
[0071] Figure 5 FIG. 1 is a flow chart of a self-recovery method of a dual-core smart meter management unit in another embodiment. This embodiment relates to another optional implementation process of determining a troubleshooting strategy based on the read operation status information of the target business application. Figure 5 As shown, the above step 203 includes:
[0072] Step 501: When the fault status information corresponding to the target business application includes a file error identifier, repairing the file is used as the fault elimination strategy.
[0073] In an optional implementation of this embodiment, if the cause of the failure of the target business application is that the target business application fails due to an error in a file itself when the target business application calls or runs a certain file, for example, a software failure caused by a file data error in Flash may include: a failure to open the file, or insufficient file size, which may cause a file error, and then cause the target business application to fail; in this case, even if the business application is restarted again, or the management unit of the electric meter is restarted, a software failure will occur when reading the file due to the file error; therefore, the repair file can be used as a troubleshooting method. strategy, and the file error identifier corresponding to the fault can be written into the above-mentioned shared pipe file as fault status information to instruct the supervisory program to repair the target business application according to the file error identifier; optionally, different file repair processes can be adopted for faults caused by different file errors, that is, different troubleshooting strategies can be corresponding, and different file error identifiers can be corresponding to different file errors; for example: in the case where the file error is a failure to open the file, creating a new file can be used as a troubleshooting strategy for repairing the file; in the case where the file error is insufficient file size, filling the missing part of the file with 0 can be used as a troubleshooting strategy for repairing the file, etc.
[0074] Correspondingly, the above step 204 includes:
[0075] Step 502: Repair target files related to the operation of the target business application.
[0076] In an optional implementation of the present embodiment, when the supervisory program detects that the fault status information of the target business application includes a file error identifier, it is necessary to repair the target file related to the operation of the target business application; optionally, a troubleshooting strategy corresponding to the file error identifier can be determined based on the above-mentioned different file error identifiers, and the target file related to the operation of the target business application can be repaired based on the troubleshooting strategy.
[0077] In an optional implementation of the present embodiment, after executing the repair operation on the target file, the supervisory program can also detect whether the target file is repaired successfully. If the repair of the target file fails, the target file can be deleted and the target business application can be restarted to resolve the failure of the target business application and achieve normal operation of the target business application. Based on the above examples, for the target file that failed to open the file, it can be determined whether the target file is repaired successfully by detecting whether the created new file can be opened normally. If the created new file can be opened normally, it can be determined that the target file is repaired successfully. For the target file with insufficient file size, it can be determined whether the target file is repaired successfully by detecting whether the size of the repaired target file meets the requirements. If the size of the repaired target file meets the requirements, it can be determined that the target file is repaired successfully.
[0078] In the present embodiment, by determining that the fault status information corresponding to the target business application includes a file error identifier, a repair file is used as the troubleshooting strategy, and the target file related to the operation of the target business application is repaired according to the troubleshooting strategy; in the case of a file error, the erroneous file can be repaired, thereby solving the fault problem caused by the erroneous file even if the business application is restarted, thereby greatly improving the fault self-recovery capability of the meter management unit and improving the overall performance of the meter management unit.
[0079] Figure 6 FIG. 1 is a flow chart of a self-recovery method of a dual-core smart meter management unit in another embodiment. This embodiment relates to another optional implementation process of determining a troubleshooting strategy based on the read operation status information of the target business application. Figure 6 As shown, the above step 203 includes:
[0080] Step 601 : when the fault status information corresponding to the target service application includes a hardware component error identifier, initializing the hardware component and restarting the target service application are used as the fault elimination strategy.
[0081] In an optional implementation of the present embodiment, if the cause of the failure of the target business application is that the target business application fails due to an error in the hardware component itself when the target business application calls or runs a certain hardware component, for example: when calling the communication component to implement data interaction, the communication component cannot normally send and receive data, resulting in the target business application being unable to run normally and failing; in this case, initializing the hardware component and restarting the target business application can be used as the troubleshooting strategy, and the hardware component error identifier corresponding to the failure can be written into the above-mentioned shared pipe file as failure status information, so as to instruct the supervisory program to repair the target business application according to the hardware component error identifier; optionally, the failure status information can also include the identifier of the hardware component, and the identifier of the hardware component can be the name or ID of the hardware component.
[0082] Correspondingly, the above step 204 includes:
[0083] Step 602: Initialize the hardware components called by the target business application and restart the target business application.
[0084] In an optional implementation of this embodiment, the supervisory program may initialize the hardware component called by the target service application according to the identifier of the hardware component in the above fault status information, and restart the target service application.
[0085] In this embodiment, by determining that the fault status information corresponding to the target business application includes a hardware component error identifier, initializing the hardware component and restarting the target business application are used as the troubleshooting strategy, and the hardware component called by the target business application is initialized according to the troubleshooting strategy, and the target business application is restarted; in the case of a hardware component error, only the faulty hardware component can be repaired without affecting the normal use of other hardware components, and without affecting the normal use of other business applications other than the target business application, which greatly improves the efficiency and rate of self-recovery of the software fault of the meter management unit, and improves the overall performance of the meter management unit. In addition, according to the above description of different fault conditions, and the description of the corresponding troubleshooting strategies under different fault conditions, it can be seen that the embodiment of the present application can flexibly handle various types of software faults, and the monitoring program can accurately handle different software faults according to the running status information of each business application, and can avoid the situation where the fault caused by the same reason occurs multiple times.
[0086] In an optional embodiment of the present application, when a business application exits normally, the business application may also write the exit status information of the business application to the shared pipe file to instruct the supervisory program to read the exit status information of the business application, mark the business application as having exited normally, and no longer monitor the business application; optionally, when the business application is restarted after exiting, the business application may also write the startup status information of the business application to the shared pipe file to instruct the supervisory program to monitor the running status of the business application after reading the startup status information of the business application.
[0087] This embodiment can monitor the operating status of a normally running business application, and can also suspend the monitoring of the business application when the business application exits normally, and can re-monitor the business application when the business application is restarted after the exit; and can improve the intelligence and reliability of the electric meter management unit.
[0088] It should be understood that although Figure 2-6 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-6At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0089] In one embodiment, Figure 7 As shown, a self-recovery device of a dual-core smart meter management unit is provided, comprising: a first reading module 701, a first determining module 702, a second determining module 703 and a repairing module 704, wherein:
[0090] The first reading module 701 is used to read the running status information of each business application stored in the shared pipe file, wherein the shared pipe file is used for each business application installed in the power meter to write the running status information of each business application into the shared pipe file.
[0091] The first determination module 702 is used to determine whether each business application has an operation failure according to the read operation status information.
[0092] The second determination module 703 is used to determine a fault elimination strategy according to the read operation status information of the target business application program when a running fault occurs in the target business application program among the business applications.
[0093] The repair module 704 is used to repair the target business application according to the troubleshooting strategy.
[0094] In one of the embodiments, the device also includes: a startup module, a second reading module, a third determination module and a restart module; the startup module is used to control the startup of each business application after the electric meter is powered on; the second reading module is used to read the startup status information of each business application in a preset storage location, wherein the storage location is used for each business application to write the startup status information of each business application into the storage location; the third determination module is used to determine whether there is a business application that has not been successfully started among the business applications based on the startup status information read; the restart module is used to control the restart of the business application that has not been successfully started if there is a business application that has not been successfully started.
[0095] In one of the embodiments, the above-mentioned first determination module 702 is specifically used to determine whether the read running status information contains fault status information, and the fault status information is used to characterize that a fault occurs in the business application during operation; if the read running status information contains the fault status information, the business application corresponding to the fault status information is used as the target business application that has failed.
[0096] In one of the embodiments, the second determination module 703 is specifically used to restart the target business application as the troubleshooting strategy when the fault status information corresponding to the target business application includes a restart identifier; correspondingly, the repair module 704 is specifically used to restart the target business application.
[0097] In one of the embodiments, the second determination module 703 is specifically used to use the repair file as the troubleshooting strategy when the fault status information corresponding to the target business application includes a file error identifier; correspondingly, the repair module 704 is specifically used to repair the target file related to the operation of the target business application.
[0098] In one of the embodiments, the device further includes: a detection module; the detection module is used to detect whether the target file is repaired successfully; if the repair of the target file fails, the target file is deleted and the target business application is restarted.
[0099] In one of the embodiments, the second determination module 703 is specifically used to initialize the hardware component and restart the target business application as the troubleshooting strategy when the fault status information corresponding to the target business application includes a hardware component error identifier; correspondingly, the repair module 704 is specifically used to initialize the hardware component called by the target business application and restart the target business application.
[0100] For the specific definition of the self-recovery device of the dual-core smart meter management unit, please refer to the definition of the self-recovery method of the dual-core smart meter management unit above, which will not be repeated here. Each module in the self-recovery device of the above-mentioned dual-core smart meter management unit can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0101] In one embodiment, a computer device is provided. The computer device may be a dual-core smart meter, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, a communication interface and a display screen connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a self-recovery method of a dual-core smart meter management unit is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen.
[0102] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0103] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0104] Reading the running status information of each business application stored in the shared pipe file, wherein the shared pipe file is used for each business application installed in the power meter to write the running status information of each business application into the shared pipe file;
[0105] Determine whether each business application has an operation failure according to the read operation status information;
[0106] In the event that a target business application among the business applications has an operation failure, determining a fault elimination strategy according to the read operation status information of the target business application;
[0107] The target business application is repaired according to the troubleshooting strategy.
[0108] In one embodiment, the processor further implements the following steps when executing the computer program: after the electric meter is powered on, control each business application to start; read the startup status information of each business application at a preset storage location, wherein the storage location is used for each business application to write the startup status information of each business application to the storage location; determine whether there is any business application that has not been successfully started among the business applications based on the read startup status information; if there is a business application that has not been successfully started, control the business application that has not been successfully started to restart.
[0109] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining whether the read running status information contains fault status information, and the fault status information is used to characterize that a fault occurs in the business application during operation; if the read running status information contains the fault status information, the business application corresponding to the fault status information is used as the target business application that has failed.
[0110] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when the fault status information corresponding to the target business application includes a restart identifier, restarting the target business application is used as the troubleshooting strategy; correspondingly, the target business application is repaired according to the troubleshooting strategy, including: restarting the target business application.
[0111] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when the fault status information corresponding to the target business application includes a file error identifier, the repair file is used as the troubleshooting strategy; correspondingly, the target business application is repaired according to the troubleshooting strategy, including: repairing the target files related to the operation of the target business application.
[0112] In one embodiment, when the processor executes the computer program, the following steps are also implemented: detecting whether the target file is repaired successfully; if the target file fails to be repaired, deleting the target file and restarting the target business application.
[0113] In one embodiment, the processor also implements the following steps when executing the computer program: when the fault status information corresponding to the target business application includes a hardware component error identifier, initializing the hardware component and restarting the target business application are used as the troubleshooting strategy; correspondingly, repairing the target business application according to the troubleshooting strategy, including: initializing the hardware component called by the target business application, and restarting the target business application.
[0114] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0115] Reading the running status information of each business application stored in the shared pipe file, wherein the shared pipe file is used for each business application installed in the power meter to write the running status information of each business application into the shared pipe file;
[0116] Determine whether each business application has an operation failure according to the read operation status information;
[0117] In the event that a target business application among the business applications has an operation failure, determining a fault elimination strategy according to the read operation status information of the target business application;
[0118] The target business application is repaired according to the troubleshooting strategy.
[0119] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: after the electric meter is powered on, each business application is controlled to start; the startup status information of each business application is read from a preset storage location, wherein the storage location is used for each business application to write the startup status information of each business application to the storage location; based on the read startup status information, it is determined whether there is a business application that has not been successfully started among the business applications; if there is a business application that has not been successfully started, the business application that has not been successfully started is controlled to be restarted.
[0120] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining whether the read running status information contains fault status information, and the fault status information is used to characterize that a fault occurs in the business application during operation; if the read running status information contains the fault status information, the business application corresponding to the fault status information is used as the target business application that has failed.
[0121] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the fault status information corresponding to the target business application includes a restart identifier, restarting the target business application is used as the troubleshooting strategy; correspondingly, the target business application is repaired according to the troubleshooting strategy, including: restarting the target business application.
[0122] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the fault status information corresponding to the target business application includes a file error identifier, the repair file is used as the troubleshooting strategy; correspondingly, the target business application is repaired according to the troubleshooting strategy, including: repairing the target files related to the operation of the target business application.
[0123] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: detecting whether the target file is repaired successfully; if the target file fails to be repaired, deleting the target file and restarting the target business application.
[0124] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the fault status information corresponding to the target business application includes a hardware component error identifier, initializing the hardware component and restarting the target business application are used as the troubleshooting strategy; correspondingly, the target business application is repaired according to the troubleshooting strategy, including: initializing the hardware component called by the target business application, and restarting the target business application.
[0125] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0126] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this specification.
[0127] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A self-recovery method for a dual-core smart meter management unit, characterized in that: The management unit runs a supervisory program and a plurality of business applications, and the method is applied to the supervisory program, including: After the electric meter is powered on, the supervisory program and each of the business applications are controlled to start, and a shared pipe file is created; wherein the shared pipe file is used for each of the business applications installed in the electric meter to write the running status information of each of the business applications into the shared pipe file; Reading the startup status information of each of the business applications at a preset storage location, wherein the storage location is used for each of the business applications to write the startup status information of each of the business applications into the storage location; Determining whether there is a business application program that has not been successfully started among the business applications according to the read startup status information; If there is a business application that has not been successfully started, controlling the business application that has not been successfully started to restart; Reading the running status information of each of the business applications stored in the shared pipeline file; Determining whether each of the business applications has an operation failure according to the read operation status information; In the event that a target business application among the business applications has an operation failure, determining a troubleshooting strategy according to the read operation status information of the target business application; The target business application is repaired according to the troubleshooting strategy.
2. The method according to claim 1, characterized in that: Determining whether each of the business applications has an operation failure according to the read operation status information includes: Determine whether the read running status information contains fault status information, wherein the fault status information is used to indicate that a fault occurs during the running of the business application; If the read running status information contains the fault status information, the business application corresponding to the fault status information is used as the target business application where the fault occurs.
3. The method according to claim 2, characterized in that The determining of a troubleshooting strategy according to the read operation status information of the target business application program includes: If the fault status information corresponding to the target business application includes a restart flag, restarting the target business application is used as the fault troubleshooting strategy; Correspondingly, repairing the target business application according to the troubleshooting strategy includes: Restart the target business application.
4. The method according to claim 2, characterized in that: The determining of a troubleshooting strategy according to the read operation status information of the target business application program includes: If the fault status information corresponding to the target business application includes a file error identifier, repairing the file is used as the fault elimination strategy; Correspondingly, repairing the target business application according to the troubleshooting strategy includes: Repair target files related to the operation of the target business application.
5. The method according to claim 4, characterized in that The method further comprises: Detecting whether the target file is repaired successfully; If the target file fails to be repaired, the target file is deleted and the target business application is restarted.
6. The method according to claim 2, characterized in that The determining of a troubleshooting strategy according to the read operation status information of the target business application program includes: If the fault status information corresponding to the target business application includes a hardware component error identifier, initializing the hardware component and restarting the target business application are used as the fault elimination strategy; Correspondingly, repairing the target business application according to the troubleshooting strategy includes: Initialize the hardware components called by the target business application, and restart the target business application.
7. The method according to claim 1, characterized in that The method further comprises: When the read operation status information of the business application includes exit status information, the business application is no longer monitored; In a case where the read running status information of the business application after the exit includes the startup status information, the running status of the business application after the exit is monitored.
8. A self-recovery device for a dual-core smart meter management unit, characterized in that: The device comprises: A startup module, used for controlling the startup of the supervisory program and each service application after the electric meter is powered on, and creating a shared pipe file; wherein the shared pipe file is used for each service application installed in the electric meter to write the running status information of each service application into the shared pipe file; A second reading module is used to read the startup status information of each of the business applications at a preset storage location, wherein the storage location is used for each of the business applications to write the startup status information of each of the business applications into the storage location; A third determination module is used to determine whether there is a business application that has not been successfully started among the business applications according to the read startup status information; A restart module, configured to control the restart of the service application that has not been successfully started if there is any service application that has not been successfully started; A first reading module, used for reading the running status information of each of the business applications stored in the shared pipeline file; A first determination module, used to determine whether each of the business applications has an operation failure according to the read operation status information; A second determination module is used to determine a troubleshooting strategy according to the read operation status information of the target business application when an operation failure occurs in the target business application among the business applications; A repair module is used to repair the target business application according to the troubleshooting strategy.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Application software fault recovery method and terminal equipment
CN105988882A
Application program starting method and device, terminal and medium
CN110413341A
