CN115774629A - Method and terminal for transmitting fault diagnosis data by serial port - Google Patents

Method and terminal for transmitting fault diagnosis data by serial port Download PDF

Info

Publication number
CN115774629A
CN115774629A CN202211547716.4A CN202211547716A CN115774629A CN 115774629 A CN115774629 A CN 115774629A CN 202211547716 A CN202211547716 A CN 202211547716A CN 115774629 A CN115774629 A CN 115774629A
Authority
CN
China
Prior art keywords
serial port
data
fault diagnosis
terminal
diagnosis data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211547716.4A
Other languages
Chinese (zh)
Inventor
陈晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuzhou Chuangshi Xunlian Information Technology Co ltd
Original Assignee
Fuzhou Chuangshi Xunlian Information Technology Co ltd
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 Fuzhou Chuangshi Xunlian Information Technology Co ltd filed Critical Fuzhou Chuangshi Xunlian Information Technology Co ltd
Priority to CN202211547716.4A priority Critical patent/CN115774629A/en
Publication of CN115774629A publication Critical patent/CN115774629A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention discloses a method and a terminal for transmitting fault diagnosis data by a serial port, when the fault diagnosis data needs to be checked, the fault diagnosis data is firstly analyzed and converted into ASCII (American standard code for information interchange) code which can be displayed at the serial port terminal, and the converted data is stored in a data buffer; and then the converted data in the data buffer is sent to the pre-selection serial port module, and the pre-selection serial port module is controlled to send the converted data to the serial port terminal. The fault diagnosis method and the fault diagnosis system convert fault diagnosis data into ASCII codes which can be displayed on the serial port terminal, then buffer the ASCII codes in the data buffer and match with the pre-selection serial port module to realize that the data is completely transmitted to the serial port terminal, so that a user does not need to open a cover to insert a card when carrying out fault diagnosis, and can directly observe the change of the fault codes in the starting process on the serial port terminal.

Description

Method and terminal for transmitting fault diagnosis data through serial port
Technical Field
The invention relates to the technical field of fault diagnosis, in particular to a method and a terminal for transmitting fault diagnosis data by a serial port.
Background
The X86 architecture processor device uses a BIOS (basic input output system) as a boot firmware, which initializes a large number of devices such as CPU IO, memory, PCIE devices, and USB devices during the boot process. Once an error occurs in the starting process, the BIOS is started and stopped, and from the perspective of a user, after the BIOS is started and stopped, no error information can be checked, which brings great trouble to fault diagnosis.
In order to solve the above-mentioned troubles, the conventional method is to insert a PORT80 failure diagnosis card into the failure machine, and preliminarily determine what the failure may be related to according to the position where the PORT80 diagnosis card is stopped. However, this method has great limitations, one of which is to open the cover and insert the PORT80 diagnostic card, and the other is to know the last fault code only from the PORT80 diagnostic card, and cannot directly observe the starting process.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the method and the terminal for transmitting the fault diagnosis data through the serial port are provided, and the change of a fault code in the starting process can be directly observed without opening a cover and inserting a card.
In order to solve the technical problems, the invention adopts the technical scheme that:
a method for transmitting fault diagnosis data by a serial port comprises the following steps:
s1, analyzing fault diagnosis data, converting the fault diagnosis data into ASCII codes which can be displayed at a serial port terminal, and storing the converted data in a data buffer;
s2, the converted data in the data buffer are sent to a preselection serial port module, and the preselection serial port module is controlled to send the converted data to the serial port terminal.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a terminal for transmitting fault diagnosis data by a serial port comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the following steps:
s1, analyzing fault diagnosis data, converting the fault diagnosis data into ASCII codes which can be displayed at a serial port terminal, and storing the converted data in a data buffer;
s2, the converted data in the data buffer are sent to a pre-selection serial port module, and the pre-selection serial port module is controlled to send the converted data to the serial port terminal.
The invention has the beneficial effects that: the method and the terminal for transmitting the fault diagnosis data by the serial port are characterized in that the fault diagnosis data are converted into ASCII codes which can be displayed on the serial port terminal, and then the ASCII codes are cached in a data cache and then matched with a preselected serial port module to realize that the data are completely transmitted to the serial port terminal, so that a user does not need to open a cover to insert a card when carrying out fault diagnosis, and the change of the fault codes in the starting process can be directly observed on the serial port terminal.
Drawings
Fig. 1 is a schematic step diagram of a method for transmitting fault diagnosis data by a serial port according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for transmitting fault diagnosis data by a serial port according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal for transmitting fault diagnosis data by a serial port according to an embodiment of the present invention.
Description of the reference symbols:
1. a terminal for transmitting fault diagnosis data by a serial port; 2. a processor; 3. a memory.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
Referring to fig. 1 and 2, a method for transmitting fault diagnosis data by a serial port includes the steps of:
s1, analyzing fault diagnosis data, converting the fault diagnosis data into ASCII codes which can be displayed at a serial port terminal, and storing the converted data in a data buffer;
s2, the converted data in the data buffer are sent to a pre-selection serial port module, and the pre-selection serial port module is controlled to send the converted data to the serial port terminal.
From the above description, the beneficial effects of the present invention are: the method comprises the steps of firstly converting fault diagnosis data into ASCII (American standard code for information interchange) codes which can be displayed at a serial port terminal, then caching the ASCII codes in a data cache and then matching with a preselected serial port module to completely send the data to the serial port terminal, so that a user does not need to open a cover to insert a card when carrying out fault diagnosis, and can directly observe the change of the fault codes in the starting process on the serial port terminal.
Further, the analyzing the fault diagnosis data and converting the fault diagnosis data into ASCII codes capable of being displayed at the serial port terminal specifically includes:
analyzing the fault diagnosis data and obtaining 8-bit 16-system analysis data;
judging the section to which the upper four bits of the analysis data belong, if the section to which the upper four bits of the analysis data belong is 0-9, executing conversion processing of adding 0x30, and if the section to which the upper four bits of the analysis data belong is A-F, executing conversion processing of adding 0x 37;
judging the section of the lower four bits of the analysis data, if the section is 0-9, executing conversion processing of adding 0x30, and if the section is A-F, executing conversion processing of adding 0x 37;
and inserting a space character into the analysis data after the conversion processing is finished to obtain the converted data.
From the above description, it can be known that through the conversion processing of converting one byte into 3 bytes, the 4-bit 16-digit numbers of 0-9 and A-F are just converted into the ASCII codes of 0-9 and A-F, so as to conveniently display the fault diagnosis data at the serial port terminal, and replace the display mode of the existing seven-segment digital tube using the fault diagnosis card, so that the user can more comprehensively and intuitively know the change of the fault code.
Further, step S2 is preceded by:
setting a serial port switching signal;
if the serial port switching signal is in a first state, controlling the pre-selection serial port module to be connected with a serial port interface of the serial port terminal, and executing the step S2;
and if the serial port switching signal is in a second state, controlling other serial port modules to be connected with the serial port interface of the serial port terminal.
As can be seen from the above description, the serial port module connected to the serial port interface is flexibly switched by setting the serial port switching signal, so that the normal serial port function can be maintained when the user does not need to check the failure diagnosis data; when a user needs to check the fault diagnosis data, the fault diagnosis data are acquired in real time through the pre-selection serial port module.
Further, after the step S2, the method further includes:
and S3, analyzing and judging whether a preset hot key exists in the serial port data stream received by the serial port interface of the serial port terminal, if so, switching the serial port switching signal from the first state to the second state or from the second state to the first state.
According to the above description, the state of the serial port switching signal is adjusted by setting the preset hot key, so that the serial port data stream can be analyzed and judged in the process of receiving the serial port data stream, the normal serial port function is not influenced, and the fault diagnosis data can be conveniently and quickly switched and checked.
Further, the preset hot key comprises preset effective characters and character gaps located before and after the preset effective characters.
According to the description, the preset hot key is set as the preset effective character and the character gaps positioned in front of and behind the preset effective character, and the method has the remarkable characteristic, so that the mistaken identification of the preset hot key and the corresponding misoperation can be effectively avoided when the serial port data stream is received, the normal use of a user is not influenced, and the reliability of identification is guaranteed.
Referring to fig. 3, a terminal 1 for transmitting fault diagnosis data via a serial port includes a memory 3, a processor 2, and a computer program stored in the memory 3 and operable on the processor 2, where the processor 2 implements the following steps when executing the computer program:
s1, analyzing fault diagnosis data and converting the fault diagnosis data into ASCII codes which can be displayed at a serial port terminal, and storing the converted data in a data buffer;
s2, the converted data in the data buffer are sent to a pre-selection serial port module, and the pre-selection serial port module is controlled to send the converted data to the serial port terminal.
As can be seen from the above description, the beneficial effects of the present invention are: the fault diagnosis method comprises the steps of firstly converting fault diagnosis data into ASCII (American standard code for information interchange) codes which can be displayed at a serial port terminal, then caching the ASCII codes in a data cache, and then matching with a pre-selection serial port module to completely send the data to the serial port terminal, so that a user does not need to open a cover to insert a card when carrying out fault diagnosis, and can directly observe the change of fault codes in the starting process on the serial port terminal.
Further, the analyzing the fault diagnosis data and converting the fault diagnosis data into ASCII codes which can be displayed on the serial port terminal specifically includes:
analyzing the fault diagnosis data and obtaining 8-bit 16-system analytical data;
judging the section to which the upper four bits of the analysis data belong, if the section to which the upper four bits of the analysis data belong is 0-9, executing conversion processing of adding 0x30, and if the section to which the upper four bits of the analysis data belong is A-F, executing conversion processing of adding 0x 37;
judging the section of the lower four bits of the analysis data, if the section is 0-9, executing conversion processing of adding 0x30, and if the section is A-F, executing conversion processing of adding 0x 37;
and inserting a space character into the analysis data after the conversion processing is finished to obtain the converted data.
From the above description, it can be known that through the conversion processing of converting one byte into 3 bytes, the 4-bit 16-digit numbers of 0-9 and A-F are just converted into the ASCII codes of 0-9 and A-F, so as to conveniently display the fault diagnosis data at the serial port terminal, and replace the display mode of the existing seven-segment digital tube using the fault diagnosis card, so that the user can more comprehensively and intuitively know the change of the fault code.
Further, step S2 is preceded by:
setting a serial port switching signal;
if the serial port switching signal is in a first state, controlling the pre-selection serial port module to be connected with a serial port interface of the serial port terminal, and executing the step S2;
and if the serial port switching signal is in a second state, controlling other serial port modules to be connected with the serial port interface of the serial port terminal.
As can be seen from the above description, the serial port module connected to the serial port interface is flexibly switched by setting the serial port switching signal, so that the normal serial port function can be maintained when the user does not need to check the failure diagnosis data; when a user needs to check the fault diagnosis data, the fault diagnosis data are acquired in real time through the pre-selection serial port module.
Further, after the step S2, the method further includes:
and S3, analyzing and judging whether a preset hot key exists in the serial port data stream received by the serial port interface of the serial port terminal, if so, switching the serial port switching signal from the first state to the second state or from the second state to the first state.
According to the above description, the state of the serial port switching signal is adjusted by setting the preset hot key, so that the serial port data stream can be analyzed and judged in the process of receiving the serial port data stream, the normal serial port function is not influenced, and the fault diagnosis data can be conveniently and quickly switched and checked.
Further, the preset hot key comprises preset effective characters and character gaps located before and after the preset effective characters.
According to the description, the preset hot key is set as the preset effective character and the character gaps positioned in front of and behind the preset effective character, and the method has the remarkable characteristic, so that the mistaken identification of the preset hot key and the corresponding misoperation can be effectively avoided when the serial port data stream is received, the normal use of a user is not influenced, and the reliability of identification is guaranteed.
The method and the terminal for transmitting the fault diagnosis data by the serial port can be suitable for a scene of checking the fault diagnosis data, and are explained by specific implementation modes as follows:
referring to fig. 1 and fig. 2, a first embodiment of the present invention is:
a method for a serial port to transmit fault diagnosis data, as shown in fig. 1 and fig. 2, includes the steps of:
s1, analyzing fault diagnosis data, converting the fault diagnosis data into ASCII codes which can be displayed at a serial port terminal, and storing the converted data in a data buffer;
in this embodiment, the analyzing the fault diagnosis data and converting the fault diagnosis data into ASCII codes that can be displayed on the serial port terminal specifically includes:
analyzing the fault diagnosis data and obtaining 8-bit 16-system analysis data;
judging the section of the upper four bits of the analysis data, if the section is 0-9, executing the conversion processing of adding 0x30, if the section is A-F, executing the conversion processing of adding 0x 37;
judging the section of the lower four bits of the analysis data, if the section is 0-9, executing the conversion processing of adding 0x30, if the section is A-F, executing the conversion processing of adding 0x 37;
and inserting a space character into the analysis data after the conversion processing is finished to obtain the converted data.
In this embodiment, the conversion process is exemplified as follows:
if the fault diagnosis data is 0x78, the high 4 bits are 0x07, plus 0x30, the result is 0x37, corresponding to ASCII character "7"; the lower four bits are 0x0B, plus 0x37, resulting in 0x42 for the ASCII character "B". Then, after the upper four bits and the lower four bits are respectively processed, inserting a space character which corresponds to 0x20; thus, the original one-byte data 0x7B is converted into three bytes, 0x37, 0x42, 0x20. Namely, after processing, the 4-bit 16-system number of 0-9 and A-F is just converted into the ASCII code of 0-9 and A-F, which is convenient for displaying at a serial port terminal.
In this embodiment, after the conversion, the converted data is increased compared with the original fault diagnosis data, and the data flow of the original bus for transmitting the fault diagnosis data is much larger than that of the normally used serial port bus; therefore, data loss is easy to occur when the converted data is directly transmitted on the serial port bus; therefore, the present embodiment designs a buffering mechanism: and storing the 3-byte ASCII code by using a 1K-byte data buffer, and extracting the converted data to the preselected serial port module one by one according to a first-in first-out principle when the preselected serial port module is not in the sending process.
And S2, the converted data in the data buffer is sent to a pre-selection serial port module, and the pre-selection serial port module is controlled to send the converted data to a serial port terminal.
In this embodiment, step S2 further includes, before: setting a serial port switching signal; if the serial port switching signal is in the first state, controlling the pre-selection serial port module to be connected with a serial port interface of the serial port terminal, and executing the step S3; and if the serial port switching signal is in the second state, controlling other serial port modules to be connected with the serial port interface of the serial port terminal. When the serial port interface is connected to other serial port modules, such as a CPU (central processing unit) serial port, a normal serial port function is executed, so that fault diagnosis data are not sensed and influenced by a user; after the preselected serial port module is connected, the user can check all fault diagnosis data in the starting process.
And S3, analyzing and judging whether a preset hot key exists in the serial port data stream received by the serial port interface of the serial port terminal, if so, switching the serial port switching signal from the first state to the second state or from the second state to the first state.
The preset hot key comprises preset effective characters and character gaps positioned in front of and behind the preset effective characters. Preferably, two character gaps are arranged before and after the preset effective character; this is when considering a large amount of serial ports to interact, the transmission gap between the characters is very little, generally is less than 1 character, so the design can effectively avoid the malfunction, does not influence the normal use of user.
Referring to fig. 3, the second embodiment of the present invention is:
a terminal 1 for transmitting fault diagnosis data by a serial port comprises a memory 3, a processor 2 and a computer program which is stored on the memory 3 and can run on the processor 2, wherein the step of the first embodiment is realized when the processor 2 executes the computer program.
In summary, according to the method and the terminal for transmitting fault diagnosis data by a serial port, provided by the invention, the fault diagnosis data is converted into ASCII codes which can be displayed on the serial port terminal, and then the ASCII codes are cached in the data cache and then are matched with the preselected serial port module to realize that the data is completely transmitted to the serial port terminal, so that a user does not need to open a cover to insert a card during fault diagnosis, and the change of the fault codes in the starting process can be directly observed on the serial port terminal.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for transmitting fault diagnosis data by a serial port is characterized by comprising the following steps:
s1, analyzing fault diagnosis data, converting the fault diagnosis data into ASCII codes which can be displayed at a serial port terminal, and storing the converted data in a data buffer;
s2, the converted data in the data buffer are sent to a pre-selection serial port module, and the pre-selection serial port module is controlled to send the converted data to the serial port terminal.
2. The method for transmitting fault diagnosis data through a serial port according to claim 1, wherein the analyzing the fault diagnosis data and converting the fault diagnosis data into ASCII codes capable of being displayed on the serial port terminal specifically comprises:
analyzing the fault diagnosis data and obtaining 8-bit 16-system analysis data;
judging the section to which the upper four bits of the analysis data belong, if the section to which the upper four bits of the analysis data belong is 0-9, performing conversion processing of adding 0x30, and if the section to which the upper four bits of the analysis data belong is A-F, performing conversion processing of adding 0x 37;
judging the section of the lower four bits of the analysis data, if the section is 0-9, executing conversion processing of adding 0x30, and if the section is A-F, executing conversion processing of adding 0x 37;
and inserting a space character into the analysis data after the conversion processing is finished to obtain the converted data.
3. The method for serial port transmission of fault diagnosis data according to claim 1, wherein step S2 is preceded by:
setting a serial port switching signal;
if the serial port switching signal is in a first state, controlling the pre-selection serial port module to be connected with a serial port interface of the serial port terminal, and executing the step S2;
and if the serial port switching signal is in a second state, controlling other serial port modules to be connected with the serial port interface of the serial port terminal.
4. The method for serial port transmission of fault diagnosis data according to claim 3, wherein after step S2, further comprising:
and S3, analyzing and judging whether a preset hot key exists in the serial port data stream received by the serial port interface of the serial port terminal, if so, switching the serial port switching signal from the first state to the second state or from the second state to the first state.
5. The method for transmitting fault diagnosis data through the serial port according to claim 4, wherein the preset hot key comprises preset effective characters and character gaps located before and after the preset effective characters.
6. A terminal for transmitting fault diagnosis data by a serial port comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, and is characterized in that the processor executes the computer program to realize the following steps:
s1, analyzing fault diagnosis data and converting the fault diagnosis data into ASCII codes which can be displayed at a serial port terminal, and storing the converted data in a data buffer;
s2, the converted data in the data buffer are sent to a preselection serial port module, and the preselection serial port module is controlled to send the converted data to the serial port terminal.
7. The terminal for transmitting fault diagnosis data through a serial port according to claim 6, wherein the parsing and converting of the fault diagnosis data into ASCII codes capable of being displayed at the serial port terminal specifically comprises:
analyzing the fault diagnosis data and obtaining 4-bit 16-system analysis data with the size of one byte;
judging the section to which the upper four bits of the analysis data belong, if the section to which the upper four bits of the analysis data belong is 0-9, performing conversion processing of adding 0x30, and if the section to which the upper four bits of the analysis data belong is A-F, performing conversion processing of adding 0x 37;
judging the section of the lower four bits of the analysis data, if the section is 0-9, executing conversion processing of adding 0x30, and if the section is A-F, executing conversion processing of adding 0x 37;
and inserting a space character into the analysis data after the conversion processing is finished to obtain the converted data.
8. The terminal for transmitting the fault diagnosis data through the serial port according to claim 6, wherein the step S2 is preceded by:
setting a serial port switching signal;
if the serial port switching signal is in a first state, controlling the pre-selection serial port module to be connected with a serial port interface of the serial port terminal, and executing the step S2;
and if the serial port switching signal is in a second state, controlling other serial port modules to be connected with the serial port interface of the serial port terminal.
9. The terminal for serial port transmission of fault diagnosis data according to claim 8, further comprising after step S2:
and S3, analyzing and judging whether a preset hot key exists in the serial port data stream received by the serial port interface of the serial port terminal, if so, switching the serial port switching signal from the first state to the second state or from the second state to the first state.
10. The terminal for transmitting the failure diagnosis data through the serial port according to claim 9, wherein the preset hot key comprises preset effective characters and character gaps positioned before and after the preset effective characters.
CN202211547716.4A 2022-12-05 2022-12-05 Method and terminal for transmitting fault diagnosis data by serial port Pending CN115774629A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211547716.4A CN115774629A (en) 2022-12-05 2022-12-05 Method and terminal for transmitting fault diagnosis data by serial port

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211547716.4A CN115774629A (en) 2022-12-05 2022-12-05 Method and terminal for transmitting fault diagnosis data by serial port

