Dialing abnormity self-detection method based on hierarchical diagnosis strategy and electric meter concentrator
By employing a self-testing method based on a hierarchical diagnostic strategy, the meter concentrator performs step-by-step troubleshooting when the network is abnormal. This solves the problem of insufficient log recording in the meter concentrator during network anomaly scenarios, enabling efficient and accurate fault identification and repair, and is suitable for remote fault troubleshooting.
Patent Information
- Application Number
- CN202511091872.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-11-11
AI Technical Summary
Electricity meter concentrators lack effective log recording in network anomaly scenarios, making troubleshooting difficult. Existing technologies can only temporarily and manually enable log capture, which cannot capture key information during network anomalies.
A self-testing method based on a hierarchical diagnostic strategy is adopted, including basic network access hardware condition detection, concentrator's own network access condition detection, and routine network information detection. Faults are identified step by step, and log files are summarized and optimized.
It enables efficient and accurate identification and repair of network anomalies without on-site debugging, reduces human resource consumption, and provides detailed log files to support comprehensive analysis by network engineers.
Smart Images

Figure CN120935620A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wireless communication technology, specifically to a dialing anomaly self-detection method based on a hierarchical diagnostic strategy and an electricity meter concentrator. Background Technology
[0002] As the central management and control device of the remote centralized meter reading system, the meter concentrator needs to maintain good network communication with both the terminal devices and the remote meter reading system in order to periodically read terminal data and transmit commands from the system.
[0003] The meter concentrator lacks log records to aid in analyzing the cause of network anomalies. This is because the concentrator uses a mobile network dial-up module (hereinafter referred to as the GPRS module) for network dialing. The GPRS module's modem logs are the most effective means of troubleshooting network faults, but modem logs are typically massive in volume, and the concentrator's hundreds of megabytes of memory cannot support such long-term logging. Therefore, the only feasible approach is to temporarily and manually enable log capture and then disable it after a period of time. However, in real-world scenarios, logs obtained after triggering log capture following a network anomaly are ineffective for analyzing the cause of the anomaly, as troubleshooting requires information about the period between the normal network transition and the anomaly.
[0004] Therefore, it is necessary to provide an automated diagnostic solution for mobile data network dialing anomalies in the electricity meter concentrator. Summary of the Invention
[0005] The technical problem to be solved by this invention is to provide a dialing anomaly self-detection method and a meter concentrator based on a hierarchical diagnostic strategy, which achieves comprehensive diagnosis through step-by-step troubleshooting and efficiently and accurately identifies faults.
[0006] To solve the above-mentioned technical problems, the first technical solution adopted by the present invention is as follows:
[0007] A self-detection method for dialing anomalies based on a hierarchical diagnostic strategy includes:
[0008] When the concentrator application senses that it cannot connect to the target server, it performs a basic hardware condition check for network access.
[0009] If the basic hardware conditions for network access are passed, then the network access conditions of the concentrator itself are checked.
[0010] If the concentrator passes its own network access condition detection, then a routine network information detection is performed.
[0011] Summarize and optimize log files.
[0012] Optionally, the network access basic hardware condition detection includes:
[0013] A1. Determine the GPRS module insertion status by outputting the hardware pin level; if not inserted, prompt to check the GPRS module, log the information, and end the process; if successfully inserted, perform network access condition detection on the concentrator itself.
[0014] Optionally, the concentrator's own network access condition detection includes:
[0015] B1. Determine the SIM card status by sending a SIM card PIN code query command to the modem; if the SIM card status is abnormal, log the error and end the process; if the SIM card status is normal, proceed to B2.
[0016] B2. Determine the packet-switched domain registration status by sending a packet-switched domain network registration query command to the modem; if the packet-switched domain registration fails, log the error and execute B3; if the packet-switched domain registration succeeds, execute B4.
[0017] B3. Send a signal strength detection command through the GPRS module to determine whether the received downlink signal strength of the base station is less than the preset value; if it is less than the preset value, prompt to check the antenna; if it is greater than or equal to the preset value, prompt to contact the network operator.
[0018] B4. Determine the packet-switched domain attachment status by sending a packet-switched domain attachment status query command; if the packet-switched domain attachment is successful, log the result and perform the routine network information detection; if the packet-switched domain attachment fails, prompt the user to contact the network operator.
[0019] Optionally, the preset value in B3 is between 8 and 15.
[0020] Optionally, the conventional network information detection includes one or more of the following detection methods: Ping public server detection, network packet capture detection, router information detection, network interface address information detection, and path node list detection.
[0021] Optionally, the conventional network information detection includes:
[0022] C1. Initiate Internet Control Message Protocol connectivity test to the public domain name server through the Gprs module, and log the test results;
[0023] C2. Initiate Internet Control Message Protocol connectivity test to the target server through the GPRS module, and at the same time, specify the USB virtual network interface corresponding to the GPRS module to capture network data packets sent to the target server host address through the tcp dump tool, and record the target server host address and the captured network data packets in the log.
[0024] C3. Obtain routing information using the network routing tool iproute and record it in the logs;
[0025] C4. Obtain the network interface address information of the concentrator through the network interface address configuration tool ipaddr and record it in the log;
[0026] C5. Use the traceroute tool to send TTL layered probe messages to the target server host address of the specified USB virtual network interface of the GPRS module, obtain the list of path nodes from the concentrator to the target server, and record the log.
[0027] Optionally, the process of summarizing and optimizing log files includes:
[0028] According to the preset log management strategy, all log files are split, archived, deleted, and compressed.
[0029] Optionally, all log files can be processed using the logrotate tool according to a preset log management strategy.
[0030] Another technical solution provided by this invention is:
[0031] An electricity meter concentrator includes a computer-readable storage medium and a processor; the computer-readable storage medium stores a computer program, which, when executed by the processor, can implement the above-mentioned dialing anomaly self-detection method based on a hierarchical diagnostic strategy.
[0032] The beneficial effects of this invention are as follows: When the concentrator application detects an inability to connect to the target server, it first performs a basic network access hardware condition check to rule out situations where the inability to connect to the network is caused by the device environment, reducing the cost of manually checking the device environment; then, it performs a network access condition check on the concentrator itself to rule out situations where the inability to connect to the network is caused by the device itself, reducing the cost of manually checking the device. At this point, simple network anomalies can be repaired efficiently and accurately, greatly saving human resources; if the device has normal network access but still cannot establish a connection with the target server, then routine network information checks continue, collecting multiple judgment criteria and integrating and summarizing log files so that network engineers can conduct comprehensive analysis based on the log files, efficiently and accurately identifying the problem. This invention is particularly suitable for remote fault diagnosis scenarios where on-site debugging conditions are unavailable. Attached Figure Description
[0033] Figure 1 This is a flowchart illustrating a dialing anomaly self-detection method based on a hierarchical diagnostic strategy, provided in an embodiment of the present invention. Detailed Implementation
[0034] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0035] Example 1
[0036] This embodiment provides a self-detection method for dialing anomalies based on a hierarchical diagnostic strategy, which is particularly suitable for remote troubleshooting of concentrators in dialing anomaly situations where there are no on-site debugging conditions.
[0037] like Figure 1 As shown in the figure, this embodiment provides a dialing anomaly self-detection method based on a hierarchical diagnostic strategy, which includes the following:
[0038] When the concentrator application detects that it cannot establish a network connection with the target server, it triggers a network anomaly self-diagnosis process:
[0039] (I) Basic Hardware Requirements Test for Network Access
[0040] A1. The application determines the insertion status of the GPRS module by outputting the hardware pin level. If the GPRS module is not inserted, it prompts the user to check the GPRS module, logs the information, and ends the process. If the GPRS module is successfully inserted, it proceeds to the next diagnostic step, which is to perform a network access condition test on the concentrator itself.
[0041] (II) Concentrator's Own Network Access Condition Detection
[0042] B1. The application determines the SIM card status by sending a SIM card PIN code query command (i.e., AT+CPIN? command) to the modem; if the SIM card status is abnormal, it logs the error and ends the process; if the SIM card status is normal, it proceeds to B2.
[0043] B2. The application determines the packet-switched domain (PS domain) registration status by sending a packet-switched domain (PS domain) network registration query command (i.e., AT+CGREG? command) to the modem. If the packet-switched domain registration fails, the log records that the PS domain registration failed and executes B3. If the packet-switched domain registration succeeds, executes B4.
[0044] B3. The application sends a signal strength detection command (i.e., AT+CSQ command) through the GPRS module, and then parses the downlink signal strength of the base station returned according to the command.
[0045] If the downlink signal strength of the base station is less than the preset value, it means that the signal strength received by the GPRS module is weak at this time. This may be due to the antenna not being inserted or the antenna function being abnormal. The system will prompt you to check the antenna and record the error in the log.
[0046] If the downlink signal strength of the base station is greater than or equal to the preset value, it indicates that the quality of the wireless signal link between the GPRS module and the base station basically meets the network registration requirements. Furthermore, the SIM card status has already been confirmed to meet the network registration requirements in step B1 above. Therefore, if network registration still fails at this point, it can be basically confirmed that the problem is caused by the network operator; it is recommended to contact the network operator to confirm the cause.
[0047] In some specific implementations, the preferred value range for the preset value is between 8 and 15, with 10 being the most desirable. This helps to more accurately determine whether the strength of the network signal provided by the network operator meets the network connection standards of the application.
[0048] B4. The application determines the packet-switched domain attachment status by sending a packet-switched domain attachment status query command (i.e., the AT+CGATT? command). If the packet-switched domain attachment is successful, it is logged and proceeds to the next diagnostic step, i.e., performing routine network information detection. If the packet-switched domain attachment is unsuccessful, it is logged and a prompt is made to contact the network operator.
[0049] (III) Routine Network Information Detection
[0050] The routine network information detection includes one or more of the following: Ping public server detection, network packet capture detection, router information detection, network interface address information detection, and path node list detection.
[0051] In this embodiment, it is preferable to perform each detection, specifically including the following steps:
[0052] C1. The application initiates Internet Control Message Protocol version 4 connectivity test (also known as ping test) to the public domain name server through the GPRS module, and logs the test results.
[0053] Here, public domain name servers, such as www.baidu.com, are mentioned. Normally, public domain name servers are stable. If the concentrator and the public domain name server are not connected, it indicates a problem with the concentrator's network. If the concentrator and the public domain name server are connected, but the concentrator and the target server are not connected, it indicates a problem with the target server's network. Ping logs should be recorded for engineers to analyze.
[0054] C2. The application initiates Internet Control Message Protocol version 4 connectivity test to the target server through the GPRS module. At the same time, it specifies the USB virtual network interface 0 corresponding to the GPRS module to capture network packets sent to the target server host address using the TCP dump tool. The target server host address and the captured network packet information are recorded in the log so that engineers can perform transport layer protocol analysis.
[0055] C3. The application obtains routing information through the network routing tool iproute and records it in the logs to confirm whether the network anomaly is caused by routing issues.
[0056] C4. The application obtains the network interface address information of the concentrator through the network interface address configuration tool ipaddr and records it in the log to confirm whether the network address is abnormal.
[0057] C5. Using the USB virtual network interface 0 corresponding to the specified GPRS module, the traceroute tool is used to send TTL layered probe messages to the target server host address to obtain the list of path nodes between the concentrator and the target server and record it in the log to confirm whether a path node between the concentrator and the target server is abnormal and causes the network connection to fail.
[0058] Optionally, there is no explicit requirement for the order of steps C1 to C5 above.
[0059] (iv) Summarize and optimize log files
[0060] All log files recorded in steps (i) to (iii) above are processed by cutting, archiving, deleting and compressing according to the preset log management strategy in order to optimize the log files and greatly reduce the amount of log data.
[0061] In some specific implementations, the log rotation management tool logrotate is used to process all log files according to a preset log management strategy.
[0062] In some other specific implementations, the preset log management strategy includes, but is not limited to, cutting, archiving, deleting, and compressing all log files according to preset conditions such as time and size thresholds.
[0063] As a specific example, all types of logs generated during each diagnostic task execution are stored in a dedicated directory named after their execution time (the directory naming format can be "year-month-day-hour-minute-second", with a typical path such as / opt / log / gprs_net / 20250804105530). In the logrotate configuration file logrotate.conf, the regular expression " / opt / log / gprs_net / [0-9]{14} / *" is used to precisely match all diagnostic log files generated in all time periods.
[0064] The system achieves automated log management through the following mechanisms:
[0065] Compression mechanism: The configuration command "compress" enables the gzip compression algorithm, which automatically compresses and stores log files.
[0066] Capacity control: Set up intelligent capacity detection logic in the postrotate script to calculate the total capacity of the log storage directory in real time using the "du-sb" command.
[0067] Automatic cleanup: When the total log volume exceeds a preset threshold (e.g., 30MB, or 737280 bytes), the system automatically identifies and deletes the earliest timestamp historical log directory (achieved through the "ls -td" command in conjunction with the "tail -1" command), thereby ensuring that the storage space is always in a healthy state.
[0068] This embodiment provides a dial-up anomaly self-detection method based on a hierarchical diagnostic strategy. When the concentrator application detects an inability to connect to the target server, it first performs (I) a basic network access hardware condition check to rule out the possibility that the device environment is causing the inability to connect to the network, reducing the cost of manual confirmation of the device environment. Then, it performs (II) a concentrator's own network access condition check to investigate the possibility that the device itself is causing the inability to connect to the network, reducing the cost of manual confirmation of the device. If B3 and B4 confirm that the device meets the network access conditions but still cannot connect to the network, the network operator can be identified as the responsible party. If the device has successfully connected to the network but still cannot connect to the target server, the cause of the problem cannot be determined based on a single judgment criterion. At this time, (III) a conventional network information check collects multiple judgment criteria. Based on the integrated and summarized log file, network engineers can perform comprehensive analysis based on the log file to efficiently and accurately identify the anomaly. This invention is particularly suitable for remote fault diagnosis scenarios without on-site debugging conditions. It can perform step-by-step troubleshooting through a hierarchical diagnostic strategy to achieve comprehensive diagnosis and efficiently and accurately identify faults.
[0069] Example 2
[0070] This embodiment further extends the first embodiment and provides an electricity meter concentrator, including a computer-readable storage medium and a processor; the computer-readable storage medium stores a computer program, which, when executed by the processor, can implement the above-mentioned dialing anomaly self-detection method based on a hierarchical diagnostic strategy.
[0071] The specific steps of the dialing anomaly self-detection method based on the hierarchical diagnostic strategy will not be repeated here. Please refer to the description in Example 1 for details.
[0072] It is understood that the meter concentrator is also equipped with the tools required for various diagnoses in the dialing anomaly self-detection method based on the hierarchical diagnostic strategy, such as the TCP dump tool, the network routing tool iproute, the network interface address configuration tool ipaddr, the tracing tool traceroute, and the log rotation management tool logrotate.
[0073] As can be understood from the above description, those skilled in the art will recognize that all or part of the processes in the above technical solutions can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the methods described above. After being executed by a processor, the program can also achieve the beneficial effects of the corresponding methods.
[0074] The storage medium can be a hard disk, optical disc, read-only memory (ROM), or random access memory (RAM), etc.
[0075] In summary, the present invention provides a dial-up anomaly self-detection method and a meter concentrator based on a hierarchical diagnostic strategy. When the concentrator application detects an inability to connect to the target server, it first performs a basic network access hardware condition check to rule out device environment-related issues, reducing the cost of manual verification of the device environment. Then, it performs a network access condition check on the concentrator itself to rule out device-related issues, further reducing the cost of manual verification of the device. This allows for efficient and accurate repair of simple network anomalies, significantly saving manpower. If the device has normal network access but still cannot establish a connection with the target server, it continues with routine network information detection, collecting multiple judgment criteria and integrating and summarizing log files. This allows network engineers to conduct comprehensive analysis based on the log files, efficiently and accurately identifying the anomaly. This invention achieves comprehensive diagnosis through step-by-step troubleshooting, efficiently and accurately identifying faults, significantly saving manpower, efficiently repairing simple network anomalies, and helping network engineers efficiently and accurately identify complex anomalies.
[0076] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A self-detection method for dialing anomalies based on a hierarchical diagnostic strategy, characterized in that, include: When the concentrator application senses that it cannot connect to the target server, it performs a basic hardware condition check for network access. If the basic hardware conditions for network access are passed, then the network access conditions of the concentrator itself are checked. If the concentrator passes its own network access condition detection, then a routine network information detection is performed. Summarize and optimize log files.
2. The dialing anomaly self-detection method based on a hierarchical diagnostic strategy as described in claim 1, characterized in that, The basic hardware condition detection for network access includes: A1. Determine the GPRS module insertion status by outputting the hardware pin level; if not inserted, prompt to check the GPRS module, log the information, and end the process; if successfully inserted, perform network access condition detection on the concentrator itself.
3. The dialing anomaly self-detection method based on a hierarchical diagnostic strategy as described in claim 1, characterized in that, The concentrator's own network access condition detection includes: B1. Determine the SIM card status by sending a SIM card PIN code query command to the modem; if the SIM card status is abnormal, log the error and end the process; if the SIM card status is normal, proceed to B2. B2. Determine the packet-switched domain registration status by sending a packet-switched domain network registration query command to the modem; if the packet-switched domain registration fails, log the error and execute B3; if the packet-switched domain registration succeeds, execute B4. B3. Send a signal strength detection command through the GPRS module to determine whether the received downlink signal strength of the base station is less than the preset value; if it is less than the preset value, prompt to check the antenna; if it is greater than or equal to the preset value, prompt to contact the network operator. B4. Determine the packet-switched domain attachment status by sending a packet-switched domain attachment status query command; if the packet-switched domain attachment is successful, log the result and perform the routine network information detection; if the packet-switched domain attachment fails, prompt the user to contact the network operator.
4. The dialing anomaly self-detection method based on a hierarchical diagnostic strategy as described in claim 3, characterized in that, The preset value in B3 is between 8 and 15.
5. The dialing anomaly self-detection method based on a hierarchical diagnostic strategy as described in claim 1, characterized in that, The routine network information detection includes one or more of the following: Ping public server detection, network packet capture detection, router information detection, network interface address information detection, and path node list detection.
6. The dialing anomaly self-detection method based on a hierarchical diagnostic strategy as described in claim 5, characterized in that, The conventional network information detection includes: C1. Initiate Internet Control Message Protocol connectivity test to the public domain name server through the Gprs module, and log the test results; C2. Initiate Internet Control Message Protocol connectivity test to the target server through the GPRS module, and at the same time, specify the USB virtual network interface corresponding to the GPRS module to capture network packets sent to the target server host address through the tcp dump tool, and record the target server host address and the captured network packets in the log. C3. Obtain routing information using the network routing tool iproute and record it in the logs; C4. Obtain the network interface address information of the concentrator through the network interface address configuration tool ipaddr and record it in the log; C5. Use the traceroute tool to send TTL hierarchical probe messages to the target server host address of the specified USB virtual network interface of the GPRS module, obtain the list of path nodes from the concentrator to the target server, and record the log.
7. The dialing anomaly self-detection method based on a hierarchical diagnostic strategy as described in claim 1, characterized in that, The process of summarizing and optimizing log files includes: According to the preset log management strategy, all log files are split, archived, deleted, and compressed.
8. The dialing anomaly self-detection method based on a hierarchical diagnostic strategy as described in claim 7, characterized in that, The log rotation management tool logrotate processes all log files according to a preset log management strategy.
9. A meter concentrator, characterized in that, It includes a computer-readable storage medium and a processor; the computer-readable storage medium stores a computer program, which, when executed by the processor, is capable of implementing the dialing anomaly self-detection method based on a hierarchical diagnostic strategy as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Electricity consumption information gathering fault detection system and remote channel detection method therefor
CN103700235A
Maintenance method for dealing with GPRS / CDMA module unable to access Internet
CN103870370A
Device for detecting electricity information acquisition equipment
CN104537816A
Remote monitoring system and method of power acquiring terminal network
CN104618940A
Integral system for measuring and detecting power theft.
MX2010010896A