Abnormality recording system and method of network gateway

By introducing network transmission interfaces, storage units and processing units into the network gateway to record and transmit abnormal log files, it solves the problem of information acquisition and analysis when Internet service providers manage gateway exceptions, and realizes automated abnormal status recording and analysis. , reducing the information collection burden on operators.

CN118540212APending Publication Date: 2024-08-23REALTEK SEMICON CORP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310143587.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-21
Publication Date
2024-08-23

Smart Images

  • Figure CN118540212A
    Figure CN118540212A
Patent Text Reader

Abstract

The invention discloses an abnormality recording system of a network gateway and a method thereof, and relates to an abnormality recording system comprising an external server and a network gateway. The network gateway comprises a network transmission interface, a storage unit and a processing unit. The processing unit is connected to the network transmission interface and the storage unit. The network transmission interface is in network connection with an external server. The storage unit stores an abnormal log file. When the processing unit detects an abnormal state, the processing unit generates an abnormal log file according to the abnormal state, and transmits the abnormal log file in the storage unit to an external server through the network transmission interface in a startup stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to an electronic device and an abnormality recording system and method thereof, and in particular to an abnormality recording system and method of a network gateway. Prior art

[0002] In order to provide better network connection quality, many Internet Service Providers (ISPs) make corresponding configuration settings for each domain and its gateway when building Internet infrastructure. In addition, Internet service providers will also configure gateways from different manufacturers according to the different nature of the domain.

[0003] Due to the differences in gateway specifications and setting environments, Internet service providers may have trouble managing them. In particular, after an abnormality occurs in the gateway, the gateway will usually restart automatically. Since all operating states of the gateway will be restarted after the restart, it is difficult for back-end staff to obtain relevant information about the gateway at the time of the abnormality. In addition, due to the differences in gateway models, software versions and setting environments of various companies, it is even more difficult for back-end staff to reproduce the state of gateway abnormalities, especially for Internet service providers that deploy a large number of gateways. Internet service providers may use gateways from different manufacturers according to applications in different network domains, and the control software (or firmware) versions of each gateway will also be different, making it more difficult for back-end staff to analyze errors. Summary of the invention

[0004] In view of this, in some embodiments, the network gateway includes a network transmission interface, a storage unit and a processing unit. The network transmission interface is connected to an external server; the storage unit stores abnormal log files; the processing unit connects the storage unit and the network transmission interface to detect abnormal conditions and generate abnormal log files according to the abnormal conditions; when the network gateway is in the boot stage, the processing unit is also used to detect whether there is an abnormal log file in the storage unit, and when there is an abnormal log file in the storage unit, transmit the abnormal log file to the external server via the network transmission interface. The network gateway can record the current abnormal log file by itself when an abnormality occurs, so that the network operator can extract the abnormal log file later.

[0005] In some embodiments, the exception log file includes an information recording structure, the information recording structure includes device information and exception code information, and the device information includes serial number, manufacturer code information, device model information, media access control information, device firmware information, device software information, exception log length consultation or a combination thereof.

[0006] In some embodiments, when no abnormal state is detected, the processing unit generates a system log file according to a normal state and stores it in the storage unit, and the abnormal log file is composed of an information record structure and an information record structure of the system log file.

[0007] In some embodiments, after the abnormal log file is transmitted to the external server, the processing unit clears the abnormal log file in the storage unit.

[0008] In some embodiments, a processing method for recording an abnormal state of a network gateway includes the following steps: when the network gateway is in the boot phase, the network gateway detects whether there is an abnormal log file. If there is no abnormal log file, the network gateway completes the boot and enters the working phase; when the network gateway is in the working phase, the network gateway executes a log recording program, including: when the operating state of the network gateway is an abnormal state, the network gateway generates and stores an abnormal log file corresponding to the abnormal state. If there is an abnormal log file, the network gateway transmits the abnormal log file to an external server.

[0009] In some embodiments, the network gateway executing the log recording program further includes when the operation status of the network gateway is a normal status, the network gateway generating and storing a system log file corresponding to the normal status.

[0010] In some embodiments, upon completion of generating and storing the exception log file, the network gateway performs a restart operation.

[0011] In some embodiments, the step of the network gateway transmitting the exception log file to the external server includes the network gateway checking the connection status with the external server; the network gateway reading and uploading the stored exception log file to the external server; the network gateway confirming whether the exception log file has been uploaded; when the exception log file has been uploaded, the network gateway clears the uploaded exception log file.

