WO2021227588A1 - 日志获取方法、装置、终端、服务器和计算机可读存储介质 - Google Patents

日志获取方法、装置、终端、服务器和计算机可读存储介质 Download PDF

Info

Publication number
WO2021227588A1
WO2021227588A1 PCT/CN2021/076766 CN2021076766W WO2021227588A1 WO 2021227588 A1 WO2021227588 A1 WO 2021227588A1 CN 2021076766 W CN2021076766 W CN 2021076766W WO 2021227588 A1 WO2021227588 A1 WO 2021227588A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
server
terminal
log acquisition
data
Prior art date
Application number
PCT/CN2021/076766
Other languages
English (en)
French (fr)
Inventor
张震
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Priority to JP2022553077A priority Critical patent/JP2023516417A/ja
Priority to EP21804127.5A priority patent/EP4102776A4/en
Priority to US17/905,786 priority patent/US20230114166A1/en
Publication of WO2021227588A1 publication Critical patent/WO2021227588A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • 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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • 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/28Restricting access to network management systems or functions, e.g. using authorisation function to access network configuration
    • 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/34Signalling channels for network management communication

Definitions

  • the embodiments of the present invention relate to the field of communication technology, and in particular to a log acquisition method, device, terminal, server, and computer-readable storage medium.
  • 5G network application scenarios such as cloud VR/AR, Internet of Vehicles, wireless medical treatment, connected drones, smart cities, smart manufacturing, personal AI assistance, etc.
  • IoT devices MBB (Mobile Broadband, mobile broadband) terminal equipment can be used in all walks of life, and can be deployed in various environments, such as barren deserts, dense forests and other places that are difficult or inaccessible to humans.
  • MBB Mobile Broadband, mobile broadband
  • some terminal device diagnosis methods need to be connected to the terminal device at a close distance to export the running log data of the device, and it is impossible to obtain the running log data of the terminal device remotely.
  • Equipment diagnosis caused some trouble.
  • the embodiment of the present invention provides a log acquisition method, which is applied to a terminal, including: receiving a log acquisition instruction sent by a server; establishing a data flow path with the server in response to the log acquisition instruction; Real-time log data, and send real-time log data to the server through the data flow path.
  • Embodiments of the present invention also provide a log acquisition method, applied to a server, including: sending a log acquisition instruction to a terminal; and establishing a data flow with the terminal in response to a data flow path establishment request initiated by the terminal based on the log acquisition instruction Road; Receive real-time log data sent by the terminal through the data stream path.
  • the embodiment of the present invention also provides a log acquisition device, which is built in the terminal and includes: a main control communication module configured to receive a log acquisition instruction sent by the server, and in response to the log acquisition instruction, establish a connection with the server Data flow path:
  • the log acquisition module is set to collect the real-time log data of the terminal and send the real-time log data to the server through the data flow path.
  • the embodiment of the present invention also provides a terminal, including: at least one processor; The processor executes, so that at least one processor can execute the foregoing log acquisition method applied to the terminal.
  • the embodiment of the present invention also provides a server, including: at least one processor; The processor executes, so that at least one processor can execute the foregoing log acquisition method applied to the server.
  • the embodiment of the present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the above-mentioned log acquisition method.
  • Figure 1 is a schematic diagram of the principle of acquiring terminal log data in some situations
  • FIG. 2 is a schematic flowchart of a log acquisition method provided by the first embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a message format structure in a log acquisition method provided by the first embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a log acquisition method provided by the second embodiment of the present invention.
  • FIG. 5 is a schematic diagram of interaction of a log acquisition method provided by the second embodiment of the present invention.
  • FIG. 6 is a schematic flowchart of a log acquisition method provided by the third embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a log acquisition device provided by the fourth embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a terminal provided by the fifth embodiment of the present invention.
  • Figure 1 is a schematic diagram of the principle of obtaining the running log data of the MBB terminal device or module in some situations.
  • the MBB device or module in order to obtain the MBB device or module, it is necessary to connect the MBB device or module through a USB cable at a close distance.
  • an embodiment of the present invention provides a log acquisition method, which includes: receiving a log acquisition instruction sent by a server; establishing a data flow path with the server in response to the log acquisition instruction; collecting real-time log data of the terminal, and passing The data flow path sends real-time log data to the server, so that the log data of the terminal device can be obtained remotely, which brings great convenience for the user to obtain the running log data of the terminal for diagnosis.
  • the first embodiment of the present invention relates to a log acquisition method, which is applied to a terminal.
  • FIG. 2 is a schematic flowchart of the log acquisition method provided by this embodiment.
  • the log acquisition method provided by this embodiment will be described in detail below with reference to the accompanying drawings.
  • the terminal can be a mobile phone, mobile WI-FI, tablet computer, notebook computer, vehicle-mounted computer, drone, vehicle-mounted TBOX (Telematics BOX), remote medical equipment, or vehicle wireless communication (Vehicle to X, V2X) and other electronic equipment .
  • vehicle-mounted TBOX Telematics BOX
  • remote medical equipment or vehicle wireless communication (Vehicle to X, V2X) and other electronic equipment .
  • the user can initiate a log acquisition instruction to the terminal through the server, and use the server to obtain the log data from the terminal to realize the remote diagnosis of the terminal status.
  • the terminal is a mobile phone, mobile Wi-Fi and other equipment, It can diagnose the current network rate of the terminal, registered cell status, bit error rate or signal strength, etc.; for example, when the terminal is a vehicle-mounted TBOX, remote medical equipment or V2X application, the user can also diagnose the application functions on the terminal.
  • Step S101 Receive a log acquisition instruction sent by the server.
  • step S101 it may further include: establishing a control channel with the server based on the TCP protocol.
  • the terminal establishes a control channel based on the TCP (Transmission Control Protocol) protocol with the server by acquiring the IP address and port information of the server, and receives the log acquisition instruction sent by the server through the control channel.
  • TCP Transmission Control Protocol
  • control channel can be established between the terminal and the server in other ways. It should be noted that the example of establishing a control channel with a server based on the TCP protocol does not involve the core content of the present invention, and does not constitute a limitation to the present invention.
  • a private JSON format message can be used to communicate between the terminal and the server, and different msgids are used to control the acquisition of different log functions.
  • private JSON format messages include: header tag, control field length (controlLen), control field (controlField), data field length (dataLen), data field (dataField), and message tail tag (tail tag) ), the message structure is shown in Figure 3.
  • the message header used to indicate the beginning of the message, occupies 2 bytes.
  • the start flag is 0x23 0x7E, which is "# ⁇ ";
  • the length of the control field, int32 type is used to indicate the length of the following control field.
  • This field occupies four bytes and stores the length data in big-endian network byte order;
  • control Field used to fill control data, JSON data defines control message;
  • data field length int32 type, used to indicate the length of the following data field dataField, this field occupies four bytes, and the length data is stored in big-endian network byte order ;
  • Data field used for actual filling data, such as configuration file compressed package data, historical log compressed package data;
  • message tail used to indicate the end of the message, occupies 2 bytes.
  • the end flag is 0x7E 0x23, that is, " ⁇ #". When there is no data field, the length of the data field is filled with 0, followed by the end of the message.
  • the log acquisition instruction may include a system log acquisition instruction, a modem log acquisition instruction, and a history log acquisition instruction.
  • step S102 may be executed to identify the type of the log acquisition instruction. If the log acquisition instruction is The identification result includes a system log acquisition instruction or a modem log acquisition instruction.
  • Step S103 is executed.
  • a data flow path with the server is established; if the log acquisition instruction includes a history log acquisition instruction, step S105 is executed.
  • Historical log data send historical log data to the server through the control channel. Obtaining historical log data can facilitate diagnosis and analysis of the historical operating status of the terminal. By combining the historical log data of the terminal, it is helpful to further analyze the terminal's operating status or the cause of operating failure.
  • the log obtaining instruction may also include only the system log obtaining instruction or the modem log obtaining instruction.
  • Step S103 In response to the log acquisition instruction, establish a data flow path with the server.
  • the data flow path with the server is established through the server's IP address and port information.
  • establishing a data flow path with the server may include: establishing a data flow path based on a socket (Socket) mechanism.
  • the log data transmitted in the data flow path can be encrypted to ensure data security and avoid the leakage of the user's log data.
  • socket Socket
  • how to establish a data flow path with the server based on the socket mechanism is a well-known technology, and will not be described in detail here.
  • Step S104 Collect real-time log data of the terminal, and send the real-time log data to the server through the data stream path.
  • Log acquisition instructions include system log acquisition instructions and/or modem log acquisition instructions; among them, when log acquisition instructions include system log acquisition instructions, real-time log data includes real-time system log data; when log acquisition instructions include modem log acquisition instructions, real-time log data Including real-time modem log data.
  • the terminal When receiving the log acquisition instruction sent by the server including the system log acquisition instruction, the terminal collects its own real-time system log data, and sends the real-time system log data to the server through a socket; when the log acquisition instruction sent by the server includes the modem log When obtaining instructions, the terminal collects its own real-time modem log data, and sends the real-time modem log data to the server through a socket.
  • system log data includes device application layer function operation status and diagnostic information
  • modem log data includes: device chip manufacturer's network-related function operation status and diagnostic information.
  • the terminal After the terminal receives the msgid6 message type system log acquisition instruction and/or the modem log acquisition instruction from the control channel, it establishes a data stream path through the socket mechanism to transmit the real-time log data stream. After the terminal receives the ACK (Acknowledgement) confirmation message that the data flow path is successfully established from the server, it collects system log data or modem log data on the terminal in real time, and sends real-time system log data or real-time modem log data to the server through the data flow path. . After the data flow path is successfully established, the terminal sends a unique identifier to the server on the data flow path to the server. The server uses this unique identifier to identify the terminal device to which the data transmitted by the current data flow path belongs. The unique identifier can include: IMEI, SN , Device name and log type.
  • Step S105 Obtain historical log data, and send the historical log data to the server through the control channel.
  • the terminal has a local storage unit configured to store historical log data of the terminal, where the historical log data includes: syslog, dmesg, firewall status, CPU operating efficiency, battery life and other device information.
  • the log acquisition instruction includes the historical log acquisition instruction
  • the terminal sends the historical log data stored in the local storage unit to the server through the control channel. For example, after the historical log data is packaged and assembled, it is filled in the data field of the JSON format message. Use msgid2 message type to send historical log data to the server.
  • the terminal when the terminal receives the msgid6 message type system log closing command and/or modem log closing command from the control channel, it closes the established data flow path and stops real-time collection of system logs and real-time collection of modem logs.
  • the log acquisition method provided by the embodiment of the present invention can realize remote acquisition of real-time operation log data of the terminal device by establishing a data flow path between the terminal and the server, and avoids that the user must be connected to the terminal device at a close distance to export the log in some situations.
  • the shortcomings of the data provide great convenience for users to remotely obtain terminal operation log data for diagnosis. For ordinary users, users can remotely view the operating status of the equipment. For operators, operators do not need to arrange work The personnel go to the equipment site for diagnosis, which can reduce the operator's labor cost.
  • the second embodiment of the present invention provides a log acquisition method.
  • the second embodiment is roughly the same as the first embodiment, but the difference is that before receiving the log acquisition instruction sent by the server, it also includes receiving the log function request sent by the server, and establishing a control channel with the server based on the TCP protocol; the receiving server The log acquisition instruction sent is: the log acquisition instruction is received through the control channel.
  • Figure 4 is a schematic flow diagram of the log acquisition method provided in this embodiment
  • Figure 5 is an interactive schematic diagram of the log acquisition method provided in this embodiment.
  • Step S201 Receive a request to turn on the log function.
  • the server may send a log-on request to the terminal through the TR069 protocol after querying and acquiring the IMEI number of the terminal.
  • the log-on request carries the server's IP address and port information.
  • Step S203 can be executed directly after step S201 is executed, or step S203 can be executed after step S202 is executed.
  • Step S202 Verify the identity of the server. If the verification is passed, step S203 is executed to establish a control channel with the server based on the TCP protocol; if the verification fails, step S204 is executed, and the feedback is not passed.
  • the log-on request in this embodiment may also carry a key.
  • it may also include: verifying that the server's identity is a legal identity based on the key.
  • the terminal verifies the identity of the server based on the key. If the key verification is passed, the server identity is legal, and step S203 is performed to establish a control channel with the server. If the key verification fails, the server's identity is illegal, and a message that the key is incorrect and the identity verification fails is fed back to the server.
  • verifying the legitimacy of the server's identity can prevent the log data of the terminal from being illegally obtained, and ensure the security of the log data of the terminal.
  • Step S203 Establish a control channel with the server based on the TCP protocol.
  • the server After the server is authenticated, it establishes a control channel based on the TCP (Transmission Control Protocol) protocol with the server according to the IP address and port information in the log function request.
  • TCP Transmission Control Protocol
  • Step S205 Receive a log acquisition instruction sent by the server.
  • Step S206 Identify the type of the log acquisition instruction. If the log acquisition instruction is a system log acquisition instruction and/or a modem log acquisition instruction, perform step S207, in response to the log acquisition instruction, establish a data flow path with the server; if the log acquisition instruction The instruction is a historical log acquisition instruction, and step S209 is executed to acquire historical log data, and send the historical log data to the server through the control channel.
  • Step S207 In response to the log acquisition instruction, establish a data flow path with the server.
  • Step S208 Collect real-time log data of the terminal, and send the real-time log data to the server through the data stream path.
  • Step S209 Obtain historical log data, and send the historical log data to the server through the control channel.
  • steps S205, S206, S207, S208, and S209 are the same as steps S101, S102, S103, S04, and S105 in the previous embodiment.
  • steps S101, S102, S103, S04, and S105 please refer to the description in the previous embodiment, which will not be repeated here. .
  • this embodiment only turns on the log data acquisition function when needed, avoiding the terminal being always in the working state of acquiring logs, avoiding unnecessary power consumption; and also verifying the legitimacy of the server identity, which can avoid The log data of the terminal is illegally obtained to ensure the security of the log data of the terminal.
  • the third embodiment of the present invention relates to a log acquisition method, applied to a server, including: sending a log acquisition instruction to a terminal; in response to a data flow path connection request initiated by the terminal based on the log acquisition instruction, establishing data circulation with the terminal Road; Receive real-time log data sent by the terminal through the data stream path.
  • FIG. 6 is a schematic flow chart of the log acquisition method provided in this embodiment.
  • the log acquisition method provided in this embodiment will be described in detail below in conjunction with the accompanying drawings.
  • the server may be an ACS server.
  • Step S301 Send a log acquisition instruction to the terminal.
  • step S301 it may further include: sending a request to enable the log function to the terminal.
  • the log acquisition function of the terminal is turned on by sending a log function request to the terminal, so that the log data acquisition function of the terminal is turned on when needed, which prevents the terminal from always being in the working state of acquiring logs and avoids unnecessary power consumption.
  • the log function request can also include a key for the terminal to verify the identity of the server. After receiving the confirmation information fed back by the terminal, a control channel is established with the terminal. The confirmation information is verified by the terminal based on the key. After the identity of the server is a legal identity, the sending of a log acquisition instruction to the terminal specifically includes: sending a log acquisition instruction to the terminal through a control channel.
  • the key is sent to the terminal for the terminal to verify the legitimacy of the server identity, which can prevent the log data of the terminal from being illegally obtained and ensure the security of the log data of the terminal.
  • Step S302 In response to a data flow path establishment request initiated by the terminal based on the log acquisition instruction, a data flow path with the terminal is established.
  • Step S303 Receive the real-time log data sent by the terminal through the data stream path.
  • the log acquisition instruction may include a system log acquisition instruction, a modem log acquisition instruction, and/or a historical log acquisition instruction.
  • the log acquisition instruction sent to the terminal includes a system log acquisition instruction and/or a modem log acquisition instruction
  • the terminal is received through the data stream channel
  • the sent real-time log data corresponding to the log acquisition instruction; when the log acquisition instruction sent to the terminal includes the historical log acquisition instruction, the historical log data sent by the terminal is received through the control channel.
  • the server saves the received system log data stream and modem log data stream in the corresponding file in real time, and saves the historical log data extracted from the data field in the corresponding file for users to read the log data in the file .
  • this embodiment is a server embodiment corresponding to the above-mentioned embodiment, and this embodiment can be implemented in cooperation with the above-mentioned embodiment.
  • the corresponding technical details mentioned in the above embodiments are still valid in this embodiment, and in order to reduce repetition, they will not be repeated here.
  • the corresponding technical details mentioned in this embodiment can also be applied to the above embodiment.
  • the log acquisition method provided by the embodiment of the present invention can realize remote acquisition of real-time operation log data of the terminal device by establishing a data flow path between the terminal and the server, and avoids that the user must be connected to the terminal device at a close distance to export the log in some situations.
  • the shortcomings of the data provide great convenience for users to remotely obtain terminal operation log data for diagnosis. For ordinary users, users can remotely view the operating status of the equipment. For operators, operators do not need to arrange work The personnel go to the equipment site for diagnosis, which can reduce the operator's labor cost.
  • the fourth embodiment of the present invention provides a log acquisition device.
  • the log acquisition device is built in the terminal 10 and includes: a master communication module 11 configured to receive a log acquisition instruction sent by a server and respond to the log acquisition instruction , Establish a data flow path with the server; the log acquisition module 12 is set to collect real-time log data of the terminal, and send the real-time log data to the server through the data flow path.
  • FIG. 7 is a schematic structural diagram of the log acquisition device provided by this embodiment.
  • the log acquisition device provided by this embodiment will be described in detail below with reference to the accompanying drawings. For the same or similar technical details, please refer to the specific description in the above embodiment. No longer.
  • the log acquisition module 12 may include: a system log module 13 and a modem (modem) log module 14; the system log acquisition module 13 is configured to collect the real-time system log of the terminal when the log acquisition instruction includes a system log acquisition instruction The modem log module 14 is configured to collect real-time modem log data from the terminal when the log acquisition instruction includes a modem log acquisition instruction, and send the real-time modem log data through the data flow path. The log data is sent to the server.
  • modem modem
  • the log acquisition device may further include: a local storage unit 15 configured to store the historical log data of the terminal; the master communication module 11 is also configured to store locally when the log acquisition instruction includes a historical log acquisition instruction The unit 15 obtains historical log data, and sends the historical log data to the server through the control channel.
  • a local storage unit 15 configured to store the historical log data of the terminal
  • the master communication module 11 is also configured to store locally when the log acquisition instruction includes a historical log acquisition instruction The unit 15 obtains historical log data, and sends the historical log data to the server through the control channel.
  • the log acquisition device may also include: an activation module 16 configured to receive a log-on request sent by the server, the log-on request includes a key, and the legitimacy of the server’s identity is verified based on the key; After the server identity verification result is legal, the main control communication module 11 is notified to establish a control channel with the server.
  • an activation module 16 configured to receive a log-on request sent by the server, the log-on request includes a key, and the legitimacy of the server’s identity is verified based on the key; After the server identity verification result is legal, the main control communication module 11 is notified to establish a control channel with the server.
  • the startup module 16 may be a TR069 module, and the server may be a TR069 ACS server.
  • the log acquisition module 12 and the main control communication module 11 are normally closed and non-working. Only when the user needs to acquire the terminal’s log data, reverse control through the TR069 protocol The terminal equipment, the TR069 module starts the main control communication module 11 and the log acquisition module 12, and informs the main control communication module 11 of the server's IP address and port information for the main control communication module to establish a connection with the server.
  • the terminal 10 has a WAN interface. On the WAN interface, it can be connected to the Internet via a modem, a wireless network WI-FI or an rj45 network cable, and can be connected to a server via the Internet.
  • main control communication module 11, the log acquisition module 12, and the local storage unit 15 in this embodiment may be integrated into one log management module.
  • this embodiment is a device embodiment corresponding to the first and second embodiments, and this embodiment can be implemented in cooperation with the first and second embodiments.
  • the corresponding technical details mentioned in the first and second embodiments are still valid in this embodiment, and in order to reduce repetition, they will not be repeated here.
  • the corresponding technical details mentioned in this embodiment can also be applied to the first and second embodiments.
  • the fifth embodiment of the present invention provides a terminal, as shown in FIG. 8, including at least one processor 501; and a memory 502 communicatively connected with the at least one processor 501;
  • the instructions executed by 501 are executed by at least one processor 501, so that the at least one processor 501 can execute the foregoing log acquisition method applied to the terminal.
  • the sixth embodiment of the present invention also provides a server.
  • the server may include at least one processor 501; and, communicate with at least one processor 501.
  • connection mode of the processor and the memory in the terminal is similar to the connection mode of the processor and the memory in the server, and the details are as follows.
  • the memory 502 and the processor 501 are connected in a bus manner.
  • the bus may include any number of interconnected buses and bridges, and the bus connects one or more various circuits of the processor 501 and the memory 502 together.
  • the bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, etc., which are all known in the art, and therefore, no further description will be given herein.
  • the bus interface provides an interface between the bus and the transceiver.
  • the transceiver may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium.
  • the data processed by the processor 501 is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor 501.
  • the processor 501 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory 502 may be configured to store data used by the processor 501 when performing operations.
  • the embodiment of the present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the above-mentioned log acquisition method applied to a terminal, or to implement the above-mentioned log acquisition method applied to a server. Data acquisition method.
  • the program is stored in a storage medium and includes several instructions to enable a device ( It may be a single-chip microcomputer, a chip, etc.) or a processor (processor) that executes all or part of the steps of the methods described in the various embodiments of the present invention.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
  • the embodiments of the present invention provide a log acquisition method, device, terminal, server, and computer-readable storage medium, so that the log data of the terminal can be remotely acquired.
  • the embodiment of the present invention can realize the remote acquisition of real-time operation log data of the terminal device, avoiding the disadvantage that the user must be connected to the terminal device at a close distance to export the log data in some situations.
  • Obtaining terminal operating log data remotely for diagnosis provides great convenience. For ordinary users, users can remotely view the operating status of the equipment. For operators, operators do not need to arrange staff to perform diagnosis on the equipment site. , Which can reduce the operator's labor costs.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)
  • Telephonic Communication Services (AREA)

