WO2018209852A1 - Pos machine, method for fetching debugging information of wireless communication module of pos machine, and storage medium - Google Patents

Pos machine, method for fetching debugging information of wireless communication module of pos machine, and storage medium Download PDF

Info

Publication number
WO2018209852A1
WO2018209852A1 PCT/CN2017/102389 CN2017102389W WO2018209852A1 WO 2018209852 A1 WO2018209852 A1 WO 2018209852A1 CN 2017102389 W CN2017102389 W CN 2017102389W WO 2018209852 A1 WO2018209852 A1 WO 2018209852A1
Authority
WO
WIPO (PCT)
Prior art keywords
data stream
usb data
wireless communication
communication module
detected
Prior art date
Application number
PCT/CN2017/102389
Other languages
French (fr)
Chinese (zh)
Inventor
何文亮
石长松
Original Assignee
万达百汇科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 万达百汇科技(深圳)有限公司 filed Critical 万达百汇科技(深圳)有限公司
Publication of WO2018209852A1 publication Critical patent/WO2018209852A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Definitions

  • the present application relates to the field of information technology, and in particular, to a POS machine, a POS machine wireless communication module debugging information capture method and a storage medium.
  • the POS machine communicates by setting a wireless communication module.
  • the wireless communication module of the POS machine runs on an independent operating system.
  • the debugging information of the wireless communication module cannot be directly read by the operating system of the POS machine.
  • the POS machine needs to be disassembled.
  • the debug lead on the wireless communication module is led out, and the debug lead is connected to the PC, and the debugging information of the wireless communication module is captured by the PC.
  • a POS machine a POS machine wireless communication module debugging information capture method, and a storage medium are provided.
  • a POS machine wireless communication module debugging information capture method comprising:
  • One or more computer readable non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the steps of:
  • a POS machine comprising: a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, the processor performing the following steps when executing the computer readable instructions:
  • FIG. 1 is a flow chart of a method for capturing debug information of a POS wireless communication module in an embodiment
  • FIG. 2 is a supplementary flowchart of a method for capturing information of a wireless communication module of a POS machine in still another embodiment
  • FIG. 3 is a schematic structural view of a POS machine in an embodiment
  • FIG. 4 is a schematic structural view of a POS machine in still another embodiment
  • FIG. 5 is a schematic structural diagram of a POS machine in an embodiment.
  • a method for capturing information of a wireless communication module of a POS machine including the following steps:
  • Step 102 Obtain a USB device node of the wireless communication module, and open a capture node of the USB device node for capturing debug information of the wireless communication module.
  • the debugging information of the wireless communication module is used to locate the debugging problem of the wireless communication module, such as a network failure problem, a TCP connection or a data packet abnormality problem.
  • the POS machine obtains the USB device node of the wireless communication module, including the node for performing the data service, the node for grasping the debugging information of the wireless communication module, and the like, and is used for opening. Grab the crawl node of the wireless communication module debugging information.
  • Step 104 Configure port information of the crawling node.
  • the POS device configures the port information of the crawling node, and the port information of the crawling node includes: a port baud rate, a port control mode flag constant, and a port local mode flag. Constants, port input mode flag constants, and port output mode flag constants.
  • Step 106 Send a grab command to the wireless communication module to detect the USB data stream.
  • the POS machine sends a grab command to the wireless communication module, starts to capture the configuration information of the wireless communication module, and detects the USB data stream.
  • the POS machine detects the USB data stream, the POS machine performs subsequent steps. Step 108 to step 110.
  • Step 108 Cache the detected USB data stream when the USB data stream is detected.
  • the POS machine reads the detected USB data stream and saves the read USB data stream to the temporary cache.
  • Step 110 Create a crawl file and write the cached USB data stream into the crawl file.
  • the POS machine creates a capture file in the local flash (Flash EEPROM), writes the cached USB data stream to the capture file, and saves it in the local flash for subsequent technical personnel to analyze the problem. Further, in one embodiment, in order to save storage space and ensure storage speed, the captured file adopts a binary file.
  • Flash EEPROM Flash EEPROM
  • the POS machine wireless communication module debugging information capture method by acquiring the USB device node of the wireless communication module, opening a capture node for capturing the wireless communication module debugging information, configuring the port information of the capture node; and sending the capture instruction To the wireless communication module, the USB data stream is detected.
  • the USB data stream is detected, the USB data stream is buffered, and the cached USB data stream is written into the captured file to complete the wireless communication module debugging information capture operation.
  • the debugging method of the wireless communication module of the POS machine realizes the automatic capture of the debugging information of the wireless communication module, and the debugging operation of the wireless communication module is simple and convenient, and the debugging efficiency of the wireless communication module debugging information is greatly improved.
  • the method further includes: querying the number of times of detecting the USB data stream when the USB data stream is not detected; and performing the step of detecting the USB data stream when the number of times of detection is less than or equal to the preset number of detection times.
  • the POS machine in order to avoid failure of capturing the wireless communication module debugging information due to failure of detecting the USB data stream, if the USB data stream is not detected, the POS machine re-detects the USB data stream, if re-detected When the USB data stream is detected by the USB data stream, the above steps 108 to 110 are performed; if the USB data stream is not detected by the re-detection, The POS machine can continue to re-detect the USB data stream.
  • the preset detection number threshold is preset, and each time the USB data stream is detected, Record the number of times the USB data stream is currently detected. When the USB data stream is not detected, query the number of times the USB data stream is detected. When the number of times of detection is less than or equal to the preset number of detection times, perform the step of detecting the USB data stream and re-detect the USB. Data stream; when the number of detections is greater than the threshold of the preset number of detections, the crawling node is closed, and the debugging operation of the wireless communication module is ended.
  • the method further includes recording a start time and an end time of writing the cached USB data stream into the crawl file. Further, as shown in FIG. 2, in an embodiment, the foregoing method further includes:
  • Step 112 When an interrupt occurs in writing the cached USB data stream to the capture file, the capture instruction is sent to the wireless communication module to detect the USB data stream.
  • Step 114 When the USB data stream is detected, the detected USB data stream is buffered, and the time interval between the time when the USB data stream is detected and the last time when the USB data stream is written into the grab file is calculated.
  • Step 116 When the time interval is less than or equal to the preset time interval, the cached USB data stream is written into the last created crawl file.
  • Step 118 When the time interval is greater than the preset time interval, create a new capture file, write the cached USB data stream into the newly created capture file, and record the USB data stream write time.
  • the POS machine resends the capture instruction to the wireless communication module to re-detect the USB data stream, and if the probe is re-detected To the USB data stream, the detected USB data stream continues to be cached.
  • the cached USB data stream may also be pre-set to be written into the captured file.
  • the threshold of the preset interrupt detection number of the USB data stream is re-detected when an interruption occurs, and after the USB data stream write interrupt occurs, the number of times the current USB data stream is currently detected is recorded each time the USB data stream is detected, when the USB data stream is not detected.
  • querying probe USB The number of times of the data stream; when the number of times of detection is less than or equal to the threshold value of the preset number of interrupt detections, the USB data stream is re-detected; when the number of times of detection is greater than the threshold number of the preset terminal detection times, the crawling node is closed, and the debugging information of the wireless communication module is ended. operating.
  • the preset time interval for re-probing the USB data stream after the interruption is set in advance, and if the USB data stream is detected after re-probing after the USB data stream write interruption occurs, The time to re-detect the USB data stream is compared with the end time of the last USB data stream written to the fetch file, and the time to re-detect the USB data stream is calculated and the last time the USB data stream is written to the fetch file.
  • Time interval if the time interval is less than or equal to the preset time interval, the data stream is continuously written to the original binary file for continuous recording; if the time interval is greater than the preset time interval, the existing binary file is closed, and Create a new binary file, write the re-detected data stream to the new binary file, and record the time at which the write started.
  • the USB data can be avoided after the interruption time is too long.
  • the USB data stream stored is not continuous, which is inconvenient for subsequent analysis. On the other hand, it can also avoid storing multiple crawl files after a short interruption, causing the captured file not to be viewed when analyzing data. Convenience.
  • the POS machine determines whether an interrupt is generated by writing a USB data stream to the capture file by detecting whether the end capture instruction is acquired. If the end of the capture operation is not obtained when the USB data stream is written to the capture file, An interrupt is generated to write the USB data stream to the capture file. If the USB data stream is written to the capture file after receiving the end capture instruction, the USB data stream is written to the capture file and the write end is completed normally, and no write interruption occurs. At this time, the crawling node is closed, and the debugging operation of the wireless communication module is ended.
  • the wireless communication module uses a 4G wireless communication module as an example for description.
  • the wireless communication module may also be a 2G wireless communication module or a 3G wireless communication module.
  • a 5G wireless communication module the embodiment is used to define a specific type of the wireless communication module, and the above POS wireless communication
  • the module debugging information capture method can be applied to any type of POS wireless communication module.
  • a POS machine wireless communication module debugging information capture method comprising the following steps:
  • the CPU (central processing unit) of the POS machine and the 4G wireless communication module are connected by a USB cable, and the POS machine starts up to enumerate the USB related information between the CPU of the POS machine and the 4G wireless communication module.
  • the POS machine After obtaining the debugging instruction of the wireless communication module debugging information, the POS machine first obtains USB related information between the CPU of the POS machine and the 4G wireless communication module, including a ttyACM0 node for performing data service, for capturing the wireless communication module.
  • the ttyACM1 node of the debugging information (that is, the crawling node) and the node information of the ttyACM3 node for sending the AT command, if the USB device node of the wireless communication module fails to complete the debugging operation of the wireless communication module; if the wireless communication is obtained If the USB device node of the module is successful, the ttyACM1 node for capturing the debugging information of the wireless communication module is turned on. If the ttyACM1 node fails to be opened, the USB device node is closed to end the debugging operation of the wireless communication module; if the ttyACM1 node is properly opened, the execution continues. Next, the ttyACM1 node configuration operation.
  • the ttyACM1 node is correctly opened and configured to obtain the trace information of the 4G wireless communication module. Therefore, in order to allow the USB data stream of the debugging information of the wireless communication module to be output from the ttyACM1 node in a correct and controllable manner, the capture mode setting is required after the capture node is started, and the port information of the capture node is correctly configured. To ensure that the USB data stream of the wireless communication module is output from the ttyACM1 node in a correct manner. If the configuration of the port information of the capture node fails, the debugging of the wireless communication module cannot be performed, and the POS machine closes. Take the node and end the debugging of the wireless communication module debugging information.
  • the port information of the capture node includes: a port baud rate, a port control mode flag constant, a port local mode flag constant, a port input mode flag constant, and a port output mode flag constant.
  • the port information configuration of the specific ttyACM1 node includes the following:
  • c_lflag First, set the ICANON flag to enable the standard mode, allowing the use of special characters EOF, EOL, EOL2, ERASE, KILL, LNEXT, REPRINT, STATUS and WERASE. And a cache by row. Then, set the ECHO flag to echo the input characters. Next, set the ECHOE flag to erase the previous input character or erase the previous word. Finally, the ISIG flag is set to generate a corresponding signal when the characters INTR, QUIT, SUSP or DSUSP are accepted.
  • the status of each of the above flag bits is set to 1, and the corresponding flag bit function is turned on.
  • the flag bit function is turned off.
  • the flag bit function can be set when the flag bit status is 0, and the flag bit function is turned off when the flag bit is 1, which can be set according to actual needs, which is not specifically limited in this embodiment.
  • the POS machine sends a grab command to the wireless communication module, turns on the wireless communication module debug information capture mode, and detects the USB data stream.
  • the AT command is a command set for communication by the wireless communication module, and is an application interface provided by the wireless communication module, and the POS device performs communication and data service operations with the wireless through the AT command.
  • the POS machine detects the USB data stream and performs flow control on the USB data stream through the read function of the internal API function of the system. If there is a USB data stream, the read function is used to read and read the data at a certain speed. A temporary buffer in a temporary buffer that caches the detected USB data stream. If the probe fails, close the ttyACM1 node and end the crawl operation.
  • the POS machine in the process of detecting the USB data stream, in order to avoid failure of capturing the wireless communication module debugging information due to failure of detecting the USB data stream, if the USB data stream is not detected, the POS machine re-detects the USB.
  • the data stream if the USB data stream is detected when the USB data stream is re-detected, the detected USB data stream is cached; if the USB data stream is not detected by re-probing, the POS machine can continue to re-detect the USB data stream.
  • the preset detection number threshold may be preset, and the USB number is detected each time. According to the flow, the number of times of detecting the USB data stream is recorded. When the USB data stream is not detected, the number of times of detecting the USB data stream is queried; when the number of times of detection is less than or equal to the preset number of detection times, the step of detecting the USB data stream is performed. Re-detecting the USB data stream; when the number of detections is greater than the preset detection number threshold, the capture node is closed, and the debugging operation of the wireless communication module is ended.
  • a binary capture file is created in the local flash (flash memory) of the POS machine, the USB data stream in the temporary buffer is written into the capture file, and the captured wireless communication module is saved in the local flash of the POS machine.
  • Debugging information when the end of the fetching instruction is obtained, the POS machine closes the fetching file, closes the fetching node, and completes the fetching operation. If the USB data stream fails to be written to the fetching file, the crawling node is closed, and the wireless communication module is terminated. Debug information fetching operations.
  • the POS machine can resend the capture instruction to the wireless communication module, re-probe the USB data stream, and detect the USB data stream if re-detected. , then continue to cache the detected USB data stream and write the cached USB data stream to the crawl file.
  • a preset time interval eg, 1 minute
  • the USB data stream is detected during re-probing after the USB data stream write interruption occurs, the USB data stream is re-detected.
  • the time to the USB stream is compared to the end time of the last USB stream written to the fetch file, and the time to re-detect the USB stream is calculated and the last time the USB stream was written to the fetch file.
  • Time interval If the time interval is less than or equal to the preset time interval, the data stream is continuously written to the original binary file for continuous recording. If the time interval is greater than the preset time interval, the existing binary file is closed and the new file is re-established. The binary file, writes the re-detected data stream to the new binary file, and records the time at which the write started.
  • the debugging information of the wireless communication module of the POS machine can automatically capture the debugging information of the wireless communication module, greatly improving the debugging efficiency of the debugging information of the wireless communication module, and the debugging information of the captured wireless communication module is stored in the local flash.
  • the PC tool can export the captured files to a PC (personal computer) for debugging information analysis (such as net state analysis, TCP/IP packet analysis, etc.).
  • the method is simple and convenient to operate, if there is no POS machine If there is a problem with the line communication module, the ordinary user can perform the debugging of the wireless communication module debugging information.
  • the user can send it to the professional technician of the POS machine manufacturer for debugging information analysis, which can realize the remote positioning analysis problem of the technician. It can save the time cost and economic cost (such as transportation cost) of problem analysis and location on the way to the site, which is beneficial to improve the efficiency of technicians and reduce the maintenance cost of POS.
  • a structural block diagram of a POS machine 300 is provided.
  • Each of the following modules may be implemented in whole or in part by software, hardware or a combination thereof.
  • the POS machine 300 includes:
  • the crawling node opening module 302 obtains a USB device node of the wireless communication module, and opens a crawling node of the USB device node for capturing debugging information of the wireless communication module.
  • the port information configuration module 304 is configured to configure port information of the fetch node.
  • the first data detecting module 306 is configured to send a grab command to the wireless communication module to detect the USB data stream.
  • the first data cache module 308 is configured to cache the detected USB data stream when the USB data stream is detected.
  • the first data storage module 310 is configured to create a crawl file and write the cached USB data stream into the crawl file.
  • the POS machine 300 further includes:
  • the detection times query module 312 is configured to query the number of times the USB data stream is detected when the USB data stream is not detected.
  • the detection number comparison module 314 is configured to send the first detection instruction to the first data detection module 306 when the number of detection times is less than or equal to the preset detection number threshold.
  • the POS machine 300 further includes:
  • the timing module 316 is configured to record a start time and an end time of writing the cached USB data stream into the capture file.
  • the POS machine 300 further includes:
  • the interrupt detection module 318 is configured to send the second probe instruction to the second data detection module 320 when an interrupt occurs in writing the cached USB data stream to the capture file.
  • the second data detecting module 320 is configured to send a grab command to the wireless communication module according to the second detecting instruction to detect the USB data stream.
  • the second data cache module 322 is configured to cache the detected USB data stream when the USB data stream is detected, and calculate the time when the USB data stream is detected and the end time of the last time the USB data stream is written into the captured file. Interval.
  • the second data storage module 324 is configured to write the cached USB data stream into the newly created capture file when the time interval is less than or equal to the preset time interval; when the time interval is greater than the preset time interval, the new data capture module Take the file, write the cached USB data stream to the newly created capture file, and record the USB data stream write time.
  • the port information of the capture node includes: a port baud rate, a port control mode flag constant, a port local mode flag constant, a port input mode flag constant, and a port output mode flag constant.
  • one or more computer readable non-volatile storage media storing computer readable instructions, the computer readable instructions being executed by one or more processors such that the one Or multiple processors perform the following steps:
  • the computer readable instructions described above are further executed by the processor to:
  • the step of detecting the USB data stream is performed when the number of detections is less than or equal to a preset number of detection thresholds.
  • the computer readable instructions described above when executed by the processor, further implement the step of recording a start time and an end time of writing the cached USB data stream into the fetch file.
  • the following steps are further implemented: when an interrupt occurs in writing the cached USB data stream to the fetch file, sending a fetch command to the wireless communication module , detecting USB data stream;
  • the port information of the crawling node includes: a port baud rate, a port control mode flag constant, a port local mode flag constant, and a port input. Mode flag constants and port output mode flag constants.
  • a POS machine comprising: a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, the processor performing the following steps when executing the computer readable instructions:
  • the POS machine described above includes a processor and a memory connected by a system bus, the memory including a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium of the POS machine stores an operating system, and further includes a computer readable instruction.
  • the computer readable instructions are executable by the processor for implementing a POS wireless communication module debugging information capture method.
  • the processor is a CPU of the POS machine for providing computing and control capabilities to support the operation of the entire POS machine.
  • the internal memory in the POS machine provides a cached operating environment for operating systems and computer readable instructions in a non-volatile storage medium.
  • FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the POS machine to which the solution of the present application is applied.
  • the specific POS machine can It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • the processor also performs the following steps when executing the computer readable instructions:
  • the step of detecting the USB data stream is performed.
  • the processor when executing the computer readable instructions, also performs the step of recording a start time and an end time of writing the cached USB data stream into the fetch file.
  • the processor also performs the following steps when executing the computer readable instructions:
  • the capture instruction is sent to the wireless communication module to detect the USB data stream;
  • the detected USB data stream is buffered, and the time interval between the time when the USB data stream is detected and the last time the USB data stream is written into the grab file is calculated;
  • the cached USB data stream is written into the last created crawl file
  • the port information of the capture node includes: a port baud rate, a port control mode flag constant, a port local mode flag constant, a port input mode flag constant, and a port output mode flag constant.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present application relates to a POS machine, a method for fetching debugging information of a wireless communication module of the POS machine, and a storage medium. The method comprises: obtaining USB device nodes of the wireless communication module, and enabling a fetching node among the USB device nodes for fetching the debugging information of the wireless communication module; configuring port information of the fetching node; sending a fetching instruction to the wireless communication module to detect USB data flows; caching the detected USB data flows if the USB data flows are detected; and creating a fetching file, and writing the cached USB data flows into the fetching file.

