Data log collection system, method, device and medium
By designing a data log collection system on the Cortex-M3/M4 platform, using the micro control unit and memory to record communication logs during the communication process, it solves the problem of being unable to record logs under protocols such as UART, and achieves the acquisition and storage of log data. Suitable for low data volume and low speed communication equipment.
Patent Information
- Application Number
- CN202210190848.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-02-25
AI Technical Summary
When communicating using communication protocols such as UART in the Cortex-M3/M4 platform, communication logs cannot be recorded, making debugging, error location and data analysis difficult.
A data log collection system is designed, which receives and transmits data during the communication process through the micro-control unit, and saves the log data in the memory. It uses the preset serial port communication protocol to connect the communication equipment to realize the binding and saving of the data.
It realizes recording communication logs and obtaining log data during the communication process without modifying the code or circuit of the communication equipment. It supports data collection in offline state and is suitable for low data volume and low-speed communication equipment.
Smart Images

Figure CN114553731B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data log collection, and in particular to a data log collection system, method, device and medium. Background Art
[0002] Currently, in the Cortex-M3 / M4 (such as STM32) platform, it is impossible to record communication logs when using communication protocols such as UART (Universal Asynchronous Receiver / Transmitter). Therefore, it is not convenient to use communication logs for debugging, error location, data analysis, etc.
[0003] In summary, how to record communication logs during the communication process to obtain log data is a problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a data log collection system, method, device, and storage medium, which can record communication logs during the communication process to obtain log data. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a data log collection system, characterized in that the data log collection system includes a memory and a micro control unit connected to the memory, the micro control unit includes a first transceiver port for connecting to a first communication device and a second transceiver port for connecting to a second communication device, respectively established based on a preset serial port communication protocol; wherein,
[0006] The micro control unit is used to receive first data generated by the first communication device through the first transceiver port, and transmit the first data to the second communication device through the second transceiver port; and / or is used to receive second data generated by the second communication device through the second transceiver port, and transmit the second data to the first communication device through the first transceiver port;
[0007] The micro control unit is also used to obtain the first data after binding based on the first data and / or obtain the second data after binding based on the second data, and save the first data after binding and / or the second data after binding to the memory to obtain corresponding log data.
[0008] Optionally, the micro control unit further includes a third transceiver port, and the micro control unit is used to connect to the host computer through the third transceiver port;
[0009] The micro control unit is used to transmit the log data in the memory to the host computer through the third transceiver port, so that the host computer software saves the read log data based on a preset content format and a preset file format to obtain a log file.
[0010] Optionally, the memory is also used to delete the log data currently stored in the memory that meets the first condition or the second condition; wherein, the first condition is that the current free storage space in the memory is less than the preset free storage space, and the second condition is that the log data currently stored in the memory has been transmitted to the host computer for storage.
[0011] Optionally, the micro control unit is further used to bind a first identification character pre-set in the memory for indicating the sending direction of the first data to the first data to obtain bound first data and / or to bind a second identification character pre-set in the memory for indicating the sending direction of the second data to the second data to obtain bound second data, and save the bound first data and / or the bound second data to the memory to obtain corresponding log data.
[0012] Optionally, the data log collection system further includes a power supply component for supplying power to the data log collection system.
[0013] Optionally, a power supply line is further provided between the data log collection system and the first communication device and / or the second communication device, wherein the first communication device and / or the second communication device supplies power to the data log collection system via the power supply line.
[0014] In a second aspect, the present application discloses a data log collection method, characterized in that it is applied to a data log collection system, the data log collection system includes a memory and a micro control unit connected to the memory, the micro control unit includes a first transceiver port for connecting to a first communication device and a second transceiver port for connecting to a second communication device, respectively established based on a preset serial port communication protocol, wherein the method includes:
[0015] receiving first data generated by the first communication device through the first transceiver port of the micro control unit, and transmitting the first data to the second communication device through the second transceiver port of the micro control unit; and / or receiving second data generated by the second communication device through the second transceiver port of the micro control unit, and transmitting the second data to the first communication device through the first transceiver port of the micro control unit;
[0016] The micro control unit obtains first data after binding based on the first data and / or obtains second data after binding based on the second data, and saves the first data after binding and / or the second data after binding to the memory to obtain corresponding log data.
[0017] Optionally, the acquiring, by the microcontroller unit, first data after binding based on the first data and / or acquiring second data after binding based on the second data, and saving the first data after binding and / or the second data after binding to the memory to obtain corresponding log data includes:
[0018] Determine a first identification character used to indicate a sending direction of the first data and a second identification character used to indicate a sending direction of the second data which are preset in the memory;
[0019] The micro control unit binds the first identification character with the first data to obtain the bound first data and / or binds the second identification character with the second data to obtain the bound second data, and saves the bound first data and / or the bound second data to the memory to obtain corresponding log data.
[0020] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the aforementioned disclosed data log collection method is implemented.
[0021] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed data log collection method is implemented.
[0022] It can be seen that the present application discloses a data log collection system, the data log collection system includes a memory and a micro control unit connected to the memory, the micro control unit includes a first transceiver port for connecting to a first communication device and a second transceiver port for connecting to a second communication device, which are respectively established based on a preset serial port communication protocol; wherein the micro control unit is used to receive the first data generated by the first communication device through the first transceiver port, and transmit the first data to the second communication device through the second transceiver port; and / or, it is used to receive the second data generated by the second communication device through the second transceiver port, and transmit the second data to the first communication device through the first transceiver port; the micro control unit is also used to obtain the first data after binding based on the first data and / or obtain the second data after binding based on the second data, and save the first data after binding and / or the second data after binding to the memory to obtain the corresponding log data. It can be seen that the data log collection system disclosed in the present application can send and receive the first data and / or the second data through the micro control unit, and obtain the first data and / or the second data in the micro control unit through the memory, that is, it can obtain log data during the communication process. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0024] Figure 1 A data log collection system structure diagram provided for this application;
[0025] Figure 2 A specific data log collection system structure diagram provided for this application;
[0026] Figure 3 A flow chart of a data log collection method provided for this application;
[0027] Figure 4 A schematic diagram of an existing data log collection system between two devices without a data log collection system installed;
[0028] Figure 5 A schematic diagram of a data log collection system between two devices provided by the present application for installing a data log collection system;
[0029] Figure 6 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] Currently, in the Cortex-M3 / M4 (such as STM32) platform, it is impossible to record the communication log in the process of using communication protocols such as UART for communication, so it is not convenient to use the communication log for debugging, error location and data analysis. In order to overcome the above problems, the application provides a data log collection system that can record the communication log during the communication process to obtain log data.
[0032] See also Figure 1 As shown, the embodiment of the present invention discloses a data log collection system 12, the data log collection system 12 includes a memory 121 and a micro control unit 122 connected to the memory 121, the micro control unit 122 includes a first transceiver port for connecting to a first communication device 11 and a second transceiver port for connecting to a second communication device 13, which are respectively established based on a preset serial port communication protocol;
[0033] That is, the first transceiver port is used to establish a connection with the first communication device 11 , and the second transceiver port is used to establish a connection with the second communication device 13 .
[0034] Optionally, the first transceiver port and the second transceiver port may specifically be UART ports, which is not limited here.
[0035] The micro control unit 122 is used to receive the first data generated by the first communication device 11 through the first transceiver port, and transmit the first data to the second communication device 13 through the second transceiver port; and / or, to receive the second data generated by the second communication device 13 through the second transceiver port, and transmit the second data to the first communication device 11 through the first transceiver port;
[0036] The micro control unit 122 is further used to obtain the first data after binding based on the first data and / or obtain the second data after binding based on the second data, and save the first data after binding and / or the second data after binding to the memory 121 to obtain corresponding log data.
[0037] In an optional embodiment, both the first transceiver port and the second transceiver port may be UART ports.
[0038] It can be understood that the micro control unit 122 is also specifically used to bind the first identification character pre-set in the memory 121 for indicating the sending direction of the first data with the first data to obtain the bound first data and / or bind the second identification character pre-set in the memory 121 for indicating the sending direction of the second data with the second data to obtain the bound second data, and save the bound first data and / or the bound second data to the memory 121 to obtain the corresponding log data. After the first identification character and the second identification character are provided, the sending directions of the first data and the second data can be determined respectively by the first identification character and the second identification character.
[0039] It should be noted that the data log collection system 12 also includes a power supply component for powering the data log collection system 12. In addition, a power supply line is also provided between the data log collection system 12 and the first communication device 11 and / or the second communication device 13, wherein the first communication device 11 and / or the second communication device 12 supplies power to the data log collection system 12 through the power supply line. In summary, the data log collection system 12 can be powered by the power supply component in the data log collection system 12, or it can be powered by the power supply line between the data log collection system 12 and the first communication device 11 and the second communication device 13. It should be noted that the data log collection system 12 can include a power supply component.
[0040] It should be pointed out that when collecting data logs, the data log collection system 12 is used, and the data log collection can be performed without modifying the codes and circuits corresponding to the first communication device 11 and the second communication device 13. Furthermore, this collection process does not need to modify the communication protocol, does not interfere with the normal communication process, and directly connects the data log collection system 12 in series to the first transceiver port of the first communication device 11 and the second transceiver port of the second communication device 13, and can save data after normal power supply. In addition, this collection process can be completed without connecting to a computer, that is, it can be completed in an offline state. When log data needs to be obtained, it can be obtained from the memory 121 by connecting to a computer.
[0041] It should be noted that the data collected by the data log collection system 12 can be UART, CAN (Controller Area Network,), RS485, IIC (Inter-Integrated Circuit) and other data. The micro control unit 122 can be STM32, GD32, Huada MCU, Guoming N32 and the like.
[0042] It can be seen that the present application discloses a data log collection system, the data log collection system includes a memory and a micro control unit connected to the memory, the micro control unit includes a first transceiver port for connecting to a first communication device and a second transceiver port for connecting to a second communication device, which are respectively established based on a preset serial port communication protocol; wherein the micro control unit is used to receive the first data generated by the first communication device through the first transceiver port, and transmit the first data to the second communication device through the second transceiver port; and / or, it is used to receive the second data generated by the second communication device through the second transceiver port, and transmit the second data to the first communication device through the first transceiver port; the micro control unit is also used to obtain the first data after binding based on the first data and / or obtain the second data after binding based on the second data, and save the first data after binding and / or the second data after binding to the memory to obtain the corresponding log data. It can be seen that the data log collection system disclosed in the present application can send and receive the first data and / or the second data through the micro control unit, and obtain the first data and / or the second data in the micro control unit through the memory, that is, it can obtain log data during the communication process. On the one hand, by setting up a micro control unit to realize data transmission and data collection between the first communication device and the second communication device, there is no need to make any circuit or code changes to the first communication device and the second communication device, and the micro control unit can realize independent power supply and offline operation, that is, data collection can be completed without connecting to a computer, etc., which can be extremely applicable to some outdoor scenarios.
[0043] See also Figure 2 As shown, the embodiment of the present invention discloses a data log collection system 22, the data log collection system 22 includes a memory 221 and a micro control unit 222 connected to the memory 221, the micro control unit 222 includes a first transceiver port connected to the first communication device 21 and a second transceiver port connected to the second communication device 23 respectively established based on a preset serial port communication protocol; wherein,
[0044] The micro control unit 222 is used to receive the first data generated by the first communication device 21 through the first transceiver port, and transmit the first data to the second communication device 23 through the second transceiver port; and / or is used to receive the second data generated by the second communication device 23 through the second transceiver port, and transmit the second data to the first communication device 21 through the first transceiver port;
[0045] The micro control unit 222 is further used to obtain the first data after binding based on the first data and / or obtain the second data after binding based on the second data, and save the first data after binding and / or the second data after binding to the memory 221 to obtain corresponding log data.
[0046] The micro control unit 222 also includes a third transceiver port, and the micro control unit 222 is used to connect to the host computer through the third transceiver port. Optionally, the third transceiver port can also be pre-established based on a preset serial port communication protocol. The micro control unit 222 is used to transmit the log data in the memory 221 to the host computer 24 through the third transceiver port when the host computer software pre-installed in the host computer 24 reads the log data in the memory 221, so that the host computer software saves the read log data based on the preset content format and the preset file format to obtain a log file.
[0047] It should be noted that the memory 221 is also used to delete the log data currently stored in the memory 221 that meets the first condition or the second condition; wherein the first condition is that the current free storage space in the memory 221 is less than the preset free storage space, and the second condition is that the memory 221 has transmitted the currently stored log data to the host computer 24 for preservation. Among them, the memory 221 can be a flash, so that the memory 221 can continue to be used to store log data. It can be seen that the size of the data log collection system 22 depends on the size of the memory 221, so it is suitable for use on devices with low data volume, and it is not necessary to delete the log data in the memory. In addition, it should be noted that data log collection will affect the communication delay, so this system is suitable for use on devices with low-speed communication.
[0048] It should be noted that the preset file format may be TXT format.
[0049] It can be seen that the present application discloses a data log collection system, which includes a memory and a microcontroller unit connected to the memory, wherein the microcontroller unit includes a first transceiver port for connecting to a first communication device and a second transceiver port for connecting to a second communication device, which are respectively established based on a preset serial port communication protocol; wherein the microcontroller unit is used to receive first data generated by the first communication device through the first transceiver port, and transmit the first data to the second communication device through the second transceiver port; and / or is used to receive second data generated by the second communication device through the second transceiver port, and transmit the second data to the second communication device through the first transceiver port. A communication device; the micro control unit is also used to obtain the first data after binding based on the first data and / or obtain the second data after binding based on the second data, and save the first data after binding and / or the second data after binding to the memory to obtain corresponding log data. In addition, when the host software pre-installed in the host computer reads the log data in the memory, the log data in the memory is transmitted to the host computer through the third transceiver port pre-established between the micro control unit and the host computer based on the preset serial port communication protocol, so that the host computer software saves the read log data based on the preset content format and the preset file format to obtain a log file. It can be seen from this that the data log collection system disclosed in the present application can send and receive the first data and / or the second data through the micro control unit, and obtain the first data and / or the second data in the micro control unit through the memory, that is, it can obtain log data during the communication process, and then, the read log data is saved based on the preset content format and the preset file format by the host computer software to obtain a log file.
[0050] See also Figure 3 As shown, the embodiment of the present application discloses a data log collection method, which is applied to a data log collection system, wherein the data log collection system includes a memory and a micro control unit connected to the memory, wherein the micro control unit includes a first transceiver port for connecting to a first communication device and a second transceiver port for connecting to a second communication device, respectively established based on a preset serial port communication protocol, wherein the method includes:
[0051] Step S11: receiving first data generated by the first communication device through the first transceiver port of the microcontroller unit, and transmitting the first data to the second communication device through the second transceiver port of the microcontroller unit; and / or receiving second data generated by the second communication device through the second transceiver port of the microcontroller unit, and transmitting the second data to the first communication device through the first transceiver port of the microcontroller unit.
[0052] In an embodiment of the present application, the data log collection system receives the first data generated by the first communication device through the first transceiver port of the micro control unit, and transmits the first data to the second communication device through the second transceiver port of the micro control unit; and / or receives the second data generated by the second communication device through the second transceiver port of the micro control unit, and transmits the second data to the first communication device through the first transceiver port of the micro control unit. Thus, communication between the first communication device and the second communication device is performed, and log data between the second communication device and the first communication device is recorded.
[0053] Step S12: The microcontroller obtains first data after binding based on the first data and / or obtains second data after binding based on the second data, and saves the first data after binding and / or the second data after binding to the memory to obtain corresponding log data.
[0054] In an embodiment of the present application, when saving the first data and the second data to the memory, the sending direction of the first data and the second data also needs to be considered. After obtaining the first data and the second data, the first identifier representing the sending direction of the first data is bound to the first data to obtain the bound first data, and the second identifier representing the sending direction of the second data is bound to the second data to obtain the bound second data. Then, the bound first data and the bound second data are used to obtain the corresponding log data.
[0055] In an embodiment of the present application, after obtaining the log data, it is also necessary to use the host computer software pre-written and installed in the host computer to read the log data in the memory, and then save it in a preset content format and a preset file format to obtain a log file. Specifically, the log data in the memory is read through a third transceiver port pre-established between the micro control unit and the host computer based on a preset serial port communication protocol.
[0056] In the embodiment of the present application, the storage space in the memory is limited, so it is suitable for devices with low data volume. In addition, when the storage space in the memory is insufficient, the log data currently stored in the memory that meets the first condition and the second condition can be deleted; wherein the first condition is that the current free storage space in the memory is less than the preset free storage space, and the second condition is that the memory has transmitted the currently stored log data to the host computer for storage.
[0057] It can be seen that the present application discloses a data log collection method, characterized in that it is applied to a data log collection system, the data log collection system includes a memory and a micro control unit connected to the memory, the micro control unit includes a first transceiver port for connecting to a first communication device and a second transceiver port for connecting to a second communication device, respectively established based on a preset serial port communication protocol, wherein the method includes: receiving the first data generated by the first communication device through the first transceiver port of the micro control unit, and transmitting the first data to the second communication device through the second transceiver port of the micro control unit; and / or, receiving the second data generated by the second communication device through the second transceiver port of the micro control unit, and transmitting the second data to the first communication device through the first transceiver port of the micro control unit; obtaining the first data after binding based on the first data and / or obtaining the second data after binding based on the second data through the micro control unit, and saving the first data after binding and / or the second data after binding to the memory to obtain the corresponding log data. It can be seen that the data log collection system disclosed in the present application can obtain log data during the communication process, and after obtaining the log data, obtain the log data through the host computer, and save the log data in a preset content format and a preset file format to obtain a log file.
[0058] like Figure 4 As shown, it is a communication process between two devices using UART serial communication without installing an existing data log collection system. It can be seen from the figure that the sending interface of the first communication device is connected to the receiving interface of the second communication device, the receiving interface of the first communication device is connected to the sending interface of the second communication device, and the first communication device and the second communication device share a common ground, that is, a common END. Among them, the sending interface is represented by TX and the receiving interface is represented by RX.
[0059] like Figure 5As shown, the communication process between two devices using UART serial port communication for installing the data log collection system, it can be seen from the figure that the data log collection system is connected between the first communication device and the second communication device, the collector in the figure is the data log collection system, and the data log collection system in the figure includes STM32MCU and external flash, STM32MCU is a microprocessor, and the external flash is a memory. The data log collection system has three interfaces called uart1, uart2, and uart3, which are connected to the first communication device, the first communication device, and the host computer respectively. Among them, uart1 includes a receiving interface and a sending interface of the first communication device, and uart2 includes a receiving interface and a sending interface of the second communication device. The receiving interface of uart1 of the data log collection system saves the first data received from the first communication device to the external flash and sends the first data to the second communication device through the sending interface of uart2, and the receiving interface of uart2 of the data log collection system saves the second data received from the second communication device to the external flash and sends the second data to the first communication device through the sending interface of uart1. The external flash saves the acquired first data and second data to obtain log data, and then the host computer software in the host computer reads the log data from the external flash through uart3, and saves the log data in a preset content format and a preset file format to obtain a log file. It should be noted that the first data is generated by the first communication device, and the second data is generated by the second communication device. The preset file format can be TXT format. Among them, the sending interface is represented by TX, the receiving interface is represented by RX, and the first communication device and the second communication device share a common ground, that is, a common END. It should be noted that uart1 is the first transceiver port, uart2 is the second transceiver port, and uart3 is the third transceiver port.
[0060] Furthermore, an embodiment of the present application also provides an electronic device, Figure 6 This is a structural diagram of an electronic device 30 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0061] Figure 6 The present invention provides a schematic diagram of the structure of an electronic device 30 provided in an embodiment of the present application. The electronic device 30 may specifically include: at least one processor 31, at least one memory 32, a power supply 33, an input / output interface 34, a communication interface 35, and a communication bus 36. The memory 32 is used to store a computer program, which is loaded and executed by the processor 31 to implement the relevant steps of the data log collection method disclosed in any of the aforementioned embodiments.
[0062] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 30; the communication interface 35 can create a data transmission channel between the electronic device 30 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 34 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0063] In addition, the memory 32, as a carrier for resource storage, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The memory 32 can include a random access memory as a running memory and a non-volatile memory for external memory storage purposes. The storage resources thereon include an operating system 321, a computer program 322, etc. The storage method can be temporary storage or permanent storage.
[0064] The operating system 321 is used to manage and control the hardware devices on the electronic device 30 on the source host and the computer program 322. The operating system 321 can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the data log collection method performed by the electronic device 30 disclosed in any of the aforementioned embodiments, the computer program 322 can further include a computer program that can be used to complete other specific tasks.
[0065] In this embodiment, the input and output interface 34 may specifically include but is not limited to a USB interface, a hard disk reading interface, a serial interface, a voice input interface, a fingerprint input interface, etc.
[0066] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed data log collection method is implemented.
[0067] For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.
[0068] The computer-readable storage medium mentioned here includes random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, magnetic disk or optical disk or any other form of storage medium known in the technical field. Wherein, the computer program is implemented when executed by the processor. For the specific steps of the method, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0069] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the data log collection method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0070] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0071] The steps of the algorithm described in conjunction with the embodiments disclosed herein can be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0072] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0073] The data log collection system, method, device and medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A data log collection system, It is characterized in that The data log collection system includes a memory and a micro control unit connected to the memory, wherein the micro control unit includes a first transceiver port for connecting to a first communication device and a second transceiver port for connecting to a second communication device, respectively established based on a preset serial port communication protocol; wherein, The micro control unit is used to receive the first data generated by the first communication device through the first transceiver port, and transmit the first data to the second communication device through the second transceiver port; and / or is used to receive the second data generated by the second communication device through the second transceiver port, and transmit the first data to the first communication device through the first transceiver port; The micro control unit is further used for acquiring first data after binding based on the first data and / or acquiring second data after binding based on the second data, and saving the first data after binding and / or the second data after binding to the memory to obtain corresponding log data; Wherein, the data log collection system further includes a power supply component for supplying power to the data log collection system; A power supply line is further provided between the data log collection system and the first communication device and / or the second communication device, wherein the first communication device and / or the second communication device supplies power to the data log collection system via the power supply line.
2. The data log collection system according to claim 1, It is characterized in that The micro control unit also includes a third transceiver port, and the micro control unit is connected to the host computer through the third transceiver port; The micro control unit is used to transmit the log data in the memory to the host computer through the third transceiver port, so that the host computer software saves the read log data based on a preset content format and a preset file format to obtain a log file.
3. The data log collection system according to claim 2, It is characterized in that The memory is also used to delete the log data currently stored in the memory that meets the first condition or the second condition; wherein the first condition is that the current free storage space in the memory is less than the preset free storage space, and the second condition is that the memory has transferred the currently stored log data to the host computer for storage.
4. The data log collection system according to claim 1, It is characterized in that The micro control unit is specifically further used to bind a first identification character pre-set in the memory for indicating the sending direction of the first data to the first data to obtain bound first data and / or to bind a second identification character pre-set in the memory for indicating the sending direction of the second data to the second data to obtain bound second data, and save the bound first data and / or the bound second data to the memory to obtain corresponding log data.
5. A data log collection method, It is characterized in that Applied to a data log collection system, the data log collection system includes a memory and a micro control unit connected to the memory, the micro control unit includes a first transceiver port for connecting to a first communication device and a second transceiver port for connecting to a second communication device, respectively established based on a preset serial port communication protocol, wherein the method includes: receiving first data generated by the first communication device through the first transceiver port of the micro control unit, and transmitting the first data to the second communication device through the second transceiver port of the micro control unit; and / or receiving second data generated by the second communication device through the second transceiver port of the micro control unit, and transmitting the second data to the first communication device through the first transceiver port of the micro control unit; Acquire, by the micro control unit, first data after binding based on the first data and / or second data after binding based on the second data, and save the first data after binding and / or the second data after binding to the memory to obtain corresponding log data; The data log collection system is powered by a power supply component in the data log collection system, or the data log collection system is powered by the first communication device and / or the second communication device through a power supply route; wherein the power supply route is a power supply line provided between the data log collection system and the first communication device and / or the second communication device.
6. The data log collection method according to claim 5, It is characterized in that The acquiring, by the microcontroller unit, first data after binding based on the first data and / or acquiring second data after binding based on the second data, and saving the first data after binding and / or the second data after binding to the memory to obtain corresponding log data includes: Determine a first identification character used to indicate a sending direction of the first data and a second identification character used to indicate a sending direction of the second data which are preset in the memory; The micro control unit binds the first identification character with the first data to obtain the bound first data and / or binds the second identification character with the second data to obtain the bound second data, and saves the bound first data and / or the bound second data to the memory to obtain corresponding log data.
7. An electronic device, It is characterized in that It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the data log collection method as described in any one of claims 5 to 6 is implemented.
8. A computer-readable storage medium, It is characterized in that Used to store computer programs; wherein, when the computer program is executed by a processor, the data log collection method as described in any one of claims 5 to 6 is implemented.
