CN112350861A - Log obtaining method and device, computer equipment and storage medium - Google Patents

Log obtaining method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112350861A
CN112350861A CN202011181003.1A CN202011181003A CN112350861A CN 112350861 A CN112350861 A CN 112350861A CN 202011181003 A CN202011181003 A CN 202011181003A CN 112350861 A CN112350861 A CN 112350861A
Authority
CN
China
Prior art keywords
log
communication module
target communication
bridge port
debugging bridge
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
CN202011181003.1A
Other languages
Chinese (zh)
Other versions
CN112350861B (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.)
Fibocom Wireless Inc
Original Assignee
Fibocom Wireless Inc
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 Fibocom Wireless Inc filed Critical Fibocom Wireless Inc
Priority to CN202011181003.1A priority Critical patent/CN112350861B/en
Publication of CN112350861A publication Critical patent/CN112350861A/en
Application granted granted Critical
Publication of CN112350861B publication Critical patent/CN112350861B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a log obtaining method and device, computer equipment and a storage medium. The method comprises the following steps: receiving a log acquisition request which is sent by a client based on a second debugging bridge port and aims at a target communication module through a first debugging bridge port of the target communication module; sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port; acquiring decoding information matched with the log acquisition request through the log service application, and decoding an initial log file of the target communication module, which is appointed to be acquired by the log acquisition request, according to the decoding information to generate a log in accordance with an expected format; the expected format is a format supported by the client; and returning the log which accords with the expected format to a second debugging bridge port of the client based on the first debugging bridge port. By adopting the method, the effective log can be read.

Description