Description

POS机、POS机无线通讯模块调试信息抓取方法及存储介质POS machine, POS machine wireless communication module debugging information capture method and storage medium
相关申请的交叉引用Cross-reference to related applications
本申请要求于2017年05月15日提交中国专利局,申请号为201710340133.7,发明名称为“POS机、POS机无线通讯模块调试信息抓取方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application is required to be submitted to the China Patent Office on May 15, 2017, the application number is 201710340133.7, and the invention title is “Priority of Chinese Patent Application for POS Machine, POS Machine Wireless Communication Module Debugging Information Grab Method and Device”, all of which are The content is incorporated herein by reference.
技术领域Technical field
本申请涉及信息技术领域,特别是涉及一种POS机、POS机无线通讯模块调试信息抓取方法及存储介质。The present application relates to the field of information technology, and in particular, to a POS machine, a POS machine wireless communication module debugging information capture method and a storage medium.
背景技术Background technique
一般的,POS机中通过设置无线通讯模块进行通讯。POS机的无线通讯模块运行于独立的操作系统,无线通讯模块的调试信息不能直接通过POS机的操作系统读取出来,为了定位POS机的无线通讯模块的调试问题,需要拆开POS机,将位于无线通讯模块上的调试引线引出来,再将调试引线与PC机连接,通过PC机抓取无线通讯模块的调试信息。在实现本申请的过程中,发明人发现现有技术中至少存在如下问题:无线通讯模块调试信息抓取过程中频繁的拆机、连线、装机操作使得调试信息抓取操作非常不方便,且严重影响抓取效率。Generally, the POS machine communicates by setting a wireless communication module. The wireless communication module of the POS machine runs on an independent operating system. The debugging information of the wireless communication module cannot be directly read by the operating system of the POS machine. In order to locate the debugging problem of the wireless communication module of the POS machine, the POS machine needs to be disassembled. The debug lead on the wireless communication module is led out, and the debug lead is connected to the PC, and the debugging information of the wireless communication module is captured by the PC. In the process of implementing the present application, the inventor has found that at least the following problems exist in the prior art: frequent teardown, connection, and installation operations in the process of capturing information of the wireless communication module make the debugging information capture operation very inconvenient, and Seriously affect the efficiency of the capture.
发明内容Summary of the invention
根据实施例的解决方案,提供一种POS机、POS机无线通讯模块调试信息抓取方法及存储介质。According to the solution of the embodiment, a POS machine, a POS machine wireless communication module debugging information capture method, and a storage medium are provided.
一种POS机无线通讯模块调试信息抓取方法,包括:A POS machine wireless communication module debugging information capture method, comprising:
获取无线通讯模块的USB设备节点,开启USB设备节点中用于抓取无 线通讯模块调试信息的抓取节点;Obtain the USB device node of the wireless communication module, and open the USB device node for capturing no The capture node of the line communication module debugging information;
配置抓取节点的端口信息;Configure the port information of the crawling node.
发送抓取指令至无线通讯模块,探测USB数据流;Send a capture command to the wireless communication module to detect the USB data stream;
当探测到USB数据流时,缓存探测到的USB数据流;及Cache the detected USB data stream when a USB data stream is detected; and
创建抓取文件,将缓存的USB数据流写入抓取文件中。Create a crawl file and write the cached USB data stream to the crawl file.
一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more computer readable non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the steps of:
获取无线通讯模块的USB设备节点,开启USB设备节点中用于抓取无线通讯模块调试信息的抓取节点;Obtaining a USB device node of the wireless communication module, and opening a capture node of the USB device node for capturing debug information of the wireless communication module;
配置抓取节点的端口信息;Configure the port information of the crawling node.
发送抓取指令至无线通讯模块,探测USB数据流;Send a capture command to the wireless communication module to detect the USB data stream;
当探测到USB数据流时,缓存探测到的USB数据流;及Cache the detected USB data stream when a USB data stream is detected; and
创建抓取文件,将缓存的USB数据流写入抓取文件中。Create a crawl file and write the cached USB data stream to the crawl file.
一种POS机,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现以下步骤:A POS machine comprising: a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, the processor performing the following steps when executing the computer readable instructions:
获取无线通讯模块的USB设备节点,开启USB设备节点中用于抓取无线通讯模块调试信息的抓取节点;Obtaining a USB device node of the wireless communication module, and opening a capture node of the USB device node for capturing debug information of the wireless communication module;
配置抓取节点的端口信息;Configure the port information of the crawling node.
发送抓取指令至无线通讯模块,探测USB数据流;Send a capture command to the wireless communication module to detect the USB data stream;
当探测到USB数据流时,缓存探测到的USB数据流;及Cache the detected USB data stream when a USB data stream is detected; and
创建抓取文件,将缓存的USB数据流写入抓取文件中。Create a crawl file and write the cached USB data stream to the crawl file.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。Details of one or more embodiments of the present application are set forth in the accompanying drawings and description below. Other features, objects, and advantages of the invention will be apparent from the description and appended claims.
附图说明 DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings to be used in the embodiments will be briefly described below. Obviously, the drawings in the following description are only some embodiments of the present application, Those skilled in the art can also obtain other drawings based on these drawings without any creative work.
图1为一个实施例中POS机无线通讯模块调试信息抓取方法流程图;1 is a flow chart of a method for capturing debug information of a POS wireless communication module in an embodiment;
图2为又一个实施例中POS机无线通讯模块调试信息抓取方法的补充流程图;2 is a supplementary flowchart of a method for capturing information of a wireless communication module of a POS machine in still another embodiment;
图3为一个实施例中POS机的结构示意图;3 is a schematic structural view of a POS machine in an embodiment;
图4为又一个实施例中POS机的结构示意图;4 is a schematic structural view of a POS machine in still another embodiment;
图5为一个实施例中POS机的结构示意图。FIG. 5 is a schematic structural diagram of a POS machine in an embodiment.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
请参阅图1,一种POS机无线通讯模块调试信息抓取方法,包括以下步骤:Please refer to FIG. 1 , a method for capturing information of a wireless communication module of a POS machine, including the following steps:
步骤102:获取无线通讯模块的USB设备节点,开启USB设备节点中用于抓取无线通讯模块调试信息的抓取节点。Step 102: Obtain a USB device node of the wireless communication module, and open a capture node of the USB device node for capturing debug information of the wireless communication module.
无线通讯模块的调试信息用于定位无线通讯模块的调试问题,如注网失败问题、TCP连接或数据包异常问题等。当无线通讯模块出现调试问题时,POS机获取无线通讯模块的USB设备节点,包括用于进行数据业务的业务节点、用于抓取无线通讯模块调试信息的抓取节点等节点信息,开启用于抓取无线通讯模块调试信息的抓取节点。The debugging information of the wireless communication module is used to locate the debugging problem of the wireless communication module, such as a network failure problem, a TCP connection or a data packet abnormality problem. When the wireless communication module has a debugging problem, the POS machine obtains the USB device node of the wireless communication module, including the node for performing the data service, the node for grasping the debugging information of the wireless communication module, and the like, and is used for opening. Grab the crawl node of the wireless communication module debugging information.
步骤104:配置抓取节点的端口信息。Step 104: Configure port information of the crawling node.
具体地,开启抓取节点后,POS机配置抓取节点的端口信息,抓取节点的端口信息包括:端口波特率、端口控制模式标志常量、端口本地模式标志 常量、端口输入模式标志常量及端口输出模式标志常量。Specifically, after the crawling node is enabled, the POS device configures the port information of the crawling node, and the port information of the crawling node includes: a port baud rate, a port control mode flag constant, and a port local mode flag. Constants, port input mode flag constants, and port output mode flag constants.
步骤106:发送抓取指令至无线通讯模块,探测USB数据流。Step 106: Send a grab command to the wireless communication module to detect the USB data stream.
具体地,完成抓取节点的端口信息配置后,POS机向无线通信模块发送抓取指令,开始抓取无线通讯模块配置信息,探测USB数据流,当POS机探测到USB数据流时,执行后续的步骤108至步骤110。Specifically, after the configuration of the port information of the crawling node is completed, the POS machine sends a grab command to the wireless communication module, starts to capture the configuration information of the wireless communication module, and detects the USB data stream. When the POS machine detects the USB data stream, the POS machine performs subsequent steps. Step 108 to step 110.
步骤108:当探测到USB数据流时,缓存探测到的USB数据流。Step 108: Cache the detected USB data stream when the USB data stream is detected.
具体地,当探测到USB数据流时,POS机读取探测到的USB数据流,并将读取出的USB数据流保存到临时缓存中。Specifically, when the USB data stream is detected, the POS machine reads the detected USB data stream and saves the read USB data stream to the temporary cache.
步骤110:创建抓取文件,将缓存的USB数据流写入抓取文件中。Step 110: Create a crawl file and write the cached USB data stream into the crawl file.
具体地,POS机在本地flash(Flash EEPROM,闪存)中创建抓取文件,将缓存的USB数据流写入抓取文件,保存在本地flash中,以供后续技术人员进行问题分析。进一步的,在一个实施例中,为了节省存储空间并保证存储速度,抓取文件采用二进制文件。Specifically, the POS machine creates a capture file in the local flash (Flash EEPROM), writes the cached USB data stream to the capture file, and saves it in the local flash for subsequent technical personnel to analyze the problem. Further, in one embodiment, in order to save storage space and ensure storage speed, the captured file adopts a binary file.
上述POS机无线通讯模块调试信息抓取方法,通过获取无线通讯模块的USB设备节点,开启用于抓取无线通讯模块调试信息的抓取节点,配置抓取节点的端口信息;并发送抓取指令至无线通讯模块,探测USB数据流,当探测到USB数据流时,缓存USB数据流,再将缓存的USB数据流写入抓取文件,完成无线通讯模块调试信息抓取操作。上述POS机无线通讯模块调试信息抓取方法实现了无线通讯模块调试信息自动抓取,无线通讯模块调试信息抓取操作简单方便,大大提高了无线通讯模块调试信息的抓取效率。The POS machine wireless communication module debugging information capture method, by acquiring the USB device node of the wireless communication module, opening a capture node for capturing the wireless communication module debugging information, configuring the port information of the capture node; and sending the capture instruction To the wireless communication module, the USB data stream is detected. When the USB data stream is detected, the USB data stream is buffered, and the cached USB data stream is written into the captured file to complete the wireless communication module debugging information capture operation. The debugging method of the wireless communication module of the POS machine realizes the automatic capture of the debugging information of the wireless communication module, and the debugging operation of the wireless communication module is simple and convenient, and the debugging efficiency of the wireless communication module debugging information is greatly improved.
在一个实施例中,上述方法还包括:当未探测到USB数据流时,查询探测USB数据流的次数;当探测次数小于或等于预设探测次数阈值时,执行探测USB数据流的步骤。In an embodiment, the method further includes: querying the number of times of detecting the USB data stream when the USB data stream is not detected; and performing the step of detecting the USB data stream when the number of times of detection is less than or equal to the preset number of detection times.
具体地,在探测USB数据流的过程中,为避免因探测USB数据流失败而导致抓取无线通讯模块调试信息失败,如果未探测到USB数据流,POS机重新探测USB数据流,如果重新探测USB数据流时探测到USB数据流,则执行时上述的步骤108至步骤110;如果重新探测还没有探测到USB数据流, POS机可继续重新探测USB数据流。本实施例中,为了避免出现因多次探测失败而导致POS机一直重复探测USB数据流影响抓取无线通讯模块调试信息的效率,预先设置预设探测次数阈值,每次探测USB数据流时,记录当前探测USB数据流的次数,当未探测到USB数据流时,查询探测USB数据流的次数;当探测次数小于或等于预设探测次数阈值时,执行探测USB数据流的步骤,重新探测USB数据流;当探测次数大于预设探测次数阈值时,关闭抓取节点,结束无线通讯模块调试信息抓取操作。Specifically, in the process of detecting the USB data stream, in order to avoid failure of capturing the wireless communication module debugging information due to failure of detecting the USB data stream, if the USB data stream is not detected, the POS machine re-detects the USB data stream, if re-detected When the USB data stream is detected by the USB data stream, the above steps 108 to 110 are performed; if the USB data stream is not detected by the re-detection, The POS machine can continue to re-detect the USB data stream. In this embodiment, in order to avoid the possibility that the POS machine repeatedly detects the USB data stream and affects the debugging information of the wireless communication module due to multiple detection failures, the preset detection number threshold is preset, and each time the USB data stream is detected, Record the number of times the USB data stream is currently detected. When the USB data stream is not detected, query the number of times the USB data stream is detected. When the number of times of detection is less than or equal to the preset number of detection times, perform the step of detecting the USB data stream and re-detect the USB. Data stream; when the number of detections is greater than the threshold of the preset number of detections, the crawling node is closed, and the debugging operation of the wireless communication module is ended.
在一个实施例中,上述方法还包括:记录将缓存的USB数据流写入抓取文件中的开始时间和结束时间。进一步的,如图2所示,在一个实施例中,上述方法还包括:In one embodiment, the method further includes recording a start time and an end time of writing the cached USB data stream into the crawl file. Further, as shown in FIG. 2, in an embodiment, the foregoing method further includes:
步骤112:当将缓存的USB数据流写入抓取文件中发生中断时,发送抓取指令至无线通讯模块,探测USB数据流。Step 112: When an interrupt occurs in writing the cached USB data stream to the capture file, the capture instruction is sent to the wireless communication module to detect the USB data stream.
步骤114:当探测到USB数据流时,缓存探测到的USB数据流,并计算探测到USB数据流的时间与最近一次将USB数据流写入抓取文件中的结束时间的时间间隔。Step 114: When the USB data stream is detected, the detected USB data stream is buffered, and the time interval between the time when the USB data stream is detected and the last time when the USB data stream is written into the grab file is calculated.
步骤116:当时间间隔小于或等于预设时间间隔时,将缓存的USB数据流写入最近一次创建的抓取文件中。Step 116: When the time interval is less than or equal to the preset time interval, the cached USB data stream is written into the last created crawl file.
步骤118:当时间间隔大于预设时间间隔时,新建抓取文件,将缓存的USB数据流写入新建的抓取文件中,并记录USB数据流写入时间。Step 118: When the time interval is greater than the preset time interval, create a new capture file, write the cached USB data stream into the newly created capture file, and record the USB data stream write time.
具体地,本实施例中,如果在将缓存的USB数据流写入抓取文件的过程中发生中断,POS机重新发送抓取指令至无线通信模块,重新探测USB数据流,如果重新探测时探测到USB数据流,则继续缓存探测到的USB数据流。为了避免出现因多次探测失败而导致POS机一直重复探测USB数据流影响抓取无线通讯模块调试信息的效率,在一个实施例中,也可以预先设置将缓存的USB数据流写入抓取文件中发生中断时重新探测USB数据流的预设中断探测次数阈值,发生USB数据流写入中断后,每次探测USB数据流时,记录当前探测USB数据流的次数,当未探测到USB数据流时,查询探测USB 数据流的次数;当探测次数小于或等于预设中断探测次数阈值时,重新探测USB数据流;当探测次数大于预设终端探测次数阈值时,关闭抓取节点,结束无线通讯模块调试信息抓取操作。Specifically, in this embodiment, if an interruption occurs in the process of writing the cached USB data stream into the capture file, the POS machine resends the capture instruction to the wireless communication module to re-detect the USB data stream, and if the probe is re-detected To the USB data stream, the detected USB data stream continues to be cached. In order to avoid the possibility that the POS machine repeatedly detects the USB data stream and affects the debugging information of the wireless communication module due to multiple detection failures, in one embodiment, the cached USB data stream may also be pre-set to be written into the captured file. The threshold of the preset interrupt detection number of the USB data stream is re-detected when an interruption occurs, and after the USB data stream write interrupt occurs, the number of times the current USB data stream is currently detected is recorded each time the USB data stream is detected, when the USB data stream is not detected. When querying probe USB The number of times of the data stream; when the number of times of detection is less than or equal to the threshold value of the preset number of interrupt detections, the USB data stream is re-detected; when the number of times of detection is greater than the threshold number of the preset terminal detection times, the crawling node is closed, and the debugging information of the wireless communication module is ended. operating.
进一步地,由于缓存存储空间限制,在一个实施例中,预先设置中断后重新探测USB数据流的预设时间间隔,如果发生USB数据流写入中断后重新探测时探测到USB数据流,则将重新探测到USB数据流的时间与上一次将USB数据流写入抓取文件中的结束时间比较,计算重新探测到USB数据流的时间与最近一次将USB数据流写入抓取文件中的结束时间的时间间隔,如果该时间间隔小于或等于预设时间间隔,则将数据流继续写入原来的二进制文件,连续记录;如果时间间隔大于预设时间间隔,则关闭已有的二进制文件,重新建立新的二进制文件,将重新探测到的数据流写入新的二进制文件,并记录开始写入的时间。本实施例中,通过设置预设时间间隔选择发生写入中断后将USB数据流连续写入原抓取文件或重新写入新的抓取文件,一方面能够避免中断时间过长后将USB数据流写入一个抓取文件中时存储的USB数据流不连续,不方便后续分析;另一方面,也能够避免出现短暂中断后存储多个抓取文件,造成后续分析数据时查看抓取文件不方便。Further, due to the limitation of the cache storage space, in one embodiment, the preset time interval for re-probing the USB data stream after the interruption is set in advance, and if the USB data stream is detected after re-probing after the USB data stream write interruption occurs, The time to re-detect the USB data stream is compared with the end time of the last USB data stream written to the fetch file, and the time to re-detect the USB data stream is calculated and the last time the USB data stream is written to the fetch file. Time interval, if the time interval is less than or equal to the preset time interval, the data stream is continuously written to the original binary file for continuous recording; if the time interval is greater than the preset time interval, the existing binary file is closed, and Create a new binary file, write the re-detected data stream to the new binary file, and record the time at which the write started. In this embodiment, by setting a preset time interval, selecting a USB data stream to be continuously written into the original capture file or rewriting the new capture file after the write interruption occurs, on the one hand, the USB data can be avoided after the interruption time is too long. When the stream is written into a crawl file, the USB data stream stored is not continuous, which is inconvenient for subsequent analysis. On the other hand, it can also avoid storing multiple crawl files after a short interruption, causing the captured file not to be viewed when analyzing data. Convenience.
更进一步地,POS机通过检测是否获取到结束抓取指令判断将USB数据流写入抓取文件是否发生中断,如果将USB数据流写入抓取文件结束时未获取到结束抓取指令,则为将USB数据流写入抓取文件发生中断,如果接收到结束抓取指令后结束将USB数据流写入抓取文件,则将USB数据流写入抓取文件正常结束,未发生写入中断,此时,关闭抓取节点,结束无线通讯模块调试信息抓取操作。Further, the POS machine determines whether an interrupt is generated by writing a USB data stream to the capture file by detecting whether the end capture instruction is acquired. If the end of the capture operation is not obtained when the USB data stream is written to the capture file, An interrupt is generated to write the USB data stream to the capture file. If the USB data stream is written to the capture file after receiving the end capture instruction, the USB data stream is written to the capture file and the write end is completed normally, and no write interruption occurs. At this time, the crawling node is closed, and the debugging operation of the wireless communication module is ended.
进一步的,以下列举具体应用实施例对上述的POS机无线通讯模块调试信息抓取方法进行详细说明。为便于说明,本实施例以无线通信模块采用4G无线通信模块为例进行说明,但是,需要说明的是,在其它实施例中,无线通讯模块还可以是2G无线通信模块、3G无线通信模块,或5G无线通信模块,本实施例并于用于限定无线通讯模块的具体类型,上述的POS机无线通 讯模块调试信息抓取方法可以应用于任意类型的POS机无线通讯模块。Further, the following specific application examples are used to describe the above-mentioned POS wireless communication module debugging information capture method in detail. For convenience of description, the wireless communication module uses a 4G wireless communication module as an example for description. However, in other embodiments, the wireless communication module may also be a 2G wireless communication module or a 3G wireless communication module. Or a 5G wireless communication module, the embodiment is used to define a specific type of the wireless communication module, and the above POS wireless communication The module debugging information capture method can be applied to any type of POS wireless communication module.
一种POS机无线通讯模块调试信息抓取方法,包括以下步骤:A POS machine wireless communication module debugging information capture method, comprising the following steps:
1)、获取无线通讯模块的USB设备节点,开启USB设备节点中用于抓取无线通讯模块调试信息的抓取节点。1) Obtain a USB device node of the wireless communication module, and open a capture node of the USB device node for capturing the debugging information of the wireless communication module.
具体地,POS机的CPU(中央处理器)与4G无线通讯模块之间通过USB线连接,POS机开机便会把POS机的CPU与4G无线通讯模块之间的USB相关信息枚举出来。当获取到无线通讯模块调试信息抓取指令后,POS机首先获取POS机的CPU与4G无线通讯模块之间的USB相关信息,包括用于进行数据业务的ttyACM0节点,用于抓取无线通讯模块调试信息的ttyACM1节点(即抓取节点),以及用于发送AT命令的ttyACM3节点等节点信息,如果获取无线通讯模块的USB设备节点失败则结束本次无线通讯模块调试信息操作;如果获取无线通讯模块的USB设备节点成功,则开启用于抓取无线通讯模块调试信息的ttyACM1节点,若打开ttyACM1节点失败则关闭USB设备节点结束本次无线通讯模块调试信息操作;如果正确打开ttyACM1节点则继续执行下一步ttyACM1节点配置操作。Specifically, the CPU (central processing unit) of the POS machine and the 4G wireless communication module are connected by a USB cable, and the POS machine starts up to enumerate the USB related information between the CPU of the POS machine and the 4G wireless communication module. After obtaining the debugging instruction of the wireless communication module debugging information, the POS machine first obtains USB related information between the CPU of the POS machine and the 4G wireless communication module, including a ttyACM0 node for performing data service, for capturing the wireless communication module. The ttyACM1 node of the debugging information (that is, the crawling node) and the node information of the ttyACM3 node for sending the AT command, if the USB device node of the wireless communication module fails to complete the debugging operation of the wireless communication module; if the wireless communication is obtained If the USB device node of the module is successful, the ttyACM1 node for capturing the debugging information of the wireless communication module is turned on. If the ttyACM1 node fails to be opened, the USB device node is closed to end the debugging operation of the wireless communication module; if the ttyACM1 node is properly opened, the execution continues. Next, the ttyACM1 node configuration operation.
2)、配置抓取节点的端口信息。2) Configure the port information of the crawling node.
具体地,正确打开并配置好ttyACM1节点,才能获取到4G无线通讯模块的trace信息。因此,为了让无线通讯模块的调试信息的USB数据流以一个正确的,可控制的方式从ttyACM1节点输出,开启抓取节点后需要进行抓取模式设置,对抓取节点的端口信息进行正确配置,以保证无线通讯模块的调试信息USB数据流以一个正确的方式从ttyACM1节点输出,如果抓取节点的端口信息配置失败,则无法进行无线通讯模块的调试信息的抓取操作,POS机关闭抓取节点,结束无线通讯模块调试信息抓取操作。Specifically, the ttyACM1 node is correctly opened and configured to obtain the trace information of the 4G wireless communication module. Therefore, in order to allow the USB data stream of the debugging information of the wireless communication module to be output from the ttyACM1 node in a correct and controllable manner, the capture mode setting is required after the capture node is started, and the port information of the capture node is correctly configured. To ensure that the USB data stream of the wireless communication module is output from the ttyACM1 node in a correct manner. If the configuration of the port information of the capture node fails, the debugging of the wireless communication module cannot be performed, and the POS machine closes. Take the node and end the debugging of the wireless communication module debugging information.
在一个实施例中,抓取节点的端口信息包括:端口波特率、端口控制模式标志常量、端口本地模式标志常量、端口输入模式标志常量及端口输出模式标志常量。具体ttyACM1节点的端口信息配置包括以下内容:In one embodiment, the port information of the capture node includes: a port baud rate, a port control mode flag constant, a port local mode flag constant, a port input mode flag constant, and a port output mode flag constant. The port information configuration of the specific ttyACM1 node includes the following:
a)、使用终端控制函数,设置ttyACM1节点的终端设备结构端口的波特 率为115200。a), using the terminal control function, set the port of the terminal device structure port of the ttyACM1 node The rate is 115200.
b)、设置终端设备结构端口的控制模式标志常量c_cflag:首先,设置CLOCAL标志位,用于忽略4G无线通讯模块的控制线。然后,设置CREAD标志位,用于打开接受者。接着,设置CS8标志位,用于设置字符长度掩码为8,用于指定传送或接收字节时用的位数为8bits。最后,设置HUPCL标志位,在一个进程关闭设备后,用于挂断4G无线通讯模块的控制线。b), set the terminal device structure port control mode flag constant c_cflag: First, set the CLOCAL flag bit, used to ignore the control line of the 4G wireless communication module. Then, set the CREAD flag to open the recipient. Next, set the CS8 flag to set the character length mask to 8 to specify the number of bits used to transmit or receive bytes to 8 bits. Finally, the HUPCL flag is set to hang up the control line of the 4G wireless communication module after a process has shut down the device.
c)、进一步设置终端设备结构端口的控制模式标志常量c_cflag:首先,设置PARENB标志位,用于允许输出产生奇偶信息以及输入的奇偶校验(启动同位产生与侦测)。然后,设置CSIZE标志位,用于设置字符长度掩码。最后,设置CSTOPB标志位,用于设置两个停止位。c) Further setting the control mode flag constant of the terminal device structure port c_cflag: First, the PARENB flag is set to allow the output to generate parity information and input parity (to initiate parity generation and detection). Then, set the CSIZE flag to set the character length mask. Finally, set the CSTOPB flag to set two stop bits.
d)、设置终端设备结构端口的本地模式标志常量c_lflag:首先,设置ICANON标志位,用于启用标准模式,允许使用特殊字符EOF,EOL,EOL2,ERASE,KILL,LNEXT,REPRINT,STATUS和WERASE,以及按行的缓存。然后,设置ECHO标志位,用于回显输入字符。接着,设置ECHOE标志位,用于擦除前一个输入字符,或者擦除前一个词。最后,设置ISIG标志位,用于当接受到字符INTR,QUIT,SUSP或DSUSP时,产生相应的信号。d) Set the local mode flag of the terminal device structure port. The constant c_lflag: First, set the ICANON flag to enable the standard mode, allowing the use of special characters EOF, EOL, EOL2, ERASE, KILL, LNEXT, REPRINT, STATUS and WERASE. And a cache by row. Then, set the ECHO flag to echo the input characters. Next, set the ECHOE flag to erase the previous input character or erase the previous word. Finally, the ISIG flag is set to generate a corresponding signal when the characters INTR, QUIT, SUSP or DSUSP are accepted.
e)、设置终端设备结构端口的输入模式标志常量c_iflag:首先,设置INLCR标志位,用于将输入中的NL翻译为CR(将收到的换行符号转换为Return)。然后,设置ICRNL标志位,用于将输入中的回车翻译为新行(除非设置了IGNCR,否则当输入信号有CR时不会终止输入)。接着,设置IGNCR标志位,用于忽略输入中的回车。接着,设置IXON标志位,用于启用输出的XON/XOFF流控制。最后,设置IXOFF标志位,用于启用输入的XON/XOFF流控制。e) Set the input mode flag constant of the terminal device structure port c_iflag: First, set the INLCR flag bit to translate the NL in the input into CR (convert the received line feed symbol to Return). Then, set the ICRNL flag to translate the carriage return in the input to a new line (unless IGNCR is set, the input will not be terminated when the input signal has CR). Next, set the IGNCR flag to ignore the carriage return in the input. Next, set the IXON flag to enable XON/XOFF flow control for the output. Finally, the IXOFF flag is set to enable the XON/XOFF flow control of the input.
f)、进一步设置终端设备结构端口的输入模式标志常量c_iflag:设置IGNPAR标志位,用于忽略桢错误和奇偶校验错。f), further set the terminal device structure port input mode flag constant c_iflag: set the IGNPAR flag bit, used to ignore 桢 errors and parity errors.
g)、设置终端设备结构端口的输出模式标志常量c_oflag:首先,设置OPOST标志位,用于启用具体实现自行定义的输出处理。然后,设置ONLRET 标志位,用于不输出回车。接着,设置ONOCR标志位,用于不在第0列输出回车。最后,设置OCRNL标志位,用于将输出中的回车映射为新行符。g), set the terminal device structure port output mode flag constant c_oflag: First, set the OPOST flag bit, used to enable specific implementation of the self-defined output processing. Then, set ONLRET Flag bit, used to not output a carriage return. Next, set the ONOCR flag to not output a carriage return in column 0. Finally, the OCRNL flag is set to map the carriage return in the output to a newline character.
具体地,在一个实施例中,将上述各标志位的状态设置为1,开启相应的标志位功能,标志位状态为0时,关闭标志位功能。当然,在其它实施例中,也可设置标志位状态为0时开启标志位功能,标志位为1时关闭标志位功能,具体可根据实际需要进行设置,本实施例不做具体限定。Specifically, in one embodiment, the status of each of the above flag bits is set to 1, and the corresponding flag bit function is turned on. When the flag bit status is 0, the flag bit function is turned off. Of course, in other embodiments, the flag bit function can be set when the flag bit status is 0, and the flag bit function is turned off when the flag bit is 1, which can be set according to actual needs, which is not specifically limited in this embodiment.
3)、发送抓取指令至无线通讯模块,探测USB数据流。3) Send a grab command to the wireless communication module to detect the USB data stream.
具体地,完成步骤2)中各标志位的设置后,POS机发送抓取指令至无线通讯模块,开启无线通讯模块调试信息抓取模式,探测USB数据流。在一个实施例中,POS机通过ttyACM3节点向4G无线通讯模块发一条AT命令“AT+TRACE=1”,打开无线通讯模块调试信息抓取模式,如果AT命令发送失败,则关闭抓取节点,结束抓取操作。进一步地,AT命令是无线通讯模块进行通讯的命令集合,是无线通讯模块提供的一些应用接口,POS机通过AT命令与无线进行通讯和数据业务操作。Specifically, after the setting of each flag bit in step 2) is completed, the POS machine sends a grab command to the wireless communication module, turns on the wireless communication module debug information capture mode, and detects the USB data stream. In one embodiment, the POS sends an AT command "AT+TRACE=1" to the 4G wireless communication module through the ttyACM3 node, and the wireless communication module debug information capture mode is turned on. If the AT command fails to be sent, the capture node is closed. End the crawl operation. Further, the AT command is a command set for communication by the wireless communication module, and is an application interface provided by the wireless communication module, and the POS device performs communication and data service operations with the wireless through the AT command.
4)、当探测到USB数据流时,缓存探测到的USB数据流。4) Cache the detected USB data stream when the USB data stream is detected.
具体地,POS机通过系统内部API函数的read函数来探测USB数据流并对USB数据流进行流量控制,如果有USB数据流过来,就用read函数读出来,并以一定的速度读取数据到一个临时的buffer一个临时的buffer中,缓存探测到的USB数据流。如果探测失败则关闭ttyACM1节点,结束抓取操作。Specifically, the POS machine detects the USB data stream and performs flow control on the USB data stream through the read function of the internal API function of the system. If there is a USB data stream, the read function is used to read and read the data at a certain speed. A temporary buffer in a temporary buffer that caches the detected USB data stream. If the probe fails, close the ttyACM1 node and end the crawl operation.
进一步地,在一个实施例中,在探测USB数据流的过程中,为避免因探测USB数据流失败而导致抓取无线通讯模块调试信息失败,如果未探测到USB数据流,POS机重新探测USB数据流,如果重新探测USB数据流时探测到USB数据流,则缓存探测到的USB数据流;如果重新探测还没有探测到USB数据流,POS机可继续重新探测USB数据流。并且,为了避免出现因多次探测失败而导致POS机一直重复探测USB数据流影响抓取无线通讯模块调试信息的效率,还可以预先设置预设探测次数阈值,每次探测USB数 据流时,记录当前探测USB数据流的次数,当未探测到USB数据流时,查询探测USB数据流的次数;当探测次数小于或等于预设探测次数阈值时,执行探测USB数据流的步骤,重新探测USB数据流;当探测次数大于预设探测次数阈值时,关闭抓取节点,结束无线通讯模块调试信息抓取操作。Further, in an embodiment, in the process of detecting the USB data stream, in order to avoid failure of capturing the wireless communication module debugging information due to failure of detecting the USB data stream, if the USB data stream is not detected, the POS machine re-detects the USB. The data stream, if the USB data stream is detected when the USB data stream is re-detected, the detected USB data stream is cached; if the USB data stream is not detected by re-probing, the POS machine can continue to re-detect the USB data stream. Moreover, in order to avoid the possibility that the POS machine repeatedly detects the USB data stream and affects the debugging information of the wireless communication module due to multiple detection failures, the preset detection number threshold may be preset, and the USB number is detected each time. According to the flow, the number of times of detecting the USB data stream is recorded. When the USB data stream is not detected, the number of times of detecting the USB data stream is queried; when the number of times of detection is less than or equal to the preset number of detection times, the step of detecting the USB data stream is performed. Re-detecting the USB data stream; when the number of detections is greater than the preset detection number threshold, the capture node is closed, and the debugging operation of the wireless communication module is ended.
5)、创建抓取文件,将缓存的USB数据流写入抓取文件中。5) Create a crawl file and write the cached USB data stream to the crawl file.
具体地,在POS机的本地flash(闪存)中创建二进制的抓取文件,将临时buffer中的USB数据流写到抓取文件中,在POS机的本地flash中保存抓取到的无线通讯模块调试信息,当获取到结束抓取指令,POS机关闭抓取文件,关闭抓取节点,完成抓取操作,如果将USB数据流写到抓取文件失败,则关闭抓取节点,结束无线通讯模块调试信息抓取操作。Specifically, a binary capture file is created in the local flash (flash memory) of the POS machine, the USB data stream in the temporary buffer is written into the capture file, and the captured wireless communication module is saved in the local flash of the POS machine. Debugging information, when the end of the fetching instruction is obtained, the POS machine closes the fetching file, closes the fetching node, and completes the fetching operation. If the USB data stream fails to be written to the fetching file, the crawling node is closed, and the wireless communication module is terminated. Debug information fetching operations.
进一步地,如果在将缓存的USB数据流写入抓取文件的过程中发生中断,POS机可以重新发送抓取指令至无线通信模块,重新探测USB数据流,如果重新探测时探测到USB数据流,则继续缓存探测到的USB数据流,并将缓存的USB数据流写入抓取文件中。在一个实施例中,还可以预先设置中断后重新探测USB数据流的预设时间间隔(如1分钟),如果发生USB数据流写入中断后重新探测时探测到USB数据流,则将重新探测到USB数据流的时间与上一次将USB数据流写入抓取文件中的结束时间比较,计算重新探测到USB数据流的时间与最近一次将USB数据流写入抓取文件中的结束时间的时间间隔,如果该时间间隔小于或等于预设时间间隔,则将数据流继续写入原来的二进制文件,连续记录;如果时间间隔大于预设时间间隔,则关闭已有的二进制文件,重新建立新的二进制文件,将重新探测到的数据流写入新的二进制文件,并记录开始写入的时间。Further, if an interruption occurs in the process of writing the cached USB data stream to the capture file, the POS machine can resend the capture instruction to the wireless communication module, re-probe the USB data stream, and detect the USB data stream if re-detected. , then continue to cache the detected USB data stream and write the cached USB data stream to the crawl file. In an embodiment, a preset time interval (eg, 1 minute) for re-probing the USB data stream after the interruption may be preset, and if the USB data stream is detected during re-probing after the USB data stream write interruption occurs, the USB data stream is re-detected. The time to the USB stream is compared to the end time of the last USB stream written to the fetch file, and the time to re-detect the USB stream is calculated and the last time the USB stream was written to the fetch file. Time interval. If the time interval is less than or equal to the preset time interval, the data stream is continuously written to the original binary file for continuous recording. If the time interval is greater than the preset time interval, the existing binary file is closed and the new file is re-established. The binary file, writes the re-detected data stream to the new binary file, and records the time at which the write started.
上述POS机无线通讯模块调试信息抓取能够实现无线通讯模块调试信息自动抓取,大大提高了无线通讯模块调试信息的抓取效率,抓取到的无线通讯模块调试信息存储在本地flash中,通过PC工具将抓取文件导出到PC(personal computer,个人计算机)中即可进行调试信息分析(如注网状态分析,TCP/IP数据包分析等)。并且,该方法操作简单方便,如果POS机中无 线通讯模块出现问题,普通用户就能够进行无线通讯模块调试信息抓取,用户导出抓取文件后可通过网络发送给POS机厂家的专业技术人员进行调试信息分析,能够实现技术人员远程定位分析问题,可省去前往的现场进行问题分析定位的时间成本及经济成本(如,交通成本),有利于提升技术人员的工作效率,并降低POS机维护成本。The debugging information of the wireless communication module of the POS machine can automatically capture the debugging information of the wireless communication module, greatly improving the debugging efficiency of the debugging information of the wireless communication module, and the debugging information of the captured wireless communication module is stored in the local flash. The PC tool can export the captured files to a PC (personal computer) for debugging information analysis (such as net state analysis, TCP/IP packet analysis, etc.). Moreover, the method is simple and convenient to operate, if there is no POS machine If there is a problem with the line communication module, the ordinary user can perform the debugging of the wireless communication module debugging information. After the user exports the captured file, the user can send it to the professional technician of the POS machine manufacturer for debugging information analysis, which can realize the remote positioning analysis problem of the technician. It can save the time cost and economic cost (such as transportation cost) of problem analysis and location on the way to the site, which is beneficial to improve the efficiency of technicians and reduce the maintenance cost of POS.
请参阅图3,提供了一种POS机300的结构框图,下述的每个模块可全部或部分通过软件、硬件或其组合来实现。Referring to FIG. 3, a structural block diagram of a POS machine 300 is provided. Each of the following modules may be implemented in whole or in part by software, hardware or a combination thereof.
参照图3,POS机300,包括:Referring to FIG. 3, the POS machine 300 includes:
抓取节点开启模块302:获取无线通讯模块的USB设备节点,开启USB设备节点中用于抓取无线通讯模块调试信息的抓取节点。The crawling node opening module 302: obtains a USB device node of the wireless communication module, and opens a crawling node of the USB device node for capturing debugging information of the wireless communication module.
端口信息配置模块304:用于配置取节点的端口信息。The port information configuration module 304 is configured to configure port information of the fetch node.
第一数据探测模块306:用于发送抓取指令至无线通讯模块,探测USB数据流。The first data detecting module 306 is configured to send a grab command to the wireless communication module to detect the USB data stream.
第一数据缓存模块308,用于当探测到USB数据流时,缓存探测到的USB数据流。The first data cache module 308 is configured to cache the detected USB data stream when the USB data stream is detected.
第一数据存储模块310,用于创建抓取文件,将缓存的USB数据流写入抓取文件中。The first data storage module 310 is configured to create a crawl file and write the cached USB data stream into the crawl file.
在一个实施例中,上述POS机300还包括:In an embodiment, the POS machine 300 further includes:
探测次数查询模块312,用于当未探测到USB数据流时,查询探测USB数据流的次数。The detection times query module 312 is configured to query the number of times the USB data stream is detected when the USB data stream is not detected.
探测次数比较模块314,用于当探测次数小于或等于预设探测次数阈值时,发送第一探测指令至第一数据探测模块306。The detection number comparison module 314 is configured to send the first detection instruction to the first data detection module 306 when the number of detection times is less than or equal to the preset detection number threshold.
如图4所示,在一个实施例中,上述POS机300还包括:As shown in FIG. 4, in an embodiment, the POS machine 300 further includes:
计时模块316,用于记录将缓存的USB数据流写入抓取文件中的开始时间和结束时间。The timing module 316 is configured to record a start time and an end time of writing the cached USB data stream into the capture file.
在一个实施例中,上述POS机300还包括: In an embodiment, the POS machine 300 further includes:
中断检测模块318,用于当将缓存的USB数据流写入抓取文件中发生中断时,发送第二探测指令至第二数据探测模块320。The interrupt detection module 318 is configured to send the second probe instruction to the second data detection module 320 when an interrupt occurs in writing the cached USB data stream to the capture file.
第二数据探测模块320,用于根据第二探测指令发送抓取指令至无线通讯模块,探测USB数据流。The second data detecting module 320 is configured to send a grab command to the wireless communication module according to the second detecting instruction to detect the USB data stream.
第二数据缓存模块322,用于当探测到USB数据流时,缓存探测到的USB数据流,并计算探测到USB数据流的时间与最近一次将USB数据流写入抓取文件中的结束时间的时间间隔。The second data cache module 322 is configured to cache the detected USB data stream when the USB data stream is detected, and calculate the time when the USB data stream is detected and the end time of the last time the USB data stream is written into the captured file. Interval.
第二数据存储模块324,用于当时间间隔小于或等于预设时间间隔时,将缓存的USB数据流写入最近一次创建的抓取文件中;当时间间隔大于预设时间间隔时,新建抓取文件,将缓存的USB数据流写入新建的抓取文件中,并记录USB数据流写入时间。The second data storage module 324 is configured to write the cached USB data stream into the newly created capture file when the time interval is less than or equal to the preset time interval; when the time interval is greater than the preset time interval, the new data capture module Take the file, write the cached USB data stream to the newly created capture file, and record the USB data stream write time.
在一个实施例中,抓取节点的端口信息包括:端口波特率、端口控制模式标志常量、端口本地模式标志常量、端口输入模式标志常量及端口输出模式标志常量。In one embodiment, the port information of the capture node includes: a port baud rate, a port control mode flag constant, a port local mode flag constant, a port input mode flag constant, and a port output mode flag constant.
在一个实施例中,还提供了一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:In one embodiment, there is provided one or more computer readable non-volatile storage media storing computer readable instructions, the computer readable instructions being executed by one or more processors such that the one Or multiple processors perform the following steps:
获取无线通讯模块的USB设备节点,开启USB设备节点中用于抓取无线通讯模块调试信息的抓取节点;Obtaining a USB device node of the wireless communication module, and opening a capture node of the USB device node for capturing debug information of the wireless communication module;
配置抓取节点的端口信息;Configure the port information of the crawling node.
发送抓取指令至无线通讯模块,探测USB数据流;Send a capture command to the wireless communication module to detect the USB data stream;
当探测到USB数据流时,缓存探测到的USB数据流;及Cache the detected USB data stream when a USB data stream is detected; and
创建抓取文件,将缓存的USB数据流写入抓取文件中。Create a crawl file and write the cached USB data stream to the crawl file.
在一个实施例中,上述计算机可读指令被处理器执行时还实现以下步骤:In one embodiment, the computer readable instructions described above are further executed by the processor to:
当未探测到USB数据流时,查询探测USB数据流的次数;及Query the number of times the USB data stream is detected when no USB data stream is detected; and
当探测次数小于或等于预设探测次数阈值时,执行所述探测USB数据流的步骤。 The step of detecting the USB data stream is performed when the number of detections is less than or equal to a preset number of detection thresholds.
在一个实施例中,上述计算机可读指令被处理器执行时还实现以下步骤:记录将缓存的USB数据流写入所述抓取文件中的开始时间和结束时间。In one embodiment, the computer readable instructions described above, when executed by the processor, further implement the step of recording a start time and an end time of writing the cached USB data stream into the fetch file.
在一个实施例中,上述计算机可读指令被处理器执行时还实现以下步骤:当将缓存的USB数据流写入所述抓取文件中发生中断时,发送抓取指令至所述无线通讯模块,探测USB数据流;In one embodiment, when the computer readable instructions are executed by the processor, the following steps are further implemented: when an interrupt occurs in writing the cached USB data stream to the fetch file, sending a fetch command to the wireless communication module , detecting USB data stream;
当探测到所述USB数据流时,缓存探测到的USB数据流,并计算探测到所述USB数据流的时间与最近一次将所述USB数据流写入所述抓取文件中的结束时间的时间间隔;Cacheing the detected USB data stream when the USB data stream is detected, and calculating a time when the USB data stream is detected and an end time of writing the USB data stream to the crawl file last time time interval;
当所述时间间隔小于或等于预设时间间隔时,将缓存的USB数据流写入最近一次创建的抓取文件中;及Writing the cached USB data stream to the last created crawl file when the time interval is less than or equal to the preset time interval; and
当所述时间间隔大于预设时间间隔时,新建抓取文件,将缓存的USB数据流写入新建的抓取文件中,并记录USB数据流写入时间。When the time interval is greater than the preset time interval, a new capture file is created, the cached USB data stream is written into the newly created capture file, and the USB data stream write time is recorded.
在一个实施例中,上述计算机可读指令被处理器执行时还实现以下步骤:所述抓取节点的端口信息包括:端口波特率、端口控制模式标志常量、端口本地模式标志常量、端口输入模式标志常量及端口输出模式标志常量。In one embodiment, when the computer readable instructions are executed by the processor, the following steps are further implemented: the port information of the crawling node includes: a port baud rate, a port control mode flag constant, a port local mode flag constant, and a port input. Mode flag constants and port output mode flag constants.
在一个实施例中,还提供一种POS机,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现以下步骤:In one embodiment, a POS machine is also provided, comprising: a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, the processor performing the following steps when executing the computer readable instructions:
获取无线通讯模块的USB设备节点,开启USB设备节点中用于抓取无线通讯模块调试信息的抓取节点;Obtaining a USB device node of the wireless communication module, and opening a capture node of the USB device node for capturing debug information of the wireless communication module;
配置抓取节点的端口信息;Configure the port information of the crawling node.
发送抓取指令至无线通讯模块,探测USB数据流;Send a capture command to the wireless communication module to detect the USB data stream;
当探测到USB数据流时,缓存探测到的USB数据流;及Cache the detected USB data stream when a USB data stream is detected; and
创建抓取文件,将缓存的USB数据流写入抓取文件中。Create a crawl file and write the cached USB data stream to the crawl file.
具体地,如图5所示,在一个实施例中,上述的POS机包括通过系统总线连接的处理器和存储器,存储器包括非易失性存储介质和内存储器。其中,POS机的非易失性存储介质存储有操作系统,还包括一种计算机可读指令。 计算机可读指令可被处理器所执行,以用于实现一种POS机无线通讯模块调试信息抓取方法。在一个实施例中,处理器为POS机的CPU用于提供计算和控制能力,支撑整个POS机的运行。POS机中的内存储器为非易失性存储介质中的操作系统、计算机可读指令提供高速缓存的运行环境。本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的POS机的限定,具体的POS机可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Specifically, as shown in FIG. 5, in one embodiment, the POS machine described above includes a processor and a memory connected by a system bus, the memory including a non-volatile storage medium and an internal memory. The non-volatile storage medium of the POS machine stores an operating system, and further includes a computer readable instruction. The computer readable instructions are executable by the processor for implementing a POS wireless communication module debugging information capture method. In one embodiment, the processor is a CPU of the POS machine for providing computing and control capabilities to support the operation of the entire POS machine. The internal memory in the POS machine provides a cached operating environment for operating systems and computer readable instructions in a non-volatile storage medium. Those skilled in the art can understand that the structure shown in FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the POS machine to which the solution of the present application is applied. The specific POS machine can It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
在一个实施例中,处理器执行计算机可读指令时还执行以下步骤:In one embodiment, the processor also performs the following steps when executing the computer readable instructions:
当未探测到USB数据流时,查询探测USB数据流的次数;及Query the number of times the USB data stream is detected when no USB data stream is detected; and
当探测次数小于或等于预设探测次数阈值时,执行探测USB数据流的步骤。When the number of detections is less than or equal to the preset number of detection thresholds, the step of detecting the USB data stream is performed.
在一个实施例中,处理器执行计算机可读指令时还执行以下步骤:记录将缓存的USB数据流写入抓取文件中的开始时间和结束时间。In one embodiment, the processor, when executing the computer readable instructions, also performs the step of recording a start time and an end time of writing the cached USB data stream into the fetch file.
在一个实施例中,处理器执行计算机可读指令时还执行以下步骤:In one embodiment, the processor also performs the following steps when executing the computer readable instructions:
当将缓存的USB数据流写入抓取文件中发生中断时,发送抓取指令至无线通讯模块,探测USB数据流;When an interrupt occurs in writing the cached USB data stream to the capture file, the capture instruction is sent to the wireless communication module to detect the USB data stream;
当探测到USB数据流时,缓存探测到的USB数据流,并计算探测到USB数据流的时间与最近一次将USB数据流写入抓取文件中的结束时间的时间间隔;When the USB data stream is detected, the detected USB data stream is buffered, and the time interval between the time when the USB data stream is detected and the last time the USB data stream is written into the grab file is calculated;
当时间间隔小于或等于预设时间间隔时,将缓存的USB数据流写入最近一次创建的抓取文件中;及When the time interval is less than or equal to the preset time interval, the cached USB data stream is written into the last created crawl file; and
当时间间隔大于预设时间间隔时,新建抓取文件,将缓存的USB数据流写入新建的抓取文件中,并记录USB数据流写入时间。When the time interval is greater than the preset time interval, a new capture file is created, the cached USB data stream is written into the newly created capture file, and the USB data stream write time is recorded.
在一个实施例中,抓取节点的端口信息包括:端口波特率、端口控制模式标志常量、端口本地模式标志常量、端口输入模式标志常量及端口输出模式标志常量。 In one embodiment, the port information of the capture node includes: a port baud rate, a port control mode flag constant, a port local mode flag constant, a port input mode flag constant, and a port output mode flag constant.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,该存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等。A person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware, and the program can be stored in a non-volatile computer readable storage medium. The program, when executed, may include the flow of an embodiment of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or the like.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. For the sake of brevity of description, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, It is considered to be the range described in this specification.
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。 The above embodiments are merely illustrative of several embodiments of the present application, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the invention. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the present application. Therefore, the scope of the invention should be determined by the appended claims.

