Log acquisition method and device of wireless communication module and electronic equipment

By using pre-configured configuration files and logs to save scope parameters in the wireless communication module, monitoring and storing the context log information of core network events, the problem of log information redundancy is solved, and the effect of quickly locate the causes of communication abnormalities and reduce hardware costs is achieved.

CN119946687APending Publication Date: 2025-05-06ROLLING WIRELESS SARL
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The log information of the wireless communication module is too redundant to quickly locate the cause of communication abnormalities.

Method used

By obtaining pre-configured configuration files, parse configuration information, including network events to be monitored, core network events and log saving range parameters. Based on these configuration information, the log data of the wireless communication module is monitored, the log information corresponding to the network event to be monitored is stored in the preset buffer, and when it is determined to be a core network event, the context log information is selected according to the log storage range parameter to store it in the non-volatile storage area.

Benefits of technology

It effectively avoids redundancy of log information, quickly locates the causes of communication abnormalities in wireless communication modules, and reduces the size of the non-volatile memory area required to store log information, reducing hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946687A_ABST
    Figure CN119946687A_ABST
Patent Text Reader

Abstract

The invention relates to a log acquisition method and device of a wireless communication module and electronic equipment, and the method comprises the steps: obtaining a pre-configured configuration file, and analyzing the configuration file to obtain configuration information, the configuration information comprising a to-be-monitored network event, a core network event and a log storage range parameter; monitoring log data of the wireless communication module based on the to-be-monitored network event, and storing log information corresponding to the to-be-monitored network event to a preset buffer area under the condition that the to-be-monitored network event is monitored; and under the condition that the to-be-monitored network event is judged to be the core network event, selecting context log information corresponding to the core network event from a preset buffer area according to the log storage range parameter, and storing the context log information corresponding to the core network event to a preset nonvolatile storage area. In this way, the log information can be prevented from being too redundant, and the communication abnormality reason of the wireless communication module can be quickly positioned.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of wireless communication modules, and in particular to a log acquisition method, device and electronic device for a wireless communication module. Background Art

[0002] During field testing and actual use of wireless communication modules, it is usually necessary to obtain the log information of the wireless communication module to analyze the causes of communication anomalies. Therefore, the log information of the wireless communication module is extremely important.

[0003] However, in the related art, all logs generated by the wireless communication module are usually obtained, which easily leads to excessive redundancy of log information and makes it impossible to quickly locate the cause of the communication abnormality of the wireless communication module. Summary of the invention

[0004] The present application provides a log acquisition method, device and electronic device for a wireless communication module to solve the problem in the related art that the log information of the wireless communication module is too redundant and the cause of the communication abnormality of the wireless communication module cannot be quickly located.

[0005] In a first aspect, an embodiment of the present application provides a log acquisition method of a wireless communication module, the method comprising:

[0006] Obtaining a pre-configured configuration file, and parsing the configuration file to obtain configuration information, wherein the configuration information includes network events to be monitored, core network events, and log saving range parameters, and the network events to be monitored include the core network events;

[0007] Monitoring the log data of the wireless communication module based on the network event to be monitored, and storing the log information corresponding to the network event to be monitored in a preset buffer when the network event to be monitored is detected;

[0008] Determining whether the network event to be monitored is the core network event;

[0009] When it is determined that the network event to be monitored is the core network event, the context log information corresponding to the core network event is selected from the preset buffer according to the log saving range parameter, and the context log information corresponding to the core network event is stored in the preset non-volatile storage area.

[0010] Optionally, when the network event to be monitored is detected, storing log information corresponding to the network event to be monitored in a preset buffer includes:

[0011] In the case where the network event to be monitored is detected, obtaining log data corresponding to the network event to be monitored, the event type of the network event to be monitored, and the timestamp when the network event to be monitored is detected;

[0012] Concatenate the log data corresponding to the network event to be monitored, the event type of the network event to be monitored, and the timestamp when the network event to be monitored is monitored to obtain log information corresponding to the network event to be monitored;

[0013] The log information corresponding to the network event to be monitored is stored in the preset buffer.

[0014] Optionally, when the network event to be monitored is detected, storing log information corresponding to the network event to be monitored in a preset buffer includes:

[0015] In the case where the network event to be monitored is monitored, obtaining log data corresponding to the network event to be monitored, the event type of the network event to be monitored, the timestamp when the network event to be monitored is monitored, and the location information when the network event to be monitored is monitored;

[0016] The log data corresponding to the network event to be monitored, the event type of the network event to be monitored, the timestamp when the network event to be monitored is monitored, and the location information when the network event to be monitored is monitored are spliced ​​to obtain the log information corresponding to the network event to be monitored;

[0017] The log information corresponding to the network event to be monitored is stored in the preset buffer.

[0018] Optionally, after storing the log information corresponding to the network event to be monitored in the preset buffer, the method further includes:

[0019] Determine whether there is expired log information in the preset buffer, wherein the expired log information refers to a log stored in the preset buffer before a first preset time before the moment when the network event to be monitored is detected;