Log obtaining method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a log obtaining method and apparatus, a computer device, and a storage medium.
Background
With the development of communication technology, people have higher and higher requirements on communication equipment. In accelerating the development of communication devices, people in the related art generally need to know the current status of modules in the communication devices by reading the relevant logs of the modules in the communication devices.
In the traditional method, a file containing a log capturing instruction is sent to a module in the communication equipment through a diagnosis port for interaction so as to obtain a log file returned by the module in the communication equipment. However, the situation that partial content of the log captured by the method cannot be analyzed exists at present, and the situation that a worker knows and analyzes the current state of the module in the communication equipment is greatly hindered. Therefore, how to read the effective log is a problem to be solved urgently.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a log obtaining method, apparatus, computer device and storage medium capable of reading a valid log in response to the above technical problem.
A method of log retrieval, the method comprising:
receiving a log acquisition request which is sent by a client based on a second debugging bridge port and aims at a target communication module through a first debugging bridge port of the target communication module;
sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port;
acquiring decoding information matched with the log acquisition request through the log service application, and decoding an initial log file of the target communication module, which is appointed to be acquired by the log acquisition request, according to the decoding information to generate a log in accordance with an expected format; the expected format is a format supported by the client;
and returning the log which accords with the expected format to a second debugging bridge port of the client based on the first debugging bridge port.
In one embodiment, the receiving, by a first debug bridge port of a target communication module, a log obtaining request sent by a client based on a second debug bridge port and directed to the target communication module includes:
receiving a log acquisition request aiming at a target communication module, which is forwarded by a debugging bridge process, through a daemon process in the target communication module based on forwarding connection with the debugging bridge process at a PC (personal computer) end; the log obtaining request is sent to a second debugging bridge port by a client in the PC terminal based on second socket connection, and then is monitored and forwarded by the debugging bridge process;
and sending the log acquisition request to the first debugging bridge port through a daemon process of the target communication module.
In one embodiment, the sending the log obtaining request to a log service application in the target communication module through the first debug bridge port includes:
and sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port based on first socket connection.
In one embodiment, the client is a log capture tool operated by the PC, and the second socket connection is established between the log capture tool and the second debug bridge port;
the method further comprises the following steps:
starting a log tool in the target communication module as a log service application;
establishing a first socket connection between the log service application and the first debug bridge port.
An apparatus for log retrieval, the apparatus comprising:
the receiving module is used for receiving a log obtaining request which is sent by a client based on a second debugging bridge port and aims at the target communication module through a first debugging bridge port of the target communication module;
the sending module is used for sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port;
a generating module, configured to obtain, through the log service application, decoding information matched with the log obtaining request, and decode, according to the decoding information, an initial log file of the target communication module specified and obtained by the log obtaining request, to generate a log conforming to an expected format; the expected format is a format supported by the client;
the sending module is further configured to return the log conforming to the expected format to a second debugging bridge port of the client based on the first debugging bridge port.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving a log acquisition request which is sent by a client based on a second debugging bridge port and aims at a target communication module through a first debugging bridge port of the target communication module;
sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port;
acquiring decoding information matched with the log acquisition request through the log service application, and decoding an initial log file of the target communication module, which is appointed to be acquired by the log acquisition request, according to the decoding information to generate a log in accordance with an expected format; the expected format is a format supported by the client;
and returning the log which accords with the expected format to a second debugging bridge port of the client based on the first debugging bridge port.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a log acquisition request which is sent by a client based on a second debugging bridge port and aims at a target communication module through a first debugging bridge port of the target communication module;
sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port;
acquiring decoding information matched with the log acquisition request through the log service application, and decoding an initial log file of the target communication module, which is appointed to be acquired by the log acquisition request, according to the decoding information to generate a log in accordance with an expected format; the expected format is a format supported by the client;
and returning the log which accords with the expected format to a second debugging bridge port of the client based on the first debugging bridge port.
According to the log obtaining method and device, the computer equipment and the storage medium, the target communication module receives the log obtaining request which is sent by the client based on the second debugging bridge port and aims at the target communication module through the first debugging bridge port. Namely, the transparent transmission between the target communication module and the client is realized based on the debugging bridge port. In a target communication module, sending the log obtaining request to the log service application in the target communication module so as to obtain the decoding information matched with the log obtaining request from the log service application, and decoding the initial log file of the target communication module obtained by the log obtaining request according to the decoding information to generate a log conforming to the expected format. That is, the log service application is provided in the target communication module to decode the original log, thereby obtaining a log in a format that can be supported by the client. And then, returning the log which accords with the expected format to the client through the debugging bridge port transparent transmission. Therefore, the effective log of the target communication module can be read by the client through the transparent transmission of the debugging bridge port and the decoding of the log service application in the target communication module.
A method of log retrieval, the method comprising:
generating a log acquisition request aiming at a target communication module according to a preset protocol instruction and a configuration file;
sending the log obtaining request to a first debugging bridge port of the target communication module based on a second debugging bridge port of a PC (personal computer) end;
receiving the log of the target communication module which is in accordance with the expected format and returned by aiming at the log obtaining request;
wherein the expected format is a format supported by the client; and the returned log is generated after the log service application in the target communication module acquires decoding information matched with the log acquisition request and decodes the initial log file of the target communication module according to the decoding information.
In one embodiment, the method further comprises:
when the target communication module is loaded to the PC end after being successfully started and the candidate debugging bridge port of the target communication module is available, then
Appointing the first debugging bridge port and a second debugging bridge port of the client from the candidate debugging bridge ports; the first debugging bridge port and the second debugging bridge port are debugging bridge ports for data forwarding;
and when the candidate debugging bridge port is unavailable, issuing a restart instruction to the target communication module to indicate the target communication module to restart.
An apparatus for log retrieval, the apparatus comprising:
the generating module is used for generating a log obtaining request aiming at the target communication module according to a preset protocol instruction and a configuration file;
the sending module is used for sending the log obtaining request to a first debugging bridge port of the target communication module based on a second debugging bridge port of a PC (personal computer) terminal;
the receiving module is used for receiving the log of the target communication module which is returned by aiming at the log obtaining request and accords with the expected format; wherein the expected format is a format supported by the client; and the returned log is generated after the log service application in the target communication module acquires decoding information matched with the log acquisition request and decodes the initial log file of the target communication module according to the decoding information.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
generating a log acquisition request aiming at a target communication module according to a preset protocol instruction and a configuration file;
sending the log obtaining request to a first debugging bridge port of the target communication module based on a second debugging bridge port of a PC (personal computer) end;
receiving the log of the target communication module which is in accordance with the expected format and returned by aiming at the log obtaining request;
wherein the expected format is a format supported by the client; and the returned log is generated after the log service application in the target communication module acquires decoding information matched with the log acquisition request and decodes the initial log file of the target communication module according to the decoding information.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
generating a log acquisition request aiming at a target communication module according to a preset protocol instruction and a configuration file;
sending the log obtaining request to a first debugging bridge port of the target communication module based on a second debugging bridge port of a PC (personal computer) end;
receiving the log of the target communication module which is in accordance with the expected format and returned by aiming at the log obtaining request;
wherein the expected format is a format supported by the client; and the returned log is generated after the log service application in the target communication module acquires decoding information matched with the log acquisition request and decodes the initial log file of the target communication module according to the decoding information.
According to the log obtaining method, the log obtaining device, the computer equipment and the storage medium, the log obtaining request aiming at the target communication module is generated according to the preset protocol instruction and the configuration file. And then, based on a second debugging bridge port of the client, sending the log obtaining request to a first debugging bridge port of the target communication module. And sending the log obtaining request to a first debugging bridge port of the target communication module through a second debugging bridge port of the client, and successfully transmitting the log obtaining request to the target communication module. And finally, the client receives the effective log which is returned by the log service application of the target communication module aiming at the log obtaining request and conforms to the expected format. Therefore, the client in the PC side reads the effective log of the target communication module by the transparent transmission of the debugging bridge port and the decoding of the log by the log service application in the target communication module.
Drawings
FIG. 1 is a diagram of an application environment of a log retrieval method in one embodiment;
FIG. 2 is a flowchart illustrating a log retrieval method according to one embodiment;
FIG. 3 is a system diagram of a log retrieval method in one embodiment;
FIG. 4 is a flowchart illustrating a log retrieval method according to another embodiment;
FIG. 5 is a block diagram showing the structure of a log obtaining apparatus according to an embodiment;
FIG. 6 is a system flow diagram of a log retrieval method in one embodiment;
FIG. 7 is a block diagram showing the structure of a log obtaining apparatus according to an embodiment;
FIG. 8 is a diagram illustrating an internal structure of a computer device in one embodiment;
fig. 9 is an internal structural view of a computer device in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The log obtaining method provided by the application can be applied to the application environment shown in fig. 1. The PC terminal 102 is connected to and communicates with the target communication module 104. The PC terminal 102 may be, but is not limited to, various personal computers, notebook computers, tablet computers, etc., and the target communication module 104 is a device with modem function.
In one embodiment, as shown in fig. 2, a log obtaining method is provided, which is described by taking the method as an example applied to the target communication module 104 in fig. 1, and includes the following steps:
step 202, receiving a log obtaining request, which is sent by the client based on the second debugging bridge port and aims at the target communication module, through the first debugging bridge port of the target communication module.
The target communication module is a communication module from which the PC terminal wants to obtain a valid log. And the first debugging bridge port is a debugging bridge port of the target communication module and is used for carrying out data interaction with the client. And the second debugging bridge port is a debugging bridge port corresponding to the client in the PC terminal and is used for carrying out data interaction with the target communication module. The log obtaining request comprises a specific instruction and a specific file and is used for sending the specific instruction and the specific file to the target communication module to obtain the corresponding log. And the client is an application which is operated by the PC end and is used for generating the log acquisition request.
Specifically, the client sends a log obtaining request to the target communication module based on the second debugging bridge port. And the target communication module receives a log acquisition request sent by the client based on the second debugging bridge port through the first debugging bridge port.
In one embodiment, the target communication module may be a 5G (5 th generation mobile networks) module, which is a key component of the bearer terminal access network.
In one embodiment, the target communication module may be a device including one or more modules of communication technologies, such as a combination of a 5G communication module with modem functionality and a 4G communication module.
In an embodiment, as shown in the system block diagram of the log obtaining method in fig. 3, the client sends a log obtaining request to the target communication module based on the second debug bridge port, that is, "the client: i want logs that i can read ". And the target communication module receives a log acquisition request sent by the client based on the second debugging bridge port through the first debugging bridge port.
In one embodiment, the client may be "diaggrab" software, or may be other software capable of generating a log acquisition request for the target communication module and receiving a log of the target communication module.
And step 204, sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port.
The log service application is an application in the target communication module and is used for generating a corresponding log according to the log obtaining request.
Specifically, the target communication module sends the log obtaining request to a log service application of the target communication module through the first debugging bridge port.
In one embodiment, as shown in the system block diagram of the log obtaining method in fig. 3, the target communication module sends a log obtaining request (i.e., "the client: the log that i want to be able to read") to the log service application of the target communication module through the first debug bridge port.
In one embodiment, the logging tool in the target communication module may be used as a logging service application, or other software, as long as it can return the log in the format supported by the client according to the log obtaining request, and the log may be used as the logging service application. In one embodiment, the logging tool, may be a "diag _ mdlog" tool.
Step 206, obtaining decoding information matched with the log obtaining request through log service application, decoding an initial log file of the target communication module appointed and obtained by the log obtaining request according to the decoding information, and generating a log conforming to an expected format; the desired format is a format supported by the client.
The decoding information is information used for decoding the initial log file. The initial log file is a log file to be converted into a format supported by the client.
Specifically, the target communication module acquires the decoding information matched with the log acquisition request through the log service application. Then, the target communication module decodes the initial log file of the target communication module specified by the log acquisition request according to the decoding information, and generates a log conforming to the desired format.
And step 208, returning the log which accords with the expected format to a second debugging bridge port of the client based on the first debugging bridge port.
Specifically, the target communication module returns the log conforming to the expected format to the second debugging bridge port of the client through the first debugging bridge port. The client can receive the log which accords with the expected format based on the second debugging bridge port, and the log which accords with the expected format is the log of the format supported by the client, so that the client can completely and effectively read the log in the target communication module.
According to the log obtaining method and device, the computer equipment and the storage medium, the target communication module receives the log obtaining request which is sent by the client based on the second debugging bridge port and aims at the target communication module through the first debugging bridge port. Namely, the transparent transmission between the target communication module and the client is realized based on the debugging bridge port. In a target communication module, sending the log obtaining request to the log service application in the target communication module so as to obtain the decoding information matched with the log obtaining request from the log service application, and decoding the initial log file of the target communication module obtained by the log obtaining request according to the decoding information to generate a log conforming to the expected format. That is, the log service application is provided in the target communication module to decode the original log, thereby obtaining a log in a format that can be supported by the client. And then, returning the log which accords with the expected format to the client through the debugging bridge port transparent transmission. Therefore, the effective log of the target communication module can be read by the client through the transparent transmission of the debugging bridge port and the decoding of the log service application in the target communication module.
In one embodiment, the receiving, by a first debug bridge port of a target communication module, a log obtaining request sent by a client based on a second debug bridge port for the target communication module includes: receiving a log acquisition request aiming at the target communication module, which is forwarded by a debugging bridge process, based on forwarding connection with the debugging bridge process of the PC terminal through a daemon process in the target communication module; the log obtaining request is sent to a second debugging bridge port by a client in the PC side based on second socket connection, and then is monitored and forwarded by the debugging bridge process; and sending the log acquisition request to the first debugging bridge port through the daemon process of the target communication module.
The daemon process is a process corresponding to the first debugging bridge port of the target communication module and is used for establishing the first debugging bridge port of the target communication module, monitoring the first debugging bridge port and performing data interaction with a client side in the PC side through the first debugging bridge port. And the debugging bridge process is a process corresponding to a second debugging bridge port of the client, is used for establishing the second debugging bridge port of the client in the PC terminal, monitors the second debugging bridge port and performs data interaction with the target communication module through the second debugging bridge port. And the second socket connection is the connection for the communication between the second debugging bridge port corresponding to the debugging bridge process and the client in the PC end.
Specifically, the client in the PC side sends the log acquisition request to a second debugging bridge port monitored by a debugging bridge process in the PC side based on the second socket connection. And the debugging bridge process in the PC terminal monitors that the second debugging bridge port has the transmitted log acquisition request, and further transmits the log acquisition request to the first debugging bridge port monitored by the daemon process of the target communication module through the second debugging bridge port. The daemon process in the target communication module monitors the first debugging bridge port, and a log acquisition request which is sent by the debugging bridge process in the PC end through the second debugging bridge port and aims at the target communication module is received through the first debugging bridge port.
In this embodiment, the client in the PC side is connected through the second socket, and sends the log obtaining request to the second debugging bridge port monitored by the debugging bridge process, and the debugging bridge process further sends the log obtaining request to the first debugging bridge port monitored by the daemon of the target communication module through the second debugging bridge port. And a daemon process in the target communication module monitors that the first debugging bridge port has a log obtaining request, and receives the log obtaining request through the first debugging bridge port. Therefore, the log obtaining request of the client in the PC terminal is successfully sent to the first debugging bridge port of the target communication module from the second debugging bridge port.
In one embodiment, sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port includes: and sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port based on the first socket connection.
The first socket connection is the connection of the first debugging bridge port corresponding to the daemon process of the target communication module and the log service application of the target communication module for communication.
Specifically, in the target communication module, a first socket connection is established in advance between the log service application and the first debugging bridge port. And the daemon process in the target communication module sends the log acquisition request aiming at the target communication module, which is received through the first debugging bridge port, to the log service application of the target communication module on the basis of the first socket connection.
In one embodiment, as shown in the system block diagram of the log obtaining method in fig. 3, based on the first socket connection, the daemon process in the target communication module obtains the log obtaining request for the target communication module, which is received through the first debug bridge port, that is, "client: the log which I want to read is sent to the log service application of the target communication module.
In this embodiment, the first debugging bridge port corresponding to the daemon process in the target communication module is directly connected to the log service application based on the first socket connection, so that the log acquisition request received by the first debugging bridge port corresponding to the daemon process in the target communication module is successfully sent to the log service application of the target communication module.
In one embodiment, the client is a log capture tool run by the PC, and the second socket connection is established between the log capture tool and the second debug bridge port. The method further comprises the following steps: starting a log tool in the target communication module as a log service application; a first socket connection is established between the log service application and the first debug bridge port.
The logging tool is a tool inside the target communication module, and is used as a logging service application in the present case. The log grabbing tool is a log grabbing tool of the PC terminal. It is to be understood that the log scraping tool may be implemented as a client.
Specifically, a log tool is started in the target communication module as a log service application, and a first socket connection is established at a first debugging bridge port corresponding to the log service application and a daemon process in the target communication module. And running a log grabbing tool at the PC end, and establishing a second socket connection between the log grabbing tool and the second debugging bridge port.
In this embodiment, by establishing the first socket connection at the first debugging bridge port corresponding to the daemon process in the log service application and the target communication module, it can be achieved that data is transmitted to the log service application in the target communication module through the first debugging bridge port corresponding to the daemon process in the target communication module.
In an embodiment, as shown in fig. 4, a log obtaining method is provided, which is described by taking the method as an example applied to the PC terminal 102 in fig. 1, and includes the following steps:
step 402, generating a log acquisition request for the target communication module according to a preset protocol instruction and a configuration file.
The preset protocol command is a group of commands which accord with a preset protocol of the target communication module and the client. And the configuration file is configured according to the format supported by the client and is used for storing the relevant settings of the client.
Specifically, the client generates a log acquisition request for the target communication module according to a preset protocol instruction and a configuration file.
And step 404, sending a log obtaining request to the first debugging bridge port of the target communication module based on the second debugging bridge port of the PC terminal.
Specifically, the client in the PC side sends the log obtaining request generated by the log capture tool to the second debugging bridge port monitored by the debugging bridge process in the PC side based on the second socket connection. And the debugging bridge process in the PC terminal monitors the log acquisition request sent by the log grabbing tool at the second debugging bridge port, and the client side in the PC terminal further sends the log acquisition request to the first debugging bridge port monitored by the daemon process of the target communication module through the second debugging bridge port.
Step 406, receiving a log of the target communication module which is returned by aiming at the log obtaining request and accords with the expected format; wherein the expected format is a format supported by the client; and the returned log is generated after the log service application in the target communication module acquires the decoding information matched with the log acquisition request and decodes the initial log file of the target communication module according to the decoding information.
Specifically, a daemon process in the target communication module receives a log acquisition request through a first debugging bridge port. Further, the target communication module sends the log obtaining request to a log service application in the target communication module based on the first socket connection. And the log service application in the target communication module receives the log acquisition request and inquires matched decoding information according to the log acquisition request. After the log service application in the target communication module inquires decoding information matched with the log obtaining request, decoding an initial log file of the target communication module according to the decoding information to generate a log in a format supported by the client. And the log service application in the target communication module returns the log in the format supported by the client to the first debugging bridge port based on the first socket connection. And the daemon process in the target communication module sends the log of the format supported by the client to a second debugging bridge port of the client through the first debugging bridge port. And the debugging bridge process at the PC end monitors that the second debugging bridge port has the log which is sent by the daemon process in the target communication module and accords with the expected format through the first debugging bridge port, and then receives the log which is returned by aiming at the log obtaining request and accords with the target communication module in the expected format through the second debugging bridge port.
According to the log obtaining method, the log obtaining device, the computer equipment and the storage medium, the log obtaining request aiming at the target communication module is generated according to the preset protocol instruction and the configuration file. And then, based on a second debugging bridge port of the client, sending the log obtaining request to a first debugging bridge port of the target communication module. And sending the log obtaining request to a first debugging bridge port of the target communication module through a second debugging bridge port of the client, and successfully transmitting the log obtaining request to the target communication module. And finally, the client receives the effective log which is returned by the log service application of the target communication module aiming at the log obtaining request and conforms to the expected format. Therefore, the client in the PC side reads the effective log of the target communication module by the transparent transmission of the debugging bridge port and the decoding of the log by the log service application in the target communication module.
In one embodiment, the method further comprises: when the target communication module is loaded to the PC terminal after being successfully started and candidate debugging bridge ports of the target communication module are available, a first debugging bridge port and a second debugging bridge port of a specified client are specified from the candidate debugging bridge ports; the first debugging bridge port and the second debugging bridge port are debugging bridge ports for data forwarding; and when the candidate debugging bridge port is unavailable, issuing a restart instruction to the target communication module to indicate the target communication module to restart.
Specifically, the PC side is connected with the target communication module for communication. And the PC end loads the drive of the target communication module and controls the target communication module through the drive. And when the PC terminal confirms that the candidate debugging bridge ports of the target communication module are available, the first debugging bridge port of the target communication module for performing data interaction with the second debugging bridge port of the client is appointed from the candidate debugging bridge ports. And when the PC terminal confirms that the candidate debugging bridge port is unavailable, issuing a restart instruction to the target communication module to indicate the target communication module to restart.
In one embodiment, the PC side can communicate with the target communication module connection through USB.
In one embodiment, as shown in the system block diagram of the log obtaining method in fig. 3, the PC side is connected and communicates with the target communication module, i.e., "debug bridge forwarding".
In one embodiment, the target communication module is initiated as shown in the system flow diagram of the log retrieval method of FIG. 5. And the PC terminal loads the drive of the target communication module and further detects whether the candidate debugging bridge port of the target communication module is available. When the PC end detects that the candidate debugging bridge ports of the target communication module are available, a first debugging bridge port of the target communication module for data interaction with a second debugging bridge port of the client is appointed from the candidate debugging bridge ports, namely, the first debugging bridge port is appointed and the second debugging bridge port is appointed.
In one embodiment, as shown in the system flowchart of the log obtaining method in fig. 5, the log service application inside the target communication module is started, i.e., "start log service application". The target communication module is connected with the client of the PC end through the first socket connection, the appointed first debugging bridge port, the appointed second debugging bridge port and the second socket connection, namely the connection is established when the PC end runs the client. And the PC side confirms the appointed first debugging bridge port and the appointed second debugging bridge port, and still detects the failure of the whole communication connection of the system, and sends a restart instruction to restart the log service application in the target communication module.
In this embodiment, data interaction between the PC side and the target communication module can be realized by designating the second debugging bridge port of the client side and designating the first debugging bridge port of the target communication module that interacts data with the second debugging bridge port by the PC side.
In one embodiment, when the PC detects that the log capture tool of the client is in the off state, the PC disconnects the communication connection between the first debug bridge port and the second debug bridge port.
In an embodiment, as shown in the system flowchart of the log obtaining method in fig. 5, when the client in the PC captures the log of the target communication module, that is, "obtain the log", the operation of the log capture tool is stopped, the state is turned off, and the communication connection between the first debug bridge port and the second debug bridge port is disconnected, that is, "disconnect".
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts in the embodiments of the present application may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
In one embodiment, as shown in fig. 6, there is provided a log obtaining apparatus 600, including: a receiving module 602, a sending module 604, and a generating module 606, wherein:
the receiving module 602 is configured to receive, through a first debug bridge port of the target communication module, a log obtaining request, which is sent by the client based on a second debug bridge port and is addressed to the target communication module, by the client. The sending module 604 is configured to send the log obtaining request to a log service application in the target communication module through the first debug bridge port.
A generating module 606, configured to obtain, through the log service application, decoding information matched with the log obtaining request, and according to the decoding information, decode an initial log file of the target communication module specified and obtained by the log obtaining request, and generate a log conforming to an expected format; the desired format is a format supported by the client.
The sending module 604 is further configured to return a log conforming to the expected format to a second debugging bridge port of the client based on the first debugging bridge port.
In one embodiment, the receiving module 602 is further configured to receive, through a daemon process in the target communication module, a log obtaining request for the target communication module, which is forwarded by a debugging bridge process, based on a forwarding connection with the debugging bridge process at the PC side; the log obtaining request is sent to a second debugging bridge port by a client in the PC side based on second socket connection, and then is monitored and forwarded by the debugging bridge process; and sending the log acquisition request to the first debugging bridge port through the daemon process of the target communication module.
In one embodiment, the receiving module 602 is further configured to send the log obtaining request to a log service application in the target communication module through the first debug bridge port based on the first socket connection.
In one embodiment, the generation module 606 is further configured to launch a logging tool as a logging service application in the target communication module; a first socket connection is established between the log service application and the first debug bridge port.
In one embodiment, as shown in fig. 7, there is provided a log obtaining apparatus 700, including: a generating module 702, a sending module 704, and a receiving module 706, wherein:
the generating module 702 is configured to generate a log obtaining request for the target communication module according to the preset protocol instruction and the configuration file.
A sending module 704, configured to send a log obtaining request to the first debugging bridge port of the target communication module based on the second debugging bridge port of the PC side.
A receiving module 706, configured to receive a log of the target communication module that conforms to the expected format and is returned according to the log obtaining request; wherein the expected format is a format supported by the client; and the returned log is generated after the log service application in the target communication module acquires the decoding information matched with the log acquisition request and decodes the initial log file of the target communication module according to the decoding information.
In one embodiment, the sending module 704 is further configured to, when the target communication module is loaded to the PC side after being successfully started and candidate debug bridge ports of the target communication module are available, designate a first debug bridge port and a second debug bridge port of the designated client from the candidate debug bridge ports; the first debugging bridge port and the second debugging bridge port are debugging bridge ports for data forwarding; and when the candidate debugging bridge port is unavailable, issuing a restart instruction to the target communication module to indicate the target communication module to restart.
For the specific limitation of the log obtaining device, reference may be made to the above limitation on the log obtaining method, and details are not described herein again. The modules in the log obtaining device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 8. The terminal may be a PC terminal. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a log retrieval method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
In one embodiment, a computer device is provided, which may be a target communication module, the internal structure of which may be as shown in fig. 9. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The nonvolatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a log retrieval method.
Those skilled in the art will appreciate that the configurations shown in fig. 8 and 9 are merely block diagrams of portions of configurations related to aspects of the present application, and do not constitute limitations on the computing devices to which aspects of the present application may be applied, as particular computing devices may include more or fewer components than shown, or combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the log obtaining method of the above-mentioned various embodiments when executing the computer program.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the log obtaining method of the various embodiments described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A log obtaining method, characterized in that the method comprises:
receiving a log acquisition request which is sent by a client based on a second debugging bridge port and aims at a target communication module through a first debugging bridge port of the target communication module;
sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port;
acquiring decoding information matched with the log acquisition request through the log service application, and decoding an initial log file of the target communication module, which is appointed to be acquired by the log acquisition request, according to the decoding information to generate a log in accordance with an expected format; the expected format is a format supported by the client;
and returning the log which accords with the expected format to a second debugging bridge port of the client based on the first debugging bridge port.
2. The method according to claim 1, wherein the receiving, by a first debug bridge port of a target communication module, a log obtaining request sent by a client based on a second debug bridge port for the target communication module comprises:
receiving a log acquisition request aiming at a target communication module, which is forwarded by a debugging bridge process, through a daemon process in the target communication module based on forwarding connection with the debugging bridge process at a PC (personal computer) end; the log obtaining request is sent to a second debugging bridge port by a client in the PC terminal based on second socket connection, and then is monitored and forwarded by the debugging bridge process;
and sending the log acquisition request to the first debugging bridge port through a daemon process of the target communication module.
3. The method of claim 2, wherein sending the log acquisition request to a log service application in the target communication module through the first debug bridge port comprises:
and sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port based on first socket connection.
4. The method of claim 3, wherein the client is a log grabber executed by the PC, and the second socket connection is established between the log grabber and the second debug bridge port;
the method further comprises the following steps:
starting a log tool in the target communication module as a log service application;
establishing a first socket connection between the log service application and the first debug bridge port.
5. A log obtaining method, characterized in that the method comprises:
generating a log acquisition request aiming at a target communication module according to a preset protocol instruction and a configuration file;
sending the log obtaining request to a first debugging bridge port of the target communication module based on a second debugging bridge port of a PC (personal computer) end;
receiving the log of the target communication module which is in accordance with the expected format and returned by aiming at the log obtaining request;
wherein the expected format is a format supported by the client; and the returned log is generated after the log service application in the target communication module acquires decoding information matched with the log acquisition request and decodes the initial log file of the target communication module according to the decoding information.
6. The method of claim 5, further comprising:
when the target communication module is loaded to the PC end after being successfully started and the candidate debugging bridge port of the target communication module is available, then
Appointing the first debugging bridge port and a second debugging bridge port of the client from the candidate debugging bridge ports; the first debugging bridge port and the second debugging bridge port are debugging bridge ports for data forwarding;
and when the candidate debugging bridge port is unavailable, issuing a restart instruction to the target communication module to indicate the target communication module to restart.
7. An apparatus for log acquisition, the apparatus comprising:
the receiving module is used for receiving a log obtaining request which is sent by a client based on a second debugging bridge port and aims at the target communication module through a first debugging bridge port of the target communication module;
the sending module is used for sending the log obtaining request to a log service application in the target communication module through the first debugging bridge port;
a generating module, configured to obtain, through the log service application, decoding information matched with the log obtaining request, and decode, according to the decoding information, an initial log file of the target communication module specified and obtained by the log obtaining request, to generate a log conforming to an expected format; the expected format is a format supported by the client;
the sending module is further configured to return the log conforming to the expected format to a second debugging bridge port of the client based on the first debugging bridge port.
8. An apparatus for log acquisition, the apparatus comprising:
the generating module is used for generating a log obtaining request aiming at the target communication module according to a preset protocol instruction and a configuration file;
the sending module is used for sending the log obtaining request to a first debugging bridge port of the target communication module based on a second debugging bridge port of a PC (personal computer) terminal;
the receiving module is used for receiving the log of the target communication module which is returned by aiming at the log obtaining request and accords with the expected format; wherein the expected format is a format supported by the client; and the returned log is generated after the log service application in the target communication module acquires decoding information matched with the log acquisition request and decodes the initial log file of the target communication module according to the decoding information.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202011181003.1A 2020-10-29 2020-10-29 Log acquisition method, device, computer equipment and storage medium Active CN112350861B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011181003.1A CN112350861B (en) 2020-10-29 2020-10-29 Log acquisition method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011181003.1A CN112350861B (en) 2020-10-29 2020-10-29 Log acquisition method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112350861A true CN112350861A (en) 2021-02-09
CN112350861B CN112350861B (en) 2023-06-20

Family

ID=74356967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011181003.1A Active CN112350861B (en) 2020-10-29 2020-10-29 Log acquisition method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112350861B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113192232A (en) * 2021-03-15 2021-07-30 深圳市广通远驰科技有限公司 Log acquisition method and log acquisition system
CN113190410A (en) * 2021-05-10 2021-07-30 芯讯通无线科技(上海)有限公司 Log collection method, system, client and storage medium
CN114002987A (en) * 2021-11-03 2022-02-01 杭州和利时自动化有限公司 Method, device, electronic equipment and medium for acquiring log information
CN114244889A (en) * 2021-12-17 2022-03-25 深圳Tcl新技术有限公司 Log obtaining method, device, terminal, intelligent device and storage medium
CN115209394A (en) * 2022-05-31 2022-10-18 深圳市广和通无线股份有限公司 Log capture method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013038489A1 (en) * 2011-09-13 2013-03-21 株式会社日立製作所 Computer system, management method for client computer, and storage medium
CN106656607A (en) * 2016-12-27 2017-05-10 上海爱数信息技术股份有限公司 Equipment log parsing method and system, and server side having system
CN110519077A (en) * 2019-07-26 2019-11-29 济南浪潮数据技术有限公司 Log acquisition system, method, device, server and storage medium
CN111611138A (en) * 2020-04-10 2020-09-01 深圳市广和通无线股份有限公司 Log data capturing method and device, computer equipment and storage medium
CN111628967A (en) * 2020-04-20 2020-09-04 深圳市广和通无线股份有限公司 Log data transmission method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013038489A1 (en) * 2011-09-13 2013-03-21 株式会社日立製作所 Computer system, management method for client computer, and storage medium
CN106656607A (en) * 2016-12-27 2017-05-10 上海爱数信息技术股份有限公司 Equipment log parsing method and system, and server side having system
CN110519077A (en) * 2019-07-26 2019-11-29 济南浪潮数据技术有限公司 Log acquisition system, method, device, server and storage medium
CN111611138A (en) * 2020-04-10 2020-09-01 深圳市广和通无线股份有限公司 Log data capturing method and device, computer equipment and storage medium
CN111628967A (en) * 2020-04-20 2020-09-04 深圳市广和通无线股份有限公司 Log data transmission method and device, computer equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113192232A (en) * 2021-03-15 2021-07-30 深圳市广通远驰科技有限公司 Log acquisition method and log acquisition system
CN113190410A (en) * 2021-05-10 2021-07-30 芯讯通无线科技(上海)有限公司 Log collection method, system, client and storage medium
CN114002987A (en) * 2021-11-03 2022-02-01 杭州和利时自动化有限公司 Method, device, electronic equipment and medium for acquiring log information
CN114244889A (en) * 2021-12-17 2022-03-25 深圳Tcl新技术有限公司 Log obtaining method, device, terminal, intelligent device and storage medium
CN115209394A (en) * 2022-05-31 2022-10-18 深圳市广和通无线股份有限公司 Log capture method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112350861B (en) 2023-06-20