Claims (15)

  1. 一种POS机无线通讯模块调试信息抓取方法,其特征在于,包括以下步骤:A POS machine wireless communication module debugging information capture method, characterized in that the method comprises the following steps:
    获取无线通讯模块的USB设备节点,开启所述USB设备节点中用于抓取无线通讯模块调试信息的抓取节点;Obtaining a USB device node of the wireless communication module, and opening a capture node of the USB device node for capturing debug information of the wireless communication module;
    配置所述抓取节点的端口信息;Configuring port information of the crawling node;
    发送抓取指令至无线通讯模块,探测USB数据流;Send a capture command to the wireless communication module to detect the USB data stream;
    当探测到USB数据流时,缓存探测到的USB数据流;及Cache the detected USB data stream when a USB data stream is detected; and
    创建抓取文件,将缓存的USB数据流写入所述抓取文件中。Create a crawl file to write the cached USB data stream to the crawl file.
  2. 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    当未探测到USB数据流时,查询探测USB数据流的次数;及Query the number of times the USB data stream is detected when no USB data stream is detected; and
    当探测次数小于或等于预设探测次数阈值时,执行所述探测USB数据流的步骤。The step of detecting the USB data stream is performed when the number of detections is less than or equal to a preset number of detection thresholds.
  3. 根据权利要求1或2所述的方法,其特征在于,还包括:记录将缓存的USB数据流写入所述抓取文件中的开始时间和结束时间。The method of claim 1 or 2, further comprising: recording a start time and an end time of writing the cached USB data stream into the fetch file.
  4. 根据权利要求3所述的方法,其特征在于,还包括:The method of claim 3, further comprising:
    当将缓存的USB数据流写入所述抓取文件中发生中断时,发送抓取指令至所述无线通讯模块,探测USB数据流;Sending a fetch command to the wireless communication module to detect a USB data stream when an interrupt occurs in writing the cached USB data stream to the fetch file;
    当探测到所述USB数据流时,缓存探测到的USB数据流,并计算探测到所述USB数据流的时间与最近一次将所述USB数据流写入所述抓取文件中的结束时间的时间间隔;Cacheing the detected USB data stream when the USB data stream is detected, and calculating a time when the USB data stream is detected and an end time of writing the USB data stream to the crawl file last time time interval;
    当所述时间间隔小于或等于预设时间间隔时,将缓存的USB数据流写入最近一次创建的抓取文件中;及Writing the cached USB data stream to the last created crawl file when the time interval is less than or equal to the preset time interval; and
    当所述时间间隔大于预设时间间隔时,新建抓取文件,将缓存的USB数据流写入新建的抓取文件中,并记录USB数据流写入时间。When the time interval is greater than the preset time interval, a new capture file is created, the cached USB data stream is written into the newly created capture file, and the USB data stream write time is recorded.
  5. 根据权利要求1所述的方法,其特征在于,所述抓取节点的端口信息包括:端口波特率、端口控制模式标志常量、端口本地模式标志常量、端口 输入模式标志常量及端口输出模式标志常量。The method according to claim 1, wherein the port information of the crawling node comprises: a port baud rate, a port control mode flag constant, a port local mode flag constant, and a port. Input mode flag constants and port output mode flag constants.
  6. 一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more computer readable non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the steps of:
    获取无线通讯模块的USB设备节点,开启USB设备节点中用于抓取无线通讯模块调试信息的抓取节点;Obtaining a USB device node of the wireless communication module, and opening a capture node of the USB device node for capturing debug information of the wireless communication module;
    配置抓取节点的端口信息;Configure the port information of the crawling node.
    发送抓取指令至无线通讯模块,探测USB数据流;Send a capture command to the wireless communication module to detect the USB data stream;
    当探测到USB数据流时,缓存探测到的USB数据流;及Cache the detected USB data stream when a USB data stream is detected; and
    创建抓取文件,将缓存的USB数据流写入抓取文件中。Create a crawl file and write the cached USB data stream to the crawl file.
  7. 根据权利要求6所述的存储介质,其特征在于,上述计算机可读指令被处理器执行时还实现以下步骤:The storage medium of claim 6 wherein said computer readable instructions are further executed by said processor to:
    当未探测到USB数据流时,查询探测USB数据流的次数;及Query the number of times the USB data stream is detected when no USB data stream is detected; and
    当探测次数小于或等于预设探测次数阈值时,执行所述探测USB数据流的步骤。The step of detecting the USB data stream is performed when the number of detections is less than or equal to a preset number of detection thresholds.
  8. 根据权利要求6或7所述的存储介质,其特征在于,上述计算机可读指令被处理器执行时还实现以下步骤:记录将缓存的USB数据流写入所述抓取文件中的开始时间和结束时间。A storage medium according to claim 6 or claim 7, wherein said computer readable instructions are further executed by said processor to: record a start time of writing the cached USB data stream into said fetched file and End Time.
  9. 根据权利要求8所述的存储介质,其特征在于,上述计算机可读指令被处理器执行时还实现以下步骤:The storage medium of claim 8 wherein said computer readable instructions are further executed by said processor to:
    当将缓存的USB数据流写入所述抓取文件中发生中断时,发送抓取指令至所述无线通讯模块,探测USB数据流;Sending a fetch command to the wireless communication module to detect a USB data stream when an interrupt occurs in writing the cached USB data stream to the fetch file;
    当探测到所述USB数据流时,缓存探测到的USB数据流,并计算探测到所述USB数据流的时间与最近一次将所述USB数据流写入所述抓取文件中的结束时间的时间间隔;Cacheing the detected USB data stream when the USB data stream is detected, and calculating a time when the USB data stream is detected and an end time of writing the USB data stream to the crawl file last time time interval;
    当所述时间间隔小于或等于预设时间间隔时,将缓存的USB数据流写入 最近一次创建的抓取文件中;及Writing the cached USB data stream when the time interval is less than or equal to the preset time interval The last time the crawl file was created; and
    当所述时间间隔大于预设时间间隔时,新建抓取文件,将缓存的USB数据流写入新建的抓取文件中,并记录USB数据流写入时间。When the time interval is greater than the preset time interval, a new capture file is created, the cached USB data stream is written into the newly created capture file, and the USB data stream write time is recorded.
  10. 根据权利要求6所述的存储介质,其特征在于,所述抓取节点的端口信息包括:端口波特率、端口控制模式标志常量、端口本地模式标志常量、端口输入模式标志常量及端口输出模式标志常量。The storage medium according to claim 6, wherein the port information of the crawling node comprises: a port baud rate, a port control mode flag constant, a port local mode flag constant, a port input mode flag constant, and a port output mode. Flag constant.
  11. 一种POS机,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现以下步骤:A POS machine comprising: a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, wherein the processor, when executing the computer readable instructions, implements the following steps:
    获取无线通讯模块的USB设备节点,开启所述USB设备节点中用于抓取无线通讯模块调试信息的抓取节点;Obtaining a USB device node of the wireless communication module, and opening a capture node of the USB device node for capturing debug information of the wireless communication module;
    配置所述抓取节点的端口信息;Configuring port information of the crawling node;
    发送抓取指令至无线通讯模块,探测USB数据流;Send a capture command to the wireless communication module to detect the USB data stream;
    当探测到USB数据流时,缓存探测到的USB数据流;及Cache the detected USB data stream when a USB data stream is detected; and
    创建抓取文件,将缓存的USB数据流写入所述抓取文件中。Create a crawl file to write the cached USB data stream to the crawl file.
  12. 根据权利要求11所述的POS机,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:当未探测到USB数据流时,查询探测USB数据流的次数;及The POS machine according to claim 11, wherein the processor further executes the step of: querying the number of times of detecting the USB data stream when the USB data stream is not detected; and
    当探测次数小于或等于预设探测次数阈值时,执行所述探测USB数据流的步骤。The step of detecting the USB data stream is performed when the number of detections is less than or equal to a preset number of detection thresholds.
  13. 根据权利要求11或12所述的POS机,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:记录将缓存的USB数据流写入所述抓取文件中的开始时间和结束时间。A POS machine according to claim 11 or 12, wherein said processor, when said computer readable instructions are executed, further performs the step of recording the beginning of writing the cached USB data stream into said fetched file Time and end time.
  14. 根据权利要求13所述的POS机,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The POS machine of claim 13 wherein said processor further performs the following steps when said computer readable instructions are executed:
    当将缓存的USB数据流写入所述抓取文件中发生中断时,发送抓取指令至所述无线通讯模块,探测USB数据流; Sending a fetch command to the wireless communication module to detect a USB data stream when an interrupt occurs in writing the cached USB data stream to the fetch file;
    当探测到所述USB数据流时,缓存探测到的USB数据流,并计算探测到所述USB数据流的时间与最近一次将所述USB数据流写入所述抓取文件中的结束时间的时间间隔;Cacheing the detected USB data stream when the USB data stream is detected, and calculating a time when the USB data stream is detected and an end time of writing the USB data stream to the crawl file last time time interval;
    当所述时间间隔小于或等于预设时间间隔时,将缓存的USB数据流写入最近一次创建的抓取文件中;及Writing the cached USB data stream to the last created crawl file when the time interval is less than or equal to the preset time interval; and
    当所述时间间隔大于预设时间间隔时,新建抓取文件,将缓存的USB数据流写入新建的抓取文件中,并记录USB数据流写入时间。When the time interval is greater than the preset time interval, a new capture file is created, the cached USB data stream is written into the newly created capture file, and the USB data stream write time is recorded.
  15. 根据权利要求11所述的POS机,其特征在于,所述抓取节点的端口信息包括:端口波特率、端口控制模式标志常量、端口本地模式标志常量、端口输入模式标志常量及端口输出模式标志常量。 The POS machine according to claim 11, wherein the port information of the grabbing node comprises: a port baud rate, a port control mode flag constant, a port local mode flag constant, a port input mode flag constant, and a port output mode. Flag constant.
