Nothing Special   »   [go: up one dir, main page]

CN114422340A - Log reporting method, electronic device and storage medium - Google Patents

Log reporting method, electronic device and storage medium Download PDF

Info

Publication number
CN114422340A
CN114422340A CN202011086158.7A CN202011086158A CN114422340A CN 114422340 A CN114422340 A CN 114422340A CN 202011086158 A CN202011086158 A CN 202011086158A CN 114422340 A CN114422340 A CN 114422340A
Authority
CN
China
Prior art keywords
log
electronic device
fault
server
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011086158.7A
Other languages
Chinese (zh)
Other versions
CN114422340B (en
Inventor
李煜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011086158.7A priority Critical patent/CN114422340B/en
Publication of CN114422340A publication Critical patent/CN114422340A/en
Application granted granted Critical
Publication of CN114422340B publication Critical patent/CN114422340B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/10Scheduling measurement reports ; Arrangements for measurement reports

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application provides a log reporting method, electronic equipment and a storage medium, which relate to the technical field of communication, and the method comprises the following steps: generating a first fault code corresponding to a detected fault event in response to the fault event; wherein the first fault code comprises a first type and a second type; counting the frequency of the first type fault event, and starting log reporting based on the frequency; and generating a first log based on the first fault code of the first type, and sending the first log to a server to finish the report of the log. The method provided by the embodiment of the application can improve the association degree of the log and the fault event and the efficiency of log transmission, so that the efficiency of positioning the fault according to the log can be improved by the server.

Description

Log reporting method, electronic device and storage medium
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a log reporting method, electronic equipment and a storage medium.
Background
With the continuous development of wireless communication and information technology, the application of distributed scenes is more and more diversified. However, due to instability of the communication environment in the distributed network, for example, instability of the network such as WIFI, bluetooth, etc., the failure rate of the distributed service (for example, access failure, network drop, etc.) is high. In order to analyze a failure in a distributed scenario, devices in the distributed network typically generate and report a log.
Disclosure of Invention
The embodiment of the application provides a log reporting method, an electronic device and a storage medium, and aims to provide a method for acquiring and sending logs, and improve the association degree between the logs and fault events and the efficiency of log transmission, so that the efficiency of positioning faults according to the logs can be improved by a server.
In a first aspect, an embodiment of the present application provides a log reporting method, which is applied to a first electronic device, where the first electronic device and a second electronic device are in a service connection state, and the first electronic device and the second electronic device prohibit log reporting, and the method includes:
generating a first fault code corresponding to the fault event in response to the detected fault event; the first fault code comprises a first type and a second type; in particular, the failure event may include a failure detected by the first electronic device, such as a network failure, an application failure, a device failure, a system failure, and so forth. The first fault code is used to identify the identity of the fault event, wherein the first fault code may be classified into a first type (e.g., high frequency type) and a second type (e.g., normal type). The first fault code of the first type may be used to identify a fault event associated with a network fault and the first fault code of the second type may be used to identify a fault event associated with an underlying fault.
Counting the frequency of the first type fault event, and starting log reporting based on the frequency; specifically, the first electronic device may count the frequency of the first type of fault event occurring within a preset time period, and may start log reporting based on the frequency. For example, if the frequency of occurrence of the first type of fault event is greater than or equal to the frequency threshold, log reporting may be started.
And generating a first log based on a first fault code of a first type, and sending the first log to a server to complete the report of the log, wherein the first log comprises a service flow identity, and the service flow identity is used for identifying the service flow direction between the first electronic device and the second electronic device.
In one possible implementation, sending the first log to the server includes:
sending the first log to a server based on a preset log sampling rate; in particular, the log sampling rate may be a transmission frequency of the log.
In one possible implementation, sending the first log to the server includes:
adjusting a preset log sampling rate based on the frequency of the first type of fault event; specifically, the preset log sampling rate may be adjusted according to the frequency of the first type of fault event, for example, if the frequency of the first type of fault event is increased, the log sampling rate is increased, and if the frequency of the first type of fault event is decreased, the log sampling rate is decreased.
The first log is sent to the server based on the adjusted log sampling rate.
In one possible implementation manner, the method further includes:
and receiving a second log sent by the second electronic device, and sending the second log to the server, wherein the second log is generated by the second electronic device based on a second fault code of the first type, and the second fault code is generated by the second electronic device based on the detected fault event.
In one possible implementation manner, after generating a first fault code corresponding to a fault event in response to the detected fault event, the method further includes:
in response to a first operation by a user, a first log is generated based on a first fault code of a first type, and the first log is transmitted to a server. Specifically, the user may cause the first electronic device to transmit the first log by operating in the first electronic device. For example, the user may operate in a log reporting application program in the first electronic device, so that the first electronic device may send the first log.
In one possible implementation manner, the method further includes:
and responding to a second operation of the user, sending a log request to the second electronic equipment, so that the second electronic equipment sends a second log to the first electronic equipment or sends the second log to the server. Specifically, the user may cause the second electronic device to transmit the second log by operating in the first electronic device. For example, a user may operate in a log reporting application program in first electronic equipment, and in response to the operation of the user, the first electronic equipment may send a log request to second electronic equipment, so that the second electronic equipment sends a first log based on the log request; the first log may be sent to the first electronic device or sent to the server.
In a second aspect, an embodiment of the present application provides a log reporting apparatus, including:
the generating module is used for responding to the detected fault event and generating a first fault code corresponding to the fault event; the first fault code comprises a first type and a second type;
the starting module is used for counting the frequency of the first type fault event and starting log reporting based on the frequency;
the first reporting module is configured to generate a first log based on a first fault code of a first type, and send the first log to a server to complete reporting of the log, where the first log includes a service flow identity, and the service flow identity is used to identify a service flow direction between a first electronic device and a second electronic device.
In one possible implementation manner, the first reporting module is further configured to send the first log to the server based on a preset log sampling rate.
In one possible implementation manner, the first reporting module includes:
an adjusting unit for adjusting a preset log sampling rate based on the frequency of the first type of fault event;
and the reporting unit is used for sending the first log to the server based on the adjusted log sampling rate.
In one possible implementation manner, the apparatus further includes:
and receiving a second log sent by the second electronic device, and sending the second log to the server, wherein the second log is generated by the second electronic device based on a second fault code of the first type, and the second fault code is generated by the second electronic device based on the detected fault event.
In one possible implementation manner, the apparatus further includes:
and the second reporting module is used for responding to the first operation of the user, generating a first log based on the first fault code of the first type, and sending the first log to the server.
In one possible implementation manner, the apparatus further includes:
and the request module is used for responding to a second operation of the user and sending a log request to the second electronic equipment, so that the second electronic equipment sends a second log to the first electronic equipment or sends the second log to the server.
In a third aspect, an embodiment of the present application provides a first electronic device, including:
a memory, wherein the memory is used for storing a computer program code, and the computer program code includes instructions, and when the first electronic device reads the instructions from the memory, the first electronic device executes the following steps:
generating a first fault code corresponding to the fault event in response to the detected fault event; the first fault code comprises a first type and a second type;
counting the frequency of the first type fault event, and starting log reporting based on the frequency;
and generating a first log based on a first fault code of a first type, and sending the first log to a server to complete the report of the log, wherein the first log comprises a service flow identity, and the service flow identity is used for identifying the service flow direction between the first electronic device and the second electronic device.
In one possible implementation manner, when the instruction is executed by the first electronic device, the step of causing the first electronic device to execute sending the first log to the server includes:
sending the first log to a server based on a preset log sampling rate.
In one possible implementation manner, when the instruction is executed by the first electronic device, the step of causing the first electronic device to execute sending the first log to the server includes:
adjusting a preset log sampling rate based on the frequency of the first type of fault event;
the first log is sent to the server based on the adjusted log sampling rate.
In one possible implementation manner, when the instruction is executed by the first electronic device, the first electronic device further executes the following steps:
and receiving a second log sent by the second electronic device, and sending the second log to the server, wherein the second log is generated by the second electronic device based on a second fault code of the first type, and the second fault code is generated by the second electronic device based on the detected fault event.
In one possible implementation manner, when the instruction is executed by the first electronic device, the step of causing the first electronic device to execute sending the first log to the server includes:
in response to a first operation by a user, a first log is generated based on a first fault code of a first type, and the first log is transmitted to a server.
In one possible implementation manner, when the instruction is executed by the first electronic device, the first electronic device further executes the following steps:
and responding to a second operation of the user, sending a log request to the second electronic equipment, so that the second electronic equipment sends a second log to the first electronic equipment or sends the second log to the server.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon a computer program, which, when run on a computer, causes the computer to perform the method according to the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program, which is configured to perform the method according to the first aspect when the computer program is executed by a computer.
In a possible design, the program of the fifth aspect may be stored in whole or in part on a storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.
Drawings
Fig. 1 is a schematic diagram of a distributed service application scenario provided in an embodiment of the present application;
fig. 2 is a schematic view of an application scenario of a log reporting method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of an embodiment of a log reporting method provided in the present application;
fig. 4 is a schematic flowchart of another embodiment of a log reporting method provided in the present application;
fig. 5 is a schematic flowchart of a log reporting method according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of a log reporting device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of the present application, "a plurality" means two or more unless otherwise specified.
In a distributed network environment, distributed traffic is delivered as traffic flows. Fig. 1 is a schematic diagram illustrating an application scenario of a distributed service. When a distributed fault occurs, the distributed device collects logs, for example, the device a may collect a fault event reported by the distributed service through a log engine to generate a log, and send the log to the server, so that the server may analyze the log, and thereby the server may locate the fault of the distributed device. Wherein the log comprises information of the fault event. The distributed services between the devices are associated by a service flow identity (traceid), for example, the distributed service n of the device a and the distributed service n of the device B belong to the same traceid.
However, the data volume of the log is huge, and if the log generated by the device is transmitted to the server in real time, the massive log will affect the performance of the distributed service and the transmission bandwidth between the device and the server. In addition, when the device acquires the log, only the ordinary log is acquired, and the ordinary log only records simple information such as errors and warnings in service operation and does not record detailed information related to the communication network, so that the server is difficult to locate the fault after receiving the ordinary log. Furthermore, currently, different log plug-ins are selected by compiling macros to transmit corresponding logs, and dynamic adjustment cannot be performed.
The embodiment of the application provides a log reporting method.
Referring to fig. 2 to fig. 5, a description is now given of a log reporting method provided in the embodiment of the present application, where fig. 2 is an application scenario provided in the embodiment of the present application, and referring to fig. 2, the application scenario includes a first device 100 (e.g., a mobile phone), a second device 200 (e.g., a large screen, a tablet, a car machine, etc.), and a server 300.
The first device 100 and the second device 200 may establish a connection in a wireless manner, where the wireless manner may include a wireless communication manner such as WIFI, bluetooth, a cellular mobile network (e.g., 4G, 5G, etc.), for example, the first device 100 may be projected on the second device 200, and this application is not limited in this respect. The first device 100 and the server 300 may also establish a connection in a wireless manner, and the second device 200 and the server 300 may also establish a connection in a wireless manner, which may include a wireless communication manner such as WIFI, for example, the first device 100 and the second device 200 may send the generated log to the server 300, which is not limited in this application.
Fig. 3 is a schematic flow chart of an embodiment of a log reporting method provided in the embodiment of the present application, including:
in step 101, a first device 100 establishes a connection with a second device 200.
Specifically, the user may establish a service connection with the second device 200 by starting an application in the first device 100, so as to complete the networking between the first device 100 and the second device 200. For example, the user may click on a screen-casting application on the display interface of the first device 100 to establish a screen-casting connection with the second device 200. In response to the user's operation, the first device 100 establishes a connection with the second device 200, whereby networking between the first device 100 and the second device 200 may be completed, for example, the first device 100 may be projected on the second device 200.
After the first device 100 and the second device 200 complete networking, the first device 100 and the second device 200 may respectively include a traffic flow identity (traceid). The service flow identifier is used to identify flow direction information of a service flow, and for example, the flow direction information of the service flow may include a networking device list (for example, an identifier of the first device 100 and an identifier of the second device 200), a device invocation relationship (for example, the first device 100 is projected on the second device 200, where the first device 100 is a screen projection service sending end, and the second device 200 is a screen projection service receiving end), and the like.
In step 102, the first device 100 detects a fault event and generates a first fault code corresponding to the fault event.
Specifically, the first device 100 may preset two types of failures, for example, a normal type and a high frequency type. The common type fault can generate a corresponding common log, and the high frequency type fault can generate a corresponding high frequency log. The general log contains information on system-based faults, such as alarms. The high frequency log may contain information about device or network related failures, such as network anomalies. Through the analysis of the high-frequency log, the server can more accurately and rapidly position the fault.
When an application (e.g., a screen-shot application) in the first device 100 fails, for example, a network fails. A corresponding first fault code may be generated based on the current fault event. The first fault code may be used to identify specific information of the current fault in the first device 100, so that the server may analyze and locate the fault. In addition, the first fault code may also be associated with a traffic flow identity and a fault type.
In step 103, the second device 200 acquires the fault event and generates a second fault code corresponding to the fault event.
Specifically, the second device 200 may preset two types of failures, for example, a normal type and a high frequency type. The common type fault can generate a corresponding common log, and the high frequency type fault can generate a corresponding high frequency log. The general log contains information on system-based faults, such as alarms. The high frequency log may contain information about device or network related failures, such as network anomalies. Through the analysis of the high-frequency log, the server can more accurately and rapidly position the fault
When an application (e.g., a screen-shot application) in the second device 200 fails, for example, a network fails. A corresponding second fault code may be generated based on the current fault event. The second fault code may be used to identify specific information of the current fault in the second device 200, so that the server may analyze and locate the fault. The second fault code may also be associated with a traffic flow identity and a fault type.
It is understood that steps 102 and 103 are not in sequential order. Step 102 may be executed before step 103, step 102 may be executed after step 103, or step 102 may be executed simultaneously with step 103, which is not particularly limited in this embodiment of the application.
Step 104, the first device 100 starts a log reporting function based on the high-frequency type failure event frequency.
Specifically, the first device 100 may count the frequency of the high-frequency type of fault event and compare the frequency of the high-frequency type of fault event with a preset first frequency threshold. It should be noted that the first device 100 usually prohibits log reporting, that is, the first device 100 usually does not report logs, so as to avoid bandwidth occupation by frequently uploading logs. If the frequency of the high-frequency type fault event is greater than or equal to the preset first frequency threshold, the first device 100 may start a log reporting function, that is, at this time, the fault occurs more frequently, and the first device 100 may perform log reporting, so that the high-frequency log corresponding to the high-frequency type fault event may be reported to the server 300, so that the server 300 may locate the fault reported by the first device 100.
And 105, the second device 200 starts a log reporting function based on the high-frequency type fault event frequency.
Specifically, the second device 200 may count the frequency of the high-frequency type of fault event and compare the frequency of the high-frequency type of fault event with a preset second frequency threshold. It should be noted that the second device 200 usually prohibits log reporting, that is, the second device 200 usually does not report logs, so as to avoid bandwidth occupation by frequent log uploading. If the frequency of the high-frequency type fault event is greater than or equal to the preset second frequency threshold, the second device 200 may start a log reporting function, that is, at this time, the fault occurs more frequently, and the second device 200 may perform log reporting, so that the high-frequency log corresponding to the high-frequency type fault event may be reported to the server 300, so that the server 300 may locate the fault reported by the second device 200.
It is understood that steps 104 and 105 are not in sequential order. Step 104 may be performed before step 105, step 104 may be performed after step 105, or step 104 may be performed simultaneously with step 105, which is not particularly limited in this embodiment of the application.
In step 106, the first device 100 sends a high frequency log to the server 300.
Specifically, the first device 100 may generate a corresponding log from the failure event. For example, the first device 100 may generate a corresponding high frequency log from the high frequency type fault event (e.g., the first fault code) obtained in step 103. The high frequency log may contain, among other things, a device ID (e.g., an identification of the first device 100), a traffic flow ID (e.g., an identification of the traffic flow), and a fault event ID (e.g., a first fault code).
After the first device 100 generates the high frequency log, the high frequency log may be sent to the server 300 according to a preset log sampling rate, so that the server 300 may analyze and locate the fault. Wherein the log sampling rate is used to identify the transmission frequency of the log.
Optionally, the first device 100 may also dynamically adjust the log sampling rate. For example, the log sampling rate may be adjusted according to the failure frequency, and the higher the failure frequency is, the higher the log sampling rate is, and the lower the failure frequency is, the lower the log sampling rate is. Then, the first device 100 may also transmit the high frequency log to the server 300 according to the adjusted log sampling rate.
In step 107, the second device 200 transmits the high frequency log to the server 300.
Specifically, the second device 200 may generate a corresponding log from the failure event. For example, the second appliance 200 may generate a corresponding high frequency log from the high frequency type fault event (e.g., the second fault code) obtained in step 104. The high frequency log may contain, among other things, a device ID (e.g., an identification of the second device 200), a traffic flow ID (e.g., an identification of the traffic flow), and a fault event ID (e.g., a second fault code).
After the second device 100 generates the high frequency log, the high frequency log may be sent to the server 300 according to a preset sampling rate, so that the server 300 may analyze and locate the fault.
Optionally, the second device 200 may also dynamically adjust the log sampling rate. For example, the log sampling rate may be adjusted according to the failure frequency, and the higher the failure frequency is, the higher the log sampling rate is, and the lower the failure frequency is, the lower the log sampling rate is. Then, the second device 200 may also transmit the high frequency log to the server 300 according to the adjusted log sampling rate.
Fig. 4 is a schematic flow chart of another embodiment of a log reporting method according to an embodiment of the present application, including:
in step 201, the first device 100 establishes a connection with the second device 200.
Specifically, the user may establish a connection with the second device 200 by starting an application in the first device 100 to complete the networking between the first device 100 and the second device 200. For example, the user may click on a screen-casting application on the display interface of the first device 100 to establish a connection with the second device 200. In response to the user's operation, the first device 100 establishes a connection with the second device 200, whereby networking between the first device 100 and the second device 200 may be completed, for example, the first device 100 may be projected on the second device 200.
After the first device 100 and the second device 200 complete networking, the first device 100 and the second device 200 may respectively include a traffic flow identity (traceid). The service flow identity is used to identify related information of a service flow, and for example, the related information of the service flow may include a networking device list (for example, an identity of the first device 100 and an identity of the second device 200), a device invocation relationship (for example, the first device 100 is projected on the second device 200, where the first device 100 is a screen projection service sending end, and the second device 200 is a screen projection service receiving end), and the like.
In step 202, the first device 100 acquires the fault event and generates a first fault code corresponding to the fault event.
Specifically, the first device 100 may preset two types of failures, for example, a normal type and a high frequency type. The common type fault can generate a corresponding common log, and the high frequency type fault can generate a corresponding high frequency log. The general log contains information on system-based faults, such as alarms. The high frequency log may contain information about device or network related failures, such as network anomalies. Through the analysis of the high-frequency log, the server can more accurately and rapidly position the fault.
When an application (e.g., a screen-shot application) in the first device 100 fails, for example, a network fails. A corresponding first fault code may be generated based on the current fault event. The first fault code may be used to identify specific information of the current fault in the first device 100, so that the server may analyze and locate the fault. In addition, the first fault code may also be associated with a traffic flow identity and a fault type.
In step 203, the second device 200 acquires the fault event and generates a second fault code corresponding to the fault event.
Specifically, the second device 200 may preset two types of failures, for example, a normal type and a high frequency type. The common type fault can generate a corresponding common log, and the high frequency type fault can generate a corresponding high frequency log. The general log contains information on system-based faults, such as alarms. The high frequency log may contain information about device or network related failures, such as network anomalies. Through the analysis of the high-frequency log, the server can more accurately and rapidly position the fault
When an application (e.g., a screen-shot application) in the second device 200 fails, for example, a network fails. A corresponding second fault code may be generated based on the current fault event. The second fault code may be used to identify specific information of the current fault in the second device 200, so that the server may analyze and locate the fault. The second fault code may also be associated with a traffic flow identity and a fault type.
It is understood that step 202 and step 203 are not in sequential order. Step 202 may be performed before step 203, step 202 may be performed after step 203, or step 202 may be performed simultaneously with step 203, which is not particularly limited in this embodiment of the application.
In step 204, the first device 100 starts a log reporting function based on the high-frequency type failure event frequency.
Specifically, the first device 100 may count the frequency of the high-frequency type of fault event and compare the frequency of the high-frequency type of fault event with a preset first frequency threshold. If the frequency of the high-frequency type fault event is greater than or equal to the preset first frequency threshold, the first device 100 may start a log reporting function, so that the high-frequency log corresponding to the high-frequency type fault event may be reported to the server 300, so that the server 300 may locate the fault reported by the first device 100.
In step 205, the second device 200 starts a log reporting function based on the high-frequency type failure event frequency.
The second device 200 may count the frequency of the high frequency type of fault event and compare the frequency of the high frequency type of fault event with a preset second frequency threshold. If the frequency of the high-frequency type fault event is greater than or equal to the preset second frequency threshold, the second device 200 may start a log reporting function, so that the high-frequency log corresponding to the high-frequency type fault event may be reported to the server 300, so that the server 300 may locate the fault reported by the second device 200.
It is understood that step 204 and step 205 are not in sequential order. Step 204 may be performed before step 205, step 204 may be performed after step 205, or step 204 may be performed simultaneously with step 205, which is not particularly limited in this embodiment of the application.
In step 206, the second appliance 200 sends a second high frequency log to the first appliance 100.
Specifically, the second device 200 may generate a corresponding log from the failure event. For example, the second device 200 may generate a corresponding second high frequency log from the high frequency type fault event obtained in step 104. Wherein the second high frequency log may contain a device ID (e.g., an identification of the second device 200), a traffic flow ID (e.g., an identification of the traffic flow), and a fault event ID (e.g., a second fault code).
After the second device 100 generates the second high frequency log, it may be determined whether the second device 100 has a networking capability, that is, whether the second electronic device 200 has a capability of directly transmitting the second high frequency log to the server 300, and if the second electronic device 200 determines that the second device does not have the networking capability, the second high frequency log may be transmitted to the first device 100 having the networking capability according to a preset sampling rate.
Optionally, the second device 200 may also dynamically adjust the log sampling rate. For example, the log sampling rate may be adjusted according to the failure frequency, and the higher the failure frequency is, the higher the log sampling rate is, and the lower the failure frequency is, the lower the log sampling rate is. Then, the second device 200 may also transmit the second high frequency log to the first device 100 according to the adjusted log sampling rate.
In step 207, the first device 100 sends the first high frequency log and the second high frequency log to the server 300.
Specifically, the first device 100 may generate a corresponding log from the failure event. For example, the first device 100 may generate a corresponding first high frequency log according to the high frequency type fault event acquired in step 103. The first high frequency log may contain, among other things, a device ID (e.g., an identification of the first device 100), a traffic flow ID (e.g., an identification of the traffic flow), and a fault event ID (e.g., a first fault code).
After the first device 100 generates the first high frequency log, the first high frequency log may be sent to the server 300 according to a preset sampling rate, so that the server 300 may analyze and locate the fault.
Optionally, the first device 100 may also dynamically adjust the log sampling rate. For example, the log sampling rate may be adjusted according to the failure frequency, and the higher the failure frequency is, the higher the log sampling rate is, and the lower the failure frequency is, the lower the log sampling rate is. Then, the first device 100 may also transmit the first high frequency log to the server 300 according to the adjusted log sampling rate.
Alternatively, the first device 100 may also transmit the second high frequency log to the server 300 together when transmitting the first high frequency log to the server 300. The first device 100 may also send the second high-frequency log to the server 300 separately, which is not particularly limited in this embodiment.
In the embodiment of the present application, the second device 200 sends the high-frequency log to the first device 100, so that the problem that the second device 200 cannot send the high-frequency log to the server 300 due to the fact that the second device does not have networking capability can be solved.
Fig. 5 is a schematic flow chart of another embodiment of a log reporting method according to an embodiment of the present application, including:
in step 301, the first device 100 establishes a connection with the second device 200.
Specifically, the user may establish a connection with the second device 200 by starting an application in the first device 100 to complete the networking between the first device 100 and the second device 200. For example, the user may click on a screen-casting application on the display interface of the first device 100 to establish a connection with the second device 200. In response to the user's operation, the first device 100 establishes a connection with the second device 200, whereby networking between the first device 100 and the second device 200 may be completed, for example, the first device 100 may be projected on the second device 200.
After the first device 100 and the second device 200 complete networking, the first device 100 and the second device 200 may respectively include a traffic flow identity (traceid). The service flow identity is used to identify related information of a service flow, and for example, the related information of the service flow may include a networking device list (for example, an identity of the first device 100 and an identity of the second device 200), a device invocation relationship (for example, the first device 100 is projected on the second device 200, where the first device 100 is a screen projection service sending end, and the second device 200 is a screen projection service receiving end), and the like.
Step 302, the first device 100 acquires the fault event and generates a first fault code corresponding to the fault event.
Specifically, the first device 100 may preset two types of failures, for example, a normal type and a high frequency type. The common type fault can generate a corresponding common log, and the high frequency type fault can generate a corresponding high frequency log. The general log contains information on system-based faults, such as alarms. The high frequency log may contain information about device or network related failures, such as network anomalies. Through the analysis of the high-frequency log, the server can more accurately and rapidly position the fault.
When an application (e.g., a screen-shot application) in the first device 100 fails, for example, a network fails. A corresponding first fault code may be generated based on the current fault event. The first fault code may be used to identify specific information of the current fault in the first device 100, so that the server may analyze and locate the fault. In addition, the first fault code may also be associated with a traffic flow identity and a fault type.
Step 303, the second device 200 acquires the fault event and generates a second fault code corresponding to the fault event.
Specifically, the second device 200 may preset two types of failures, for example, a normal type and a high frequency type. The common type fault can generate a corresponding common log, and the high frequency type fault can generate a corresponding high frequency log. The general log contains information on system-based faults, such as alarms. The high frequency log may contain information about device or network related failures, such as network anomalies. Through the analysis of the high-frequency log, the server can more accurately and rapidly position the fault.
When an application (e.g., a screen-shot application) in the second device 200 fails, for example, a network fails. A corresponding second fault code may be generated based on the current fault event. The second fault code may be used to identify specific information of the current fault in the second device 200, so that the server may analyze and locate the fault. The second fault code may also be associated with a traffic flow identity and a fault type.
It is understood that steps 302 and 303 are not in sequential order. Step 302 may be performed before step 303, step 302 may be performed after step 303, or step 302 may be performed simultaneously with step 303, which is not particularly limited in this embodiment of the application.
In response to the user's operation, the first device 100 generates a first high frequency log, step 304.
Specifically, the user may operate on the first device 100 to start log reporting of the first device 100 and the second device 200. For example, the user may click on the log reporting application in the first device 100 to start the log reporting of the first device 100 and the second device 200. The user may also start the log reporting of the first device 100 and the second device 200 through other operations, which is not particularly limited in this embodiment of the application. In response to the user's operation, the first device 100 generates a first high frequency log, wherein the first high frequency log is generated according to the first fault code.
In step 305, the first device 100 sends a first high frequency log to the server 300.
Specifically, after the first device 100 generates the first high frequency log, the first high frequency log may be transmitted to the server 300.
In step 306, the first appliance 100 sends a log request to the second appliance 200.
Specifically, the first device 100 may also transmit a log request to the second device 200, so that the second device 200 transmits a second high-frequency log, which is generated according to the second fault code. Before sending the second high-frequency log, the second device 200 may detect its own networking capability, that is, the second device 200 may detect whether it has the capability of directly sending the log to the server. If the second device 200 determines that it has the capability of directly sending the log to the server, step 307 is executed. If the second device 200 determines that it does not have the capability to send logs directly to the server, step 308 is executed.
In step 307, the second device 200 directly transmits the second high frequency log to the server 300.
In step 308, the second device 200 transmits the second high frequency log to the first device 100.
In step 309, the first device 100 forwards the second high frequency log to the server 300.
In the embodiment of the application, the user can directly operate the equipment after finding that the equipment has a fault so as to trigger the report of the log, so that the server can receive the log as soon as possible, the delay of the log due to the report based on the sampling rate is avoided, and the user can quickly analyze and position the fault.
Fig. 6 is a schematic structural diagram of an embodiment of a log reporting device according to the present application, and as shown in fig. 6, the log reporting device 60 may include: a generating module 61, an opening module 62 and a first reporting module 63;
a generating module 61, configured to generate a first fault code corresponding to a fault event in response to the detected fault event; the first fault code comprises a first type and a second type;
the starting module 62 is used for counting the frequency of the first type fault event and starting log reporting based on the frequency;
the first reporting module 63 is configured to generate a first log based on a first fault code of a first type, and send the first log to a server to complete reporting of the log, where the first log includes a service flow identity, and the service flow identity is used to identify a service flow direction between a first electronic device and a second electronic device.
In one possible implementation manner, the first reporting module 63 is further configured to send the first log to the server based on a preset log sampling rate.
In one possible implementation manner, the first reporting module 63 includes: an adjusting unit 631 and a reporting unit 632;
an adjusting unit 631 for adjusting a preset log sampling rate based on the frequency of the first type of fault event;
a reporting unit 632, configured to send the first log to the server based on the adjusted log sampling rate.
In one possible implementation manner, the apparatus further includes: a receiving module 64;
a receiving module 64, configured to receive a second log sent by the second electronic device, and send the second log to the server, where the second log is generated by the second electronic device based on a second fault code of the first type, and the second fault code is generated by the second electronic device based on the detected fault event
In one possible implementation manner, the apparatus further includes: a second reporting module 65;
and a second reporting module 65, configured to generate a first log based on the first fault code of the first type in response to the first operation of the user, and send the first log to the server.
In one possible implementation manner, the apparatus further includes: a request module 66;
a request module 66, configured to send a log request to the second electronic device in response to a second operation of the user, so that the second electronic device sends the second log to the first electronic device or sends the second log to the server.
The log reporting device provided in the embodiment shown in fig. 6 may be configured to execute the technical solutions of the method embodiments shown in fig. 2 to fig. 5 in the present application, and the implementation principle and the technical effect may further refer to the related descriptions in the method embodiments.
It should be understood that the division of the modules of the log reporting apparatus shown in fig. 6 is only a division of a logical function, and all or part of the actual implementation may be integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling by the processing element in software, and part of the modules can be realized in the form of hardware. For example, the detection module may be a separate processing element, or may be integrated into a chip of the electronic device. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors (DSPs), one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, these modules may be integrated together and implemented in the form of a System-On-a-Chip (SOC).
Fig. 7 is a schematic structural diagram of an embodiment of an electronic device 700 according to the present application, where the first device 100 and the second device 200 may be the electronic device 700. As shown in fig. 7, the electronic device 700 may include a processor 710, an external memory interface 720, an internal memory 721, a Universal Serial Bus (USB) interface 730, a charging management module 740, a power management module 741, a battery 742, an antenna 1, an antenna 2, a mobile communication module 750, a wireless communication module 760, an audio module 770, a speaker 770A, a receiver 770B, a microphone 770C, an earphone interface 770D, a sensor module 780, keys 790, a motor 791, an indicator 792, a camera 793, a display 794, and a Subscriber Identification Module (SIM) card interface 795, and the like. Wherein the sensor module 780 may include a pressure sensor 780A, a gyroscope sensor 780B, an air pressure sensor 780C, a magnetic sensor 780D, an acceleration sensor 780E, a distance sensor 780F, a proximity light sensor 780G, a fingerprint sensor 780H, a temperature sensor 780J, a touch sensor 780K, an ambient light sensor 780L, a bone conduction sensor 780M, and the like.
It is to be understood that the illustrated structure of the embodiment of the invention is not to be construed as a specific limitation to the electronic device 700. In other embodiments of the present application, the electronic device 700 may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 710 may include one or more processing units, such as: the processor 710 may 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), among others. The different processing units may be separate devices or may be integrated into one or more processors.
The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 710 for storing instructions and data. In some embodiments, the memory in the processor 710 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 710. If the processor 710 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 710, thereby increasing the efficiency of the system.
In some embodiments, processor 710 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (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.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 710 may include multiple sets of I2C buses. The processor 710 may be coupled to the touch sensor 780K, charger, flash, camera 793, etc. through different I2C bus interfaces. For example: the processor 710 may be coupled to the touch sensor 780K via an I2C interface, such that the processor 710 and the touch sensor 780K communicate via an I2C bus interface to implement touch functionality of the electronic device 700.
The I2S interface may be used for audio communication. In some embodiments, processor 710 may include multiple sets of I2S buses. Processor 710 may be coupled to audio module 770 via an I2S bus to enable communication between processor 710 and audio module 770. In some embodiments, the audio module 770 may communicate audio signals to the wireless communication module 760 through an I2S interface to enable answering a call through a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, audio module 770 and wireless communication module 760 may be coupled by a PCM bus interface. In some embodiments, the audio module 770 may also transmit audio signals to the wireless communication module 760 through the PCM interface, so as to receive phone calls through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 710 with the wireless communication module 760. For example: the processor 710 communicates with a bluetooth module in the wireless communication module 760 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 770 may transmit the audio signal to the wireless communication module 760 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 710 with peripheral devices such as the display screen 794, the camera 793, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a display screen serial interface (DSI), and the like. In some embodiments, processor 710 and camera 793 communicate over a CSI interface to implement the capture functionality of electronic device 700. The processor 710 and the display screen 794 communicate via the DSI interface to implement the display function of the electronic device 700.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 710 with the camera 793, the display 794, the wireless communication module 760, the audio module 770, the sensor module 780, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 730 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 730 can be used to connect a charger to charge the electronic device 700, and can also be used to transmit data between the electronic device 700 and peripheral devices. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and does not limit the structure of the electronic device 700. In other embodiments of the present application, the electronic device 700 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 740 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 740 may receive charging input from a wired charger via the USB interface 730. In some wireless charging embodiments, the charging management module 740 may receive wireless charging input through a wireless charging coil of the electronic device 700. While the charging management module 740 charges the battery 742, the power management module 741 may also supply power to the electronic device.
The power management module 741 is configured to connect the battery 742, the charging management module 740 and the processor 710. The power management module 741 receives input from the battery 742 and/or the charging management module 740, and provides power to the processor 710, the internal memory 721, the display 794, the camera 793, and the wireless communication module 760, among other things. The power management module 741 may also be configured to monitor parameters such as battery capacity, battery cycle count, and battery state of health (leakage, impedance). In some other embodiments, the power management module 741 may also be disposed in the processor 710. In other embodiments, the power management module 741 and the charging management module 740 may be disposed in the same device.
The wireless communication function of the electronic device 700 may be implemented by the antenna 1, the antenna 2, the mobile communication module 750, the wireless communication module 760, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 700 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 750 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 700. The mobile communication module 750 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 750 can receive the electromagnetic wave from the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic wave, and transmit the processed electromagnetic wave to the modem processor for demodulation. The mobile communication module 750 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 750 may be disposed in the processor 710. In some embodiments, at least some of the functional modules of the mobile communication module 750 may be disposed in the same device as at least some of the modules of the processor 710.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 770A, the receiver 770B, etc.) or displays an image or video through the display screen 794. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be separate from the processor 710, and may be located in the same device as the mobile communication module 750 or other functional modules.
The wireless communication module 760 may provide a solution for wireless communication applied to the electronic device 700, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 760 may be one or more devices that integrate at least one communication processing module. The wireless communication module 760 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering on electromagnetic wave signals, and transmits the processed signals to the processor 710. The wireless communication module 760 may also receive signals to be transmitted from the processor 710, frequency modulate them, amplify them, and convert them into electromagnetic waves via the antenna 2 to radiate them.
In some embodiments, antenna 1 of electronic device 700 is coupled to mobile communication module 750 and antenna 2 is coupled to wireless communication module 760 so that electronic device 700 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 700 implements display functions via the GPU, the display screen 794, and the application processor, among others. The GPU is a microprocessor for image processing, and is connected to a display screen 794 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 710 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 794 is used to display images, video, and the like. The display screen 794 includes a display panel. The display panel may employ a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-OLED, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the electronic device 700 may include 1 or N display screens 794, N being a positive integer greater than 1.
The electronic device 700 may implement a photographing function through the ISP, the camera 793, the video codec, the GPU, the display screen 794, the application processor, and the like.
The ISP is used to process the data fed back by the camera 793. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 793.
The camera 793 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, electronic device 700 may include 1 or N cameras 793, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 700 selects a frequency bin, the digital signal processor is used to perform a fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 700 may support one or more video codecs. In this way, electronic device 700 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent cognition of the electronic device 700 can be achieved through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 720 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 700. The external memory card communicates with the processor 710 through the external memory interface 720 to implement data storage functions. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 721 may be used to store computer-executable program code, including instructions. The internal memory 721 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (e.g., audio data, phone book, etc.) created during use of the electronic device 700, and the like. In addition, the internal memory 721 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. The processor 710 performs various functional applications and data processing of the electronic device 700 by executing instructions stored in the internal memory 721 and/or instructions stored in a memory provided in the processor.
Electronic device 700 may implement audio functions via audio module 770, speaker 770A, receiver 770B, microphone 770C, headset interface 770D, and an application processor, among other things. Such as music playing, recording, etc.
The audio module 770 is used to convert digital audio information into an analog audio signal output and also used to convert an analog audio input into a digital audio signal. The audio module 770 may also be used to encode and decode audio signals. In some embodiments, the audio module 770 may be disposed in the processor 710, or some functional modules of the audio module 770 may be disposed in the processor 710.
The speaker 770A, also referred to as a "horn", is used to convert electrical audio signals into acoustic signals. The electronic device 700 may listen to music or to a hands-free conversation through the speaker 770A.
Receiver 770B, also referred to as a "handset," is used to convert the electrical audio signals into acoustic signals. When the electronic device 700 receives a call or voice information, it can receive voice by placing the receiver 770B close to the ear of the person.
Microphone 770C, also known as a "microphone," is used to convert acoustic signals into electrical signals. When making a call or sending voice information, the user can input a voice signal to the microphone 770C by speaking into the mouth of the user near the microphone 770C. The electronic device 700 may be provided with at least one microphone 770C. In other embodiments, the electronic device 700 may be provided with two microphones 770C to achieve noise reduction functions in addition to collecting sound signals. In other embodiments, the electronic device 700 may further include three, four, or more microphones 770C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The earphone interface 770D is used to connect a wired earphone. The headset interface 770D may be the USB interface 730, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 780A is used for sensing a pressure signal and converting the pressure signal into an electrical signal. In some embodiments, pressure sensor 780A may be disposed on display screen 794. Pressure sensor 780A
Such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 780A, the capacitance between the electrodes changes. The electronic device 700 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 794, the electronic apparatus 700 detects the intensity of the touch operation based on the pressure sensor 780A. The electronic apparatus 700 may also calculate the position of the touch from the detection signal of the pressure sensor 780A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 780B may be used to determine a motion gesture of the electronic device 700. In some embodiments, the angular velocity of electronic device 700 about three axes (i.e., x, y, and z axes) may be determined by gyroscope sensor 780B. The gyro sensor 780B may be used to photograph anti-shake. For example, when the shutter is pressed, the gyro sensor 780B detects the shake angle of the electronic device 700, calculates the distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 700 through a reverse motion, thereby achieving anti-shake. The gyro sensor 780B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 780C is used to measure air pressure. In some embodiments, electronic device 700 calculates altitude, aiding in positioning and navigation, from barometric pressure values measured by barometric pressure sensor 780C.
The magnetic sensor 780D includes a hall sensor. The electronic device 700 may detect the opening and closing of the flip holster using the magnetic sensor 780D. In some embodiments, when the electronic device 700 is a flip phone, the electronic device 700 may detect the opening and closing of the flip according to the magnetic sensor 780D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
Acceleration sensor 780E may detect the magnitude of acceleration of electronic device 700 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 700 is stationary. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 780F for measuring distance. The electronic device 700 may measure distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 700 may utilize range sensor 780F to range for fast focus.
The proximity light sensor 780G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 700 emits infrared light to the outside through the light emitting diode. The electronic device 700 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 700. When insufficient reflected light is detected, the electronic device 700 may determine that there are no objects near the electronic device 700. The electronic device 700 may utilize the proximity light sensor 780G to detect that the user holds the electronic device 700 close to the ear for talking, so as to automatically turn off the screen to save power. The proximity light sensor 780G may also be used in holster mode, pocket mode automatically unlock and lock screen.
The ambient light sensor 780L is used to sense ambient light brightness. The electronic device 700 may adaptively adjust the brightness of the display screen 794 based on the perceived ambient light level. The ambient light sensor 780L may also be used to automatically adjust the white balance when taking a picture. Ambient light sensor 780L may also cooperate with proximity light sensor 780G to detect whether electronic device 700 is in a pocket to prevent inadvertent touches.
The fingerprint sensor 780H is used to collect a fingerprint. The electronic device 700 may utilize the collected fingerprint characteristics to implement fingerprint unlocking, access an application lock, fingerprint photographing, fingerprint answering, and the like.
The temperature sensor 780J is used to detect temperature. In some embodiments, electronic device 700 implements a temperature processing strategy using the temperature detected by temperature sensor 780J. For example, when the temperature reported by temperature sensor 780J exceeds a threshold, electronic device 700 performs a reduction in performance of a processor located near temperature sensor 780J to reduce power consumption to implement thermal protection. In other embodiments, the electronic device 700 heats the battery 742 when the temperature is below another threshold to avoid the low temperature causing the electronic device 700 to shut down abnormally. In other embodiments, electronic device 700 performs a boost on the output voltage of battery 742 when the temperature is below a further threshold to avoid abnormal shutdown due to low temperatures.
Touch sensor 780K is also referred to as a "touch device". Touch sensor 780K may be disposed on display screen 794, and touch sensor 780K and display screen 794 form a touch screen, also referred to as a "touch screen". The touch sensor 780K is used to detect a touch operation applied thereto or therearound. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation may be provided through the display screen 794. In other embodiments, touch sensor 780K may be disposed on a surface of electronic device 700 at a different location than display screen 794.
Bone conduction sensor 780M may acquire a vibration signal. In some embodiments, bone conduction sensor 780M may acquire a vibration signal of a human vocal part vibrating a bone mass. The bone conduction sensor 780M may also contact the human body pulse to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 780M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 770 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 780M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 780M, so as to realize a heart rate detection function.
The keys 790 include a power-on key, a volume key, and the like. Keys 790 may be mechanical keys. Or may be touch keys. The electronic device 700 may receive a key input, generate a key signal input related to user setting and function control of the electronic device 700.
The motor 791 may generate a vibration indication. The motor 791 may be used for incoming call vibration prompting as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 791 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 794. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 792 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 795 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic device 700 by being inserted into the SIM card interface 795 or being pulled out of the SIM card interface 795. The electronic device 700 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 795 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 795 may be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 795 may also be compatible with different types of SIM cards. The SIM card interface 795 may also be compatible with an external memory card. The electronic device 700 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 700 employs esims, namely: an embedded SIM card. The eSIM card may be embedded in the electronic device 700 and may not be separated from the electronic device 700.
It is understood that the electronic device includes hardware structures and/or software modules for performing the functions in order to realize the functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
In the embodiment of the present application, the electronic device and the like may be divided into functional modules according to the method example, for example, each functional module may be divided according to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
Each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or all or part of the technical solutions may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor 710 to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (14)