[0020] When it is determined that the expired log information exists in the preset buffer, the expired log information is deleted.

[0021] Optionally, selecting the context log information corresponding to the core network event from the preset buffer according to the log storage range parameter includes:

[0022] According to the log preservation range parameter, determine the time range for log preservation and the event type range for log preservation, wherein the time range for log preservation refers to the time point at which the core network event is monitored as a reference point, a time range within a second preset time length before the reference point and a third preset time length after the reference point, and the event type range for log preservation refers to the event type of the network event to be monitored that has an associated relationship with the core network event;

[0023] Matching the time range of the log storage with the timestamp of each log information in the preset buffer, and matching the event type range of the log storage with the event type of each log information in the preset buffer;

[0024] According to the matching result, context log information corresponding to the core network event is selected from the preset buffer.

[0025] Optionally, the method further comprises:

[0026] When the time interval between the currently monitored core network event and the last monitored core network event is less than the third preset time length, storing the first log information stored in the preset buffer to the preset non-volatile storage area, wherein the first log information includes the upper log information and part of the lower log information corresponding to the last monitored core network event;

[0027] Continue to monitor the network events to be monitored after the currently monitored core network event, and store the log information corresponding to the monitored network events to be monitored in the preset buffer in sequence;

[0028] When the time length for storing log information in the preset buffer reaches the third preset time length after the currently monitored core network event, the second log information stored in the preset buffer is stored in the preset non-volatile storage area, wherein the second log information includes the following log information corresponding to the currently monitored core network event.

[0029] Optionally, the configuration information also includes an upper limit value of the log file;

[0030] Before storing the context log information corresponding to the core network event in a preset non-volatile storage area, the method further includes:

[0031] Calculating the sum of the context log information corresponding to the core network event and the log information stored in the preset non-volatile storage area;

[0032] Determine whether the sum is greater than an upper limit value of the log file;

[0033] When the sum is greater than the upper limit of the log file, the context log information corresponding to the earliest stored core network event in the preset non-volatile storage area is deleted.

[0034] In a second aspect, an embodiment of the present application provides a log acquisition device for a wireless communication module, the device comprising:

[0035] An acquisition module, used to acquire a pre-configured configuration file and parse the configuration file to obtain configuration information, wherein the configuration information includes network events to be monitored, core network events and log saving range parameters, and the network events to be monitored include the core network events;

[0036] A first storage module is used to monitor the log data of the wireless communication module based on the network event to be monitored, and when the network event to be monitored is detected, store the log information corresponding to the network event to be monitored in a preset buffer;

[0037] A first judgment module, used to judge whether the network event to be monitored is the core network event;

[0038] The second storage module is used to select the context log information corresponding to the core network event from the preset buffer according to the log saving range parameter when the network event to be monitored is determined to be the core network event, and store the context log information corresponding to the core network event in a preset non-volatile storage area.

[0039] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0040] Memory, used to store computer programs;

[0041] The processor is used to implement the log acquisition method of the wireless communication module described in the first aspect when executing the program stored in the memory.

[0042] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the log acquisition method of the wireless communication module described in the first aspect is implemented.

[0043] The above-mentioned technical scheme provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application obtains a pre-configured configuration file and parses the configuration information from the configuration file, wherein the configuration information includes the network event to be monitored, the core network event and the log storage range parameter, and the network event to be monitored includes the core network event; the log data of the wireless communication module is monitored based on the network event to be monitored, and when the network event to be monitored is monitored, the log information corresponding to the network event to be monitored is stored in a preset buffer; it is determined whether the network event to be monitored is the core network event; when it is determined that the network event to be monitored is the core network event, the context log information corresponding to the core network event is selected from the preset buffer according to the log storage range parameter, and the context log information corresponding to the core network event is stored in a preset non-volatile storage area. Through the above method, based on the pre-configured parameters of the network event to be monitored, the log information corresponding to the network event to be monitored can be first stored in a preset buffer, and then, when the network event to be monitored is determined to be a core network event, the context log information corresponding to the core network event can be stored from the preset buffer to the preset non-volatile storage area. In this way, the log information obtained is the context log information corresponding to the core network event, avoiding excessive redundancy of the log information, thereby quickly locating the cause of the communication abnormality of the wireless communication module. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0046] Figure 1 A flow chart of a log acquisition method for a wireless communication module provided in an embodiment of the present application;

[0047] Figure 2 A flow chart of another log acquisition method of a wireless communication module provided in an embodiment of the present application;

[0048] Figure 3 A structural diagram of a log acquisition device for a wireless communication module provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0051] See also Figure 1 , Figure 1 A flow chart of a log acquisition method of a wireless communication module provided in an embodiment of the present application. Figure 1 As shown, the log acquisition method of the wireless communication module may include the following steps:

[0052] Step S102: Obtain a pre-configured configuration file, and parse the configuration file to obtain configuration information, wherein the configuration information includes network events to be monitored, core network events, and log storage range parameters, and the network events to be monitored include core network events.