Abstract

一种日志获取方法、装置、终端、服务器和计算机可读存储介质,所述日志获取方法,应用于终端,包括:接收服务器发送的日志获取指令(S101);响应于所述日志获取指令,建立与所述服务器之间的数据流通路(S103);采集所述终端的实时日志数据,并通过所述数据流通路将所述实时日志数据发送至所述服务器(S104)。

Description

日志获取方法、装置、终端、服务器和计算机可读存储介质 技术领域
本发明实施方式涉及通信技术领域,特别涉及一种日志获取方法、装置、终端、服务器和计算机可读存储介质。
背景技术
随着5G技术的发展,各种5G网络应用场景应运而生,例如云VR/AR、车联网、无线医疗、联网无人机、智慧城市、智能制造、个人AI辅助等,从而使得物联网设备、MBB(Mobile Broadband,移动宽带)终端设备可以被应用在各行各业,以及可以被布置在各种环境,例如荒芜的沙漠,茂密的森林等人类不易或无法到达的地方。另外,为了获知终端设备的运行状态或者对终端的运行故障进行诊断,需要获取终端设备的日志数据。
一些情形中至少存在如下问题:一些终端设备诊断方式中需要近距离连接终端设备,才能导出设备内部的运行日志数据,不能实现远程获取终端设备的运行日志数据,而这对当前5G时代下的终端设备诊断造成一定的麻烦。
发明内容
有鉴于此,本发明的实施方式提供了一种日志获取方法,应用于终端,包括:接收服务器发送的日志获取指令;响应于日志获取指令,建立与服务器之间的数据流通路;采集终端的实时日志数据,并通过数据流通路将实时日志数据发送至服务器。
本发明的实施方式还提供了一种日志获取方法,应用于服务器,包括:向终端发送日志获取指令;响应于终端基于日志获取指令发起的数据流通路建立请求,建立与终端之间的数据流通路;通过数据流通路接收终端发送的实时日志数据。
本发明的实施方式还提供了一种日志获取装置,日志获取装置内置于终端,包括:主控通信模块,被设置为接收服务器发送的日志获取指令,并响应于日志获取指令,建立与服务器的数据流通路;日志获取模块,被设置为采集终端的实时日志数据,通过数据流通路将实时日志数据发送至服务器。
本发明的实施方式还提供了一种终端,包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行上述应用于终端的日志获取方法。
本发明的实施方式还提供了一种服务器,包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少 一个处理器执行,以使至少一个处理器能够执行上述应用于服务器的日志获取方法。
本发明的实施方式还提供了一种计算机可读存储介质,存储有计算机程序,其中,计算机程序被处理器执行时实现上述日志获取方法。
附图说明
一个或多个实施方式通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施方式的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1是一些情形中获取终端日志数据的原理示意图;
图2是本发明第一实施方式提供的一种日志获取方法的流程示意图;
图3是本发明第一实施方式提供的一种日志获取方法中的消息格式结构示意图;
图4是本发明第二实施方式提供的一种日志获取方法的流程示意图;
图5是本发明第二实施方式提供的一种日志获取方法的交互示意图;
图6是本发明第三实施方式提供的一种日志获取方法的流程示意图;
图7是本发明第四实施方式提供的一种日志获取装置的结构示意图;
图8是本发明第五实施方式提供的一种终端的结构示意图。
具体实施方式
图1为一些情形中获取MBB终设备或模组的运行日志数据的原理示意图,参考图1,一些情形中,为了获取到MBB设备或模组,需要近距离通过USB线连接MBB设备或模组,通过USB线,从终端上的adb接口上导出系统日志数据,或者从终端上的diag接口导出调制解调器(modem)日志数据;其中,adb接口是指安卓usb口,diag接口是指modem诊断口。也即在一些情形中,为了获取MBB终端的运行日志数据,需要工程师人员去到MBB终端设备现场,而这给MBB设备的运行诊断带来极大的不便。
有鉴于此,本发明实施方式提供一种日志获取方法,包括:接收服务器发送的日志获取指令;响应于日志获取指令,建立与服务器之间的数据流通路;采集终端的实时日志数据,并通过数据流通路将实时日志数据发送至服务器,从而可以实现远程获取终端设备的日志数据,为用户获取终端的运行日志数据进行诊断带来极大的便利。
为使本发明实施方式的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本发明而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本发明所要求保护的技术方案。
本发明的第一实施方式涉及一种日志获取方法,应用于终端。
图2为本实施方式提供的日志获取方法的流程示意图,以下将结合附图对本实施方式提供的日志获取方法进行详细说明。
其中,终端可以是手机、移动WI-FI、平板电脑、笔记本电脑、车载电脑、无人机、车载TBOX(Telematics BOX)、远程医疗器材或车用无线通信(Vehicle to X,V2X)等电子设备。
当用户需要获取终端的日志数据时,用户可以通过服务器向终端发起日志获取指令,利用服务器从终端获取日志数据,进而实现远程诊断终端的状态,例如终端为手机、移动WI-FI等设备时,可以诊断终端当前网络速率情况、注册的小区状态、误码率或信号强度等等;例如终端为车载TBOX、远程医疗器材或V2X应用等时,用户还可以诊断终端上的应用功能。
步骤S101、接收服务器发送的日志获取指令。
本实施方式中,在步骤S101之前还可以包括:基于TCP协议与服务器建立控制信道。
具体来说,终端通过获取服务器的IP地址和端口信息,与服务器建立基于TCP(Transmission Control Protocol,传输控制协议)协议的控制信道,通过控制信道接收服务器发送的日志获取指令。
在其他方式中,终端与服务器之间还可以通过其他方式建立控制信道。需要说明的是,基于TCP协议与服务器建立控制信道的举例,不涉及本发明核心内容,并不构成对本发明的限定。
本实施方式中,终端与服务器之间可以采用私有JSON格式消息进行通信,使用不同的msgid来控制获取不同的日志功能。具体来说,私有JSON格式消息包括:消息头标志(header tag)、控制域长度(controlLen)、控制域(controlField)、数据域长度(dataLen)、数据域(dataField)和消息尾标志(tail tag),消息结构如图3所示。
消息头,用于表示消息的开始,占用2个字节。例如开始标志为0x23 0x7E,即“#~”;控制域长度,int32类型,用于表示后面控制域的长度,该字段占用四个字节,以大端网络字节序形式存放长度数据;控制域,用于填充控制数据,JSON数据定义控制消息;数据域长度,int32类型,用于表示后面数据域dataField的长度,该字段占用四个字节,以大端网络字节序形式存放长度数据;数据域,用于实际填充的数据,例如配置文件压缩包数据,历史日志压缩包数据;消息尾,用于表示消息的结束,占用2个字节。结束标志为0x7E 0x23,即“~#”。当没有数据域时,将数据域长度填充0,紧接着就是消息尾部。
本实施方式中,日志获取指令可以包括系统日志获取指令、调制解调器(modem)日志获取指令和历史日志获取指令,在步骤S101之后还可以是执行步骤S102、识别日志获取指令的类型,若日志获取指令识别结果中包括系统日志获取指令或modem日志获取指令,执行 步骤S103、响应于日志获取指令,建立与服务器之间的数据流通路;若日志获取指令中包括历史日志获取指令,执行步骤S105、获取历史日志数据,通过控制信道向服务器发送历史日志数据。通过获取历史日志数据,可以有利于对终端的历史运行状态进行诊断分析。通过结合终端的历史日志数据,有利于进一步分析终端的运行状态或运行故障原因。
需要说明的是,获取历史日志并非本实施方式的必需,在其他实施方式中,日志获取指令还可以仅包括系统日志获取指令或modem日志获取指令。
步骤S103、响应于日志获取指令,建立与服务器之间的数据流通路。
具体来说,当接收到服务器发送的系统日志获取指令和/或modem日志获取指令后,通过服务器的IP地址和端口信息建立与服务器之间的数据流通路。
本实施方式中,建立与服务器之间的数据流通路,可以包括:基于套接字(Socket)机制建立数据流通路。如此,可以对数据流通路中传输的日志数据进行加密处理,保证数据安全,避免用户的日志数据泄漏。需要说明的是,如何基于套接字机制与服务器建立数据流通路为公知技术,在此不进行详细说明。
步骤S104、采集终端的实时日志数据,并通过数据流通路将实时日志数据发送至服务器。
日志获取指令包括系统日志获取指令和/或调制解调器日志获取指令;其中,日志获取指令包括系统日志获取指令时,实时日志数据包括实时系统日志数据;日志获取指令包括modem日志获取指令时,实时日志数据包括实时modem日志数据。
当接收到服务器发送的日志获取指令包括系统日志获取指令时,终端采集自身的实时系统日志数据,通过套接字的方式将实时系统日志数据发送至服务器;当服务器发送的日志获取指令包括modem日志获取指令时,终端采集自身的实时modem日志数据,通过套接字的方式将实时modem日志数据发送至服务器。
其中,系统日志数据包括设备应用层功能运行状态和诊断信息,modem日志数据包括:设备芯片厂商网路相关功能运行状态和诊断信息。
具体来说,当终端从控制信道接收到msgid6消息类型的系统日志获取指令和/或modem日志获取指令后,通过套接字机制建立数据流通路来传输实时日志数据流。终端在接收到服务器发送的数据流通路成功建立的ACK(Acknowledgement)确认消息后,实时采集终端上的系统日志数据或modem日志数据,通过数据流通路向服务器实时发送实时系统日志数据或实时modem日志数据。在数据流通路建立成功之后,终端还在数据流通路上向服务器发送唯一标识给服务器,服务器根据此唯一标识来识别当前数据流通路传输的数据所属的终端设备,其中唯一标识可以包括:IMEI、SN、设备名称和日志类型。
通过数据流通路来导出终端的实时modem日志数据,从而可以实现主动获取终端的 modem日志数据,无需通过连接PC端上的导出工具来获取终端的modem日志数据,可以实现更方便地获取终端的modem日志数据,进而通过modem日志数据对终端的运行状态进行诊断。
步骤S105、获取历史日志数据,通过控制信道向服务器发送历史日志数据。
具体来说,终端内具有本地存储单元,被设置为存储终端的历史日志数据,其中,历史日志数据包括:syslog、dmesg、防火墙状态、CPU运行效率、电池使用寿命等等设备信息。当日志获取指令中包括历史日志获取指令时,终端将本地存储单元中存储的历史日志数据,通过控制信道发送至服务器,例如将历史日志数据打包集合后,填充在JSON格式消息的数据域中,使用msgid2消息类型将历史日志数据发送至服务器。
另外,当终端从控制信道接收到msgid6消息类型的系统日志关闭指令和/或modem日志关闭指令后,关闭建立的数据流通路,并停止实时采集系统日志和实时采集modem日志。
本发明实施方式提供的日志获取方法,通过建立终端与服务器之间的数据流通路,可以实现远程获取终端设备的实时运行日志数据,避免了一些情形中用户必须近距离与终端设备连接才能导出日志数据的弊端,为用户远程获取终端的运行日志数据进行诊断提供了极大的便利,对于普通用户而言,用户可以远程查看设备的运行状态,对于运营商而言,运营商可以不需要安排工作人员到设备现场进行诊断,从而可以减少运营商的人力成本。
本发明的第二实施方式提供一种日志获取方法。第二实施方式与第一实施方式大致相同,不同之处在于,在接收服务器发送的日志获取指令之前,还包括接收服务器发送的开启日志功能请求,并基于TCP协议与服务器建立控制信道;接收服务器发送的日志获取指令为:通过控制信道接收日志获取指令。
图4为本实施方式提供的日志获取方法的流程示意图,图5为本实施方式提供的日志获取方法的交互示意图,以下将结合附图对本实施方式提供的日志获取方法进行详细说明,相同或相似的技术细节,请参考上以实施方式中的具体描述,在此不再赘述。
步骤S201、接收开启日志功能请求。
本实施方式中,服务器可以在查询获取到终端的IMEI号之后,通过TR069协议向终端发送开启日志功能请求,开启日志功能请求中携带有服务器的IP地址、端口信息。执行步骤S201之后可以直接执行步骤S203,还可以是执行步骤S202之后再执行步骤S203。
步骤S202、验证服务器身份,若验证通过,执行步骤S203、基于TCP协议与服务器建立控制信道;若验证不通过,执行步骤S204、反馈不通过。
其中,本实施方式开启日志功能请求中还可以携带密钥,在基于TCP协议与服务器建立控制信道之前,还可以包括:基于密钥验证出服务器的身份为合法身份。
具体来说,终端在接收到开启日志功能请求之后,基于密钥验证服务器的身份,如果密钥验证通过,服务器身份为合法,执行步骤S203与服务器建立控制信道。如果密钥验证不通过,则服务器身份不合法,则向服务器反馈密钥错误、身份验证不通过的消息。
在与服务器建立控制信道之前,验证服务器身份的合法性,可以避免终端的日志数据被非法获取,保证终端日志数据的安全性。
步骤S203、基于TCP协议与服务器建立控制信道。
具体地说,在服务器身份验证通过后,根据开启日志功能请求中的IP地址和端口信息,与服务器建立基于TCP(Transmission Control Protocol,传输控制协议)协议的控制信道。
步骤S205、接收服务器发送的日志获取指令。
步骤S206、识别日志获取指令的类型,若日志获取指令为系统日志获取指令和/或modem日志获取指令,执行步骤S207、响应于日志获取指令,建立与服务器之间的数据流通路;若日志获取指令为历史日志获取指令,执行步骤S209、获取历史日志数据,通过控制信道向服务器发送历史日志数据。
步骤S207、响应于日志获取指令,建立与服务器之间的数据流通路。
步骤S208、采集终端的实时日志数据,并通过数据流通路将实时日志数据发送至服务器。
步骤S209、获取历史日志数据,通过控制信道向服务器发送历史日志数据。
需要说明的是,步骤S205、S206、S207、S208和S209与上一实施方式中的步骤S101、S102、S103、S04和S105相同,具体请参考上一实施方式中的描述,在此不再赘述。
与上一实施方式相比,本实施方式在需要时才开启日志数据的获取功能,避免终端始终处于获取日志的工作状态,避免不必要的功耗;并且还验证服务器身份的合法性,可以避免终端的日志数据被非法获取,保证终端日志数据的安全性。
本发明的第三实施方式涉及一种日志获取方法,应用于服务器,包括:向终端发送日志获取指令;响应于终端基于日志获取指令发起的数据流通路连接请求,建立与终端之间的数据流通路;通过数据流通路接收终端发送的实时日志数据。
图6为本实施方式提供的日志获取方法的流程示意图,以下将结合附图对本实施方式提供的日志获取方法进行详细说明,相同或相似的技术细节,请参考上以实施方式中的具体描述,在此不再赘述。需要说明的是,本实施方式中,服务器可以是ACS服务器。
步骤S301、向终端发送日志获取指令。
其中,在步骤S301之前还可以包括:向终端发送开启日志功能请求。通过向终端发送开启日志功能请求来开启终端的日志获取功能,使得在需要时才开启终端的日志数据获取功能,避免终端始终处于获取日志的工作状态,避免不必要的功耗。
另外,开启日志功能请求中还可以包含用于供终端验证服务器的身份的密钥,在接收到终端反馈的确认信息之后,与终端建立控制信道,其中,确认信息由终端在基于密钥验证出服务器的身份为合法身份后发出,向终端发送日志获取指令具体为:通过控制信道向终端发送日志获取指令。
在建立控制信道之前,向终端发送密钥供终端来验证服务器身份的合法性,可以避免终端的日志数据被非法获取,保证终端日志数据的安全性。
步骤S302、响应于终端基于日志获取指令发起的数据流通路建立请求,建立与终端之间的数据流通路。
步骤S303、通过数据流通路接收终端发送的实时日志数据。
日志获取指令可以包括系统日志获取指令、modem日志获取指令和/或历史日志获取指令,当向终端发送的日志获取指令包括系统日志获取指令和/或modem日志获取指令时,通过数据流通路接收终端发送的与日志获取指令对应的实时日志数据;当向终端发送的日志获取指令包括历史日志获取指令时,通过控制信道接收终端发送的历史日志数据。
服务器将接收到的系统日志数据流、modem日志数据流实时保存在对应的文件中,以及将从数据域中提取的历史日志数据保存在对应的文件中,以供用户读取文件中的日志数据。
不难发现,本实施方式为上述实施方式相对应的服务器实施方式,本实施方式可与上述实施方式互相配合实施。上述实施方式中提到的相应技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相应技术细节也可应用在上述实施方式中。
本发明实施方式提供的日志获取方法,通过建立终端与服务器之间的数据流通路,可以实现远程获取终端设备的实时运行日志数据,避免了一些情形中用户必须近距离与终端设备连接才能导出日志数据的弊端,为用户远程获取终端的运行日志数据进行诊断提供了极大的便利,对于普通用户而言,用户可以远程查看设备的运行状态,对于运营商而言,运营商可以不需要安排工作人员到设备现场进行诊断,从而可以减少运营商的人力成本。
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本发明的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在本发明的保护范围内。
本发明第四实施方式提供一种日志获取装置,参考图7,日志获取装置内置于终端10,包括:主控通信模块11,被设置为接收服务器发送的日志获取指令,并响应于日志获取指令,建立与服务器的数据流通路;日志获取模块12,被设置为采集终端的实时日志数据,通过数 据流通路将实时日志数据发送至服务器。
图7为本实施方式提供的日志获取装置的结构示意图,以下将结合附图对本实施方式提供的日志获取装置进行详细说明,相同或相似的技术细节请参考上述实施方式中的具体描述,在此不再赘述。
需要说明的是,日志获取模块12可以包括:系统日志模块13和调制解调器(modem)日志模块14;系统日志获取模块13被设置为在日志获取指令包括系统日志获取指令时,采集终端的实时系统日志数据,并通过数据流通路将实时系统日志数据发送至服务器;modem日志模块14被设置为在日志获取指令包括modem日志获取指令时,采集终端的实时modem日志数据,并通过数据流通路将实时modem日志数据发送至服务器。
需要说明的是,日志获取装置还可以包括:本地存储单元15,被设置为存储终端的历史日志数据;主控通信模块11还被设置为在日志获取指令包括历史日志获取指令时,从本地存储单元15获取历史日志数据,并通过控制信道向服务器发送历史日志数据。
另外,日志获取装置还可以包括:启动模块16,被设置为接收服务器发送的开启日志功能请求,开启日志功能请求中包含密钥,并基于密钥验证服务器的身份的合法性;还被设置为在服务器身份验证结果为合法之后,通知主控通信模块11与服务器建立控制信道。
需要说明的是,启动模块16可以为TR069模块,服务器可以为TR069 ACS服务器。本实施方式中,出于终端信息安全方面的考虑,日志获取模块12、主控通信模块11正常情况下处于关闭不工作状态,只有在用户需要获取终端的日志数据时,通过TR069协议反向控制终端设备,TR069模块启动主控通信模块11和日志获取模块12,并将服务器的IP地址和端口信息通知主控通信模块11,供主控通信模块与服务器建立连接。
终端10具有WAN接口,在WAN接口上可以通过调制解调器(modem)、无线网络WI-FI或者rj45网线连接到互联网,通过互联网与服务器连接。
需要说明的是,本实施方式中的主控通信模块11、日志获取模块12、本地存储单元15可以是集成在一个日志管理模块中。
不难发现,本实施方式为第一、第二实施方式相对应的装置实施方式,本实施方式可与第一、第二实施方式互相配合实施。第一、第二实施方式中提到的相应技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相应技术细节也可应用在第一、第二实施方式中。
本发明第五实施方式提供一种终端,如图8所示,包括至少一个处理器501;以及,与至少一个处理器501通信连接的存储器502;其中,存储器502存储有可被至少一个处理器501执行的指令,指令被至少一个处理器501执行,以使至少一个处理器501能够执行上述 应用于终端的日志获取方法。
本发明第六实施方式还提供一种服务器,本实施方式提供的服务器的结构示意图可以参考图8,如图8所示,服务器可以包括至少一个处理器501;以及,与至少一个处理器501通信连接的存储器502;其中,存储器502存储有可被至少一个处理器501执行的指令,指令被至少一个处理器501执行,以使至少一个处理器501能够执行上述应用于服务器的日志获取方法。
其中,终端内的处理器和存储器的连接方式和服务器内的处理器和存储器的连接方式类似,具体如下。
存储器502和处理器501采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器501和存储器502的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器501处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器501。
处理器501负责管理总线和通常的处理,还可以提供各种功能,包括定时、外围接口、电压调节、电源管理以及其他控制功能。而存储器502可以被设置为存储处理器501在执行操作时所使用的数据。
本发明的实施方式还提供了一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现上述应用于终端的日志获取方法,或者实现上述应用于服务器的日志数据获取方法。
即,本领域技术人员可以理解,实现上述实施方式方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本发明各个实施方式所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
本发明的实施方式提供一种日志获取方法、装置、终端、服务器和计算机可读存储介质,使得可以实现远程获取终端的日志数据。本发明实施方式通过建立终端与服务器之间的数据流通路,可以实现远程获取终端设备的实时运行日志数据,避免了一些情形中用户必须近距离与终端设备连接才能导出日志数据的弊端,为用户远程获取终端的运行日志数据进行诊断 提供了极大的便利,对于普通用户而言,用户可以远程查看设备的运行状态,对于运营商而言,运营商可以不需要安排工作人员到设备现场进行诊断,从而可以减少运营商的人力成本。
本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施方式,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。任何本领域技术人员,在不脱离本发明的精神和范围内,均可作各自更动与修改,因此本发明的保护范围应当以权利要求限定的范围为准。