Similar Documents

Publication Publication Date Title
CN112350861A (en) Log obtaining method and device, computer equipment and storage medium
CN109525990B (en) Wireless screen projection method and device, computer equipment and storage medium
CN107463499B (en) ADB remote connection method, device, equipment and storage medium
US20070130342A1 (en) Allocating management method of computer
US20130318144A1 (en) Network device, system, method, and storage medium
CN113407383B (en) Main and standby system switching method and device, server and main and standby system
CN112506755A (en) Log collection method and device, computer equipment and storage medium
WO2016119623A1 (en) Method and device for realizing network sharing
CN112416698B (en) Expansion method and device of monitoring system, storage medium and electronic equipment
CN112653668A (en) Data interaction method and device, computer equipment and storage medium
CN109474386B (en) Signaling tracking method, system, network element equipment and storage medium
CN108021459B (en) Method and device for sending dotting logs across processes
CN110740447A (en) remote log grabbing method for Android terminal
CN114039760B (en) Security testing method and device, computer equipment and storage medium
CN112287265B (en) Asynchronous event driven based file conversion method and system
CN113098869B (en) Production test method, wireless intelligent device, upper computer, electronic device and medium
CN115118587A (en) Method and device for creating connector
CN112231188A (en) Log capture method and device, computer equipment and storage medium
CN115348305A (en) Connection management method, system, computer device and storage medium
CN114706786A (en) Application program testing method, device, equipment and medium of mobile terminal
CN114619462A (en) Remote desktop control method based on robot flow automation
CN113821390A (en) Switch debugging method and device, server and computer readable storage medium
CN107220149B (en) Method and system for capturing debugging data of wireless communication module in Linux system under Windows
CN111858433A (en) SSH (secure Shell) serial port redirection-based method, system, equipment and medium
CN113132961B (en) Internet of things complete machine equipment debugging method and device, computer equipment and storage medium

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