[0053] Specifically, the above-mentioned configuration file refers to a file pre-configured by the user according to the log acquisition requirements. The configuration file may include a variety of configuration information, such as network events to be monitored, core network events, and log saving range parameters. Among them, the network events to be monitored here refer to network events that need to be monitored, which include core network events and non-core network events. The log saving range parameters here may include the time range for log saving and the event type range for log saving. For example, when configuring the time range for log saving, according to the log acquisition requirements, for core network event 1, log information within the time period from 30 minutes before the occurrence of core network event 1 to 30 minutes after the occurrence can be saved, and for core network event 2, log information within the time period from 20 minutes before the occurrence of core network event 2 to 20 minutes after the occurrence can be saved, etc. For another example, when configuring the range of event types for log storage, based on log acquisition requirements, for core network event 1, log information related to network event 1 to be monitored, network event 3 to be monitored, network event 5 to be monitored, and other network events that are associated with core network event 1 can be saved; for core network event 2, log information related to network event 2 to be monitored, network event 3 to be monitored, network event 4 to be monitored, and other network events that are associated with core network event 2 can be saved.

[0054] The above-mentioned configuration file can be pre-configured in the wireless communication module, and the configuration file can be obtained from the wireless communication module; the above-mentioned configuration file can also be pre-configured in an electronic device installed with a wireless communication module, and the configuration file can be obtained from the electronic device. The embodiment of the present application does not make specific limitations.

[0055] Step S104: monitoring the log data of the wireless communication module based on the network event to be monitored, and storing the log information corresponding to the network event to be monitored in a preset buffer when the network event to be monitored is detected.

[0056] After parsing the configuration information from the configuration file, the log data of the wireless communication module can be monitored based on the network event to be monitored, and when the network event to be monitored is detected, the log information corresponding to the network event to be monitored is stored in a preset buffer. The preset buffer here can be a buffer in the wireless communication module, or a buffer in an electronic device equipped with the wireless communication module, which is not specifically limited in this application.

[0057] Step S106: Determine whether the network event to be monitored is a core network event.

[0058] Determine whether the network event to be monitored is a core network event. If the network event to be monitored is determined to be a core network event, execute step 106; if the network event to be monitored is determined to be a non-core network event, continue to execute step 104, that is, continue to monitor the log data of the wireless communication module based on the network event to be monitored, and when the network event to be monitored is detected, store the log information corresponding to the network event to be monitored in a preset buffer.

[0059] Step S108: When it is determined that the network event to be monitored is a core network event, context log information corresponding to the core network event is selected from the preset buffer according to the log storage range parameter, and the context log information corresponding to the core network event is stored in the preset non-volatile storage area.

[0060] If the network event to be monitored is determined to be a core network event, the context log information corresponding to the core network event can be selected from the preset buffer according to the log storage range parameter, and the context log information corresponding to the core network event can be stored in the preset non-volatile storage area. The context log information corresponding to the core network event here refers to the log information that meets the time range of log storage corresponding to the core network event and the event type range of log storage. Since these log information covers the log information from a period of time before the occurrence of the core network event to a period of time after the occurrence, it is called context log information. The preset non-volatile storage area here can be a non-volatile storage area in the wireless communication module, or it can be a non-volatile storage area in an electronic device equipped with a wireless communication module, and this application does not make specific limitations.

[0061] Through the above method, based on the pre-configured parameters of the network event to be monitored, the log information corresponding to the network event to be monitored can be first stored in a preset buffer, and then, when the network event to be monitored is determined to be a core network event, the context log information corresponding to the core network event is stored from the preset buffer to the preset non-volatile storage area. In this way, the acquired log information is the context log information corresponding to the core network event, avoiding excessive redundancy of the log information, thereby quickly locating the cause of the communication abnormality of the wireless communication module; and, it can also effectively reduce the size of the non-volatile storage area required for storing the log information, thereby reducing hardware costs.

[0062] In an optional embodiment, the above step S104, when a network event to be monitored is detected, storing log information corresponding to the network event to be monitored in a preset buffer, includes:

[0063] When a network event to be monitored is detected, log data corresponding to the network event to be monitored, the event type of the network event to be monitored, and the timestamp when the network event to be monitored is detected are obtained;

[0064] The log data corresponding to the network event to be monitored, the event type of the network event to be monitored and the timestamp when the network event to be monitored is detected are concatenated to obtain the log information corresponding to the network event to be monitored;

[0065] The log information corresponding to the network event to be monitored is stored in a preset buffer.

[0066] As an optional implementation, the log information corresponding to the network event to be monitored may include the log data corresponding to the network event to be monitored, the event type of the network event to be monitored, and the timestamp when the network event to be monitored is monitored. Therefore, when storing the log information corresponding to the network event to be monitored in the preset buffer, the log data corresponding to the network event to be monitored, the event type of the network event to be monitored, and the timestamp when the network event to be monitored is monitored can be obtained first, and then the log data corresponding to the network event to be monitored, the event type of the network event to be monitored, and the timestamp when the network event to be monitored is detected are spliced ​​to obtain the log information corresponding to the network event to be monitored, and finally the log information corresponding to the network event to be monitored is stored in the preset buffer.