Claims (15)

  1. 一种日志获取方法,应用于终端,所述方法包括:
    接收服务器发送的日志获取指令;
    响应于所述日志获取指令,建立与所述服务器之间的数据流通路;
    采集所述终端的实时日志数据,并通过所述数据流通路将所述实时日志数据发送至所述服务器。
  2. 根据权利要求1所述的日志获取方法,其中,所述日志获取指令包括以下日志获取指令的至少其中一种:系统日志获取指令、调制解调器日志获取指令;其中,
    所述日志获取指令包括系统日志获取指令时,所述实时日志数据包括实时系统日志数据;
    所述日志获取指令包括调制解调器日志获取指令时,所述实时日志数据包括实时调制解调器日志数据。
  3. 根据权利要求1所述的日志获取方法,在所述接收服务器发送的日志获取指令之前,还包括:
    接收所述服务器发送的开启日志功能请求,并基于TCP协议与所述服务器建立控制信道;
    所述接收服务器发送的日志获取指令为:通过所述控制信道接收所述日志获取指令。
  4. 根据权利要求3所述的日志获取方法,其中,所述开启日志功能请求中包含密钥,在所述基于TCP协议与所述服务器建立控制信道之前,还包括:
    基于所述密钥验证出所述服务器的身份为合法身份。
  5. 根据权利要求3所述的日志获取方法,其中,所述日志获取指令包括历史日志获取指令,所述日志获取方法还包括:
    从本地存储单元中获取历史日志数据;
    通过所述控制信道向所述服务器发送所述历史日志数据。
  6. 根据权利要求1所述的日志获取方法,其中,所述建立与所述服务器之间的数据流通路,包括:
    基于套接字机制建立所述数据流通路。
  7. 一种日志获取方法,应用于服务器,所述方法包括:
    向终端发送日志获取指令;
    响应于所述终端基于所述日志获取指令发起的数据流通路建立请求,建立与所述终端之间的数据流通路;
    通过所述数据流通路接收所述终端发送的实时日志数据。
  8. 根据权利要求7所述的日志获取方法,在所述向终端发送日志获取指令之前,还包括:
    向所述终端发送开启日志功能请求,所述开启日志功能请求中包含用于供所述终端验证 所述服务器的身份的密钥;
    在接收到所述终端反馈的确认信息之后,与所述终端建立控制信道;其中,所述确认信息由所述终端在基于所述密钥验证出所述服务器的身份为合法身份后发出;
    所述向终端发送日志获取指令为:通过所述控制信道向所述终端发送所述日志获取指令。
  9. 一种日志获取装置,所述日志获取装置内置于终端,所述装置包括:
    主控通信模块,被设置为接收服务器发送的日志获取指令,并响应于所述日志获取指令,建立与所述服务器的数据流通路;
    日志获取模块,被设置为采集所述终端的实时日志数据,通过所述数据流通路将所述实时日志数据发送至所述服务器。
  10. 根据权利要求9所述的日志获取装置,其中,所述日志获取模块还包括:系统日志模块和调制解调器日志模块;
    所述系统日志获取模块被设置为在所述日志获取指令包括系统日志获取指令时,采集所述终端的实时系统日志数据,并通过所述数据流通路将所述实时系统日志数据发送至所述服务器;
    所述调制解调器日志模块被设置为在所述日志获取指令包括调制解调器日志获取指令时,采集所述终端的实时调制解调器日志数据,并通过所述数据流通路将所述实时调制解调器日志数据发送至所述服务器。
  11. 根据权利要求9所述的日志获取装置,还包括:
    本地存储单元,被设置为存储所述终端的历史日志数据;
    所述主控通信模块还被设置为在所述日志获取指令包括历史日志获取指令时,从所述本地存储单元获取所述历史日志数据,并通过控制信道向所述服务器发送所述历史日志数据。
  12. 根据权利要求9所述的日志获取装置,还包括:
    启动模块,被设置为接收所述服务器发送的开启日志功能请求,所述开启日志功能请求中包含密钥,并基于所述密钥验证所述服务器的身份的合法性;还被设置为在所述服务器身份验证结果为合法之后,通知所述主控通信模块与所述服务器建立控制信道。
  13. 一种终端,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至6中任一所述的日志获取方法。
  14. 一种服务器,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求7至8中任一所述的日志获取方法。
  15. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1至6中任一所述的日志获取方法,或者实现如权利要求7至8中任一所述的日志获取方法。