1. A log reporting method is applied to a first electronic device, wherein the first electronic device and a second electronic device are in a service connection state, and the first electronic device and the second electronic device prohibit log reporting, and the method comprises the following steps:
generating a first fault code corresponding to a detected fault event in response to the fault event; wherein the first fault code comprises a first type and a second type;
counting the frequency of the first type fault event, and starting log reporting based on the frequency;
and generating a first log based on the first fault code of the first type, and sending the first log to a server to complete reporting of the log, wherein the first log comprises a service flow identity, and the service flow identity is used for identifying a service flow direction between the first electronic device and the second electronic device.
2. The method of claim 1, wherein sending the first log to a server comprises:
and sending the first log to a server based on a preset log sampling rate.
3. The method of claim 1, wherein sending the first log to a server comprises:
adjusting a preset log sampling rate based on the frequency of the first type of fault event;
sending the first log to a server based on the adjusted log sampling rate.
4. The method of claim 1, further comprising:
and receiving a second log sent by the second electronic device, and sending the second log to the server, wherein the second log is generated by the second electronic device based on a second fault code of the first type, and the second fault code is generated by the second electronic device based on the detected fault event.
5. The method of claim 1, wherein after generating a first fault code corresponding to the fault event in response to the detected fault event, the method further comprises:
and responding to a first operation of a user, generating a first log based on the first fault code of the first type, and sending the first log to a server.
6. The method of claim 4, further comprising:
responding to a second operation of the user, sending a log request to the second electronic device, so that the second electronic device sends the second log to the first electronic device or sends the second log to the server.
7. A first electronic device, comprising: a memory for storing computer program code, the computer program code comprising instructions that, when read from the memory by the first electronic device, cause the first electronic device to perform the steps of:
generating a first fault code corresponding to a detected fault event in response to the fault event; wherein the first fault code comprises a first type and a second type;
counting the frequency of the first type fault event, and starting log reporting based on the frequency;
and generating a first log based on the first fault code of the first type, and sending the first log to a server to complete reporting of the log, wherein the first log comprises a service flow identity, and the service flow identity is used for identifying a service flow direction between the first electronic device and the second electronic device.
8. The first electronic device of claim 7, wherein the instructions, when executed by the first electronic device, cause the first electronic device to perform the step of sending the first log to a server comprises:
sending the first log to a server based on a preset log sampling rate.
9. The first electronic device of claim 7, wherein the instructions, when executed by the first electronic device, cause the first electronic device to perform the step of sending the first log to a server comprises:
adjusting a preset log sampling rate based on the frequency of the first type of fault event;
sending the first log to a server based on the adjusted log sampling rate.
10. The first electronic device of claim 7, wherein the instructions, when executed by the first electronic device, cause the first electronic device to further perform the steps of:
and receiving a second log sent by the second electronic device, and sending the second log to the server, wherein the second log is generated by the second electronic device based on a second fault code of the first type, and the second fault code is generated by the second electronic device based on the detected fault event.
11. The first electronic device of claim 7, wherein the instructions, when executed by the first electronic device, cause the first electronic device to, after performing the step of generating a first fault code corresponding to the fault event in response to the detected fault event, further perform the steps of:
and responding to a first operation of a user, generating a first log based on the first fault code of the first type, and sending the first log to a server.
12. The first electronic device of claim 10, wherein the instructions, when executed by the first electronic device, cause the first electronic device to further perform the steps of:
responding to a second operation of the user, sending a log request to the second electronic device, so that the second electronic device sends the second log to the first electronic device or sends the second log to the server.
13. A computer readable storage medium comprising computer instructions which, when run on the first electronic device, cause the first electronic device to perform the method of log reporting according to any one of claims 1-6.
14. A computer program product, which, when run on a computer, causes the computer to perform a method of log reporting according to any one of claims 1 to 6.
CN202011086158.7A 2020-10-12 2020-10-12 Log reporting method, electronic equipment and storage medium Active CN114422340B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011086158.7A CN114422340B (en) 2020-10-12 2020-10-12 Log reporting method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011086158.7A CN114422340B (en) 2020-10-12 2020-10-12 Log reporting method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114422340A true CN114422340A (en) 2022-04-29
CN114422340B CN114422340B (en) 2023-10-10