[0067] Through the above method, since the log information corresponding to the network event to be monitored contains the event type of the network event to be monitored and the timestamp when the network event to be monitored is monitored, it can be ensured that the context log information corresponding to the core network event can be selected from the preset buffer according to the log storage range parameter.

[0068] In an optional embodiment, the above step S104, when a network event to be monitored is detected, storing log information corresponding to the network event to be monitored in a preset buffer, includes:

[0069] When a network event to be monitored is detected, log data corresponding to the network event to be monitored, the event type of the network event to be monitored, the timestamp when the network event to be monitored is detected, and the location information when the network event to be monitored is detected are obtained;

[0070] The log data corresponding to the network event to be monitored, the event type of the network event to be monitored, the timestamp when the network event to be monitored is monitored, and the location information when the network event to be monitored is monitored are spliced ​​to obtain the log information corresponding to the network event to be monitored;

[0071] The log information corresponding to the network event to be monitored is stored in a preset buffer.

[0072] As another optional implementation, the log information corresponding to the network event to be monitored may include, in addition to the log data corresponding to the network event to be monitored, the event type of the network event to be monitored and the timestamp when the network event to be monitored is monitored, the log information corresponding to the network event to be monitored may also include the location information when the network event to be monitored is monitored. Therefore, when storing the log information corresponding to the network event to be monitored in the preset buffer, the log data corresponding to the network event to be monitored, the event type of the network event to be monitored, the timestamp when the network event to be monitored is monitored and the location information when the network event to be monitored is monitored may be obtained first, and then the log data corresponding to the network event to be monitored, the event type of the network event to be monitored, the timestamp when the network event to be monitored is monitored and the location information when the network event to be monitored is spliced ​​to obtain the log information corresponding to the network event to be monitored, and finally the log information corresponding to the network event to be monitored is stored in the preset buffer.

[0073] Through the above method, since the log information corresponding to the network event to be monitored contains the event type of the network event to be monitored and the timestamp when the network event to be monitored is monitored, it can be ensured that the context log information corresponding to the core network event can be selected from the preset buffer according to the log storage range parameter. At the same time, since the log information corresponding to the network event to be monitored also contains the location information when the network event to be monitored is monitored, the problem can be reproduced in a targeted manner based on the location information, which helps technicians to simulate and reproduce the problem scenario more accurately. For example, when the wireless communication module has poor communication performance in a certain location area, the problem can be reproduced in the location area to determine whether it is actually a problem with the wireless communication module or a problem with the base station.

[0074] In an optional embodiment, after the above step of storing the log information corresponding to the network event to be monitored in a preset buffer, the method further includes:

[0075] Determine whether there is expired log information in the preset buffer, wherein the expired log information refers to the log stored in the preset buffer before the first preset time before the moment when the network event to be monitored is detected;

[0076] When it is determined that there is expired log information in the preset buffer, the expired log information is deleted.

[0077] Specifically, the above-mentioned first preset duration can be set according to actual needs, such as 30 minutes, 1 hour, etc., and this application does not make any specific limitation.

[0078] After storing the log information corresponding to the network event to be monitored in the preset buffer, it can also be determined whether there is expired log information in the preset buffer, wherein the expired log information here refers to the log stored in the preset buffer before the first preset time before the moment when the network event to be monitored is detected. If there is expired log information in the preset buffer, it is necessary to delete the expired log information. If there is no expired log information in the preset buffer, this step is ignored.

[0079] Through the above method, when the log information corresponding to the network event to be monitored is stored in real time, the expired log information in the preset buffer can be deleted in real time. In this way, not only the occupied space of the preset buffer can be reduced, but also the log information in the preset buffer can be ensured to be the log information of the most recent period of time.

[0080] In an optional embodiment, the above step 108, selecting context log information corresponding to the core network event from the preset buffer according to the log storage range parameter, includes:

[0081] According to the log preservation range parameter, determine the time range of log preservation and the event type range of log preservation, wherein the time range of log preservation refers to the time point at which the core network event is monitored as the reference point, the time range within the second preset time before the reference point and the third preset time after the reference point, and the event type range of log preservation refers to the event type of the network event to be monitored that has an associated relationship with the core network event;

[0082] Match the time range of log storage with the timestamp of each log information in the preset buffer, and match the event type range of log storage with the event type of each log information in the preset buffer;

[0083] According to the matching results, the context log information corresponding to the core network event is selected from the preset buffer.

[0084] Specifically, the second preset duration and the third preset duration can be set according to actual needs, such as 30 minutes, 1 hour, etc., and this application does not make specific limitations. As an optional implementation, the second preset duration can be consistent with the first preset duration, so that when the network event to be monitored is a core network event, the log information stored in the buffer just meets the time range requirement of the core network event.