PCT/CN2021/076766 2020-05-14 2021-02-18 日志获取方法、装置、终端、服务器和计算机可读存储介质 WO2021227588A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2022553077A JP2023516417A (ja) 2020-05-14 2021-02-18 ログ取得方法、端末及びサーバ
EP21804127.5A EP4102776A4 (en) 2020-05-14 2021-02-18 METHOD AND APPARATUS FOR ACQUISITION OF LOG, TERMINAL, SERVER AND COMPUTER READABLE RECORDING MEDIA
US17/905,786 US20230114166A1 (en) 2020-05-14 2021-02-18 Log acquisition method and apparatus, terminal, server, and computer readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010407845.8A CN113672478A (zh) 2020-05-14 2020-05-14 日志获取方法、装置、终端、服务器和存储介质
CN202010407845.8 2020-05-14

Publications (1)

Publication Number Publication Date
WO2021227588A1 true WO2021227588A1 (zh) 2021-11-18

Family

ID=78526274

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/076766 WO2021227588A1 (zh) 2020-05-14 2021-02-18 日志获取方法、装置、终端、服务器和计算机可读存储介质

Country Status (5)

Country Link
US (1) US20230114166A1 (zh)
EP (1) EP4102776A4 (zh)
JP (1) JP2023516417A (zh)
CN (1) CN113672478A (zh)
WO (1) WO2021227588A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115209394A (zh) * 2022-05-31 2022-10-18 深圳市广和通无线股份有限公司 日志抓取方法、装置、设备及存储介质
CN115363752B (zh) * 2022-08-22 2023-03-28 华平祥晟(上海)医疗科技有限公司 智能手术路径指引系统
CN116701336A (zh) * 2023-05-19 2023-09-05 国网物资有限公司 电力数据日志处理方法、电子设备和计算机可读介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150302694A1 (en) * 2013-08-06 2015-10-22 Patent Investment & Licensing Company Method for retrieving an identity card associated with an electronic gaming machine
CN110912998A (zh) * 2019-11-26 2020-03-24 福建汉特云智能科技有限公司 一种基于远程设备端的车辆问题排查系统及方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7308487B1 (en) * 2000-12-12 2007-12-11 Igate Corp. System and method for providing fault-tolerant remote controlled computing devices
FR2951343A1 (fr) * 2009-10-14 2011-04-15 Alcatel Lucent Gestion de dispositif de communication a travers un reseau de telecommunications
WO2013030296A1 (en) * 2011-08-31 2013-03-07 Technicolor Delivery Technologies Belgium Method for a secured backup and restore of configuration data of an end-user device, and device using the method
CN103840953B (zh) * 2012-11-21 2017-10-31 中兴通讯股份有限公司 远程日志实时获取方法及系统
US9331917B2 (en) * 2014-01-01 2016-05-03 Bank Of America Corporation Integrated production support
US20160171539A1 (en) * 2014-12-12 2016-06-16 Staples, Inc. Inference-Based Behavioral Personalization and Targeting

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150302694A1 (en) * 2013-08-06 2015-10-22 Patent Investment & Licensing Company Method for retrieving an identity card associated with an electronic gaming machine
CN110912998A (zh) * 2019-11-26 2020-03-24 福建汉特云智能科技有限公司 一种基于远程设备端的车辆问题排查系统及方法

Also Published As

Publication number Publication date
US20230114166A1 (en) 2023-04-13
JP2023516417A (ja) 2023-04-19
CN113672478A (zh) 2021-11-19
EP4102776A1 (en) 2022-12-14
EP4102776A4 (en) 2023-07-26

Similar Documents

Publication Publication Date Title
WO2021227588A1 (zh) 日志获取方法、装置、终端、服务器和计算机可读存储介质
CN112714193B (zh) 基于物联网平台的社区数据处理系统、方法、装置和设备
CN106603565A (zh) 一种数据传输、显示的方法及设备
US10885174B2 (en) IOT-enabled device and a method for manufacturing an IoT device
EP3534257B1 (en) System for updating software in moving body using vehicle-mounted gateway
US20100202451A1 (en) Modified internet protocol (ip) data packet for asynchronous ip communications
US20220188095A1 (en) Method for storing and transmitting data by using vehicle key and apparatus
EP3252997A1 (en) An iot-enabled device and a method for providing internet connectivity to a device
WO2021057802A1 (zh) 管理das系统的方法和设备、电子设备、存储介质
CN112652089A (zh) 诊断方法、车辆、系统及存储介质
US20230199502A1 (en) Apparatus and Method for Remotely Managing Devices, and Program Therefor
CN116647589A (zh) 一种车辆诊断通信方法、装置、设备及介质
CN104618341B (zh) 用于安全的远程访问的系统和方法
CN109523661A (zh) 一种安全监控方法、装置、系统、服务器及可读存储介质
CN117336035A (zh) 一种基于物联网网关的边端设备的管理协同方法
US20160294558A1 (en) Information collection system and a connection control method in the information collection system
CN116546056A (zh) 一种基于车载通信终端的远程标定方法及装置
CN116545623A (zh) 密钥灌装方法、装置、系统和设备
CN108924225A (zh) 基于Android的FlexRay车辆远程监控方法
CN116112559A (zh) 一种远程服务器管理控制方法、系统及存储介质
CN115086385A (zh) 车云间数据交互方法、装置及计算机可读存储介质
CN110300105B (zh) 一种网络密码机的远程密钥管理方法
CN113311808A (zh) 基于dtu的车载联网终端
CN116545999B (zh) 一种基于b/s架构的望远镜读出控制系统
CN114237195A (zh) 一种obd排放诊断方法及相关设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21804127

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022553077

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2021804127

Country of ref document: EP

Effective date: 20220907

NENP Non-entry into the national phase

Ref country code: DE