Publications (1)

Publication Number Publication Date
CN115774629A true CN115774629A (en) 2023-03-10

Family

ID=85391413

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211547716.4A Pending CN115774629A (en) 2022-12-05 2022-12-05 Method and terminal for transmitting fault diagnosis data by serial port

Country Status (1)

Country Link
CN (1) CN115774629A (en)

Similar Documents

Publication Publication Date Title
US11041907B2 (en) Method and system for acquisition of test data
US4761800A (en) Method and apparatus for detecting a rate of data transmission
EP0635961A1 (en) Message header classifier
US6662087B1 (en) Backward compatible diagnostic tool
CA1228930A (en) Method and apparatus for detecting synchronous or asynchronous data transmission
CN111182306B (en) Video extraction method, system, terminal and storage medium for video compression
CN107750358A (en) Data processing method
CN115774629A (en) Method and terminal for transmitting fault diagnosis data by serial port
CN101136756B (en) Electric self-checking method, system and BMC chip on network long-range control host machine
CN114328353B (en) WEB interactive serial port communication architecture
US5220499A (en) Electronic measuring apparatus having general purpose processing unit
CN210807302U (en) Network anomaly detection device
JP3435069B2 (en) Keyboard composite input device and POS terminal device
CN214586864U (en) Debugging device and debugging system
CN114676078B (en) Automatic identification method based on UART interface signals
CN217640065U (en) Mainboard, information display equipment and terminal equipment
CN117834750B (en) Device, method, system, equipment, medium and server for acquiring protocol data
KR940000453B1 (en) Low-hevel processor loading method in electronic exchange
CN117331877A (en) Serial port one-to-many communication method, system and electrical equipment
KR950003719B1 (en) Interface method by binary protocol
CN112929584A (en) P2P signal acquisition and conversion method and system and P2P signal acquisition and conversion plate
KR100312308B1 (en) Method for outputting state information of portable telephone in personal computer
KR19990004235A (en) Routing Tag Analysis Circuit of Asynchronous Transfer Mode Switch
CN117789646A (en) Display method and system based on LED display screen module and electronic equipment
CN117908424A (en) Industrial control flow acquisition controller mainboard and controller

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination