CN112350861B - Log acquisition method, device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN112350861B
CN112350861B CN202011181003.1A CN202011181003A CN112350861B CN 112350861 B CN112350861 B CN 112350861B CN 202011181003 A CN202011181003 A CN 202011181003A CN 112350861 B CN112350861 B CN 112350861B
Authority
CN
China
Prior art keywords
log
communication module
bridge port
target communication
client
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.)
Active
Application number
CN202011181003.1A
Other languages
Chinese (zh)
Other versions
CN112350861A (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

Abstract

The application relates to a log acquisition method, a log acquisition 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 debug bridge port and aims at a target communication module through the first debug 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 debug 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 which accords with an expected format; the expected format is a format supported by the client; and returning the log meeting the expected format to a second debug bridge port of the client based on the first debug bridge port. By adopting the method, the effective log can be read.

Description

Log acquisition method, device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a log obtaining method, a log obtaining device, a computer device, and a storage medium.
Background
With the development of communication technology, demands for communication devices are increasing. In accelerating the development of communication devices, those skilled in the relevant art often need to know the current status of a module in a communication device by reading the relevant log of the module in the communication device.
The traditional method is that a file containing a log grabbing instruction is sent to a module in the communication equipment through a diagnosis port to interact so as to acquire a log file returned by the module in the communication equipment. However, the current situation that part of the content of the log grabbed by the method cannot be analyzed exists, so that staff is greatly prevented from knowing and analyzing the current state of the module in the communication equipment. Therefore, how to read the valid log is a problem to be solved.
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 an effective log.
A log acquisition method, the method comprising:
receiving a log acquisition request which is sent by a client based on a second debug bridge port and aims at a target communication module through the first debug 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 debug 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 which accords with an expected format; the expected format is a format supported by the client;
and returning the log meeting the expected format to a second debug bridge port of the client based on the first debug bridge port.
In one embodiment, the receiving, by the first debug bridge port of the target communication module, a log obtaining request sent by the client based on the second debug bridge port for the target communication module includes:
receiving a log acquisition request which is forwarded by a debugging bridge process and aims at a target communication module through a daemon process in the target communication module based on forwarding connection between the daemon process and the debugging bridge process of a PC (personal computer) terminal; the log obtaining request is monitored and forwarded by the debugging bridge process after being sent to a second debugging bridge port by a client in the PC terminal based on second socket connection;
And sending the log acquisition request to the first debug bridge port through the daemon of the target communication module.
In one embodiment, the sending, by the first debug bridge port, the log obtaining request to the log service application in the target communication module includes:
and sending the log acquisition request to a log service application in the target communication module based on first socket connection through the first debug bridge port.
In one embodiment, the client is a log grabbing tool operated by the PC, and the second socket connection is established between the log grabbing tool and the second debug bridge port;
the method further comprises the steps of:
starting a log tool in the target communication module to serve as a log service application;
a first socket connection is established between the log service application and the first debug bridge port.
A log acquisition apparatus, the apparatus comprising:
the receiving module is used for receiving a log acquisition request which is sent by the client based on the second debug bridge port and aims at the target communication module through the first debug 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 debug bridge port;
the generation module is used for acquiring decoding information matched with the log acquisition request through the log service application, 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, and generating a log which accords with an expected format; the expected format is a format supported by the client;
the sending module is further configured to return the log meeting the expected format to a second debug bridge port of the client based on the first debug bridge port.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
receiving a log acquisition request which is sent by a client based on a second debug bridge port and aims at a target communication module through the first debug 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 debug 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 which accords with an expected format; the expected format is a format supported by the client;
and returning the log meeting the expected format to a second debug bridge port of the client based on the first debug bridge port.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
receiving a log acquisition request which is sent by a client based on a second debug bridge port and aims at a target communication module through the first debug 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 debug 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 which accords with an expected format; the expected format is a format supported by the client;
And returning the log meeting the expected format to a second debug bridge port of the client based on the first debug bridge port.
According to the log obtaining method, the log obtaining 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 is aimed at the target communication module through the first debugging bridge port. Namely, transparent transmission between the target communication module and the client is realized based on the debug bridge port. And in the target communication module, the log acquisition request is sent to the log service application in the target communication module, so that the decoding information matched with the log acquisition request is acquired from the log service application, and the initial log file of the target communication module appointed to be acquired by the log acquisition request is decoded according to the decoding information, so that the log conforming to the expected format is generated. That is, by setting the log service application in the target communication module to decode the original log, a log in a format that can be supported by the client is obtained. And then, the log meeting the expected format is returned to the client through the transparent transmission of the debug bridge port. Therefore, the client can read the effective log of the target communication module by debugging the transparent transmission of the bridge port and combining with the log service application in the target communication module to decode the log.
A log acquisition method, the method comprising:
generating a log acquisition request aiming at the target communication module according to a preset protocol instruction and a configuration file;
based on a second debug bridge port of the PC end, sending the log acquisition request to a first debug bridge port of the target communication module;
receiving a log of the target communication module which is returned by aiming at the log obtaining request and accords with an expected format;
wherein the desired format is a format supported by the client; and the returned log is generated by decoding the initial log file of the target communication module according to the decoding information after the log service application in the target communication module acquires the decoding information matched with the log acquisition request.
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 debug bridge port of the target communication module is available, then
Designating the first debug bridge port and designating a second debug bridge port of the client from the candidate debug bridge ports; the first debug bridge port and the second debug bridge port are debug bridge ports for data forwarding;
And when the candidate debug bridge port is not available, issuing a restarting instruction to the target communication module to instruct the target communication module to restart.
A log acquisition apparatus, the apparatus comprising:
the generation module is used for generating a log acquisition 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 acquisition request to the first debug bridge port of the target communication module based on the second debug bridge port of the PC end;
the receiving module is used for receiving the logs of the target communication module which are returned by the log acquisition request and conform to the expected format; wherein the desired format is a format supported by the client; and the returned log is generated by decoding the initial log file of the target communication module according to the decoding information after the log service application in the target communication module acquires the decoding information matched with the log acquisition request.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
Generating a log acquisition request aiming at the target communication module according to a preset protocol instruction and a configuration file;
based on a second debug bridge port of the PC end, sending the log acquisition request to a first debug bridge port of the target communication module;
receiving a log of the target communication module which is returned by aiming at the log obtaining request and accords with an expected format;
wherein the desired format is a format supported by the client; and the returned log is generated by decoding the initial log file of the target communication module according to the decoding information after the log service application in the target communication module acquires the decoding information matched with the log acquisition request.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
generating a log acquisition request aiming at the target communication module according to a preset protocol instruction and a configuration file;
based on a second debug bridge port of the PC end, sending the log acquisition request to a first debug bridge port of the target communication module;
receiving a log of the target communication module which is returned by aiming at the log obtaining request and accords with an expected format;
Wherein the desired format is a format supported by the client; and the returned log is generated by decoding the initial log file of the target communication module according to the decoding information after the log service application in the target communication module acquires the decoding information matched with the log acquisition request.
The log obtaining method, the log obtaining device, the computer equipment and the storage medium generate a log obtaining request aiming at the target communication module according to the preset protocol instruction and the configuration file. And then, based on the second debug bridge port of the client, sending the log acquisition request to the first debug bridge port of the target communication module. And sending the log acquisition request to the first debug bridge port of the target communication module through the second debug bridge port of the client, so that the log acquisition request can be successfully transmitted 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 and conforms to the expected format aiming at the log acquisition request. Therefore, through the transparent transmission of the debug bridge port and the combination of the log service application in the target communication module to decode the log, the client in the PC end reads the effective log of the target communication module.
Drawings
FIG. 1 is a diagram of an application environment for a log acquisition method in one embodiment;
FIG. 2 is a flow chart of a log obtaining method according to an embodiment;
FIG. 3 is a system block diagram of a log acquisition method in one embodiment;
FIG. 4 is a flowchart of a log obtaining method according to another embodiment;
FIG. 5 is a block diagram showing a structure of a log obtaining apparatus in one embodiment;
FIG. 6 is a system flow diagram of a log obtaining method according to an embodiment;
FIG. 7 is a block diagram showing a structure of a log obtaining apparatus in one embodiment;
FIG. 8 is an internal block diagram 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 will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The log obtaining method provided by the application can be applied to an application environment shown in fig. 1. Wherein, the PC terminal 102 is in communication with the target communication module 104. The PC end 102 may be, but not limited to, various personal computers, notebook computers, tablet computers, etc., and the target communication module 104 is a device with a modem function.
In one embodiment, as shown in fig. 2, a log obtaining method is provided, which is taken as an example of application of the method to the target communication module 104 in fig. 1, and includes the following steps:
step 202, receiving, by the first debug bridge port of the target communication module, a log acquisition request for the target communication module sent by the client based on the second debug bridge port.
The target communication module is a communication module from which the PC end wants to acquire the effective log. The first debug bridge port is a debug bridge port of the target communication module and is used for carrying out data interaction with the client. The second debug bridge port is a debug bridge port corresponding to the client in the PC end and is used for carrying out data interaction with the target communication module. The log obtaining request comprises a specific instruction and a file, and is used for sending the specific instruction and the file to the target communication module to obtain a corresponding log. The client is an application which is run by the PC and used for generating a log acquisition request.
Specifically, the client sends a log acquisition request to the target communication module based on the second debug bridge port. And the target communication module receives a log acquisition request sent by the client based on the second debug bridge port through the first debug bridge port.
In one embodiment, the target communication module may be a 5G (fifth generation mobile communication technology, 5th generation mobile networks) module, which is a key component for the bearer terminal to access the network.
In one embodiment, the target communication module may be a device including modules of one or more communication technologies, such as a combination of a 5G communication module with modem functionality and a 4G communication module.
In one 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, namely, "client: i want a log that can be read. And the target communication module receives a log acquisition request sent by the client based on the second debug bridge port through the first debug bridge port.
In one embodiment, the client may be "diaggrad" software, or may be other software capable of generating log acquisition requests for the target communication module, and receiving logs for the target communication module.
And 204, sending a log acquisition request to a log service application in the target communication module through the first debug 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 acquisition request.
Specifically, the target communication module sends a log acquisition request to a log service application of the target communication module through the first debug 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. "client: i's log 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 log tool in the target communication module may be used as a log service application, or other software, so long as the log in a format supported by the client can be returned according to the log obtaining request, which may be used as the log 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 the log service application, and decoding an initial log file of the target communication module appointed for obtaining by the log obtaining request according to the decoding information to generate a log conforming to an expected format; the desired format is a format supported by the client.
The decoding information is information used when 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 obtains decoding information matched with the log obtaining request through the log service application. And then, the target communication module decodes the initial log file of the target communication module appointed to be acquired by the log acquisition request according to the decoding information to generate a log conforming to the expected format.
Step 208, based on the first debug bridge port, a log conforming to the expected format is returned to the second debug bridge port of the client.
Specifically, the target communication module returns the log meeting the expected format to the second debug bridge port of the client through the first debug bridge port. The client can receive the log meeting the expected format based on the second debug bridge port, wherein the log meeting 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, the log obtaining 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 is aimed at the target communication module through the first debugging bridge port. Namely, transparent transmission between the target communication module and the client is realized based on the debug bridge port. And in the target communication module, the log acquisition request is sent to the log service application in the target communication module, so that the decoding information matched with the log acquisition request is acquired from the log service application, and the initial log file of the target communication module appointed to be acquired by the log acquisition request is decoded according to the decoding information, so that the log conforming to the expected format is generated. That is, by setting the log service application in the target communication module to decode the original log, a log in a format that can be supported by the client is obtained. And then, the log meeting the expected format is returned to the client through the transparent transmission of the debug bridge port. Therefore, the client can read the effective log of the target communication module by debugging the transparent transmission of the bridge port and combining with the log service application in the target communication module to decode the log.
In one embodiment, receiving, by the first debug bridge port of the target communication module, a log acquisition request for the target communication module sent by the client based on the second debug bridge port, includes: receiving a log acquisition request which is forwarded by a debugging bridge process and aims at a target communication module through a daemon process in the target communication module based on forwarding connection between the daemon process and the debugging bridge process of the PC side; the log obtaining request is monitored and forwarded by the debugging bridge process after being sent to the second debugging bridge port by the client in the PC terminal based on the second socket connection; and sending the log acquisition request to the first debug bridge port through the daemon of the target communication module.
The daemon process is a process corresponding to a first debug bridge port of the target communication module, and is used for establishing the first debug bridge port of the target communication module, monitoring the first debug bridge port, and performing data interaction with a client in the PC side through the first debug bridge port. The debugging bridge process is a process corresponding to a second debugging bridge port of the client, and is used for establishing the second debugging bridge port of the client in the PC, monitoring the second debugging bridge port and performing data interaction with the target communication module through the second debugging bridge port. The second socket connection is the connection of the communication between the second debug bridge port corresponding to the debug bridge process and the client in the PC end.
Specifically, the client in the PC sends a log acquisition request to a second debug bridge port monitored by a debug bridge process in the PC based on the second socket connection. The debugging bridge process in the PC end monitors that the second debugging bridge port has the transmitted log acquisition request, and then the log acquisition request is further transmitted to the first debugging bridge port monitored by the daemon of the target communication module through the second debugging bridge port. The daemon process in the target communication module monitors the first debug bridge port, and the debug bridge process in the PC end receives the log acquisition request for the target communication module through the first debug bridge port by sending the log acquisition request for the target communication module through the second debug bridge port.
In this embodiment, the client in the PC end sends the log obtaining request to the second debug bridge port monitored by the debug bridge process through the second socket connection, and the debug bridge process further sends the log obtaining request to the first debug bridge port monitored by the daemon of the target communication module through the second debug bridge port. And the daemon in the target communication module monitors that the first debug bridge port has a log acquisition request, and receives the log acquisition request through the first debug bridge port. Thus, the log acquisition request of the client in the PC side is successfully sent from the second debug bridge port to the first debug bridge port of the target communication module.
In one embodiment, sending a log acquisition request to a log service application in a target communication module through a first debug bridge port includes: and sending a log acquisition request to a log service application in the target communication module based on the first socket connection through the first debug bridge port.
The first socket connection is a connection that a first debug bridge port corresponding to a daemon of the target communication module communicates with a log service application of the target communication module.
Specifically, in the target communication module, a first socket connection is pre-established between the log service application and the first debug bridge port. The daemon in the target communication module sends a log acquisition request for the target communication module received through the first debug bridge port to a log service application of the target communication module based on the first socket connection.
In one embodiment, as shown in the system block diagram of the log obtaining method in fig. 3, the daemon in the target communication module will receive the log obtaining request for the target communication module through the first debug bridge port based on the first socket connection, namely "client: and I want the readable log ", and send the log to the log service application of the target communication module.
In this embodiment, the first debug bridge port corresponding to the daemon in the target communication module is directly connected with the log service application based on the first socket, so that the log acquisition request received by the first debug bridge port corresponding to the daemon in the target communication module is conveniently and successfully sent to the log service application of the target communication module.
In one embodiment, the client is a log grabbing tool running on the PC side, and the second socket connection is established between the log grabbing tool and the second debug bridge port. The method further comprises the steps of: starting a log tool in a target communication module to serve 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 scheme. The log grabbing tool is a tool for grabbing logs at the PC end. It will be appreciated that a log grabbing tool may be used as a client.
Specifically, a log tool is started in a target communication module to serve as a log service application, and a first socket connection is established at a first debug bridge port corresponding to a daemon in the target communication module. And a log grabbing tool can be operated at the PC end, and a second socket connection is established between the log grabbing tool and the second debug bridge port.
In this embodiment, the first socket connection is established between the log service application and the first debug bridge port corresponding to the daemon in the target communication module, so that data can be transmitted to the log service application in the target communication module through the first debug bridge port corresponding to the daemon in the target communication module.
In one embodiment, as shown in fig. 4, a log obtaining method is provided, and the method is applied to the PC side 102 in fig. 1 for illustration, and includes the following steps:
step 402, according to a preset protocol instruction and a configuration file, generating a log acquisition request for the target communication module.
The preset protocol instruction is a group of instructions conforming to a preset protocol of the target communication module and the client. And the configuration file is used for storing relevant settings of the client according to the format configuration file supported by 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.
Step 404, based on the second debug bridge port of the PC side, a log obtaining request is sent to the first debug bridge port of the target communication module.
Specifically, the client in the PC sends a log acquisition request generated by the log grabbing tool to a second debug bridge port monitored by a debug bridge process in the PC based on the second socket connection. The debugging bridge process in the PC end monitors that the second debugging bridge port has the log acquisition request sent by the log grabbing tool, and the client in the PC end further sends the log acquisition request to the first debugging bridge port monitored by the daemon of the target communication module through the second debugging bridge port.
Step 406, receiving a log of the target communication module conforming to the expected format returned by the log obtaining request; wherein the expected format is a format supported by the client; the returned log is generated by decoding the initial log file of the target communication module according to the decoding information after the log service application in the target communication module acquires the decoding information matched with the log acquisition request.
Specifically, a daemon process in the target communication module receives a log acquisition request through a first debug bridge port. Further, the target communication module sends a log acquisition request to a log service application within 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 the 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 acquisition 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. The log service application in the target communication module returns the log in the format supported by the client to the first debug bridge port based on the first socket connection. The daemon in the target communication module sends the log in the format supported by the client to the second debug bridge port of the client through the first debug bridge port. And the debugging bridge process at the PC end monitors that the second debugging bridge port has the log which is in the expected format and is sent by the daemon in the target communication module through the first debugging bridge port, and then receives the log which is returned by the log acquisition request and is in the expected format of the target communication module through the second debugging bridge port.
The log obtaining method, the log obtaining device, the computer equipment and the storage medium generate a log obtaining request aiming at the target communication module according to the preset protocol instruction and the configuration file. And then, based on the second debug bridge port of the client, sending the log acquisition request to the first debug bridge port of the target communication module. And sending the log acquisition request to the first debug bridge port of the target communication module through the second debug bridge port of the client, so that the log acquisition request can be successfully transmitted 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 and conforms to the expected format aiming at the log acquisition request. Therefore, through the transparent transmission of the debug bridge port and the combination of the log service application in the target communication module to decode the log, the client in the PC end reads the effective log of the target communication module.
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 debug bridge port of the target communication module is available, designating a first debug bridge port and designating a second debug bridge port of the client end from the candidate debug bridge ports; the first debug bridge port and the second debug bridge port are debug bridge ports for data forwarding; and when the candidate debug bridge port is not available, issuing a restarting instruction to the target communication module to instruct the target communication module to restart.
Specifically, the PC end is connected and communicated with the target communication module. And the PC side loads the drive of the target communication module and controls the target communication module through the drive. And when the PC side confirms that the candidate debug bridge port of the target communication module is available, designating a first debug bridge port of the target communication module for data interaction with a second debug bridge port of the client side from the candidate debug bridge ports. And when the PC end confirms that the candidate debug bridge port is not available, a restarting instruction is issued to the target communication module so as to instruct the target communication module to restart.
In one embodiment, the PC side may communicate with the target communication module connection via USB.
In one embodiment, as shown in the system block diagram of the log obtaining method in fig. 3, the PC end is connected to communicate with the target communication module, i.e. "debug bridge forwarding".
In one embodiment, as shown in the system flow chart of the log acquisition method of fig. 5, the target communication module is started. The PC side loads the drive of the target communication module and further detects whether the candidate debug bridge port of the target communication module is available. When the PC side detects that the candidate debug bridge port of the target communication module is available, designating a first debug bridge port of the target communication module which performs data interaction with a second debug bridge port of the client side from the candidate debug bridge ports, namely designating the first debug bridge port and designating the second debug bridge port.
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, that is, "start log service application". The target communication module establishes connection with a client of the PC end through a first socket connection, a designated first debugging bridge port, a designated second debugging bridge port and a second socket connection, namely the PC end runs the client and establishes connection. And the PC end confirms the appointed first debugging bridge port and the appointed second debugging bridge port, and still detects that the whole communication connection of the system fails, and sends a restarting instruction to restart the internal log service application of the target communication module.
In this embodiment, the PC side designates the second debug bridge port of the client side and designates the first debug bridge port of the target communication module for data interaction with the second debug bridge port, so that data interaction between the PC side and the target communication module can be achieved.
In one embodiment, when the PC detects that the log grabbing tool of the client is in a closed state, the communication connection between the first debug bridge port and the second debug bridge port is disconnected.
In one embodiment, as shown in the system flowchart of the log obtaining method in fig. 5, the client in the PC side grabs the log of the target communication module, i.e. "obtain log", and stops the operation of the log grabbing tool, enters a closed state, and disconnects the communication connection between the first debug bridge port and the second debug bridge port, i.e. "disconnect".
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts in the embodiments of this application may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the execution of the steps or stages is not necessarily sequential, but may be performed in turn or alternately with at least some of the other steps or stages.
In one embodiment, as shown in fig. 6, there is provided a log obtaining apparatus 600, including: a receiving module 602, a transmitting 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 for the target communication module sent by the client based on the second debug bridge port. And the sending module 604 is configured to send, through the first debug bridge port, a log obtaining request to a log service application in the target communication module.
The generating module 606 is configured to obtain, by using a log service application, decoding information that matches the log obtaining request, and decode, according to the decoding information, an initial log file of the target communication module specified to be obtained by the log obtaining request, to generate a log that conforms to a desired format; the desired format is a format supported by the client.
The sending module 604 is further configured to return, based on the first debug bridge port, a log that conforms to the desired format to the second debug bridge port of the client.
In one embodiment, the receiving module 602 is further configured to receive, by a daemon process in the target communication module, a log acquisition request for the target communication module forwarded by the debug bridge process based on a forwarding connection with the debug bridge process of the PC side; the log obtaining request is monitored and forwarded by the debugging bridge process after being sent to the second debugging bridge port by the client in the PC terminal based on the second socket connection; and sending the log acquisition request to the first debug bridge port through the daemon of the target communication module.
In one embodiment, the receiving module 602 is further configured to send, through the first debug bridge port, a log acquisition request to a log service application in the target communication module based on the first socket connection.
In one embodiment, the generating 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 transmitting 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 a preset protocol instruction and a configuration file.
And the sending module 704 is configured to send a log obtaining request to the first debug bridge port of the target communication module based on the second debug bridge port of the PC side.
A receiving module 706, configured to receive a log of the target communication module that is returned for the log obtaining request and conforms to the expected format; wherein the expected format is a format supported by the client; the returned log is generated by decoding the initial log file of the target communication module according to the decoding information after the log service application in the target communication module acquires the decoding information matched with the log acquisition request.
In one embodiment, the sending module 704 is further configured to, when the target communication module is loaded to the PC end after being successfully started and the candidate debug bridge port of the target communication module is available, designate a first debug bridge port and designate a second debug bridge port of the client from among the candidate debug bridge ports; the first debug bridge port and the second debug bridge port are debug bridge ports for data forwarding; and when the candidate debug bridge port is not available, issuing a restarting instruction to the target communication module to instruct the target communication module to restart.
The specific limitation of the log obtaining device may be referred to the limitation of the log obtaining method hereinabove, and will not be described herein. Each of the modules in the log obtaining apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure thereof may be as shown in fig. 8. Wherein, the terminal can 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 includes a non-volatile 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 the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements a log acquisition 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, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be 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, and 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 includes a non-volatile 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 the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a log acquisition method.
It will be appreciated by those skilled in the art that the structures shown in fig. 8 and 9 are block diagrams of only some of the structures associated with the present application and are not intended to limit the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided that includes a memory having a computer program stored therein and a processor that implements the log acquisition methods of the various embodiments described above when the computer program is executed.
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 acquisition methods of the various embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (11)

1. A log acquisition method, the method comprising:
receiving a log acquisition request which is forwarded by a debugging bridge process and aims at a target communication module through a daemon process in the target communication module based on forwarding connection between the daemon process and the debugging bridge process of a PC (personal computer) terminal; the daemon is used for establishing a first debugging bridge port of the target communication module, monitoring the first debugging bridge port and carrying out data interaction with a client in the PC terminal through the first debugging bridge port; the debugging bridge process is used for establishing a second debugging bridge port of the client in the PC end, monitoring the second debugging bridge port and performing data interaction with the target communication module through the second debugging bridge port; the log obtaining request is monitored and forwarded by the debugging bridge process after being sent to the second debugging bridge port by the client in the PC terminal based on the second socket connection; the second socket connection is a connection that the second debug bridge port communicates with a client in the PC end;
Sending the log acquisition request to the first debug bridge port through the daemon of the target communication module;
sending the log obtaining request to a log service application in the target communication module through the first debug 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 which accords with an expected format; the expected format is a format supported by the client;
and returning the log meeting the expected format to a second debug bridge port of the client based on the first debug bridge port.
2. The method of claim 1, wherein the sending the log obtaining request to the log service application in the target communication module through the first debug bridge port comprises:
and sending the log acquisition request to a log service application in the target communication module based on first socket connection through the first debug bridge port.
3. The method of claim 2, wherein the client is a log grabbing tool operated by the PC side, and the second socket connection is established between the log grabbing tool and the second debug bridge port;
The method further comprises the steps of:
starting a log tool in the target communication module to serve as a log service application;
a first socket connection is established between the log service application and the first debug bridge port.
4. A log acquisition method, the method comprising:
generating a log acquisition request aiming at the target communication module according to a preset protocol instruction and a configuration file;
the client in the PC end sends the log acquisition request to a second debugging bridge port monitored by a debugging bridge process in the PC end based on second socket connection so as to send the log acquisition request to a first debugging bridge port monitored by a daemon of the target communication module through the second debugging bridge port; the debug bridge process is used for establishing the second debug bridge port of the client in the PC end, monitoring the second debug bridge port and performing data interaction with the target communication module through the second debug bridge port; the daemon process is used for establishing the first debugging bridge port of the target communication module, monitoring the first debugging bridge port and carrying out data interaction with a client in the PC terminal through the first debugging bridge port; the second socket connection is a connection that the second debug bridge port communicates with a client in the PC end;
Receiving a log of the target communication module which is returned by aiming at the log obtaining request and accords with an expected format;
wherein the desired format is a format supported by the client; and the returned log is generated by decoding the initial log file of the target communication module according to the decoding information after the log service application in the target communication module acquires the decoding information matched with the log acquisition request.
5. The method according to claim 4, wherein the method further comprises:
when the target communication module is loaded to the PC end after being successfully started and the candidate debug bridge port of the target communication module is available, then
Designating the first debug bridge port and designating a second debug bridge port of the client from the candidate debug bridge ports; the first debug bridge port and the second debug bridge port are debug bridge ports for data forwarding;
and when the candidate debug bridge port is not available, issuing a restarting instruction to the target communication module to instruct the target communication module to restart.
6. A log obtaining apparatus, the apparatus comprising:
The receiving module is used for receiving a log acquisition request which is forwarded by the debugging bridge process and aims at the target communication module through a daemon process in the target communication module based on forwarding connection between the daemon process and the debugging bridge process of the PC end; the daemon is used for establishing a first debugging bridge port of the target communication module, monitoring the first debugging bridge port and carrying out data interaction with a client in the PC terminal through the first debugging bridge port; the debugging bridge process is used for establishing a second debugging bridge port of the client in the PC end, monitoring the second debugging bridge port and performing data interaction with the target communication module through the second debugging bridge port; the log obtaining request is monitored and forwarded by the debugging bridge process after being sent to the second debugging bridge port by the client in the PC terminal based on the second socket connection; the second socket connection is a connection that the second debug bridge port communicates with a client in the PC end; sending the log acquisition request to the first debug bridge port through the daemon 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 debug bridge port;
the generation module is used for acquiring decoding information matched with the log acquisition request through the log service application, 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, and generating a log which accords with an expected format; the expected format is a format supported by the client;
the sending module is further configured to return the log meeting the expected format to a second debug bridge port of the client based on the first debug bridge port.
7. The apparatus of claim 6, wherein the sending module is further configured to send the log acquisition request to a log service application in the target communication module via the first debug bridge port based on a first socket connection.
8. The apparatus of claim 7, wherein the client is a log grabbing tool operated by the PC side, and the second socket connection is established between the log grabbing tool and the second debug bridge port; the generation module is also used for starting a log tool in the target communication module to serve as a log service application; a first socket connection is established between the log service application and the first debug bridge port.
9. A log obtaining apparatus, the apparatus comprising:
the generation module is used for generating a log acquisition 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 acquisition request to a second debugging bridge port monitored by a debugging bridge process in the PC end based on second socket connection by a client in the PC end so as to send the log acquisition request to a first debugging bridge port monitored by a daemon of the target communication module through the second debugging bridge port; the debug bridge process is used for establishing the second debug bridge port of the client in the PC end, monitoring the second debug bridge port and performing data interaction with the target communication module through the second debug bridge port; the daemon process is used for establishing the first debugging bridge port of the target communication module, monitoring the first debugging bridge port and carrying out data interaction with a client in the PC terminal through the first debugging bridge port; the second socket connection is a connection that the second debug bridge port communicates with a client in the PC end;
The receiving module is used for receiving the logs of the target communication module which are returned by the log acquisition request and conform to the expected format; wherein the desired format is a format supported by the client; and the returned log is generated by decoding the initial log file of the target communication module according to the decoding information after the log service application in the target communication module acquires the decoding information matched with the log acquisition request.
10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 5.
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 CN112350861A (en) 2021-02-09
CN112350861B true 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)