Family

ID=81260427

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011086158.7A Active CN114422340B (en) 2020-10-12 2020-10-12 Log reporting method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114422340B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116049112A (en) * 2022-05-19 2023-05-02 荣耀终端有限公司 Method and system for reporting multi-device log
CN116225855A (en) * 2023-05-10 2023-06-06 荣耀终端有限公司 Log generation method, electronic equipment and storage medium
CN116662129A (en) * 2022-11-02 2023-08-29 荣耀终端有限公司 Log acquisition method, device, chip, electronic equipment and medium
CN117135263A (en) * 2023-02-16 2023-11-28 荣耀终端有限公司 Log information acquisition method and electronic equipment
CN117687880A (en) * 2023-08-03 2024-03-12 荣耀终端有限公司 Log processing method and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04117854A (en) * 1990-09-07 1992-04-17 Nec Corp Intermittent fault detection system by network management system
CN101505245A (en) * 2009-03-06 2009-08-12 成都市华为赛门铁克科技有限公司 Method and apparatus for sending log information
CN101616235A (en) * 2009-07-17 2009-12-30 中兴通讯股份有限公司 A kind of V.21 targeting signal detection method
CN105868040A (en) * 2016-03-29 2016-08-17 Tcl通力电子(惠州)有限公司 Log collection method and collection terminal
CN106341259A (en) * 2016-08-26 2017-01-18 乐视控股(北京)有限公司 Fault information report method and device
CN108280011A (en) * 2018-01-16 2018-07-13 北京小米移动软件有限公司 Daily record grasping means and device
CN108768752A (en) * 2018-06-25 2018-11-06 华为技术有限公司 fault locating method, device and system
CN110995468A (en) * 2019-11-13 2020-04-10 上海钧正网络科技有限公司 System fault processing method, device, equipment and storage medium of system to be analyzed
CN111343326A (en) * 2020-04-22 2020-06-26 Oppo广东移动通信有限公司 Method and related device for acquiring test log

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04117854A (en) * 1990-09-07 1992-04-17 Nec Corp Intermittent fault detection system by network management system
CN101505245A (en) * 2009-03-06 2009-08-12 成都市华为赛门铁克科技有限公司 Method and apparatus for sending log information
CN101616235A (en) * 2009-07-17 2009-12-30 中兴通讯股份有限公司 A kind of V.21 targeting signal detection method
CN105868040A (en) * 2016-03-29 2016-08-17 Tcl通力电子(惠州)有限公司 Log collection method and collection terminal
CN106341259A (en) * 2016-08-26 2017-01-18 乐视控股(北京)有限公司 Fault information report method and device
CN108280011A (en) * 2018-01-16 2018-07-13 北京小米移动软件有限公司 Daily record grasping means and device
CN108768752A (en) * 2018-06-25 2018-11-06 华为技术有限公司 fault locating method, device and system
CN110995468A (en) * 2019-11-13 2020-04-10 上海钧正网络科技有限公司 System fault processing method, device, equipment and storage medium of system to be analyzed
CN111343326A (en) * 2020-04-22 2020-06-26 Oppo广东移动通信有限公司 Method and related device for acquiring test log

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116049112A (en) * 2022-05-19 2023-05-02 荣耀终端有限公司 Method and system for reporting multi-device log
CN116049112B (en) * 2022-05-19 2024-07-30 荣耀终端有限公司 Method and system for reporting multi-device log
CN116662129A (en) * 2022-11-02 2023-08-29 荣耀终端有限公司 Log acquisition method, device, chip, electronic equipment and medium
CN117135263A (en) * 2023-02-16 2023-11-28 荣耀终端有限公司 Log information acquisition method and electronic equipment
CN117135263B (en) * 2023-02-16 2024-06-07 荣耀终端有限公司 Log information acquisition method, electronic device and computer readable storage medium
CN116225855A (en) * 2023-05-10 2023-06-06 荣耀终端有限公司 Log generation method, electronic equipment and storage medium
CN116225855B (en) * 2023-05-10 2023-09-12 荣耀终端有限公司 Log generation method, electronic equipment and storage medium
CN117687880A (en) * 2023-08-03 2024-03-12 荣耀终端有限公司 Log processing method and device