[0012] In some embodiments, the step of the network gateway transmitting the exception log file to the external server further includes the network gateway retransmitting the exception log file when the exception log file fails to be uploaded.

[0013] In summary, according to any embodiment, the network gateway exception recording system and method can enable the network gateway in the working stage to record an exception log file when an abnormal state occurs to save relevant information of the abnormal state, and enable the network gateway to automatically transmit the exception log file to an external server during the startup stage for network operators or back-end staff to analyze the cause of the abnormal state. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 Schematic diagram of an abnormality recording system for a network gateway according to an embodiment of the present invention.

[0015] Figure 2 The figure is a schematic diagram of the hardware architecture of a network gateway according to an embodiment of the present invention.

[0016] Figure 3 The figure is a schematic diagram of the operation flow of an abnormality recording system according to an embodiment of the present invention.

[0017] Figure 4 Schematic diagram of a finite state machine of an abnormality recording system according to an embodiment of the present invention.

[0018] Figure 5 The figure is a schematic diagram of the structure of an abnormal log file according to an embodiment of the present invention.

[0019] Figure 6 A schematic diagram of an abnormal log partition according to an embodiment. DETAILED DESCRIPTION

[0020] refer to Figure 1 and Figure 2 The abnormality recording system 100 of the network gateway 110 (hereinafter referred to as the abnormality recording system 100) includes the network gateway 110 and the external server 120. Each network domain 130 can deploy at least one network gateway 110. Each network gateway 110 is connected to multiple network devices 131 inside the network domain 130, and is connected to the external server 120 outside the network domain 130. Figure 1 The dotted box in FIG. 1 represents the network domain 130 to which the network gateway 110 belongs. The number of network devices 131 in each network domain 130 is not limited to Figure 1 Quantity shown in .

[0021] The network gateway 110 includes a network transmission interface 111, a processing unit 112, and a storage unit 113. The processing unit 112 is connected to the network transmission interface 111 and the storage unit 113. The network transmission interface 111 is network-connected to a network device 131 in a network domain 130, and is network-connected to an external server 120 in the network domain 130. The network device 131 can be connected to the network gateway 110 via a wireless network or a wired network.

[0022] In some embodiments, the network transmission interface 111 is a network interface supporting IEEE802.x Ethernet, such as an optical fiber network, a multi-twisted wire network (Category-5, 6 series), a power cable, or a wireless network. The network device 131 may be, but is not limited to, a hub, a router, a switch, a bridge, or a computing device with a network communication function. The computing device with a network communication function may be, for example, a personal computer, a laptop, a tablet computer, or a mobile phone.

[0023] The storage unit 113 stores a log recording program 114, a system log file 115, and an exception log file 116. In some embodiments, the storage unit 113 may be a flash memory, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically-erasable programmable read-only memory (EEPROM), or other non-volatile memory.

[0024] When the network gateway 110 is operating (i.e., in the working phase), the processing unit 112 executes the log recording program 114 to instantly record relevant information of the operating status of the network gateway 110. The processing unit 112 stores the recorded information as a system log file 115 or an abnormal log file 116 according to the operating status of the network gateway 110.

[0025] In some embodiments, the storage space of the storage unit 113 can be divided into a plurality of areas, and one of the areas is set as the abnormal log partition 119. Figure 6 . When the operating state is an abnormal state, the processing unit 112 generates an abnormal log file 116 that records relevant information of the abnormal operating state and stores the abnormal log file 116 in the abnormal log partition 119. If the processing unit 112 does not detect the abnormal state, the network gateway 110 is in a normal state. When the processing unit 112 is in a normal operating state, the processing unit 112 can execute the log recording program 114 to generate a system log file 115 that records relevant information of the normal operating state. The processing unit 112 stores the system log file 115 in other areas of the storage unit 113 other than the abnormal log partition 119. The operation processing of the abnormal log partition 119 and the abnormal log file 116 will be described in detail later.

[0026] In some embodiments, when executing the log recording program 114, the processing unit 112 can periodically record the operating resource status of the network gateway 110, and can also record the resource status called for each received operation request. For example, when the network gateway 110 receives the "display message" operation request issued by the network device 131, and this operation request corresponds to the "dmesg" command of the Linux operating system. Since the "dmesg" command request belongs to a normal query, the network gateway 110 will query the relevant information of the current operating resources when there is no abnormality, and store the relevant information of the queried operating resources as a system log file 115. On the contrary, when the network gateway 110 has an abnormality, the network gateway 110 will record the relevant information of the current operating resources and store the recorded file as an abnormal log file 116.

[0027] To further explain the operation process of the abnormality recording system 100, please cooperate with Figure 3 and Figure 4 shown. Figure 4 is a finite-state machine (FSM) of the network gateway 110, used to represent the corresponding processing of the network gateway 110 in each state. Figures 1 to 4 , the method for processing the abnormal state of the network gateway 110 includes:

[0028] Step S310: When the network gateway 110 is powered on, the network gateway 110 detects whether there is an abnormal log file 116;

[0029] Step S330: If the abnormal log file 116 exists, the network gateway 110 transmits the abnormal log file 116 to the external server 120;

[0030] Step S350: If the abnormal log file 116 does not exist, the network gateway 110 completes the boot and enters the working phase; and

[0031] Step S370 : During the working phase of the network gateway 110 , the network gateway 110 may execute the logging program 114 .

[0032] Wherein, step S370 includes:

[0033] Step S371: When the operation status of the network gateway 110 is normal, the network gateway 110 generates and stores the system log file 115 according to the normal status; and

[0034] Step S373 : When the operation status of the network gateway 110 is an abnormal status, the network gateway 110 generates and stores an abnormal log file 116 according to the abnormal status.

[0035] In some embodiments, in order to distinguish the operation stage of the network gateway 110, the operation stage of the network gateway 110 is defined as a booting state and a working state. The booting state generally refers to the operation stage of the network gateway 110 during the process of cold boot or warm boot. After the network gateway 110 completes the booting state, the network gateway 110 will enter the working state, corresponding to Figure 4 state T1 to state T2.

[0036] In addition to transmitting network data packets during the working phase, the network gateway 110 also receives relevant instructions from the external server 120 or the network device 131. The network gateway 110 feeds back the corresponding processing results based on the received instructions. The process of the network gateway 110 processing the received instructions will produce a corresponding operating state. Generally speaking, when the network gateway 110 operates normally (i.e., in a normal state), when the network gateway 110 receives a correct instruction or operation (hereinafter referred to as a normal operation), the network gateway 110 can feed back the corresponding processing results. If the network gateway 110 receives an abnormal instruction or operation (hereinafter referred to as an abnormal operation), the abnormal operation will cause the operating resources of the network gateway 110 to become abnormal, and at this time it is said that the network gateway 110 is in an abnormal state.

[0037] After the network gateway 110 is powered on (corresponding to step S300), the processing unit 112 of the network gateway 110 first performs a power-on operation to put the network gateway 110 in a booting stage. Figure 3 Steps S310 to S350 and Figure 4 When the network gateway 110 is in the booting stage, the processing unit 112 of the network gateway 110 detects whether there is an abnormal log file 116 in the abnormal log partition 119 of the storage unit 113 (corresponding to step S310). If the abnormal log file 116 does not exist in the storage unit 113, the network gateway 110 completes the booting and switches from the booting stage to the working stage (corresponding to steps S350 and Figure 4 state T2).

[0038] When the network gateway 110 is in the working stage (eg Figure 4As shown), the network gateway 110 will receive relevant operations from the network device 131. As mentioned above, when the network gateway 110 receives normal operations, the operating state of the network gateway 110 can be called a normal state. For example, taking the Linux operating system and its instructions as an example, if the processing unit 112 of the network gateway 110 receives the " / proc / meminfo" instruction, the processing unit 112 will query the memory usage according to the " / proc / meminfo" instruction. Since the aforementioned instruction only queries the memory usage and does not cause abnormal conditions such as resource exhaustion or deadlock, the processing unit 112 will regard the aforementioned query operation as a normal operation. Generally speaking, the processing unit 112 will maintain a normal state during normal operation. Figure 4 The process continues in state T2 until the processing unit 112 detects an operation abnormality.

[0039] On the contrary, if the processing unit 112 of the network gateway 110 causes resource exhaustion or scheduling difficulties due to the execution of the received instructions or operations, the processing unit 112 of the network gateway 110 is regarded as an abnormal operation. Abnormal operations include pointing the pointer of the network gateway 110 to an illegal memory segment, pointing a null pointer to any memory address, using an uninitialized pointer, accessing a critical resource, deadlocking, or memory exhaustion. In addition to the aforementioned abnormal resource operations, abnormal operations may also be a combination of instructions, thereby generating the aforementioned abnormal resource operations. Taking the Linux operating system and its instructions as an example, when the network gateway 110 receives the instruction of "echo c> / proc / sysrq-trigger", it will cause the abnormal operation of the network gateway 110 shutting down.