Families Citing this family (4)

* 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
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 济南浪潮数据技术有限公司 A kind of Log Collect System, method, apparatus, 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 济南浪潮数据技术有限公司 A kind of Log Collect System, method, apparatus, 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

Also Published As

Publication number Publication date
CN112350861A (en) 2021-02-09

Similar Documents

Publication Publication Date Title
CN112350861B (en) Log acquisition method, device, computer equipment and storage medium
CN110166432B (en) Method for accessing intranet target service and method for providing intranet target service
CN109525624B (en) Container login method and device and storage medium
US10613788B2 (en) Data migration between cloud storage systems
CN107463499B (en) ADB remote connection method, device, equipment and storage medium
US20160350148A1 (en) Thin client system, server device, policy management device, control method, and non-transitory computer readable recording medium
CN111314452B (en) Shell access method, device, equipment and storage medium of cloud mobile phone
US20130318144A1 (en) Network device, system, method, and storage medium
CN111625301A (en) Idempotent processing method, apparatus, device and storage medium
US11770458B1 (en) Systems for exchanging data using intermediate devices
CN102209115A (en) Method for coordinating different users in virtual desktop system
CN108123826B (en) Cross-region data interaction system and method
CN111787105B (en) File transmission method, device, computer equipment and storage medium
CN111143017B (en) Cloud operation system interaction processing method, client and cloud operation system
US20200280908A1 (en) Method for network sharing on a terminal, apparatus, air conditioner and storage medium
CN109308288B (en) Data processing method and device
CN114039760B (en) Security testing method and device, computer equipment and storage medium
CN108021459B (en) Method and device for sending dotting logs across processes
US11416383B1 (en) Systems for remote communication with test devices
CN111475763B (en) Webpage running method and device, storage medium and equipment
CN115118587A (en) Method and device for creating connector
CN114610446A (en) Method, device and system for automatically injecting probe
CN114619462A (en) Remote desktop control method based on robot flow automation
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