PCT/CN2017/102389 2017-05-15 2017-09-20 Pos machine, method for fetching debugging information of wireless communication module of pos machine, and storage medium WO2018209852A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710340133.7 2017-05-15
CN201710340133.7A CN107247645B (en) 2017-05-15 2017-05-15 POS machine, POS machine wireless communication module Debugging message grasping means and device

Publications (1)

Publication Number Publication Date
WO2018209852A1 true WO2018209852A1 (en) 2018-11-22

Family

ID=60016597

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/102389 WO2018209852A1 (en) 2017-05-15 2017-09-20 Pos machine, method for fetching debugging information of wireless communication module of pos machine, and storage medium

Country Status (2)

Country Link
CN (1) CN107247645B (en)
WO (1) WO2018209852A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109388562A (en) * 2018-09-21 2019-02-26 北京辰森世纪科技股份有限公司 Debug method and device, the system, storage medium, electronic device of pos machine

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104902494A (en) * 2015-06-15 2015-09-09 武汉邮电科学研究院 Automated testing system for a plurality of LTE terminals and testing method thereof
CN205005254U (en) * 2011-07-25 2016-01-27 艾利佛公司 Wireless USB audio frequency transceiver
CN106253010A (en) * 2015-06-10 2016-12-21 三星电子株式会社 For the method and apparatus providing interface

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN205005254U (en) * 2011-07-25 2016-01-27 艾利佛公司 Wireless USB audio frequency transceiver
CN106253010A (en) * 2015-06-10 2016-12-21 三星电子株式会社 For the method and apparatus providing interface
CN104902494A (en) * 2015-06-15 2015-09-09 武汉邮电科学研究院 Automated testing system for a plurality of LTE terminals and testing method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHOU, PING.: "The Design and Development of Wireless Intelligent Bus Platform Based on Linux", CHINA MASTER'S THESES FULL-TEXT DATABASE, 15 August 2012 (2012-08-15), ISSN: 1674-0246 *