Also Published As

Publication number Publication date
CN114422340B (en) 2023-10-10

Similar Documents

Publication Publication Date Title
CN112289313A (en) Voice control method, electronic equipment and system
CN114422340B (en) Log reporting method, electronic equipment and storage medium
CN110557740A (en) Electronic equipment control method and electronic equipment
CN113490291B (en) Data downloading method and device and terminal equipment
WO2022022319A1 (en) Image processing method, electronic device, image processing system and chip system
CN111865646A (en) Terminal upgrading method and related device
CN113225661A (en) Loudspeaker identification method and device and electronic equipment
US20240338163A1 (en) Multi-screen unlocking method and electronic device
CN113343193A (en) Identity verification method and device and electronic equipment
WO2020051852A1 (en) Method for recording and displaying information in communication process, and terminals
CN114490174A (en) File system detection method, electronic device and computer readable storage medium
WO2022199613A1 (en) Method and apparatus for synchronous playback
CN112099741A (en) Display screen position identification method, electronic device and computer readable storage medium
CN114338913B (en) Fault diagnosis method, electronic device and readable storage medium
CN114554012A (en) Incoming call answering method, electronic equipment and storage medium
CN115412678B (en) Exposure processing method and device and electronic equipment
CN111935705A (en) Data service management method and device, computer readable medium and terminal equipment
US12098978B2 (en) Method and system for measuring motor damping
CN113901485A (en) Application program loading method, electronic device and storage medium
CN115706755A (en) Echo cancellation method, electronic device, and storage medium
CN115393676A (en) Gesture control optimization method and device, terminal and storage medium
CN114466238A (en) Frame demultiplexing method, electronic device and storage medium
CN114157412A (en) Information verification method, electronic device and computer readable storage medium
CN111432156A (en) Image processing method and device, computer readable medium and terminal equipment
CN113364067B (en) Charging precision calibration method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant