CN111628967B - Log data transmission method and device, computer equipment and storage medium - Google Patents

Log data transmission method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111628967B
CN111628967B CN202010311062.XA CN202010311062A CN111628967B CN 111628967 B CN111628967 B CN 111628967B CN 202010311062 A CN202010311062 A CN 202010311062A CN 111628967 B CN111628967 B CN 111628967B
Authority
CN
China
Prior art keywords
log data
log
protocol
data packet
communication
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
CN202010311062.XA
Other languages
Chinese (zh)
Other versions
CN111628967A (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 CN202010311062.XA priority Critical patent/CN111628967B/en
Publication of CN111628967A publication Critical patent/CN111628967A/en
Application granted granted Critical
Publication of CN111628967B publication Critical patent/CN111628967B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • 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/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a log data transmission method and device, a computer device and a storage medium. The method comprises the following steps: when a server program is operated in an application layer of communication routing equipment, a client program is started to acquire a corresponding protocol parameter of the communication routing equipment in a local area network; establishing communication connection with the communication routing equipment according to the protocol parameters; sending a log list access request to the communication routing device; and receiving a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access request, and analyzing the plurality of log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets. By adopting the method, a plurality of different test terminals can simultaneously and quickly acquire the transmitted log data, and the efficiency of log data transmission is effectively improved.

Description

Log data transmission method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for transmitting log data, a computer device, and a storage medium.
Background
With the development of computer technology, various types of electronic devices such as personal computers, smart phones, communication routing devices and the like are increasing, and particularly when the communication routing devices are in a research, development and debugging stage, the generated log data need to be transmitted in real time in order to quickly find the location problem. In a conventional manner, a log data transmission channel can be opened by installing a log tool in a module and a test terminal of a communication device in a technique for transmitting log data.
However, in the current log data transmission mode, when a plurality of test terminals need to acquire real-time log data generated by the communication equipment module, the transmission is performed by using a traditional log tool, and only one-to-one transmission can be realized, and meanwhile, a large amount of time needs to be consumed to verify the transmission permission of different test terminals, so that the real-time log data of the communication equipment module cannot be acquired by the plurality of test terminals quickly and effectively, and the log transmission efficiency is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a log data transmission method, apparatus, computer device, and storage medium capable of improving log data transmission efficiency.
A method of transmitting log data, the method comprising:
when a server program is operated in an application layer of communication routing equipment, a client program is started to acquire a corresponding protocol parameter of the communication routing equipment in a local area network;
establishing communication connection with the communication routing equipment according to the protocol parameters;
sending a log list access request to the communication routing device;
and receiving a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access request, and analyzing the plurality of log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets.
In one embodiment, the parsing the plurality of log fragmentation protocol packets using a preset communication protocol includes:
the preset communication protocol comprises the name of the log data packet, the unpacking of the log data packet, the convention protocol of the package, the data length of the log data packet and the mode of checking the data packet.
In one embodiment, the parsing the plurality of log fragmentation protocol packets using a preset communication protocol includes:
unpacking the plurality of log segmentation protocol packets according to a preset communication protocol to obtain a byte value and a byte offset value corresponding to each segment of log protocol packet;
and acquiring byte information corresponding to the byte offset value from the byte value, and acquiring corresponding log data packet information according to the byte information.
In one embodiment, the obtaining the corresponding log data packet information according to the byte information includes:
acquiring character string information corresponding to the log data packet information;
and decrypting the character string information by using a key, a byte offset value and a decryption function in a preset communication protocol to obtain corresponding log data.
In one embodiment, the method further comprises:
randomly extracting information corresponding to preset byte number in each log data packet, and checking the information corresponding to the byte number to obtain a corresponding check value;
and comparing the check value with a preset threshold value to obtain a corresponding check result.
In one embodiment, the method further comprises:
when log data are transmitted, monitoring the byte length of each log data packet in real time;
when the monitored byte length of the log data packet is larger than a preset threshold value, automatically segmenting the log data packet to obtain a plurality of segmented log data packets.
In one embodiment, the method further comprises:
acquiring the transmission state of a current transmission log data packet;
and sending an instruction for automatically adjusting the data length of the log data packet and the time interval for automatically transmitting the data packet to the communication routing equipment according to the transmission state, and adjusting the capacity and the speed for transmitting the log data packet.
An apparatus for transmitting log data, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for starting a client program when a server program is operated in an application layer of communication routing equipment, and acquiring a corresponding protocol parameter of the communication routing equipment in a local area network;
the connection module is used for establishing communication connection with the communication routing equipment according to the protocol parameter;
a sending module, configured to send a log list access request to the communication routing device;
and the analysis module is used for receiving a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access request, and analyzing the plurality of log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
when a server program is operated in an application layer of communication routing equipment, a client program is started to acquire a corresponding protocol parameter of the communication routing equipment in a local area network;
establishing communication connection with the communication routing equipment according to the protocol parameters;
sending a log list access request to the communication routing device;
and receiving a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access request, and analyzing the plurality of log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
when a server program is operated in an application layer of communication routing equipment, a client program is started to acquire a protocol parameter corresponding to the communication routing equipment in a local area network;
establishing communication connection with the communication routing equipment according to the protocol parameters;
sending a log list access request to the communication routing device;
and receiving a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access request, and analyzing the plurality of log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets.
According to the log data transmission method, the log data transmission device, the computer equipment and the storage medium, when the server program is operated in the application layer of the communication routing equipment, the client program is started, the protocol parameters corresponding to the communication routing equipment in the local area network are obtained, and communication connection is established with the communication routing equipment according to the protocol parameters. Compared with the traditional log data transmission mode, the log data transmission method includes the steps of sending a log list access request to communication routing equipment, receiving a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access request, and analyzing the log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets. Therefore, when a plurality of different test terminals need to acquire real-time log data generated by a certain communication routing device at the same time, the local area network can be used for being in communication connection with the communication routing device, the plurality of log segmentation protocol packets are analyzed by using a preset communication protocol according to the log list access requests sent by the different terminals to the communication routing device and the plurality of transmitted log segmentation protocol packets by the communication routing device, and the corresponding real-time log data packets are obtained, so that the plurality of different test terminals can acquire the transmitted log data quickly at the same time, the log data transmission efficiency is effectively improved, and the communication routing device test efficiency is also improved.
Drawings
FIG. 1 is a diagram of an exemplary implementation of a method for transferring log data;
FIG. 2 is a flowchart illustrating a method for transferring log data according to an embodiment;
FIG. 3 is a flowchart illustrating a parsing step for multiple log fragmentation protocol packets using a predetermined communication protocol in one embodiment;
FIG. 4 is a schematic flow chart diagram that illustrates the steps performed in one embodiment to verify each log packet;
FIG. 5 is a block diagram showing a configuration of a log data transmission apparatus according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
The log data transmission method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the communication routing device 104 via a network. When a server program is run in an application layer of the communication routing device 104, the terminal 102 starts a client program, obtains a protocol parameter corresponding to the communication routing device 104 in the local area network, and establishes a communication connection with the communication routing device 104 according to the protocol parameter. The terminal 102 sends a log list access request to the communication routing device 104, the terminal 102 receives a plurality of log segmentation protocol packets sent by the communication routing device 104 according to the log list access request, and the terminal 102 analyzes the plurality of log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the communication routing device 104 may be, but is not limited to, various 5G communication modules, 5G communication routing devices, wired communication devices, wireless communication devices, and vehicle-mounted communication devices.
In an embodiment, as shown in fig. 2, a method for transmitting log data is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and includes the following steps:
step 202, when the server program is run in the application layer of the communication routing device, the client program is started to obtain the protocol parameters corresponding to the communication routing device in the local area network.
The terminal can communicate with the communication routing device through the network, and the terminal can keep an online state through network communication connection. For example, different types of terminal devices can be transmitted by connecting to a local area network and then using a network stabilized by an operator. The communication routing device may include a communication module, such as a 5G communication module, having a routing function. In the stage of research and development, a server program may be added to a module of the communication device in advance, for example, the module of the communication device is a Linux system, and a multi-user network operating system with stable performance may be used, that is, the server program is run in the Linux system. When the server program is operated in the application layer of the communication routing equipment, the terminal obtains the corresponding protocol parameter of the target communication routing equipment in the local area network by starting the client program. Specifically, the client program may be added to the terminal side in advance, that is, the client program may be run in the terminal. After the terminal starts the client program, the terminal can acquire the corresponding protocol parameter of the communication routing device in the local area network through the DHCP protocol. A Dynamic Host Configuration Protocol (DHCP), which is a network Protocol of a local area network, works using a UDP Protocol, and can automatically allocate IP addresses to an internal network or a network service provider, thereby implementing centralized management and allocation of IP addresses, enabling a Host in a network environment to dynamically obtain information such as IP addresses, gateway addresses, DNS server addresses, and the like, and improving the utilization rate of addresses. The existing communication routing equipment is internally provided with a DHCP program. When the communication routing equipment with the built-in DHCP service routine receives the information of the application address from the network terminal, the communication routing equipment sends the information of the relevant address configuration and the like to the network terminal so as to realize the dynamic configuration of the address information of a plurality of network terminals. The terminal obtains a Protocol parameter corresponding to the communication routing device in the local area network, where the Protocol parameter may include information such as related Address configuration, for example, an IP Address (Internet Protocol Address) refers to an Internet Protocol Address and is translated into an Internet Protocol Address. The IP address is a unified address format provided by the IP protocol, and it allocates a logical address to each network and each host on the internet, i.e. the terminal can establish a communication connection by acquiring the corresponding IP address of the communication routing device in the local area network.
In addition, a client program can be set in the terminal in advance, the client program architecture can utilize the framework of MFC + Duilib, MFC Microsoft Foundation Classes (Microsoft Foundation Classes, abbreviated as MFC) is a class library provided by Microsoft corporation, windows API is packaged in the form of C + + class, and an application program framework is included, wherein the application program framework includes a large number of Windows handle package Classes and a large number of built-in control and component package Classes of Windows. Duilib is a powerful interface development tool that can completely separate the user interface from the processing logic. The client window program can be subjected to customized interactive operation and exquisite UI design by using an MFC (micro-functional integrated circuit) development client window program and then utilizing a Duilib page development tool, and the combination of the client window program and the Duilib page development tool can realize convenience in MFC development and customization and attractiveness of Duilib. The network communication uses a TCP/IP reliable protocol, and is compiled into a 32-bit program, and the suffix name is EXE, so that the customized aesthetic design of the client window program is realized.
And step 204, establishing communication connection with the communication routing equipment according to the protocol parameters.
And after the terminal acquires the protocol parameters corresponding to the communication routing equipment by starting a preset client program, the terminal establishes communication connection with the communication routing equipment according to the protocol parameters. Specifically, a plurality of different types of terminal devices may send a protocol parameter acquisition request message to a communication routing device in a local area network by starting a client program, the communication routing device searches for a corresponding protocol parameter in the local area network, issues the corresponding protocol parameter in the local area network in the form of a message, and when receiving a message that is returned by the plurality of terminals and receives the protocol parameter, the communication routing device establishes a communication connection with the plurality of different types of terminals according to the protocol parameter.
Step 206, sending the log list access request to the communication routing device.
After a plurality of different types of terminals establish communication connection with the communication routing device according to the protocol parameters at the same time, the plurality of terminals may send log list access requests to the communication routing device at the same time. The log list access request may include multiple types of log data access lists, which may include, for example, system application layer log data (AP logs), system Kernel log data (Kernel logs), and system debug log data (Modem logs) in the communication routing module system. Different developers can send different types of log data access requests to the target communication routing equipment by starting the client program according to different requirements, wherein the log data access requests can include real-time log data acquisition and generated log files.
And step 208, receiving a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access request, and analyzing the plurality of log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets.
After the plurality of terminals simultaneously send the log list access request to the communication routing equipment, the plurality of terminals respectively receive a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access request, and different terminals analyze the plurality of log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets. A segmented protocol packet refers to a corresponding protocol packet generated according to different protocol types, for example, protocol data may include an IP packet, a TCP packet, a UDP packet, a DNS packet, and the like. Among them, TCP/IP (Transmission Control Protocol/Internet Protocol) refers to a Protocol cluster that can realize information Transmission among a plurality of different networks. A TCP packet generated according to the TCP protocol may include a header and a data portion, and the length of the TCP packet is not fixed, wherein the header length is not fixed and the data portion length is not fixed. Specifically, when a plurality of terminals respectively receive a plurality of log segmentation protocol packets sent by a target communication routing device according to a log list access request, different terminals obtain character stream contents corresponding to the log protocol packets by using a preset communication protocol. Further, when the terminal selects and acquires the real-time log data stream of the current communication routing device, the communication routing device sends the corresponding real-time log character stream to the corresponding terminal through a preset protocol and an encryption mode. When the terminal receives the real-time log data stream sent by the communication routing equipment, the terminal analyzes the real-time log data stream according to a preset communication protocol and a decryption mode, and meanwhile, the terminal verifies the character data stream according to the preset protocol to obtain verified log data content. When the terminal selects and acquires the log file which is generated by the target communication routing equipment, the target communication routing equipment sends the corresponding generated log file to the corresponding terminal through a preset protocol and an encryption mode. When the terminal receives the log file sent by the target communication routing device, the terminal analyzes the log file according to a preset communication protocol and a decryption mode, and meanwhile, the terminal can check the correctness of a log file packet according to the preset protocol to obtain the checked log data content.
In this embodiment, when the server program is run in the application layer of the communication routing device, the client program is started, the protocol parameter corresponding to the communication routing device in the local area network is obtained, and a communication connection is established with the communication routing device according to the protocol parameter. Compared with the traditional log data transmission mode, the log data transmission method includes the steps of sending a log list access request to communication routing equipment, receiving a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access request, and analyzing the log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets. Therefore, when a plurality of different test terminals need to acquire real-time log data generated by a certain communication routing device at the same time, the local area network can be used for being in communication connection with the communication routing device, the log segmentation protocol packets are analyzed by using a preset communication protocol according to a plurality of log segmentation protocol packets sent by the communication routing device according to log list access requests sent by the different terminals to the communication routing device, and corresponding real-time log data packets are obtained, so that the plurality of different test terminals can acquire the transmitted log data at the same time, the efficiency of log data transmission is effectively improved, and the efficiency of testing the communication routing device is also improved.
In one embodiment, as shown in fig. 3, the parsing the plurality of log fragmentation protocol packets using the predetermined communication protocol comprises:
step 302, unpacking a plurality of log segmentation protocol packets according to a preset communication protocol to obtain a byte value and a byte offset value corresponding to each segment of log protocol packet.
And 304, acquiring byte information corresponding to the byte offset value from the byte value, and acquiring corresponding log data packet information according to the byte information.
And after the terminal acquires the protocol parameters corresponding to the communication routing equipment by starting a preset client program, the terminal establishes communication connection with the communication routing equipment according to the protocol parameters. When a plurality of terminals send log list access requests to communication routing equipment at the same time, the plurality of terminals respectively receive a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access requests, and the terminals analyze the plurality of log segmentation protocol packets by using a preset communication protocol. Specifically, the terminal may unpack the plurality of log segmentation protocol packets according to a preset communication protocol to obtain a byte value and a byte offset value corresponding to each segment of the log protocol packet. The preset communication protocol may include a name of the log data packet, unpacking of the log data packet, an agreed protocol of the package, a data length of the log data packet, and a mode of checking the data packet. And the terminal acquires the byte value and the byte deviant corresponding to each log protocol packet according to the agreed unpacking mode in the preset communication protocol. The terminal can unpack the plurality of log segmentation protocol packets according to a preset communication protocol and a TCP protocol, and respectively obtain a byte value and a byte offset value corresponding to each log protocol packet. Further, the terminal may obtain byte information corresponding to the byte offset value from the byte value, that is, calculate the corresponding original log data packet information according to the byte information. And the plurality of terminals can simultaneously acquire different log data packets according to different test requirements and analyze the log data packets to obtain corresponding log data information. Therefore, when different terminal devices need to acquire the log data in a specific time period or a specific type, the received log protocol packets in different types can be unpacked and analyzed automatically according to the preset communication protocol, the complex process of manual operation is avoided, the transmitted log data packets can be analyzed quickly and effectively by a plurality of terminals at the same time, and the efficiency of log data transmission is improved effectively.
In one embodiment, the step of obtaining the corresponding log packet information according to the byte information includes:
and acquiring character string information corresponding to the log data packet information.
And decrypting the character string information by using a key, a byte offset value and a decryption function in a preset communication protocol to obtain corresponding log data.
The plurality of terminals can unpack the plurality of log segmentation protocol packets according to a preset communication protocol to obtain corresponding log data packet information. Specifically, the terminal may obtain original string information corresponding to the log data packet information, and the terminal decrypts the string information by using a key, a decryption function, and an offset value of a byte agreed in a preset communication protocol, to obtain decrypted complete original log data. The method includes the steps that a light encryption mode can be preset in a preset protocol, and after mixed operation is carried out according to an offset value of bytes, character string information corresponding to encrypted log data is obtained. Meanwhile, transcoding and encrypting the original log data in a symmetric encryption mode to obtain character string information corresponding to the log data after symmetric encryption. And the terminal decrypts the character string information according to the encryption mode preset in the acquired preset communication protocol to obtain corresponding log data. Therefore, even when log data are transmitted to a plurality of different types of terminals at the same time, the security of transmitting the log data to the plurality of terminals at the same time can be ensured by setting different encryption transmission communication protocols.
In an embodiment, as shown in fig. 4, the method further includes a step of verifying each log data packet, which specifically includes:
step 402, randomly extracting information corresponding to a preset byte number in each log data packet, and checking the information corresponding to the byte number to obtain a corresponding check value.
Step 404, comparing the check value with a preset threshold value to obtain a corresponding check result.
After the plurality of terminals analyze the plurality of log segmentation protocol packets by using the preset communication protocol to obtain corresponding log data packets, the terminals also need to check the correctness of the log data packets according to the preset communication protocol. The terminal can randomly extract information corresponding to the preset byte number in each log data packet through a client program by starting the client program, check the information corresponding to the byte number to obtain a corresponding check value, and then compare the check value with a preset threshold value to obtain a corresponding check result. For example, the preset byte number randomly extracted when the check data packet is set in the communication protocol may be 1 to 20, that is, the terminal randomly extracts information corresponding to 1 to 20 byte numbers in each log data packet by starting the client program, and may check the information corresponding to 1 to 20 byte numbers by using the check function. The terminal can also randomly extract the information corresponding to the preset segment number from the plurality of segmented data packets for verification to obtain a corresponding verification value, and compare the verification value with the preset threshold value to obtain a corresponding verification result. For example, the MD5 checksum (checksum) is used to check the correctness of the received transmission data by performing a hash operation on the received transmission data. I.e., a one-way operation that converts a data string of arbitrary length to a short fixed-length value. By comparing the pre-calculated hash value with the hash value transmitted with the data. If the two values are the same, the transmitted data is complete and has no error and is not falsified, so that the data can be used with confidence. The terminal can randomly extract the value corresponding to 1-20 bytes in each log data packet through starting the client program, and check the value corresponding to 1-20 bytes by using the MD5 check function to obtain a corresponding check value, namely a hash value. And the terminal compares the obtained check value with a preset threshold value, and when the check value is equal to the preset threshold value, a check result with successful check correctness is output, and the log data with correct check is stored in a corresponding path. When the check value is greater than the preset threshold value, a check result of which the check correctness fails is output, and an instruction for retransmitting the corresponding log data packet needs to be sent, so that the currently transmitted log data cannot be stored in the corresponding path. Therefore, when different terminal devices need to acquire log data in a specific time period or a specific type, the complicated check process can be effectively reduced by adopting a random extraction check mode, the time consumption for checking and the acquisition of wrong transmission log data for storage are avoided, and the log data can be quickly and effectively transmitted.
In an embodiment, the method further includes a step of monitoring the byte length of each log data packet in real time, specifically including:
when log data is transmitted, the byte length of each log data packet is monitored in real time.
And when the monitored byte length of the log data packet is greater than a preset threshold value, automatically segmenting the log data packet to obtain a plurality of segmented log data packets.
After a plurality of different types of terminals establish communication connection with the communication routing device according to the protocol parameters, the plurality of terminals can simultaneously send log list access requests to the communication routing device. Meanwhile, the plurality of terminals can also set the time length for automatically transmitting the log data packets, the size for transmitting the log data packets and the time interval for regularly transmitting the log data packets in the communication protocol in advance through a client program. When the target communication routing equipment accesses a plurality of log segmentation protocol packets sent by the request to the corresponding terminal according to the log list, the terminal can monitor the size of the transmitted log data packets in real time through a client program. When log data are transmitted, the terminal monitors the capacity of each log data packet in real time through a client program, namely monitors the byte length of each log data packet in real time. When the byte length of the log data packet monitored by the terminal through a client program is larger than a preset threshold value, the log data packet is automatically segmented to obtain a plurality of segmented log data packets. Specifically, when log data of a plurality of different terminals are transmitted, the terminals can monitor the capacity of each log data packet in real time through a client program according to a pre-configured communication protocol, that is, the size of the log data packet to be transmitted is monitored in real time. When the terminal monitors that the capacity of the transmission log data packet is larger than a preset threshold value through a client program, the transmission log data packet is automatically segmented to obtain a plurality of segmented log data packets. For example, corresponding parameters for transmitting log data packets may be set in the communication protocol in advance, and the capacity threshold of each log data packet may be set to 5MB, that is, when the terminal monitors that the capacity of a log data packet is greater than 5MB through the client program, the transmitted log data packet is automatically divided to obtain a plurality of divided log data packets, and the capacities of the divided log data packets are not greater than 5MB. Furthermore, the terminal can store the divided log data packets in a classified manner according to the time for generating the log data packets through the client program, and can also store the divided log data packets in a classified manner under a path corresponding to the terminal according to the grade type of the log data packets or the identification number of the communication routing device. Therefore, when a plurality of terminals need to check the log data of the target communication routing equipment at the same time, the log data can be accurately transmitted according to the byte length of the log data packets set by the terminals of different types, error data generated by log data packet transmission due to overlarge log data tolerance is avoided, even when the log data of the terminals of different types are transmitted at the same time, automatic rapid and accurate classified transmission of the log data can be realized, and the efficiency of log data transmission is effectively improved.
In one embodiment, the method further comprises the step of adjusting the capacity and speed of the transmission log data packets according to the transmission status, and specifically comprises the following steps:
and acquiring the transmission state of the current transmission log data packet.
And sending an instruction for automatically adjusting the data length of the log data packet and the time interval of automatic transmission of the data packet to the communication routing equipment according to the transmission state, and adjusting the capacity and the speed of transmitting the log data packet.
And a plurality of different types of terminals establish communication connection with the communication routing equipment simultaneously according to the protocol parameters, and each terminal can acquire the transmission state corresponding to the currently transmitted log data when corresponding log data is transmitted. The terminal can send an instruction for automatically adjusting the data length of the log data packet and the time interval of automatic transmission of the data packet to the communication routing equipment according to the transmission state, and adjust the capacity and the speed of transmitting the log data packet. Specifically, when log data requested by a plurality of different terminals is transmitted, the terminal may acquire a transmission state of the currently transmitted log data. The transmission state may include two states, that is, a busy state or an idle state, and when the terminal obtains that the current transmission state is busy, the terminal may send an instruction for automatically adjusting the data length of the log data packet and the time interval for automatically transmitting the data packet to the communication routing device, so as to adjust the capacity and speed of transmitting the log data packet. For example, when the terminal detects that the data length of the currently transmitted log data packet is 1kb, the terminal may send an instruction to compress the data length of the log data packet and increase the time interval of automatic transmission of the data packet to the communication routing device, adjust the data length of the transmitted log data packet to 512mb, and extend the time interval of automatic transmission of the data packet by 30s. Therefore, the terminal can automatically adjust the size of the data packet and perform segmented transmission by changing the length of the log data packet according to the real-time transmission state of the transmitted log data, the problem of data transmission congestion or error data caused by overlarge log data tolerance is avoided, even if a plurality of terminals of different types perform log data transmission simultaneously, the automatic rapid and accurate segmented transmission and storage of the log data can be realized, and the efficiency of log data transmission is effectively improved.
It should be understood that although the various steps in the flow charts of fig. 1-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed sequentially, but may be performed alternately or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 5, there is provided a log data transmission apparatus including: an obtaining module 502, a connecting module 504, a sending module 506 and a parsing module 508, wherein:
an obtaining module 502, configured to start a client program when a server program is run in an application layer of the communication routing device, and obtain a protocol parameter corresponding to the communication routing device in the local area network.
And a connection module 504, configured to establish a communication connection with the communication routing device according to the protocol parameter.
A sending module 506, configured to send the log list access request to the communication routing device.
The parsing module 508 is configured to receive multiple log segmentation protocol packets sent by the communication routing device according to the log list access request, and parse the multiple log segmentation protocol packets by using a preset communication protocol to obtain corresponding log data packets.
In one embodiment, the apparatus further comprises: and an unpacking module.
The unpacking module is used for unpacking the plurality of log segmentation protocol packets according to a preset communication protocol to obtain a byte value and a byte offset value corresponding to each log protocol packet, acquiring byte information corresponding to the byte offset value from the byte value, and obtaining corresponding log data packet information according to the byte information.
In one embodiment, the apparatus further comprises: and a decryption module.
The obtaining module 502 is further configured to obtain character string information corresponding to the log data packet information. The decryption module is used for decrypting the character string information by using a key, a byte offset value and a decryption function in a preset communication protocol to obtain corresponding log data.
In one embodiment, the apparatus further comprises: and (5) a checking module.
The check module is used for randomly extracting information corresponding to the preset byte number in each log data packet, checking the information corresponding to the byte number to obtain a corresponding check value, and comparing the check value with a preset threshold value to obtain a corresponding check result.
In one embodiment, the apparatus further comprises: and a monitoring module.
The monitoring module is used for monitoring the byte length of each log data packet in real time when log data are transmitted; when the monitored byte length of the log data packet is larger than a preset threshold value, automatically segmenting the log data packet to obtain a plurality of segmented log data packets, and transmitting the plurality of segmented log data packets.
In one embodiment, the apparatus further comprises: and an adjusting module.
The obtaining module 502 is further configured to obtain a transmission status of the current transmission log data packet. The adjusting module is used for sending an instruction for automatically adjusting the data length of the log data packet and the time interval of automatic transmission of the data packet to the communication routing equipment according to the transmission state, and adjusting the capacity and the speed of the communication routing equipment for transmitting the log data packet.
For specific limitations of the log data transmission device, reference may be made to the above limitations on the log data transmission method, which are not described herein again. The modules in the log data transmission device may be wholly or partially implemented by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a method of transferring log data. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the steps of the above-described method embodiments being implemented when the computer program is executed by the processor.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of transmitting log data, the method comprising:
when a server program is operated in an application layer of communication routing equipment, a plurality of different types of terminal equipment start the client program and respectively send a protocol parameter acquisition request message to the communication routing equipment in a local area network so as to acquire the corresponding protocol parameter of the communication routing equipment in the local area network; the communication routing equipment is a 5G communication module with a routing function; the protocol parameters comprise related address configuration information;
the terminal devices of different types establish communication connection with the communication routing device according to the address configuration information respectively;
the terminal equipment of a plurality of different types respectively sends a log list access request to the communication routing equipment; the log list access request comprises at least one of application layer log data, kernel log data or debugging log data;
the terminal devices of different types respectively receive a plurality of log segmentation protocol packets sent by the communication routing device according to the log list access request, and analyze the log segmentation protocol packets by using an unpacking mode and a decryption mode agreed in a preset communication protocol to obtain corresponding log data packets;
when log data requested by a plurality of different types of terminal equipment are transmitted, the plurality of different types of terminal equipment respectively acquire the transmission state of the currently transmitted log data packet; sending an instruction for automatically adjusting the data length of the log data packet and the time interval of automatic transmission of the data packet to the communication routing equipment according to the transmission state, and adjusting the capacity and the speed of transmitting the log data packet;
the terminal equipment of different types checks the correctness of the log data packet respectively based on a mode of checking the data packet agreed in a preset communication protocol;
when the correctness of the log data packet is verified successfully, storing the log data packet verified correctly under a corresponding path;
and when the correctness of the log data packet is verified to be failed, sending an instruction for retransmitting the log data packet to the communication routing equipment.
2. The method of claim 1, wherein the parsing the plurality of log fragmentation protocol packets using the unpacking method and the decrypting method agreed in the predetermined communication protocol comprises:
the preset communication protocol comprises the name of the log data packet, unpacking of the log data packet, an agreed protocol of the package, the data length of the log data packet and a mode of checking the data packet.
3. The method of claim 1, wherein the parsing the plurality of log fragmentation protocol packets using the unpacking method and the decrypting method agreed in the predetermined communication protocol comprises:
unpacking the plurality of log segmentation protocol packets according to an unpacking mode and a decryption mode agreed in a preset communication protocol to obtain a byte value and a byte offset value corresponding to each segment of log protocol packet;
and acquiring byte information corresponding to the byte offset value from the byte value, and acquiring corresponding log data packet information according to the byte information.
4. The method of claim 3, wherein obtaining the corresponding log packet information according to the byte information comprises:
acquiring character string information corresponding to the log data packet information;
and decrypting the character string information by using a key, a byte offset value and a decryption function in a preset communication protocol to obtain corresponding log data.
5. The method of claim 4, further comprising:
randomly extracting information corresponding to preset byte number in each log data packet, and checking the information corresponding to the byte number to obtain a corresponding check value;
and comparing the check value with a preset threshold value to obtain a corresponding check result.
6. The method of claim 1, further comprising:
when log data are transmitted, monitoring the byte length of each log data packet in real time;
and when the monitored byte length of the log data packet is greater than a preset threshold value, automatically segmenting the log data packet to obtain a plurality of segmented log data packets.
7. An apparatus for transmitting log data, the apparatus comprising:
an obtaining module, configured to, when a server program is run in an application layer of a communication routing device, start a client program by a plurality of different types of terminal devices, and send a protocol parameter obtaining request message to the communication routing device in a local area network, respectively, to obtain a protocol parameter corresponding to the communication routing device in the local area network; the communication routing equipment is a 5G communication module with a routing function; the protocol parameters comprise related address configuration information;
the connection module is used for establishing communication connection between a plurality of different types of terminal equipment and the communication routing equipment according to the address configuration information;
a sending module, configured to send log list access requests to the communication routing device by the terminal devices of different types respectively; the log list access request comprises at least one of application layer log data, kernel log data or debugging log data;
the analysis module is used for receiving a plurality of log segmentation protocol packets sent by the communication routing equipment according to the log list access request by a plurality of different types of terminal equipment respectively, and analyzing the plurality of log segmentation protocol packets by utilizing an agreed unpacking mode and a deciphering mode in a preset communication protocol to obtain corresponding log data packets;
the acquisition module is further used for acquiring the transmission state of the currently transmitted log data packet by the terminal equipment of different types when the log data requested by the terminal equipment of different types is transmitted; the adjusting module is used for sending an instruction for automatically adjusting the data length of the log data packet and the time interval of automatic transmission of the data packet to the communication routing equipment according to the transmission state, and adjusting the capacity and the speed of transmitting the log data packet;
the checking module is used for checking the correctness of the log data packet by the terminal equipment of different types respectively based on a mode of checking the data packet agreed in a preset communication protocol; when the correctness of the log data packet is verified successfully, storing the log data packet verified correctly under a corresponding path; and when the correctness of the log data packet is verified, sending an instruction for retransmitting the log data packet to the communication routing equipment.
8. The apparatus for transferring log data according to claim 7, wherein the apparatus further comprises:
the unpacking module is used for unpacking the plurality of log segmentation protocol packets according to an unpacking mode and a decryption mode agreed in a preset communication protocol to obtain a byte value and a byte offset value corresponding to each segment of log protocol packet; and acquiring byte information corresponding to the byte offset value from the byte value, and acquiring corresponding log data packet information according to the byte information.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program performs the steps of the method according to any of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202010311062.XA 2020-04-20 2020-04-20 Log data transmission method and device, computer equipment and storage medium Active CN111628967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010311062.XA CN111628967B (en) 2020-04-20 2020-04-20 Log data transmission method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010311062.XA CN111628967B (en) 2020-04-20 2020-04-20 Log data transmission method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111628967A CN111628967A (en) 2020-09-04
CN111628967B true CN111628967B (en) 2023-01-17

Family

ID=72260530

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010311062.XA Active CN111628967B (en) 2020-04-20 2020-04-20 Log data transmission method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111628967B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114339723B (en) * 2020-10-10 2024-01-26 深圳长城开发科技股份有限公司 Air upgrading method and system based on LoRa
CN112350861B (en) * 2020-10-29 2023-06-20 深圳市广和通无线股份有限公司 Log acquisition method, device, computer equipment and storage medium
CN112583818B (en) * 2020-12-08 2021-12-24 清华大学 Adaptive transport protocol selection method and device for mobile Web service
CN112784300A (en) * 2021-01-22 2021-05-11 重庆秦嵩科技有限公司 Multi-stage log encryption processing system and method
CN114002987A (en) * 2021-11-03 2022-02-01 杭州和利时自动化有限公司 Method, device, electronic equipment and medium for acquiring log information
CN114265745A (en) * 2021-12-21 2022-04-01 绿能慧充数字技术有限公司 Monitoring board log output method, system, equipment and medium based on CAN bus
CN116820895B (en) * 2023-08-29 2024-01-05 深圳市广和通无线通信软件有限公司 Log grabbing method, device, equipment and medium based on artificial intelligence
CN117527860B (en) * 2024-01-05 2024-04-09 河北普兰特生物科技有限公司 Internet of things communication method, system and medium based on distributed system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101572957A (en) * 2009-05-08 2009-11-04 深圳市宏电技术股份有限公司 Acquisition method and system of wireless terminal log based on WMMP
CN105373466A (en) * 2014-07-08 2016-03-02 阿里巴巴集团控股有限公司 A log treatment method and apparatus
CN110650055A (en) * 2019-09-30 2020-01-03 凌云天博光电科技股份有限公司 Broadcast television network equipment monitoring method and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227643A (en) * 2008-01-21 2008-07-23 中兴通讯股份有限公司 Terminal log conveying system and method
US10275301B2 (en) * 2015-09-29 2019-04-30 International Business Machines Corporation Detecting and analyzing performance anomalies of client-server based applications
CN107870849B (en) * 2016-09-28 2021-03-09 平安科技(深圳)有限公司 Processing method and device of test log
CN107911254B (en) * 2017-12-26 2021-09-28 中国移动通信集团江苏有限公司 Log transmission method and device, computing equipment and storage medium
CN108418903B (en) * 2018-05-28 2024-02-02 苏州德姆斯信息技术有限公司 Remote access system and access method for embedded software log
CN108989471A (en) * 2018-09-05 2018-12-11 郑州云海信息技术有限公司 The management method and device of log in network system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101572957A (en) * 2009-05-08 2009-11-04 深圳市宏电技术股份有限公司 Acquisition method and system of wireless terminal log based on WMMP
CN105373466A (en) * 2014-07-08 2016-03-02 阿里巴巴集团控股有限公司 A log treatment method and apparatus
CN110650055A (en) * 2019-09-30 2020-01-03 凌云天博光电科技股份有限公司 Broadcast television network equipment monitoring method and system

Also Published As

Publication number Publication date
CN111628967A (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN111628967B (en) Log data transmission method and device, computer equipment and storage medium
US11171936B2 (en) Method, device, and system for offloading algorithms
CN108664395B (en) Application program testing method, device, equipment and storage medium
CN109194625B (en) Client application protection method and device based on cloud server and storage medium
WO2016029595A1 (en) Method, device, and equipment for calling open platform and non-volatile computer storage medium
US11907700B2 (en) Upgrading method and system, server, and terminal device
CN110888838A (en) Object storage based request processing method, device, equipment and storage medium
CN108900324B (en) Method and device for checking communication performance of virtual machine
CN107864117B (en) Webpage interception method and device and computer readable storage medium
CN115086306B (en) Data transmission method and device, electronic equipment and storage medium
WO2015081693A1 (en) Network sharing user identification method and apparatus
CN114157649A (en) Reliable data transmission method and device, computer equipment and storage medium
CN110968400B (en) Application program execution method and device, computer equipment and storage medium
CN106656966A (en) Method and device for intercepting service processing request
He et al. On‐Device Detection of Repackaged Android Malware via Traffic Clustering
CN113206850B (en) Malicious sample message information acquisition method, device, equipment and storage medium
CN104486292A (en) Enterprise-resource safety-access control method, device and system
CN107548058B (en) Equipment access method and intelligent terminal
WO2024032209A1 (en) Block chain transaction verification method and apparatus, storage medium, and electronic device
CN116846669A (en) Network traffic processing method, device, computer equipment, storage medium and product
CN112019358A (en) Network configuration method, device, equipment and system
CN114996730A (en) Data encryption and decryption system, method, computer equipment and storage medium
CN111224773A (en) Quantum key management equipment
CN113098685B (en) Security verification method and device based on cloud computing and electronic equipment
CN112565447B (en) Encryption and decryption method and system matched with uploading and downloading in cloud environment and WEB file manager

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