Method and device for detecting and correcting message data format, equipment and medium
By monitoring the position and type of new input bytes in the input line, and automatically performing backspace and space padding operations, the problem of non-standard message data format is solved, achieving automatic data formatting and accuracy, and improving development and testing efficiency.
Patent Information
- Application Number
- CN202511551316.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-01-27
AI Technical Summary
When entering message data in a text input box, the inability to limit the number of spaces leads to non-standard formatting. Manually adding space separators is tedious and error-prone, resulting in sending errors.
By monitoring the position and type of new input bytes in the input line, backspace, zero-padding, and space-padding operations are automatically performed to ensure that the message data format conforms to the communication protocol.
It enables automatic formatting of message data, avoiding non-standard formats and the tediousness of manual operations, ensuring data consistency and accuracy, and improving the efficiency and accuracy of development and testing.
Smart Images

Figure CN121418482A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication protocol technology, specifically to a method, apparatus, device, and medium for detecting and correcting message data formats. Background Technology
[0002] The Unified Diagnostic Services (UDS) protocol is a standardized diagnostic communication protocol widely used in automotive electronic systems. Developed based on the ISO 14229 standard, it is primarily used for fault diagnosis, data reading and writing, software programming, and system maintenance of Electronic Control Units (ECUs). CAN bus communication is widely used in automotive electronic systems; therefore, UDS protocol commands are typically sent via the CAN bus, and their format must adhere to the CAN protocol. The Data Field in the CAN protocol message format stores the transmitted data and can hold 64 bytes, or 16 hexadecimal bits. During development and testing, engineers often need to manually input hexadecimal data to simulate CAN messages.
[0003] However, the following problems exist when entering message data in traditional text input boxes: 1. The number of spaces cannot be limited, resulting in a large number of spaces and thus causing the entered message data to be non-standard in format, such as... Figure 1 As shown; 2. It requires manually adding a space separator to separate each byte (two hexadecimal numbers), which is tedious and error-prone. Figure 2 As shown; 3. Modifying already entered characters may result in a set of data containing three characters, causing an error during transmission, such as... Figure 3 As shown.
[0004] Therefore, how to automatically detect and correct the input message data is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, device, and computer-readable storage medium for detecting and correcting message data format, which can solve the technical problem in the prior art that errors in sending message data due to non-standard format will occur when entering message data in a text box.
[0006] In a first aspect, embodiments of this application provide a method for detecting and correcting message data formats, wherein the method for detecting and correcting message data formats includes: When a new input byte is detected in the input line, determine the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line; Based on the position and type of the new input byte in the input line, and the type of the already input byte, perform backspace, zero-padding, and space-padding operations in the input line.
[0007] In conjunction with the first aspect, in one implementation, based on the position and type of the new input byte in the input line, and the type of the already input byte, a backspace operation, a zero-padding operation, and a space-padding operation are performed in the input line, including: When the new input byte is at the beginning of the input line, determine whether the new input byte is a space; If the input is a space, a backspace operation is performed on the input line.
[0008] In one implementation, based on the position and type of the new input byte in the input line, and the type of the already input bytes, a backspace operation, a zero-padding operation, and a space-padding operation are performed in the input line, including: When the new input byte is in the second position of the input line, determine whether the previous position of the new input byte is a character and whether the new input byte is a space. If so, then add a 0 before the previous bit of the new input byte.
[0009] In one implementation, based on the position and type of the new input byte in the input line, and the type of the already input bytes, a backspace operation, a zero-padding operation, and a space-padding operation are performed in the input line, including: When the position of the new input byte in the input line is greater than 2, and the new input byte is a character, if the first two digits of the new input byte are both characters, then a space is automatically added before the new input byte.
[0010] In one implementation, based on the position and type of the new input byte in the input line, and the type of the already input bytes, a backspace operation, a zero-padding operation, and a space-padding operation are performed in the input line, including: When the position of the new input byte in the input line is greater than 2 positions and the new input byte is a space, if the preceding position of the new input byte is a space, then a backspace operation is performed; If the first character of the new input byte is a character and the first two characters of the new input byte are spaces, then 0 is added before the first character of the new input byte.
[0011] In one implementation, after detecting a new input byte in the input line, the method further includes: Determine the cursor position in the input line; If the cursor is in the middle of the entered bytes, an input error message is displayed, and all entered bytes after the cursor are deleted.
[0012] In one implementation, when a new input byte is detected in the input line, determining the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line, further includes: When a new input byte is detected in the input line, it is determined whether the new input byte is either a character or a space that conforms to a preset format; If so, determine the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line; Otherwise, display a message indicating an error in the new input byte and delete the new input byte.
[0013] Secondly, embodiments of this application provide a device for detecting and correcting message data formats, the device comprising: A determination module is used to determine the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line, when a new input byte is detected in the input line. The correction module is used to perform backspace, zero-padding, and space-padding operations in the input line according to the position and type of the new input byte in the input line and the type of the already input byte.
[0014] Thirdly, embodiments of this application provide a message data format detection and correction device, the message data format detection and correction device including a processor, a memory, and a message data format detection and correction program stored in the memory and executable by the processor, wherein when the message data format detection and correction program is executed by the processor, it implements the steps of the message data format detection and correction method as described in any of the above claims.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a message data format detection and correction program, wherein when the message data format detection and correction program is executed by a processor, it implements the steps of the message data format detection and correction method as described in any of the preceding claims.
[0016] The beneficial effects of the technical solutions provided in this application include: When a new input byte is detected in the input line, its position and type within the input line are determined, along with the types of already input bytes. Based on the position and type of the new input byte and the types of the already input bytes, backspace, zero-padding, and space-padding operations are performed in the input line. This effectively solves the technical problems in related technologies, such as non-standard formatting due to the inability to limit the number of spaces in the message data input, and the cumbersome and error-prone operation caused by manually adding spaces. It achieves automatic formatting of the message data input process, eliminating the need for manual space input for byte separation and eliminating concerns about format errors, as the system automatically corrects them. This ensures the uniformity and rigor of the message data format and guarantees that the final generated message data fully complies with communication protocol requirements, significantly improving the efficiency and accuracy of development and testing. Attached Figure Description
[0017] Figure 1 A diagram illustrating how excessive spaces in the input can lead to non-standard message data formatting. Figure 2 An illustration of an error that occurred when manually adding spaces; Figure 3 This is an illustration showing how an error occurs when three characters appear in the data. Figure 4 This is a flowchart illustrating an embodiment of the method for detecting and correcting message data format in this application; Figure 5 This is an illustration showing an input error message; Figure 6 This is an illustration showing a message indicating an error in the latest input byte. Figure 7 This is a schematic diagram illustrating the specific process of detecting and correcting the message data format of this application; Figure 8 This is a schematic diagram of the functional modules of an embodiment of the message data format detection and correction device of this application; Figure 9 This is a schematic diagram of the hardware structure of the message data format detection and correction device involved in the embodiments of this application. Detailed Implementation
[0018] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0020] In a first aspect, embodiments of this application provide a method for detecting and correcting message data formats.
[0021] In one embodiment, reference is made to Figure 4 , Figure 4 This is a flowchart illustrating the first embodiment of the method for detecting and correcting the message data format of this application. Figure 4 As shown, the methods for detecting and correcting message data formats include: Step S101: When a new input byte is detected in the input line, determine the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line.
[0022] As a preferred implementation, after detecting a new input byte in the input line, the method further includes: determining the position of the cursor in the input line; if the cursor is in the middle of the already input bytes, displaying an input error message and deleting all already input bytes after the cursor.
[0023] It's worth noting that after detecting a new input byte in the input line, if the cursor is determined to be in the middle of the already entered byte sequence rather than at the end, it's determined that the user is in data modification mode. In this mode, direct modification of existing content may disrupt the established format, leading to inconsistencies in data format before and after the cursor position, and consequently causing message assembly errors. To fundamentally avoid such risks, such as... Figure 5 As shown, this embodiment will automatically display input error messages and clear all entered bytes after the cursor position, retaining only the valid content before the cursor. This mechanism ensures that any editing operation restarts from a standardized and consistent breakpoint, thereby forcibly maintaining the correctness and integrity of the entire data segment's format and effectively preventing global errors introduced by local modifications. For example, it effectively avoids situations where three characters are linked together due to modifications to already written characters.
[0024] In one embodiment, when a new input byte is detected in the input line, determining the length and type of the bytes already input in the input line further includes: when the new input byte is detected in the input line, determining whether the new input byte is either a character or a space that conforms to a preset format; if so, determining the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line; otherwise, displaying a prompt message indicating that the new input byte has an error, and deleting the new input byte.
[0025] It is worth noting that, such as Figure 6As shown, in this embodiment, characters conforming to the preset format can be hexadecimal numbers. This embodiment, through a pre-filtering mechanism, can fundamentally eliminate the input of any illegal characters, effectively avoiding the problem of interference with subsequent formatting logic or even communication protocol failure due to basic input errors, thereby ensuring the standardization and legality of the final message data from the source.
[0026] Step S102: Based on the length and type of the input bytes, perform backspace, zero-padding, and space-padding operations in the input line.
[0027] In one embodiment, when the new input byte is at the beginning of the input line, it is determined whether the new input byte is a space; if it is a space, a backspace operation is performed on the input line.
[0028] It is worth noting that message data must begin with a number, not a separator (space). A leading space has no data meaning and violates the basic formatting principle of "data first, separator last." This application uses a backspace when a space is entered at the beginning, eliminating illegal formats that start with a space and laying a correct foundation for the standardized input of subsequent data.
[0029] In one embodiment, when the new input byte is in the second position of the input line, it is determined whether the previous position of the new input byte is a character and whether the new input byte is a space; if so, 0 is added before the previous position of the new input byte.
[0030] It is worth noting that if the first character of the new input byte is a character and the new input byte is a space, it means that the user has only entered one character and then ended the input. This does not conform to the protocol specification of two bytes. At this time, the system automatically fills in 0s, instantly converting the incomplete input into a complete two-byte that conforms to the protocol specification. This eliminates the common formatting error of "missing digits" from the source, thereby avoiding tedious manual modification.
[0031] In one embodiment, when the position of the new input byte in the input line is greater than 2 positions, it is first determined whether the new input byte is a character or a space.
[0032] When the position of the new input byte in the input line is greater than 2, and the new input byte is a character, if the first two digits of the new input byte are both characters, then a space is automatically added before the new input byte.
[0033] As an example, if the first two digits of the new input byte are both characters "03", and the new input byte is the character "2", then it constitutes "032" which does not conform to the message data specification. This embodiment automatically adds a space before the new input byte to make the input conform to the specification as "03 2".
[0034] This embodiment identifies the complete byte pair "03" formed by continuous user input and automatically inserts a space after the user inputs the next character "2". This ensures that the message data is always presented in the standard format of "two digits + space", fundamentally preventing the problem of byte concatenation (three or more consecutive characters) caused by continuous input, and guaranteeing the standardization and readability of the data.
[0035] When the position of the new input byte in the input line is greater than 2 positions and the new input byte is a space, if the preceding position of the new input byte is a space, a backspace operation is performed to avoid consecutive spaces and ensure the standardization of the message data.
[0036] When the position of the new input byte in the input line is greater than 2, and the new input byte is a space, if the first character of the new input byte is a character, and the first two characters of the new input byte are spaces, then 0 is added before the first character of the new input byte.
[0037] As an example, taking the already entered message data as "10 33 5", if the user enters a space as the new input byte, intending to end the current byte, the user only enters one character "5" and ends the input, which is not a two-byte format that conforms to the protocol specification. At this time, the system automatically fills in 0, forming "10 33 05", and instantly converts the incomplete input into a complete two-byte format that conforms to the protocol specification, thereby eliminating the "missing byte" format error and avoiding tedious manual modification.
[0038] In a specific embodiment, such as Figure 7 As shown, the methods for detecting and correcting message data formats include: Step S201: Begin.
[0039] Step S202: A new input byte exists.
[0040] Step S203: Determine if the cursor is in the middle of the entered byte; if yes, proceed to step S204; if no, proceed to step S205.
[0041] Step S204: Display the input error message and delete all entered bytes after the cursor, then return to step S201.
[0042] Step S205: Determine whether the new input byte is a hexadecimal character or a space; if not, proceed to step S206; if yes, proceed to step S207.
[0043] Step S206: Display a message indicating an error in the new input byte, delete the new input byte, and return to step S201.
[0044] Step S207: Determine whether the new input byte is at the beginning of the input line; if yes, proceed to step S208; if no, proceed to step S2010.
[0045] Step S208: Determine if the new input byte is a space; if yes, proceed to step S209; if no, return to step S201.
[0046] Step S209: Perform a backspace operation in the input line and return to step S201.
[0047] Step S2010: Determine whether the new input byte is in the second position of the input line; if yes, proceed to step S2011; if no, proceed to step S2013.
[0048] Step S2011: Determine whether the preceding character of the new input byte is a character and whether the new input byte is a space; if yes, proceed to step S2012; if no (both are characters), return to step S201.
[0049] Step S2012: Add 0 before the first element of the new input byte, and shift the original content to the right.
[0050] Step S2013: Determine whether the new input byte is a character or a space; if it is a character, proceed to step S2014; if it is a space, proceed to step S2016.
[0051] Step S2014: Determine whether the first two digits of the new input byte are both characters; if yes, proceed to step S2015; otherwise, return to step S201.
[0052] Step S2015: Automatically add spaces before the newly input bytes, then return to step S201.
[0053] Step S2016: Determine if the first character of the new input byte is a space; if yes, proceed to step S2017; otherwise, proceed to step S2018.
[0054] Step S2017: Perform a backspace operation and return to step S201.
[0055] Step S2018: Is the first character of the new input byte a character, and are the first two characters of the new input byte a space? If yes, proceed to step S2019; otherwise, proceed to step S201. Step S2019: Add 0 to the beginning of the new input byte, then return to step S201.
[0056] The message data format detection and correction method provided in this application's embodiments accurately determines the specific position of a new input byte in the data stream, its own attributes (hexadecimal number or space), and the combination state of preceding characters (such as whether the first two digits constitute a complete byte). It automatically triggers precise correction mechanisms such as backspace deletion, intelligent zero padding for incomplete bytes, and automatic space padding for byte separators. This method can complete accurate formatting without the user's awareness, completely solving the unavoidable formatting anomalies such as extra spaces, missing digits, and misalignments in manual input mode. This not only ensures that the final generated message data fully complies with the strict specifications of communication protocols such as the CAN bus, eliminating communication failures caused by format errors at the source, but also significantly improves work efficiency and data reliability in diagnostic, testing, and development processes in fields such as automotive electronics, achieving a unified improvement in accuracy, efficiency, and ease of use. Secondly, embodiments of this application also provide a device for detecting and correcting message data formats.
[0057] In one embodiment, reference is made to Figure 8 , Figure 8 This is a functional module diagram of an embodiment of the message data format detection and correction device of this application. Figure 8 As shown, the message data format detection and correction device includes: A determination module is used to determine the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line, when a new input byte is detected in the input line. The correction module is used to perform backspace, zero-padding, and space-padding operations in the input line according to the position and type of the new input byte in the input line and the type of the already input byte.
[0058] Furthermore, in one embodiment, the correction module is also used for: When the new input byte is at the beginning of the input line, determine whether the new input byte is a space; If the input is a space, a backspace operation is performed on the input line.
[0059] Furthermore, in one embodiment, the correction module is also used for: When the new input byte is in the second position of the input line, determine whether the previous position of the new input byte is a character and whether the new input byte is a space. If so, then add a 0 before the previous bit of the new input byte.
[0060] Furthermore, in one embodiment, the correction module is also used for: When the position of the new input byte in the input line is greater than 2, and the new input byte is a character, if the first two digits of the new input byte are both characters, then a space is automatically added before the new input byte.
[0061] Furthermore, in one embodiment, the correction module is also used for: When the position of the new input byte in the input line is greater than 2 positions and the new input byte is a space, if the preceding position of the new input byte is a space, then a backspace operation is performed; If the first character of the new input byte is a character and the first two characters of the new input byte are spaces, then 0 is added before the first character of the new input byte.
[0062] Furthermore, in one embodiment, the determining module is further configured to: Determine the cursor position in the input line; If the cursor is in the middle of the entered bytes, an input error message is displayed, and all entered bytes after the cursor are deleted.
[0063] Furthermore, in one embodiment, the determining module is further configured to: When a new input byte is detected in the input line, it is determined whether the new input byte is either a character or a space that conforms to a preset format; If so, determine the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line; Otherwise, display a message indicating an error in the new input byte and delete the new input byte.
[0064] The functions of each module in the above-mentioned message data format detection and correction device correspond to the steps in the above-mentioned message data format detection and correction method embodiment, and their functions and implementation processes will not be described in detail here.
[0065] Thirdly, embodiments of this application provide a device for detecting and correcting message data formats. The device for detecting and correcting message data formats can be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0066] Reference Figure 8 , Figure 8 This is a schematic diagram of the hardware structure of the message data format detection and correction device involved in the embodiments of this application. In the embodiments of this application, the message data format detection and correction device may include a processor, a memory, a communication interface, and a communication bus.
[0067] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.
[0068] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces used for interconnecting internal components of the message data format detection and correction equipment, as well as interfaces used for interconnecting the message data format detection and correction equipment with other devices (such as other computing devices or user equipment). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc.; user equipment can be displays, keyboards, etc.
[0069] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0070] The processor can be a general-purpose processor, which can call the message data format detection and correction program stored in the memory and execute the message data format detection and correction method provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the message data format detection and correction program is called can refer to the various embodiments of the message data format detection and correction method of this application, and will not be repeated here.
[0071] Those skilled in the art will understand that Figure 8 The hardware structure shown does not constitute a limitation of this application and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0072] Fourthly, embodiments of this application also provide a computer-readable storage medium.
[0073] The present application has a computer-readable storage medium storing a message data format detection and correction program, wherein when the message data format detection and correction program is executed by a processor, the steps of the message data format detection and correction method described above are implemented.
[0074] The method implemented when the message data format detection and correction procedure is executed can be referred to in various embodiments of the message data format detection and correction method of this application, and will not be repeated here.
[0075] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0076] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.
[0077] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.
[0078] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0079] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.
[0080] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0081] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for detecting and correcting message data formats, characterized in that, The method for detecting and correcting the message data format includes: When a new input byte is detected in the input line, determine the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line; Based on the position and type of the new input byte in the input line, and the type of the already input byte, perform backspace, zero-padding, and space-padding operations in the input line.
2. The method for detecting and correcting message data format as described in claim 1, characterized in that, Based on the position and type of the new input byte in the input line, and the type of the already input bytes, perform backspace, zero-padding, and space-padding operations in the input line, including: When the new input byte is at the beginning of the input line, determine whether the new input byte is a space; If the input is a space, a backspace operation is performed on the input line.
3. The method for detecting and correcting message data format as described in claim 1, characterized in that, Based on the position and type of the new input byte in the input line, and the type of the already input bytes, perform backspace, zero-padding, and space-padding operations in the input line, including: When the new input byte is in the second position of the input line, determine whether the previous position of the new input byte is a character and whether the new input byte is a space. If so, then add a 0 before the previous bit of the new input byte.
4. The method for detecting and correcting message data format as described in claim 1, characterized in that, Based on the position and type of the new input byte in the input line, and the type of the already input bytes, perform backspace, zero-padding, and space-padding operations in the input line, including: When the position of the new input byte in the input line is greater than 2, and the new input byte is a character, if the first two digits of the new input byte are both characters, then a space is automatically added before the new input byte.
5. The method for detecting and correcting message data format as described in claim 1, characterized in that, Based on the position and type of the new input byte in the input line, and the type of the already input bytes, perform backspace, zero-padding, and space-padding operations in the input line, including: When the position of the new input byte in the input line is greater than 2 positions and the new input byte is a space, if the preceding position of the new input byte is a space, then a backspace operation is performed; If the first character of the new input byte is a character and the first two characters of the new input byte are spaces, then 0 is added before the first character of the new input byte.
6. The method for detecting and correcting message data format as described in claim 1, characterized in that, After detecting a new input byte in the input line, the following is also included: Determine the cursor position in the input line; If the cursor is in the middle of the entered bytes, an input error message is displayed, and all entered bytes after the cursor are deleted.
7. The method for detecting and correcting message data format as described in claim 1, characterized in that, When a new input byte is detected in the input line, determining the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line, further includes: When a new input byte is detected in the input line, it is determined whether the new input byte is either a character or a space that conforms to a preset format; If so, determine the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line; Otherwise, display a message indicating an error in the new input byte and delete the new input byte.
8. A device for detecting and correcting message data formats, characterized in that, The message data format detection and correction device includes: A determination module is used to determine the position and type of the new input byte in the input line, as well as the type of the bytes already input in the input line, when a new input byte is detected in the input line. The correction module is used to perform backspace, zero-padding, and space-padding operations in the input line according to the position and type of the new input byte in the input line and the type of the already input byte.
9. A device for detecting and correcting message data formats, characterized in that, The message data format detection and correction device includes a processor, a memory, and a message data format detection and correction program stored in the memory and executable by the processor, wherein when the message data format detection and correction program is executed by the processor, it implements the steps of the message data format detection and correction method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a message data format detection and correction program, wherein when the message data format detection and correction program is executed by a processor, it implements the steps of the message data format detection and correction method as described in any one of claims 1 to 7.