Also Published As

Publication number Publication date
CN107247645B (en) 2019-10-29
CN107247645A (en) 2017-10-13

Similar Documents

Publication Publication Date Title
KR101529811B1 (en) Systems and methods for managing endian mode of a device
CN108009065B (en) Method and apparatus for monitoring AXI bus
US8694834B2 (en) Preventing log wrap with debug scripts
CN108600053B (en) Wireless network data packet capturing method based on zero copy technology
CN114116527A (en) NVMe SSD storage method and system based on programmable fusion chip
TW201415216A (en) System and method for retrieving test logs
US10210069B2 (en) Real-time hierarchical protocol decoding
CN104102160B (en) Controller area network (CAN) bus signal transceiving analysis tool
US9063751B2 (en) Single wire bootloader for target device with self-programming capability
WO2018209852A1 (en) Pos machine, method for fetching debugging information of wireless communication module of pos machine, and storage medium
US9377966B2 (en) Method and apparatus for efficiently processing storage commands
CN106919479B (en) Real-time log recording method of embedded device controller
CN109684152A (en) A kind of RISC-V processor instruction method for down loading and its device
US8943255B2 (en) Methods and structure for accounting for connection resets between peripheral component interconnect express bridges and host devices
CN109408426A (en) A kind of agile and all-purpose serial communication method and system
CN102253875A (en) Field programmable gate array (FPGA) logic module debugging and data acquisition method based on PicoBlaze embedded soft core processor
WO2019200878A1 (en) Log recording method for cpld
CN112948268A (en) ECU software testing and calibration system based on INCA
CN112711380A (en) Log management method and device of storage equipment and related components
CN104331352A (en) Out-of-band reading detection method and out-of-band reading detection device for cache consistency chip address
CN204256731U (en) A kind of FPGA reads USB device data set at a high speed
CN112732176B (en) SSD (solid State disk) access method and device based on FPGA (field programmable Gate array), storage system and storage medium
US20240064506A1 (en) Customized code bundle to enable secure communication from internet of things devices at wireless networks
US20220365757A1 (en) Device and Method for Handling Programming Language Function
CN108664441B (en) USB read-only control system and method

Legal Events

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

Ref document number: 17910217

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 28/04/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17910217

Country of ref document: EP

Kind code of ref document: A1