[0085] When selecting the context log information corresponding to the core network event from the preset buffer according to the log saving range parameter, the time range of log saving and the event type range of log saving can be determined according to the log saving range parameter, and then the time range of log saving is matched with the timestamp of each log information in the preset buffer, and the event type range of log saving is matched with the event type of each log information in the preset buffer, and then the context log information corresponding to the core network event is selected from the preset buffer according to the matching result. That is, the log information in the preset buffer that belongs to the time range of log saving and the event type range of log saving corresponding to the core network event is used as the context log information corresponding to the core network event.

[0086] Through the above method, the obtained log information can be the context log information corresponding to the core network event, avoiding excessive redundancy of log information, so that the cause of communication abnormality of the wireless communication module can be quickly located; and it can also effectively reduce the size of the non-volatile storage area required to store log information, thereby reducing hardware costs.

[0087] In an optional embodiment, the method further comprises:

[0088] When the time interval between the currently monitored core network event and the last monitored core network event is less than a third preset time length, storing the first log information stored in the preset buffer to a preset non-volatile storage area, wherein the first log information includes the upper log information and part of the lower log information corresponding to the last monitored core network event;

[0089] Continue to monitor the network events to be monitored after the currently monitored core network event, and store the log information corresponding to the monitored network events to be monitored in a preset buffer in sequence;

[0090] When the time length for storing log information in the preset buffer reaches a third preset time length after the currently monitored core network event, the second log information stored in the preset buffer is stored in the preset non-volatile storage area, wherein the second log information includes the following log information corresponding to the currently monitored core network event.

[0091] Specifically, when the time interval between the currently monitored core network event and the last monitored core network event is less than the third preset duration (i.e., a new core network event is detected when the context log information of the last monitored core network event has not been fully acquired), the upper context log information and part of the lower context log information corresponding to the last monitored core network event stored in the preset buffer can be first stored in the preset non-volatile storage area, and then the network event to be monitored after the currently monitored core network event continues to be monitored, and the log information corresponding to the monitored network event to be monitored is stored in the preset buffer in sequence until the duration of storing the log information in the preset buffer after the currently monitored core network event reaches the third preset duration, and the lower context log information corresponding to the currently monitored core network event stored in the preset buffer is again stored in the preset non-volatile storage area.

[0092] For example, assuming that the time when the last monitored core network event was monitored is 1:00, and the time when the currently monitored core network event is monitored is 1:20, and the time range for saving the logs of the last monitored core network event and the currently monitored core network event is based on the time point when the core network event was monitored, and the time range within 30 minutes before the reference point and 30 minutes after the reference point, then the log information stored in the preset buffer from 0:30 to 1:20 can be stored in the preset non-volatile storage area at 1:20, and then the log information stored in the preset buffer from 1:20 to 1:50 can be stored in the preset non-volatile storage area at 1:50. In this way, the log information within the time range from 0:30 to 1:50 can be obtained.

[0093] In this way, when the time interval between two adjacent core network events is relatively small, the log information in the preset buffer can be migrated twice to prevent the log information from overflowing in the preset buffer, thereby ensuring that the context log information of two adjacent core network events can be stored in the preset non-volatile storage area.

[0094] In an optional embodiment, the configuration information also includes an upper limit value of the log file;

[0095] Before the above step 108, storing the context log information corresponding to the core network event in the preset non-volatile storage area, the method further includes:

[0096] Calculating the sum of the context log information corresponding to the core network event and the log information stored in the preset non-volatile storage area;

[0097] Determine whether the sum is greater than the upper limit of the log file;

[0098] When the total is greater than the upper limit of the log file, the context log information corresponding to the earliest stored core network event in the preset non-volatile storage area is deleted.

[0099] Specifically, before storing the context log information corresponding to the core network event in the preset non-volatile storage area, the sum of the context log information corresponding to the core network event and the log information stored in the preset non-volatile storage area can also be calculated, and then it is determined whether the sum is greater than the upper limit of the log file. If the sum is greater than the upper limit of the log file, the context log information corresponding to the core network event stored earliest in the preset non-volatile storage area can be deleted. If the sum is less than or equal to the upper limit of the log file, there is no need to delete the context log information corresponding to the core network event stored earliest in the preset non-volatile storage area.

[0100] Through the above method, when the context log information corresponding to the core network event is stored in real time, the historical log information in the preset non-volatile storage area can be deleted in real time. In this way, not only the occupied space of the preset non-volatile storage area can be reduced, but also the log information in the preset non-volatile storage area can be ensured to be the log information of the most recent period of time.

[0101] In an optional embodiment, the log acquisition process of the wireless communication module can be as follows: Figure 2 As shown, the specific steps include:

[0102] Step S202: monitoring the log data of the wireless communication module based on the network event to be monitored.

[0103] The event type of the network event to be monitored needs to be pre-configured in the configuration file.

[0104] Step S204: when a network event to be monitored is detected, the log data, event type, and timestamp and location information of the network event to be monitored corresponding to the network event to be monitored are concatenated into a log message, and stored in a preset buffer.

[0105] The location information may be obtained by a Global Positioning System (GPS) module on an electronic device equipped with a wireless communication module, or may be obtained through the Internet.