[0040] When an abnormal operation occurs in the network gateway 110, the processing unit 112 of the network gateway 110 generates an abnormal log file 116 corresponding to the abnormal operation (corresponding to step S373 and Figure 4 In some embodiments, an abnormal log file 116 includes an information recording structure 118 and a system log file 115, such as Figure 5 As shown. The information record structure 118 includes device information and exception code information. The device information may include serial number, manufacturer code information, device model information, media access control information (Media Access Control, MAC), device firmware information, device software information, file leading identifier, exception log length inquiry or any combination thereof. In one embodiment, the exception log file 116 is a header information (i.e., information record structure 118) added to the beginning of the system log file 115. Figure 5In the information recording structure 118, the left column indicates the column name of the recording column of the information recording structure 118, and the right column indicates the example content of the corresponding column name, but the example content is only for illustration and is not limited to this.

[0041] Among them, the exception code information is a representative number of the abnormal state. The backstage personnel can find the occurrence environment, conditions or elimination methods of the abnormal events of the network gateway 110 according to the exception code information. In addition to generating a serial number based on a timestamp, the processing unit 112 can also generate a serial number by combining a timestamp with other information. The manufacturer coding information is the code information of the sales manufacturer of the network gateway 110. The device model information is the model of the network gateway 110. The media access control information is the MAC address information of the network gateway 110. The device firmware information is the firmware version currently running on the network gateway 110. The device software information is the version information of the operating system carried by the network gateway 110.

[0042] Specifically, when an abnormal state occurs, the processing unit 112 writes the relevant information of the network gateway 110 into the corresponding field of the information recording structure 118, and the processing unit 112 also writes the information of the operation process into the system log file 115. In addition, the processing unit 112 combines the information recording structure 118 and the system log file 115 into an abnormal log file 116, and stores it in the abnormal log partition 119 of the storage unit 113.

[0043] In some embodiments, after generating the exception log file 116 (ie, after step S373), the processing unit 112 performs a restart operation (corresponding to step S375), so that the network gateway 110 restarts to enter the boot phase again (ie, returns to execute step S300).

[0044] In some embodiments, after step S310, if the storage unit 113 has an abnormal log file 116, the processing unit 112 checks the connection status with the external server 120. If the connection status is that the communication with the external server 120 is not established, the processing unit 112 drives the network transmission interface 111 to connect to the external server 120.

[0045] In some embodiments, the external server 120 may be a cloud server, or a designated personal computer or mobile communication device.

[0046] In some embodiments, the storage unit 113 may also store connection information 117. In addition to recording the transmission method of the external server 120, the connection information 117 also records the network address and login information of the external server 120, such as a user account or password. After the network connects to the external server 120, the processing unit 112 also logs in to the external server 120 according to the connection information 117 to establish a communication link with the external server 120.

[0047] After the connection state is to establish a communication link with the external server 120, the processing unit 112 of the network gateway 110 reads the abnormal log file 116 in the abnormal log partition 119 of the storage unit 113, and uploads the read abnormal log file 116 to the external server 120 via the communication link (corresponding to step S330 and Figure 4 In some embodiments, the processing unit 112 may select a corresponding transmission method to upload the abnormal log file 116 according to the connection information 117. In some embodiments, the transmission method may be, but is not limited to, File Transfer Protocol (FTP), Hypertext Transfer Protocol (HTTP), or Hypertext Transfer Protocol Secure (HTTPS).

[0048] After starting to upload, the network gateway 110 confirms whether the abnormal log file 116 has been uploaded. After the abnormal log file 116 is uploaded to the external server 120, the processing unit 112 of the network gateway 110 clears the uploaded abnormal log file 116 in the storage unit 113 (corresponding to step S330), and then enters the working stage from the boot stage (corresponding to step S350). For example, after the upload is completed, the processing unit 112 clears the abnormal log partition 119 of the storage unit 113, and then enters the working stage from the boot stage.

[0049] In some embodiments, the storage unit 113 further includes an abnormal log partition 119, such as Figure 6 The abnormal log partition 119 stores at least one set of abnormal log files 116. Other normal system log files 115 can be stored in other locations of the storage unit 113 without affecting the storage of the abnormal log files 116. Please refer to Figure 6 When the network gateway 110 is turned on, it can check whether there is an abnormal log file 116 in the abnormal log partition 119. The processing unit 112 uploads the abnormal log files 116 of the abnormal log partition 119 to the external server 120 one by one and clears the abnormal log files 116 that have been transmitted until the abnormal log partition 119 is cleared.

[0050] In summary, according to any embodiment, the abnormality recording system 100 and method of the network gateway 110 can enable the network gateway 110 in the working stage to record the abnormality log file 116 at the moment of the abnormal state to save the relevant information of the abnormal state, and enable the network gateway 110 to automatically transmit the abnormality log file 116 to the external server 120 during the booting stage, so that the network operator or back-end staff can analyze the cause of the abnormal state. Since the network gateway 110 can record and upload the relevant status of its abnormal events by itself, it can effectively reduce the burden of collecting information for operators who deploy a large number of network gateways 110.

[0051] Description of Reference Numerals

[0052] 100: Abnormal recording system

[0053] 110: Network Gateway

[0054] 111: Network transmission interface

[0055] 112: Processing unit

[0056] 113: Storage unit

[0057] 114: Logging Program

[0058] 115: System log file

[0059] 116: Abnormal log file

[0060] 117: Connection information

[0061] 118: Information Record Structure

[0062] 119: Abnormal log partition

[0063] 120: External server

[0064] 130:Domain

[0065] 131: Network equipment

[0066] S300, S310, S330, S350, S370, S371, S373, S375: Steps

[0067] T1, T2, T3, T4: Status

Claims

1. A network gateway, comprising: Network transmission interface, used for network connection to external servers; A storage unit, used for storing abnormal log files; as well as a processing unit connected to the storage unit and the network transmission interface, and configured to detect an abnormal state and generate the abnormal log file according to the abnormal state; When the network gateway is in the booting stage, the processing unit is also used to detect whether the abnormal log file exists in the storage unit, and when the abnormal log file exists in the storage unit, transmit the abnormal log file to the external server via the network transmission interface.

2. The network gateway according to claim 1, wherein the exception log file includes an information recording structure, the information recording structure includes device information and exception code information, and the device information includes a serial number, manufacturer code information, device model information, media access control information, device firmware information, device software information or a combination thereof.

3. The network gateway according to claim 2, wherein when the processing unit does not detect the abnormal state, the processing unit generates a system log file according to a normal state and stores it in the storage unit, and wherein the abnormal log file is composed of the information record structure and the information record structure of the system log file. 4 . The network gateway according to claim 1 , wherein after the abnormal log file is completely transmitted to the external server, the processing unit clears the abnormal log file in the storage unit. 5 . The network gateway according to claim 1 , wherein the processing unit transmits the abnormal log file to the external server according to File Transfer Protocol, Hypertext Transfer Protocol or Hypertext Transfer Protocol Secure. 6 . The network gateway according to claim 1 , wherein the storage unit is defined with an exception log partition, and the exception log file is stored in the exception log partition.

7. A method for processing an abnormal state of a network gateway, comprising: When the network gateway is in the startup phase, the network gateway detects whether there is an abnormal log file; If the abnormal log file does not exist, the network gateway completes the startup and enters the working stage; as well as When the network gateway is in the working stage, the network gateway executes a logging procedure, including: When the operation state of the network gateway is an abnormal state, the network gateway generates and stores the abnormal log file corresponding to the abnormal state; as well as If the abnormal log file exists, the network gateway transmits the abnormal log file to an external server.

8. The method for processing an abnormal state of a network gateway according to claim 7, wherein the network gateway executing the logging program further comprises: When the operating state of the network gateway is a normal state, the network gateway generates and stores a system log file corresponding to the normal state.

9. The method for processing an abnormal state of a network gateway according to claim 7, further comprising: When the operation state of the network gateway is the abnormal state, the network gateway generates and stores a system log file corresponding to the abnormal state; as well as When the abnormal log file is generated and stored, the network gateway performs a restart operation.

10. The method for processing an abnormal state of a network gateway according to claim 7, wherein the step of transmitting the abnormal log file to the external server by the network gateway comprises: The network gateway checks the connection status with the external server; The network gateway reads and uploads the stored abnormal log file to the external server; The network gateway confirms whether the abnormal log file has been uploaded; as well as When the exception log file is completely uploaded, the network gateway clears the uploaded exception log file.

11. The method for processing an abnormal state of a network gateway according to claim 10, wherein the step of transmitting the abnormal log file to the external server by the network gateway further comprises: When the abnormal log file fails to be uploaded, the network gateway retransmits the abnormal log file.

Citation Information

Cited By

  • Abnormal processing method and device, electronic equipment and storage medium

    CN120639757A