Method, terminal device and readable storage medium for generating a log
By recording absolute time information in the log records and combining multiple time information to determine the absolute time, the log overwriting problem caused by insufficient memory on the terminal device is solved, achieving more efficient log storage and problem localization.
Patent Information
- Application Number
- CN202310651052.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-02
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2043-06-02
AI Technical Summary
The limited memory capacity of terminal devices causes logs to be overwritten in a short period of time, affecting problem localization and handling.
By recording absolute time information when generating log records and combining multiple time information to determine the absolute time during storage, the memory resources required for storage are reduced and log overwriting is avoided.
It effectively saves memory resources, prevents critical logs from being overwritten in a short period of time, and ensures the smooth location and handling of problems.
Smart Images

Figure CN119065915B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the terminal field, and in particular to a log generation method, a terminal device and a readable storage medium. BACKGROUND
[0002] A terminal device generates event records when working, which are referred to as logs. The logs record time information, user and related operation descriptions, such as application logs, security logs or system logs, etc. In the development and operation process, logs are needed to help developers troubleshoot problems. With the development of communication systems, the complexity of terminal devices is increasing, and thus the number of logs generated by terminal devices when working is increasing. However, the memory capacity of terminal devices is limited, so the more logs generated by terminal devices per unit time, the higher the possibility that the logs are overwritten in the memory of the terminal device in a short time. In this case, key logs may be lost in a short time, which is not conducive to people positioning terminal device problems or performing other processing according to the key logs. SUMMARY
[0003] The present application provides a log generation method, a terminal device and a readable storage medium. The scheme provided by the present application can save memory resources in the process of storing logs, and avoid the logs being overwritten in the memory of the terminal device in a short time, that is, the problem that the logs needed for positioning terminal device problems or performing other processing are overwritten in a short time can be avoided.
[0004] To achieve the above-mentioned purpose, the present application adopts the following technical solutions:
[0005] In a first aspect, a log generation method is provided, which is applied to a terminal device. The terminal device includes a first processing module, a second processing module and a storage module. The method includes: the first processing module generates a first log record based on first time information from the second processing module, the first log record including the first time information, the first time information being used to determine an absolute time for generating a second log record in combination with second time information, the second log record being generated by the first processing module and stored in the storage module, the second log record including the second time information; and the storage module stores the first log record.
[0006] The log record generated by the terminal device is indispensable when positioning problems of the terminal device, and the absolute time for generating the log record needs to be recorded in the log record, for example, the year / month / day / hour / minute / second information for generating the log record. The log record with the absolute time often occupies a large amount of memory resources.
[0007] Based on this, the scheme provided in the application records the second time information in the generation of a certain log record (for example, the second log record), for example, the second time information can be the time information generated by the local clock, and records the first time information for determining the absolute time of generating the second log record in another log record (for example, the first log record), for example, the first time information can include information for determining the year / month / day of generating the second log record. Since the first time information can determine the absolute time of generating the multiple second log records corresponding to the same first time information in combination with the multiple second time information, the scheme provided in the application can store the multiple second log records recording the second time information and the first log record when storing the log subsequently. Compared with storing the multiple second log records, each of which records the absolute time of generating the second log record, the scheme provided in the application can save more memory resources in the process of storing the log.
[0008] In some possible implementation manners, the method further includes: periodically sending, by the second processing module, the first time information to the first processing module.
[0009] Based on the above scheme, the first processing module can periodically generate the first log record according to the first time information, so as to avoid that the absolute time of generating the second log record that has not been covered cannot be determined after the first log record generated earlier is covered in the memory.
[0010] In some possible implementation manners, the sending period of the first time information is determined based on pre-configuration.
[0011] In some possible implementation manners, the terminal device further includes a third processing module, and the method further includes: obtaining, by the third processing module, the first log record and the second log record from the storage module; and generating, by the third processing module, a third log record based on the first log record and the second log record, the third log record including the absolute time of generating the second log record and all or part of the content of the second log record except the second time information.
[0012] Based on the above scheme, if the third processing module needs the second log record when positioning the problem, the third processing module can generate the third log record based on the first log record and the second log record in the storage module, the third log record including the absolute time of generating the second log record and all or part of the information of the second log record except the time information. That is, after generating the third log record, the third processing module can directly position or troubleshoot the problem according to the third log record.
[0013] In some possible implementation manners, the storage module stores the third log record, and a log file in which the third log record is located does not contain the first log record and the second log record.
[0014] Based on the above scheme, the log file in which the third log record is located is different from the log file in which the first log record and / or the second log record is located. The first log record and the second log record can be in the same log file or in different log files, which is not limited in the present application.
[0015] In some possible implementation manners, the first processing module is a radio frequency chip for amplifying the power of the radio frequency signal, or the first processing module is a chip for controlling whether to radiate the radio frequency signal.
[0016] In some possible implementation manners, the second processing module is an application chip.
[0017] In a second aspect, a method for generating a log is provided, and the method is applied to a first device. The first device includes a processing module and a storage module. The method includes: determining, by the processing module, whether a preset condition is met before generating a fourth log record corresponding to a first time unit, the fourth log record including information representing a communication condition between the first device and a second device in the first time unit; and generating, by the processing module, the fourth log record and storing, by the storage module, the fourth log record in a case where the preset condition is met.
[0018] Based on the above scheme, the processing module needs to determine whether the preset condition is met before generating the fourth log record. The fourth log record is generated and stored only in the case where the preset condition is met, that is, the fourth log record is not generated in the case where the preset condition is not met. Therefore, the scheme provided in the present application can reduce the number of generated fourth log records by condition determination, thereby reducing the memory space of the first device occupied by the fourth log record, avoiding the problem that the log is covered in the memory of the first device in a short time, and thereby avoiding the problem that the key log record required for positioning the first device problem or other processing is covered in a short time.
[0019] In some possible implementation manners, the preset condition includes at least one of the following: a communication signal energy between the first device and the second device is less than or equal to a first threshold in the first time unit; a packet error rate SER of a communication link between the first device and the second device is less than or equal to a second threshold in the first time unit; a reference signal received power RSRP corresponding to the communication link between the first device and the second device does not jump in the first time unit; a sending module or a receiving module of the first device is in a working mode in the first time unit; the fourth log record includes only content related to uplink transmission when the first time unit is an uplink transmission resource; and the fourth log record includes only content related to downlink transmission when the first time unit is a downlink transmission resource.
[0020] In some possible implementation manners, the fourth log record is a log record related to the first device as a sender, and the preset condition is satisfied when any one of the following conditions is met: a maximum transmission power between the first device and the second device is less than or equal to a first threshold in the first time unit; a transmission module of the first device is in an operating mode in the first time unit; or the first time unit is an uplink transmission resource.
[0021] In some possible implementation manners, the fourth log record is a log record related to the first device as a receiver, and the preset condition is satisfied when any one of the following conditions is met: a received signal strength indication (RSSI) between the first device and the second device is less than or equal to a second threshold in the first time unit; a service experience rate (SER) of a packet transmitted between the first device and the second device is less than or equal to the second threshold in the first time unit; a reference signal received power (RSRP) corresponding to a communication link between the first device and the second device does not jump in the first time unit; a receiving module of the first device is in an operating mode in the first time unit; or the first time unit is a downlink transmission resource.
[0022] In some possible implementation manners, the fourth log record includes information representing: a subscriber identity module (SIM) identifier, a time slot number, a system frame number, a subcarrier spacing, a time domain symbol index, a maximum transmission power, and a target transmission power.
[0023] In some possible implementation manners, the fourth log record includes information representing: a subscriber identity module (SIM) identifier, a time slot number, a system frame number, a subcarrier spacing, a time domain symbol index, a maximum transmission power, and a target transmission power.
[0024] In some possible implementation manners, the processing module is a cellular communication baseband chip.
[0025] In a third aspect, a terminal device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program, the processor executes the steps of processing in the first aspect or any one of the methods in the first aspect, or the processor executes the steps of processing in the second aspect or any one of the methods in the second aspect.
[0026] In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium stores a computer program, the computer program includes program instructions, when the program instructions are executed by a processor, the processor executes the steps of processing in the first aspect or any one of the methods in the first aspect, or the processor executes the steps of processing in the second aspect or any one of the methods in the second aspect.
[0027] In a fifth aspect, a computer program product is provided, which includes computer program codes, when the computer program codes are run by a terminal device, the terminal device is caused to perform the steps of processing in the first aspect or any one of the methods in the first aspect, or the terminal device is caused to perform the steps of processing in the second aspect or any one of the methods in the second aspect.
[0028] The beneficial effects of the third aspect to the fifth aspect can refer to the first aspect and the second aspect, and will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 is a hardware structure block diagram of a terminal device provided by an embodiment of the present application;
[0030] Figure 2 is a schematic diagram of a new radio communication air interface frame structure provided by an embodiment of the present application;
[0031] Figure 3 is a flowchart of a method for generating a log provided by an embodiment of the present application;
[0032] Figure 4 is a flowchart of a process from log generation to disk landing provided by an embodiment of the present application;
[0033] Figure 5 is a flowchart of another method for generating a log provided by an embodiment of the present application;
[0034] Figure 6 is another flowchart of a process from log generation to disk landing provided by an embodiment of the present application;
[0035] Figure 7 is a structure block diagram of an apparatus 700 provided by an embodiment of the present application;
[0036] Figure 8 is a structure diagram of a terminal device 800 provided by an embodiment of the present application. DETAILED DESCRIPTION
[0037] The technical solutions in the present application will be described below with reference to the accompanying drawings.
[0038] In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B; "and / or" in this paper is only a description of the association relationship of the associated object, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two.
[0039] Hereinafter, the terms "first", "second", "third", "fourth", "fifth", "sixth", "seventh" and "eighth" are used only for the purpose of description, and are not to be understood as indicating or implying relative importance or a specific number of technical features indicated. Therefore, the features defined with "first", "second", "third", "fourth", "fifth", "sixth", "seventh" and "eighth" can explicitly or implicitly include one or more of the features.
[0040] The method for generating a log provided by the embodiments of the present application can be applied to a mobile phone, a tablet computer, a notebook computer, a palm computer, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart home, and the like, which can generate a log. The embodiments of the present application do not limit the specific type of the terminal device.
[0041] The hardware structure of the terminal device 100 for implementing the above method is described below. For example, Figure 1 A hardware structure of the terminal device 100 is shown. The terminal device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, and a transceiver 150.
[0042] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0043] For example, when the terminal device 100 is a mobile phone or a tablet computer, it can include all the components shown in the figure, or only include some of the components shown in the figure.
[0044] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors.
[0045] The controller can generate operation control signals according to the instruction operation code and the timing signal, complete the control of fetching and executing instructions.
[0046] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that have just been used or are used repeatedly by the processor 110. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.
[0047] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0048] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a limitation on the structure of the terminal device 100. In some other embodiments of the present application, the terminal device 100 can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.
[0049] The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In addition to charging, the USB interface can also be used to open the USB debugging switch or in other words, to open the USB debugging mode. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through the wireless charging coil of the terminal device 100. The charging management module 140 can charge the battery 142 and also supply power to the terminal device through the power management module 141.
[0050] The power management module 141 is configured to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to supply power to the processor 110, the internal memory 121 and the like. In some other embodiments, the power management module 141 can also be arranged in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be arranged in the same device.
[0051] The transceiver 150 is configured to transmit data or signaling and the like to other devices outside the terminal device 100 or to receive data or signaling and the like from other devices outside the terminal device 100.
[0052] The external memory interface 120 can be configured to connect an external memory card, such as a micro (Micro) memory card (secured digital memory card, SD), to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize data storage function.
[0053] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc. The data storage area may store data created during the use of terminal device 100, such as logs. In addition, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of terminal device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory disposed in the processor.
[0054] In practical application scenarios, the operating system of the terminal device 100 may include, but is not limited to, Symbian, Android, Windows, macOS, iOS, Blackberry, HarmonyOS, and other operating systems. This application does not impose any limitations on the operating system of the terminal device.
[0055] Before describing the solutions provided in the embodiments of this application, the terms involved in this application will be explained.
[0056] Logs can be understood in a broad sense, such as event records generated by terminal devices or chips during operation, including log records, log files, log content, log data, etc.
[0057] Log recording: A log record is generated by a terminal device or chip for each operation performed, and the log record may include one or more lines of content. One or more log records may be stored in a log file, which is stored in the terminal device's memory. Additionally, log records may also be called log content, log data, etc. This application does not limit the name of log records and uses "log record" as a unified description.
[0058] Figure 2 This is a schematic diagram of the air interface frame structure for new radio (NR) communication provided in this application embodiment.
[0059] For example, such as Figure 2 As shown, the duration T of a wireless frame f = 10 milliseconds (ms), the duration T of a time slot slot=0.5ms, one subframe consists of two time slots. When the terminal device is operating in 5G NR cellular communication mode, a maintenance log is generated in each time slot.
[0060] It should be noted that the temporal granularity of generating dimension monitoring logs can be predefined. In the example above, the temporal granularity of generating dimension monitoring logs is time slot, and this application does not impose any restrictions on this.
[0061] Logs generated by terminal devices can be divided into event logs and statistical logs. Event logs are generated only when an event occurs, such as when the terminal device and the base station complete a radio resource control (RRC) connection, or when the terminal device initiates a call. Statistical logs are generated when the terminal device periodically checks a certain function / parameter, such as when the terminal device checks the cellular communication quality.
[0062] During the Beta testing phase of terminal devices, logs were captured to identify issues. NR (Radio Frequency) monitoring logs accounted for a significant portion, reaching 20%. NR monitoring logs characterize the signal energy of cellular communication on the terminal device, and each time-domain granularity (e.g., subframe) generates an NR monitoring log. These logs, such as those characterizing signal reception or transmission energy, are crucial for pinpointing 5G signal loss issues. Since monitoring communication quality is essential, generating NR monitoring logs is unavoidable. However, the limited storage space and the problem of logs being overwritten quickly can be addressed by streamlining these logs.
[0063] In view of this, this application proposes a log generation scheme that can reduce the amount of maintenance logs generated, save more memory resources in the subsequent log storage process, and avoid logs being overwritten in the terminal device's memory in a short time, thereby avoiding the problem that critical logs required for locating terminal device problems or performing other processing are overwritten in a short time.
[0064] Figure 3 This is a flowchart illustrating a method for generating logs provided in an embodiment of this application.
[0065] like Figure 3 The method 300 shown can be used in a first device, which includes a processing module and a storage module. Method 300 includes the following steps:
[0066] S301, before generating the log record #1 corresponding to the first time unit, the processing module determines whether a preset condition is met, the log record #1 includes information representing a communication condition between the first device and the second device on the first time unit, the first device is a terminal device, and the second device is another terminal device or a network device.
[0067] The network device can manage transmission resources, provide access services for user equipment, and complete the forwarding of user equipment data between user equipment and a core network. The network device in the present application includes but is not limited to: an evolved Node B (eNB), a radio network controller (RNC), a Node B (NB), a base station controller (BSC), a base transceiver station (BTS), a home evolved NodeB (HeNB) or a home Node B (HNB), a baseband unit (BBU), an access point (AP) in a wireless fidelity (WIFI) system, a wireless relay node, a wireless backhaul node, a transmission point (TP) or a transmission and reception point (TRP), and the like. It can also be a gNB or a transmission point (TRP or TP) in a 5G NR system, one or a group of antenna panels (including multiple antenna panels) of a base station in a 5G system, or a network node constituting a gNB or a transmission point, such as a baseband unit (BBU) or a distributed unit (DU), or a base station in a future communication system, and the like.
[0068] For example, the time domain granularity of the log record #1 (corresponding to the fourth log record in the invention) generated by the first device configured by the network device is a time slot, and before generating the log record #1 corresponding to each time slot, the first device needs to determine whether the preset condition is met. The log record #1 is, for example, the measurement log mentioned above. At this time, the above-mentioned first time unit can be a certain time slot. If the time domain granularity of the log record #1 generated by the first device configured by the network device is a subframe, the above-mentioned first time unit can be a certain subframe, and so on. The communication condition can be represented by parameters such as communication signal energy, symbol error rate (SER), reference signal receiving power (RSRP), and the like.
[0069] In a possible implementation, the preset condition comprises at least one of the following: a communication signal energy between the first device and the second device is less than or equal to a first threshold in a first time unit; a SER of a packet transmitted between the first device and the second device is less than or equal to a second threshold in the first time unit; a RSRP corresponding to a communication link between the first device and the second device does not jump in the first time unit; a sending module or a receiving module of the first device is in a working mode in the first time unit; when the first time unit is an uplink transmission resource, the log record #1 only includes content related to uplink transmission; when the first time unit is a downlink transmission resource, the log record #1 only includes content related to downlink transmission.
[0070] S302, in a case where the preset condition is met, the processing module generates a log record #1, and the storage module stores the log record #1.
[0071] In a possible implementation #1, the log record #1 is a log record related to the first device as a sender, that is, the log record #1 records relevant descriptions of the first device in a sending operation in the first time unit. When the first device is a sender, the receiver can be a network device or another first device, which is not limited in the application. The preset condition is met, including that any one or more of the following is met:
[0072] A maximum sending power between the first device and the second device is less than or equal to a first threshold in the first time unit; a sending module of the first device is in a working mode in the first time unit; or the first time unit is an uplink transmission resource.
[0073] When the log record #1 is a log record related to the first device as a sender, the communication signal energy is, for example, a maximum sending power, and a first threshold corresponding to the maximum sending power is the first threshold. When the log record #1 is a log record related to the first device as a receiver, the communication signal energy is, for example, a received signal strength indication (RSSI), and a first threshold corresponding to the received signal strength indication is a second threshold. The first threshold and the second threshold can be preconfigured or predefined, which is not limited in the application, and the first threshold and the second threshold are different.
[0074] For example, when the log record #1 is a log record related to the first device as a sender, the log record #1 includes information indicating the following content: a subscriber identity module (SIM) identifier, a time slot number, a system frame number, a subcarrier spacing, a symbol index, a maximum sending power, and a target sending power.
[0075] Optionally, when the log record #1 is the log record related to the first device as the sender, the log record #1 further comprises a field indicating any of the following: a timing parameter, a maximum power reduction (MPR), a number of resource blocks (RBs), a sounding reference signal (SRS) index.
[0076] For example, when the log record #1 is the log record related to the first device as the sender, some of the contents in the log record #1 can be generated according to the actual operation performed by the first device, such as a time slot number, a system frame number, a subcarrier spacing, a symbol index, a timing parameter, an RB, an SRS index, etc., some of the contents in the log record #1 can be generated according to a protocol, such as a maximum transmission power, an MPR, etc., and some of the contents in the log record #1 can be generated according to an indication from a network device, such as a target transmission power.
[0077] It should be noted that when the preset condition in the implementation manner #1 is not met, the processing module does not generate the log record #1, or the processing module generates the log record #1 but the storage module does not store the log record #1.
[0078] It can be understood that when any of the preset conditions in the implementation manner #1 is not met, the processing module can not generate the log record #1. Alternatively, when any of the preset conditions in the implementation manner #1 is not met, the processing module can generate the log record #1, but does not write the log record #1 into the buffer, so that the log record #1 will not be written to the storage module. Alternatively, when any of the preset conditions in the implementation manner #1 is not met, the processing module generates the log record #1 and writes the log record #1 into the buffer, and the log record #1 can be filtered in the process of writing from the buffer to the storage module, so that the log record #1 will not be written to the storage module. The present application does not limit the operations of the processing module and the storage module when any of the preset conditions in the implementation manner #1 is not met.
[0079] In example #1, the maximum transmission power between the first device and the second device is greater than a first threshold in a first time unit, or in other words, the maximum transmission power of the first device for transmitting a signal to the second device in the first time unit is greater than the first threshold, at this time, the preset condition is not met, the first threshold is a threshold of the configured maximum transmission power, which can be the value range of the maximum transmission power field in the test log, and the first threshold can be configured by the developer according to the experience value. The preset condition judging manner in example #1 can be in the development stage of the first device.
[0080] Example #2, the transmitting module of the first device is in a turn-off mode (tx off) in the first time unit, or in other words, the transmitting module of the first device does not work in the first time unit, at this time the preset condition is not met. For example, the network device does not schedule the first device to transmit a packet in the first time unit, or the first device is in a frequency measurement process in the first time unit, at this time the transmitting module is in a turn-off mode.
[0081] Example #3, the first time unit is a downlink transmission resource, at this time the preset condition is not met, for example, according to the time division duplexing (TDD) band standard of the 3rd generation partnership project (3GPP), the first time unit is a downlink time slot D. That is, when the first time unit is a downlink time slot D, the first device corresponding to the first time unit is not generated as a sender-related log record.
[0082] Possible implementation #2, the log record #1 is a first device as a receiver-related log record, that is, the log record #1 records the relevant description of the first device when it performs a receiving operation in the first time unit, when the terminal device is a receiver, the sender can be a network device or another terminal device, which is not limited by the present application. The preset condition is met including any one or more of the following:
[0083] The received signal strength indication (RSSI) between the first device and the second device is less than or equal to a second threshold in the first time unit; the SER of the packet transmitted between the first device and the second device is less than or equal to the second threshold in the first time unit; the RSRP of the communication link corresponding to the first device and the second device does not jump in the first time unit; the receiving module of the first device is in a working mode in the first time unit; or, the first time unit is a downlink transmission resource.
[0084] For example, when the log record #1 is a first device as a receiver-related log, the log record #1 includes information indicating the following: SIM card identifier, time slot number, system frame number, subframe number, RSSI.
[0085] Optionally, when the log record #1 is a first device as a receiver-related log record, the log record #1 further includes information indicating the following: timing parameter, carrier index, receiving antenna index, low noise amplifier (LNA) receiving gain (gain) position.
[0086] Exemplarily, when the log record #1 is a log record related to the first device as a receiver, the content in the log record #1 can be generated according to an operation actually performed by the first device, can be generated according to a protocol, or can be generated according to an indication of a network device, and the application does not make any limitation in this regard.
[0087] Exemplarily, the processing module for generating the log record #1 is a cellular communication baseband chip.
[0088] It should be noted that when the preset condition is not met in the implementation manner #2, the processing module does not generate the log record #1, or the processing module generates the log record #1 but the storage module does not store the log record #1.
[0089] The specific implementation when the preset condition is not met can refer to the related description in the implementation manner #1, which will not be described herein again.
[0090] In example #4, the RSSI between the first device and the second device is greater than a second threshold in the first time unit, or in other words, the RSSI of the signal received by the first device in the first time unit is greater than the second threshold, at this time, the preset condition is not met, and the second threshold is a configured threshold of the RSSI, which can be a value range of the RSSI field in the measurement log, and the second threshold can be configured by the developer according to the experience value. The preset condition judging manner in example #4 can be in the development stage of the first device.
[0091] In example #5, the SER of the message transmitted between the first device and the second device is greater than a second threshold in the first time unit, at this time, the preset condition is not met. Based on the service scenarios such as call, voice and video, the SER of the message received by the communication receiver is high, for example, the signal quality is poor, the call is not clear, the call is interrupted, the sound is interrupted, and so on. The preset condition judging manner in example #5 can be in the stage of using the first device by the user.
[0092] In example #6, the receiving module of the first device is in a closed mode (rx off) in the first time unit, at this time, the preset condition is not met, for example, the network device or other terminal device does not transmit the message to the first device in the first time unit, or the first device is in the inter-frequency measurement process in the first time unit.
[0093] In example #7, the first time unit is an uplink transmission resource, at this time, the preset condition is not met, for example, according to the 3GPP TDD frequency band standard, the first time unit is an uplink (uplink) time slot U. That is, when the first time unit is the uplink time slot U, the log record #1 corresponding to the first device as a receiver is not generated.
[0094] Example #8: The RSRP corresponding to the communication link between the first and second devices changes abruptly within the first time unit, at which point the preset conditions are not met. For example, the RSRP experiences a cliff-like change within the first time unit.
[0095] If the preset conditions are met, and log record #1 has been generated, the storage module will store log record #1.
[0096] For example, the processing module is a cellular communication baseband chip. When the preset conditions are met, the cellular communication baseband chip generates log record #1 and writes the generated log record #1 into the log buffer. The AP chip writes the log record #1 in the buffer into the disk / hard disk space of the first device from time to time according to the disk writing rules.
[0097] For example, Figure 4 As shown, when the cellular communication baseband chip is in working mode, it continuously generates cellular communication maintenance logs according to the time-domain resource granularity and cyclically writes the generated maintenance logs to a log buffer, such as random access memory (RAM). The AP chip writes the logs in the buffer to the disk / hard disk space of the first device at irregular intervals according to the disk writing rules. However, the disk / hard disk space is fixed, and if the cellular communication baseband chip generates logs too quickly, the logs stored on the disk / hard disk will be overwritten more quickly. The method 300 provided in this application can reduce the number of cellular communication maintenance logs generated by preset conditions. This reduces the memory space occupied by maintenance logs, such as log record #1, in the first device, avoiding the possibility that the logs in the memory of the first device will be overwritten in a short time, thus avoiding the problem that critical logs required for locating problems in the first device or performing other processing will be overwritten in a short time.
[0098] Figure 5 This is a flowchart illustrating another method for generating logs provided in an embodiment of this application.
[0099] like Figure 5 The method 500 shown can be used in a terminal device, which includes a first processing module, a second processing module, and a storage module. The method 500 includes the following steps:
[0100] S501, the first processing module generates log record #2 based on the first time information from the second processing module. Log record #2 includes the first time information. The first time information is used to determine the absolute time of generating log record #3 by combining with the second time information. Log record #3 is generated by the first processing module and stored in the storage module. Log record #3 includes the second time information.
[0101] For example, the first processing module cannot obtain absolute time, when generating the log record #3 (corresponding to the second log record in the invention), the log record #3 includes time, for example, x hour x minute x second, which can be generated based on the local clock of the first processing module, at this time, the specific date of generating the log record #3 cannot be determined. The second processing module can obtain absolute time and send it to the first processing module, that is, the first time information is absolute time, the first processing module generates the log record #2 (corresponding to the first log record in the invention) based on the absolute time, the log record #2 includes the absolute time, for example, x year x month x day x hour x minute x second, the log record #2 and the log record #3 are sequentially stored in the storage module, and when the problem is located by subsequently capturing the log, the absolute time of generating the log record #3 can be recovered according to the log record #2 and the log record #3.
[0102] The log record #2 and the log record #3 can be understood as log records generated by the first processing module and used for different purposes, the log record #2 is used to determine the absolute time of generating the log record #3, and the log record #3 records specific operations or matters performed by the terminal device in the absolute time, and is used to provide specific content executed by the terminal device in the absolute time when the problem is subsequently located. The absolute time of generating the log record #3 can be understood as the absolute time at which the operation recorded in the log record #3 is actually performed by the terminal device. Optionally, the method 500 further includes:
[0103] The second processing module periodically sends the first time information to the first processing module.
[0104] In a possible implementation, the second processing module sends the first time information to the first processing module according to a preconfigured period.
[0105] For example, the first time information is x year x month x day, the second time information included in the log record #3 is x hour x minute x second, and the preconfigured period can be one day; or the first time information is x year x month, the second time information included in the log record #3 is x day x hour x minute x second, and the preconfigured period can be one month; or the first time information is x year x month x day x hour, the second time information included in the log record #3 is x minute x second, and the preconfigured period can be one hour, and so on.
[0106] Exemplarily, the first processing module is a radio frequency chip for amplifying power of a radio frequency signal, or the first processing module is a chip for controlling whether to radiate the radio frequency signal, and the first processing module controls whether to radiate the radio frequency signal in two cases, one control is that the first processing module feeds the radio frequency signal to an antenna to radiate out, and the other control is that the first processing module shields the radio frequency signal, that is, controls not to feed the radio frequency signal to the antenna, that is, controls not to radiate the radio frequency signal out. For example, the first processing module is a radio frequency enhancement chip. The first processing module cannot know absolute time, and can only perceive running time of itself, for example, the first processing module has a sleep time, and the local clock of the first processing module does not count during the sleep time, or the local clock of the first processing module is out of synchronization for a long time to cause time error.
[0107] Exemplarily, the second processing module is an AP chip, and the AP chip can communicate, that is, can perform time synchronization, and can obtain accurate absolute time, for example, x years, x months, x days, x hours, x minutes and x seconds.
[0108] S502, the storage module stores the log record #2.
[0109] Exemplarily, the radio frequency enhancement chip writes the generated log record #2 into a log buffer, and the AP chip writes the log record #2 in the buffer into a disk / hard disk space of the terminal device at irregular time according to a disk writing rule.
[0110] The storage module can store the log record #2 and the log record #3, and when a problem occurs subsequently and log grabbing and analysis are needed, for example, the log record #3 needs to be grabbed, but the time included in the log record #3 is not the absolute time of generating the log record #3, at this time, the log record #2 also needs to be grabbed to restore the absolute time of generating the log record #3, so as to locate the problem.
[0111] Optionally, the terminal device further includes a third processing module, and the method 500 further includes:
[0112] The third processing module obtains the log record #2 and the log record #3 from the storage module; the third processing module generates a log record #4 based on the log record #2 and the log record #3, and the log record #4 includes the absolute time of generating the log record #3 and all or part of information in the log record #3 except time information.
[0113] If the third processing module needs log record #3 when locating the problem, the third processing module can generate log record #4 (corresponding to the third log record in the invention) based on log record #2 and log record #3 in the storage module, and log record #4 includes the absolute time of generating log record #3 and all or part of the information in log record #3 except the time information. That is, after generating log record #4, the third processing module can directly locate or troubleshoot the problem according to log record #4.
[0114] Optionally, the method 500 further includes:
[0115] The storage module stores log record #4, and the log file where log record #4 is located does not contain log record #2 and log record #3.
[0116] For example, the log file where log record #4 is located is different from the log file where log record #2 and / or log record #3 are located. Log record #2 and log record #3 can be in the same log file or in different log files, which is not limited in the present application.
[0117] It should be noted that generating log record #2 can be before generating log record #3, and generating log record #2 can be after generating log record #3, which is not limited in the present application. Therefore, storing log record #2 can be before storing log record #3, and storing log record #2 can be after storing log record #3, which is not limited in the present application.
[0118] As shown in Figure 6 The radio frequency enhancement chip continuously generates log record #3 when in the working mode, and periodically generates log record #2. The generated logs are cyclically written into the log buffer, such as RAM. The AP chip writes the logs in the buffer into the disk / hard disk space of the terminal device at irregular time according to the disk writing rule.
[0119] The method 500 provided in the application records the second time information in the generation of a certain log record #3, for example, the second time information can be the time information generated by the local clock, records the first time information for determining the absolute time of generating the log record #3 in the log record #2, for example, the first time information can include the information for determining the year / month / day of generating the second log record, and since the first time information can determine the absolute time of generating a plurality of log records #3 corresponding to the same first time information in combination with a plurality of second time information. Therefore, the method 500 provided in the application can store a plurality of log records #3 recording the second time information and the log record #2 when storing the log subsequently. Relative to storing a plurality of log records #3, each log record #3 records the absolute time of generating the log record #3, the scheme provided in the application can save more memory resources in the process of storing the log, and thus can avoid the problem that the log is covered in the memory of the terminal device for a short time, thereby avoiding the problem that the key log required for positioning the terminal device problem or other processing is covered in a short time.
[0120] It should be understood that the above examples are intended to help those skilled in the art understand the embodiments of the application, and are not intended to limit the embodiments of the application to the specific values or specific scenarios exemplified. Those skilled in the art can obviously make various equivalent modifications or changes according to the above examples given, and such modifications or changes also fall within the scope of the embodiments of the application.
[0121] Figure 7 is a structural block diagram of an apparatus 700 provided by the embodiments of the application, only the parts related to the embodiments of the application are shown for the convenience of description.
[0122] In one design, the apparatus 700 is applied to a first device, and the apparatus 700 includes a processing module 701 and a storage module 702. Figure 7
[0123] The processing module 701 is configured to determine whether a preset condition is met before generating a log record #1 corresponding to a first time unit, and the log record #1 includes information representing the communication quality between the first device and a second device at the first time unit. In the case where the preset condition is met, the processing module 701 is configured to generate the log record #1, and the storage module 702 is configured to store the log record #1.
[0124] In some possible implementations, the preset conditions include at least one of the following: the communication signal energy between the first device and the second device is less than or equal to a first threshold within the first time unit; the bit error rate (SER) of the transmitted message between the first device and the second device is less than or equal to a second threshold within the first time unit; the reference signal received power (RSRP) corresponding to the communication link between the first device and the second device does not change within the first time unit; the transmitting module or receiving module of the first device is in working mode within the first time unit; when the first time unit is an uplink transmission resource, log record #1 only includes content related to uplink transmission; when the first time unit is a downlink transmission resource, log record #1 only includes content related to downlink transmission.
[0125] In some possible implementations, log record #1 is a log record related to the first device as the sender, and the preset condition satisfies any of the following: the maximum transmission power between the first device and the second device is less than or equal to a first threshold in the first time unit; the transmission module of the first device is in working mode in the first time unit; or the first time unit is an uplink transmission resource.
[0126] In some possible implementations, log record #1 is a log record related to the first device as the receiver, and the preset conditions include any of the following: the received signal strength indication between the first device and the second device is less than or equal to the second threshold in the first time unit; the SER of the transmitted message between the first device and the second device is less than or equal to the second threshold in the first time unit; the RSRP corresponding to the communication link between the first device and the second device does not change in the first time unit; the receiving module of the first device is in working mode in the first time unit; or the first time unit is a downlink transmission resource.
[0127] In some possible implementations, log entry #1 includes information representing the following: user identification module identifier, timeslot number, system frame number, subcarrier spacing, time-domain symbol index, maximum transmit power, and target transmit power.
[0128] In some possible implementations, log entry #1 includes information representing the following: user identification module identifier, timeslot number, system frame number, subframe number, and received signal strength indication.
[0129] In some possible implementations, the processing module is a cellular communication baseband chip.
[0130] In another design, device 700 is applied to a first device, such as a terminal device, see reference. Figure 7 The device 700 includes a processing module 701 and a storage module 702. The processing module 701 includes a first processing unit and a second processing unit.
[0131] The first processing unit generates log record #2 based on the first time information from the second processing unit, the log record #2 includes the first time information, the first time information is used to determine the absolute time of generating the log record #3 in combination with the second time information, the log record #3 is generated by the first processing unit and stored in the storage module 702, and the log record #3 includes the second time information.
[0132] In some possible implementation manners, the second processing unit periodically sends the first time information to the first processing unit.
[0133] In some possible implementation manners, the sending period of the first time information is determined based on pre-configuration.
[0134] In some possible implementation manners, the processing module 701 further includes a third processing unit, the third processing unit is configured to acquire the log record #2 and the log record #3 from the storage module 702, and generate a log record #4 based on the log record #2 and the log record #3, the log record #4 includes the absolute time of generating the log record #3 and all or part of information in the log record #3 except the time information.
[0135] In some possible implementation manners, the storage module 702 is further configured to store the log record #4, and a log file in which the log record #4 is located does not contain the log record #2 and the log record #3.
[0136] In some possible implementation manners, the first processing unit is a radio frequency chip for amplifying the power of a radio frequency signal, or the first processing unit is a chip for controlling whether to radiate a radio frequency signal.
[0137] In some possible implementation manners, the second processing unit is an application chip.
[0138] It should be noted that the information interaction, execution process and the like between the above modules are based on the same concept as the method embodiments of the present application, and the specific functions, steps, interpretation of terms, correlations and resulting technical effects can be referred to the method embodiments, which will not be described here.
[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit, and the integrated unit can be realized in the form of hardware or in the form of software functional unit. For example, the "module" can be a software program, a hardware circuit or a combination of the two, which realizes the above functions. The hardware circuit can include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor or a group processor) and a memory for executing one or more software or firmware programs, a combination logic circuit and / or other suitable components supporting the described functions.
[0140] Therefore, the modules of each example described in the embodiments of the present application can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0141] In addition, the specific names of each functional unit and module are only for easy mutual distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0142] It should be understood that the hardware system and apparatus in the embodiments of the present application can execute the various methods of the foregoing embodiments of the present application, that is, the specific working process of the various products can refer to the corresponding process in the foregoing method embodiments.
[0143] The embodiment of the present application further provides a computer readable storage medium, wherein computer instructions are stored in the computer readable storage medium; when the computer readable storage medium is run on a terminal device, the terminal device executes the method as described above. The computer instructions can be stored in the computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as one or more servers, data centers, etc. integrated with one or more media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium or a semiconductor medium (for example, a solid state disk (SSD)) and the like.
[0144] The embodiment of the present application further provides a computer program product containing computer instructions, when it is run on a terminal device, the terminal device can execute the technical solutions as described above.
[0145] Figure 8 is a structural schematic diagram of a terminal device 800 provided by the embodiment of the present application. The terminal device 800 includes a chip 801, wherein the chip 801 includes one or more chips, for example, the chip 801 includes a chip #1, a chip #2 and a chip #3, and the chip 801 is used to support the terminal device to execute the technical solutions shown in the methods 300 and 500 described above. The chip can be a general-purpose processor or a special-purpose processor.
[0146] Optionally, the terminal device 800 further includes a transceiver 802, which is used to accept the control of the chip 801 and is used to support the terminal device to execute the technical solutions as described above.
[0147] Optionally, the terminal device 800 can further include a storage medium 803.
[0148] In one design, the chip 801 includes one chip, and the terminal device 800 is used to implement the technical solutions executed by the first device in the method 300 described above.
[0149] In another design, the chip 801 includes a chip #1, a chip #2 and a chip #3, and the terminal device 800 is used to implement the technical solutions executed by the terminal device in the method 500 described above.
[0150] It should be noted that the chip can be implemented using one or more field programmable gate arrays (FPGAs), programmable logic devices (PLDs), controllers, state machines, gated logic, discrete hardware components, any other suitable circuitry, or any combination of the above, which are capable of carrying out the various functions described throughout the present disclosure.
[0151] The apparatus, the terminal device, the computer storage medium, and the computer program product provided by the embodiments of the present application are used to execute the method provided above, and thus the beneficial effects that can be achieved thereby can refer to the beneficial effects of the method provided above. Here, no further elaboration is provided.
[0152] It should be understood that the above is only to help those skilled in the art better understand the embodiments of the present application, and not to limit the scope of the embodiments of the present application. Those skilled in the art can obviously make various equivalent modifications or changes according to the above examples given, for example, some steps in each embodiment of the above method can be unnecessary, or some steps can be newly added, etc. Or a combination of any two or more embodiments. Such modifications, changes or combinations also fall within the scope of the embodiments of the present application.
[0153] It should also be understood that the above description of the embodiments of the present application focuses on the differences between the various embodiments, and the same or similar parts that are not mentioned can be referred to each other. For the sake of brevity, no further elaboration is provided here.
[0154] It should also be understood that the size of the sequence number of each process described above does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0155] It should also be understood that in the embodiments of the present application, "pre-configuration", "pre-setting", "pre-definition" can be realized by pre-saving the corresponding code, table or other means that can be used to indicate the relevant information in the device (for example, including the terminal device), and the present application does not limit the specific implementation manner thereof.
[0156] It should also be understood that the division of the modes, cases, categories and embodiments in the embodiments of the present application is only for the convenience of description, and should not constitute a special limitation. The features in various modes, categories, cases and embodiments can be combined without contradiction.
[0157] It should also be understood that, in the various embodiments of the present application, the terms and / or descriptions between different embodiments are consistent and can be mutually referred to if there is no special description and logical conflict, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationship.
[0158] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any change or replacement within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of generating a log, characterized by, The method is applied to a terminal device, the terminal device comprising a first processing module, a second processing module and a storage module, the first processing module being a radio frequency chip for power amplification of a radio frequency signal, or the first processing module being a chip for controlling whether to radiate a radio frequency signal, the second processing module being an application chip, the method comprising: The second processing module periodically sends first time information to the first processing module, the first time information being absolute time; The first processing module generates a first log record based on the first time information, the first log record being temporarily stored in a log buffer, the log buffer being distinguished from the storage module, the first log record comprising the first time information; The first processing module continuously generates a second log record when in a working mode, the second log record being temporarily stored in the log buffer, the second log record comprising second time information, the second time information being time information generated by a local clock of the first processing module; The second processing module writes the first log record and the second log record of the log buffer into the storage module; The storage module stores the first log record and the second log record, the first time information being used to determine absolute time of generation of the second log record in combination with the second time information.
2. The method of claim 1, wherein, The sending period of the first time information is determined based on pre-configuration.
3. The method of any one of claims 1-2, wherein, The terminal device further comprises a third processing module, and the method further comprises: The third processing module acquires the first log record and the second log record from the storage module; The third processing module generates a third log record based on the first log record and the second log record, the third log record comprising the absolute time and all or part of the content of the second log record except the second time information.
4. The method of claim 3, wherein, The method further comprises: The storage module stores the third log record, a log file in which the third log record is located not containing the first log record and the second log record.
5. A terminal device, characterized by, A computer program product comprises a computer program, the computer program comprising program instructions, the program instructions causing a processor to execute a method as claimed in any one of claims 1 to 4 when the program instructions are executed by the processor.
6. A computer-readable storage medium, characterized in that, A computer readable storage medium stores a computer program, the computer program comprising program instructions, the program instructions causing a processor to execute a method as claimed in any one of claims 1 to 4 when the program instructions are executed by the processor.
7. A computer program product, characterised in that, The computer program product comprises computer program code, the computer program code causing a terminal device to execute a method as claimed in any one of claims 1 to 4 when the computer program code is run by the terminal device.
Citation Information
Patent Citations
Audio fault time positioning method, audio data storage method and electronic equipment
CN115022442A