[0106] Step S206: Determine whether there is expired log information in the preset buffer.

[0107] If there is expired log information in the preset buffer, step S208 is executed; if there is no expired log information in the preset buffer, step S210 is executed. The expired log information refers to the difference between the timestamp of the log and the current timestamp is greater than the preset time length LogSaveBefore.

[0108] Step S208: Delete the expired log information.

[0109] Step S210: Determine whether the network event to be monitored is a core network event.

[0110] If the network event to be monitored is a core network event, step S212 is executed; if the network event to be monitored is a non-core network event, step S224 is executed.

[0111] Step S212: Use the current time point as the timestamp of the core network event.

[0112] Step S214: determine whether the log storage flag LogSave is true.

[0113] If the log storage flag LogSave is false, it means that the context log information of the previous core network event has been stored from the preset buffer to the preset non-volatile storage area, and this time only the context log information of the current core network event needs to be stored, so step S216 and step S202 can be executed; if the log storage flag LogSave is true, it means that the context log information of the previous core network event has not yet been stored from the preset buffer to the preset non-volatile storage area, so step S218 can be executed.

[0114] Step S216: Set the log storage flag LogSave to true.

[0115] Step S218: Store the log information in the preset buffer into the preset non-volatile storage area, and clear the preset buffer.

[0116] Step S220: Determine whether the log file is larger than the upper limit of the log file.

[0117] If the log file is larger than the upper limit of the log file, execute step S222; if the log file is smaller than or equal to the upper limit of the log file, execute step S202.

[0118] Step S222: Delete the context log information corresponding to the earliest stored core network event in the preset non-volatile storage area.

[0119] Step S224: determine whether the log storage flag LogSave is true.

[0120] If the log storage flag LogSave is true, it means that the context log information of the previous core network event has not yet been stored from the preset buffer to the preset non-volatile storage area, and the log information of the non-core network event needs to be buffered as the context log information of the previous core network event, and step S226 can be executed; if the log storage flag LogSave is false, it means that the context log information of the previous core network event has been stored from the preset buffer to the preset non-volatile storage area, and the log information of the non-core network event does not need to be used as the context log information of the previous core network event, and only needs to be buffered, and step S202 can be executed.

[0121] Step S226: Determine whether the difference between the current timestamp and the timestamp of the core network event is greater than a preset duration LogSaveAfter.

[0122] If the difference between the current timestamp and the timestamp of the core network event is greater than the preset duration LogSaveAfter, execute steps S228 and S218; if the difference between the current timestamp and the timestamp of the core network event is less than or equal to the preset duration LogSaveAfter, execute step S202.

[0123] Step S228: Set the log storage flag LogSave to false.

[0124] By executing the above steps S202 to S228, the log information of the core network events can be obtained, which has the following beneficial effects:

[0125] 1. Improve the flexibility of log acquisition: By flexibly adjusting the configuration information in the configuration file, the most suitable log information can be captured according to different environments and usage scenarios, which enhances the flexibility of log capture.

[0126] 2. Improve the accuracy of problem diagnosis: By improving the log capture mechanism, relevant logs can be captured more accurately, which is crucial for subsequent log analysis and problem diagnosis.

[0127] 3. Enhance the ability to locate problems: By capturing log information within a specified time range before and after core network events occur, the context information of the problem can be effectively obtained, providing effective directionality for rapid problem location, thereby speeding up problem solving.

[0128] 4. Improve the ability to reproduce problems: Log information contains location information, which makes problem reproduction more targeted and helps technicians simulate and reproduce problem scenarios more accurately.

[0129] 5. Helps to discover potential problems: Log analysis based on location information helps to discover base station problems in the existing network environment, which is of great significance for preventing and solving network failures and improving network stability and service quality.

[0130] 6. Optimize resource allocation: By accurately capturing relevant logs, unnecessary data processing can be reduced, resource allocation can be optimized, and system efficiency can be improved.

[0131] See also Figure 3 , Figure 3 A structural diagram of a log acquisition device for a wireless communication module provided in an embodiment of the present application. Figure 3 As shown, the log acquisition device 300 of the wireless communication module includes:

[0132] The acquisition module 302 is used to acquire a pre-configured configuration file and parse the configuration file to obtain configuration information, wherein the configuration information includes network events to be monitored, core network events and log storage range parameters, and the network events to be monitored include core network events;

[0133] The first storage module 304 is used to monitor the log data of the wireless communication module based on the network event to be monitored, and when the network event to be monitored is detected, store the log information corresponding to the network event to be monitored in a preset buffer;

[0134] A first determination module 306 is used to determine whether the network event to be monitored is a core network event;

[0135] The second storage module 308 is used to select the context log information corresponding to the core network event from the preset buffer according to the log saving range parameter when the network event to be monitored is determined to be a core network event, and store the context log information corresponding to the core network event in the preset non-volatile storage area.

[0136] Furthermore, the first storage module 304 includes:

[0137] A first acquisition submodule is used to acquire, when a network event to be monitored is detected, log data corresponding to the network event to be monitored, the event type of the network event to be monitored, and a timestamp when the network event to be monitored is detected;

[0138] A first splicing submodule is used to splice the log data corresponding to the network event to be monitored, the event type of the network event to be monitored and the timestamp when the network event to be monitored is monitored, so as to obtain the log information corresponding to the network event to be monitored;

[0139] The first storage submodule is used to store log information corresponding to the network event to be monitored in a preset buffer.

[0140] Furthermore, the first storage module 304 also includes:

[0141] The second acquisition submodule is used to acquire, when a network event to be monitored is detected, log data corresponding to the network event to be monitored, the event type of the network event to be monitored, the timestamp when the network event to be monitored is detected, and the location information when the network event to be monitored is detected;

[0142] A second splicing submodule is used to splice the log data corresponding to the network event to be monitored, the event type of the network event to be monitored, the timestamp when the network event to be monitored is monitored, and the location information when the network event to be monitored is monitored, so as to obtain the log information corresponding to the network event to be monitored;

[0143] The second storage submodule is used to store the log information corresponding to the network event to be monitored in a preset buffer.

[0144] Furthermore, the first storage module 304 also includes:

[0145] A judgment submodule, used to judge whether there is expired log information in the preset buffer, wherein the expired log information refers to the log stored in the preset buffer before the first preset time before the moment when the network event to be monitored is detected;

[0146] The deletion submodule is used to delete the expired log information when it is determined that there is expired log information in the preset buffer.

[0147] Furthermore, the second storage module 308 includes:

[0148] A determination submodule is used to determine the time range of log storage and the event type range of log storage according to the log storage range parameter, wherein the time range of log storage refers to the time point at which the core network event is monitored as the reference point, the time range within the second preset time before the reference point and the third preset time after the reference point, and the event type range of log storage refers to the event type of the network event to be monitored that has an associated relationship with the core network event;

[0149] A matching submodule, used to match the time range of log storage with the timestamp of each log information in the preset buffer, and to match the event type range of log storage with the event type of each log information in the preset buffer;

[0150] The selection submodule is used to select the context log information corresponding to the core network event from the preset buffer according to the matching result.

[0151] Furthermore, the log acquisition device 300 of the wireless communication module further includes:

[0152] A third storage module is used to store the first log information stored in the preset buffer to a preset non-volatile storage area when the time interval between the currently monitored core network event and the last monitored core network event is less than a third preset time length, wherein the first log information includes the upper log information and part of the lower log information corresponding to the last monitored core network event;

[0153] The fourth storage module is used to continue monitoring the network events to be monitored after the currently monitored core network event, and store the log information corresponding to the monitored network events to be monitored in a preset buffer in sequence;

[0154] The fifth storage module is used to store the second log information stored in the preset buffer to the preset non-volatile storage area when the length of time for storing log information in the preset buffer reaches a third preset length of time after the currently monitored core network event, wherein the second log information includes the following log information corresponding to the currently monitored core network event.

[0155] Furthermore, the configuration information also includes an upper limit value of the log file; the log acquisition device 300 of the wireless communication module also includes:

[0156] A calculation module, used to calculate the sum of the context log information corresponding to the core network event and the log information stored in the preset non-volatile storage area;

[0157] The second judgment module is used to judge whether the sum is greater than the upper limit of the log file;

[0158] The deletion module is used to delete the context log information corresponding to the earliest stored core network event in the preset non-volatile storage area when the total is greater than the upper limit of the log file.

[0159] It should be noted that the log acquisition device 300 of the wireless communication module can implement the steps of the log acquisition method of the wireless communication module provided in the aforementioned method embodiment, and can achieve the same technical effect, which will not be described one by one here.

[0160] like Figure 4 As shown, the embodiment of the present application further provides an electronic device, including a processor 411, a communication interface 412, a memory 413 and a communication bus 414, wherein the processor 411, the communication interface 412, and the memory 413 communicate with each other through the communication bus 414.

[0161] Memory 413, used for storing computer programs;

[0162] In one embodiment of the present application, the processor 411 is used to implement the steps of the log acquisition method of the wireless communication module provided by any one of the aforementioned method embodiments when executing the program stored in the memory 413.

[0163] The electronic device provided in the embodiment of the present application may specifically be a module capable of realizing a communication function or a terminal device including the module, etc. The terminal device may be a mobile terminal or a smart terminal. The mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a laptop computer, etc.; the smart terminal may specifically be a terminal including a wireless communication module such as a smart car, a smart watch, a shared bicycle, a smart cabinet, etc.; the module may specifically be a wireless communication module, such as any one of a 2G communication module, a 3G communication module, a 4G communication module, a 5G communication module, and a NB-IOT communication module.

[0164] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the log acquisition method of the wireless communication module provided in any of the aforementioned method embodiments are implemented.

[0165] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0166] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A log acquisition method for a wireless communication module, characterized in that: The method comprises: Obtaining a pre-configured configuration file, and parsing the configuration file to obtain configuration information, wherein the configuration information includes network events to be monitored, core network events, and log saving range parameters, and the network events to be monitored include the core network events; Monitoring the log data of the wireless communication module based on the network event to be monitored, and storing the log information corresponding to the network event to be monitored in a preset buffer when the network event to be monitored is detected; Determining whether the network event to be monitored is the core network event; When it is determined that the network event to be monitored is the core network event, the context log information corresponding to the core network event is selected from the preset buffer according to the log saving range parameter, and the context log information corresponding to the core network event is stored in the preset non-volatile storage area.

2. The method according to claim 1, characterized in that When the network event to be monitored is detected, the log information corresponding to the network event to be monitored is stored in a preset buffer, including: In the case where the network event to be monitored is detected, obtaining log data corresponding to the network event to be monitored, the event type of the network event to be monitored, and the timestamp when the network event to be monitored is detected; Concatenate the log data corresponding to the network event to be monitored, the event type of the network event to be monitored, and the timestamp when the network event to be monitored is monitored to obtain log information corresponding to the network event to be monitored; The log information corresponding to the network event to be monitored is stored in the preset buffer.

3. The method according to claim 1, characterized in that When the network event to be monitored is detected, the log information corresponding to the network event to be monitored is stored in a preset buffer, including: In the case where the network event to be monitored is monitored, obtaining log data corresponding to the network event to be monitored, the event type of the network event to be monitored, the timestamp when the network event to be monitored is monitored, and the location information when the network event to be monitored is monitored; The log data corresponding to the network event to be monitored, the event type of the network event to be monitored, the timestamp when the network event to be monitored is monitored, and the location information when the network event to be monitored is monitored are spliced ​​to obtain the log information corresponding to the network event to be monitored; The log information corresponding to the network event to be monitored is stored in the preset buffer.

4. The method according to claim 2 or 3, characterized in that: After storing the log information corresponding to the network event to be monitored in the preset buffer, the method further includes: Determine whether there is expired log information in the preset buffer, wherein the expired log information refers to a log stored in the preset buffer before a first preset time before the moment when the network event to be monitored is detected; When it is determined that the expired log information exists in the preset buffer, the expired log information is deleted.

5. The method according to claim 2 or 3, characterized in that: The selecting, from the preset buffer according to the log storage range parameter, context log information corresponding to the core network event includes: According to the log preservation range parameter, determine the time range for log preservation and the event type range for log preservation, wherein the time range for log preservation refers to the time point at which the core network event is monitored as a reference point, a time range within a second preset time length before the reference point and a third preset time length after the reference point, and the event type range for log preservation refers to the event type of the network event to be monitored that has an associated relationship with the core network event; Matching the time range of the log storage with the timestamp of each log information in the preset buffer, and matching the event type range of the log storage with the event type of each log information in the preset buffer; According to the matching result, context log information corresponding to the core network event is selected from the preset buffer.

6. The method according to claim 5, characterized in that The method further comprises: When the time interval between the currently monitored core network event and the last monitored core network event is less than the third preset time length, storing the first log information stored in the preset buffer to the preset non-volatile storage area, wherein the first log information includes the upper log information and part of the lower log information corresponding to the last monitored core network event; Continue to monitor the network events to be monitored after the currently monitored core network event, and store the log information corresponding to the monitored network events to be monitored in the preset buffer in sequence; When the time length for storing log information in the preset buffer reaches the third preset time length after the currently monitored core network event, the second log information stored in the preset buffer is stored in the preset non-volatile storage area, wherein the second log information includes the following log information corresponding to the currently monitored core network event.

7. The method according to claim 1, characterized in that The configuration information also includes an upper limit value of the log file; Before storing the context log information corresponding to the core network event in a preset non-volatile storage area, the method further includes: Calculating the sum of the context log information corresponding to the core network event and the log information stored in the preset non-volatile storage area; Determine whether the sum is greater than an upper limit value of the log file; When the sum is greater than the upper limit of the log file, the context log information corresponding to the earliest stored core network event in the preset non-volatile storage area is deleted.

8. A log acquisition device for a wireless communication module, characterized in that: The device comprises: An acquisition module, used to acquire a pre-configured configuration file and parse the configuration file to obtain configuration information, wherein the configuration information includes network events to be monitored, core network events and log saving range parameters, and the network events to be monitored include the core network events; A first storage module is used to monitor the log data of the wireless communication module based on the network event to be monitored, and when the network event to be monitored is detected, store the log information corresponding to the network event to be monitored in a preset buffer; A first judgment module, used to judge whether the network event to be monitored is the core network event; The second storage module is used to select the context log information corresponding to the core network event from the preset buffer according to the log saving range parameter when the network event to be monitored is determined to be the core network event, and store the context log information corresponding to the core network event in a preset non-volatile storage area.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the log acquisition method of the wireless communication module described in any one of claims 1 to 7 when executing the program stored in the memory.

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 log acquisition method of the wireless communication module according to any one of claims 1 to 7 is implemented.