Error correction method and device of communication matrix, terminal and storage medium

CN117857244BActive Publication Date: 2026-10-20GREAT WALL NEW ENERGY COMMERCIAL VEHICLE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211211274.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2026-10-20
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

[0005]本申请实施例提供了一种通信矩阵的错误修正方法、装置、终端及存储介质,以解决现有技术方式效率较低且出错率较高,影响CAN或LIN通信协议的开发效率的问题

Benefits of technology

[0049]本申请实施例提供一种通信矩阵的错误修正方法、装置、终端及存储介质,通过不同的错误修正模式,可以对通信矩阵文件仅检查错误,也可以对通信矩阵文件既检查错误,又修正错误,当为仅检查错误模式时,通过在预设信息提示区显示第一错误数据的位置、第一错误数据和第一错误数据对应的建议修正数据可以提示用户错误数据的位置,并给出修改意见,便于客户修改,可以减少工作量,提高效率,降低出错率;当为检查和修正错误模式时,不仅可以检查出错误数据,还可以自动修正错误数据,并在目标文件中高亮显示错误数据或修正后的数据,以提示用户修改位置,方便用户查看,且无需用户操作即可自动修改错误数据,可以进一步提升效率,降低出错率,提升CAN或LIN通信协议的开发效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117857244B_ABST
    Figure CN117857244B_ABST
Patent Text Reader

Abstract

The application provides an error correction method and device of a communication matrix, a terminal and a storage medium. The method comprises the following steps: obtaining a communication matrix file; obtaining an error correction mode; obtaining preset data required for correcting errors; if the error correction mode is a check error mode only, checking first error data in the communication matrix file, and displaying the position of the first error data, the first error data and corresponding recommended correction data in a preset information prompt area; if the error correction mode is a check and correct error mode, checking second error data in the communication matrix file, correcting the second error data in a target file, and highlighting the second error data and / or the data after the correction of the second error data; and the target file is the communication matrix file or a copy corresponding to the communication matrix file. The application can automatically correct error data without user operation, can improve efficiency, reduce error rate and improve the development efficiency of CAN or LIN communication protocols.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, terminal and storage medium for error correction of a communication matrix. Background Technology

[0002] CAN (Controller Area Network) is an ISO internationally standardized serial communication protocol that has been widely used in industrial automation, automobiles, ships, medical equipment, and industrial equipment. LIN (Local Interconnect Network) is mainly used for auxiliary functions of the CAN bus and is a low-cost serial communication mode.

[0003] In the automotive industry, Excel documents are typically used to record CAN or LIN communication matrices, documenting basic information about messages and signals from each bus node. However, with the increasing automation and intelligence of vehicles, the number of nodes and messages in the communication matrix is ​​growing rapidly. This has led to a significant increase in the workload of manually editing Excel documents, resulting in a high error rate and difficulty in detecting errors. Consequently, the development and maintenance of CAN or LIN communication matrices require substantial time.

[0004] Currently, some communication matrix creation tools can check for errors and generate inspection results when importing communication matrices into Excel documents. However, these tools can only check for errors; staff still need to manually locate and correct each error against the inspection results, which is inefficient and has a high error rate, impacting the development efficiency of CAN or LIN communication protocols. Summary of the Invention

[0005] This application provides an error correction method, apparatus, terminal, and storage medium for a communication matrix, to solve the problems of low efficiency and high error rate in existing technologies, which affect the development efficiency of CAN or LIN communication protocols.

[0006] In a first aspect, embodiments of this application provide an error correction method for a communication matrix, including:

[0007] Obtain the communication matrix file;

[0008] Get error correction mode;

[0009] Obtain the preset data required for error correction;

[0010] If the error correction mode is the error-only check mode, the first error data in the communication matrix file is checked and the location of the first error data, the first error data, and the suggested correction data corresponding to the first error data are displayed in the preset information prompt area.

[0011] If the error correction mode is the check and correction error mode, then the second error data in the communication matrix file is checked and corrected in the target file based on the preset data, and the second error data and / or the corrected data are highlighted; the target file is the communication matrix file or a copy of the communication matrix file.

[0012] In one possible implementation, if the error correction mode is an error checking and correction mode, the error correction method for the communication matrix also includes:

[0013] The location of the second error data, the second error data, and the corrected data are displayed in the preset information prompt area.

[0014] In one possible implementation, if the error correction mode is to only check the error mode, the error correction method for the communication matrix also includes:

[0015] In the communication matrix file, the first erroneous data is highlighted.

[0016] In one possible implementation, the second erroneous data in the obtained communication matrix file is checked, and based on preset data, the second erroneous data is corrected in the target file, including:

[0017] For each item in the communication matrix file, based on preset inspection conditions, second error data is obtained from the data values ​​corresponding to each item, and the second error data is corrected in the target file according to the preset correction strategy corresponding to the preset data and the second error data.

[0018] In one possible implementation, for each item in the communication matrix file, based on preset inspection conditions, second erroneous data is obtained from the data values ​​corresponding to each item, and the second erroneous data is corrected in the target file according to the preset correction strategy corresponding to the preset data and the second erroneous data, including at least one of the following steps:

[0019] For the message names and signal names in the communication matrix file, determine whether there are illegal characters in the data values ​​corresponding to the message names and signal names. If there are illegal characters, the data values ​​corresponding to the message names and signal names are taken as the second error data. In the target file, the illegal characters in the second error data are deleted.

[0020] For message names and signal names in the communication matrix file, determine whether the first character of each data value corresponding to the message name and each data value corresponding to the signal name is a letter. If the first character of the data value corresponding to the message name and the signal name is not a letter, take the data value corresponding to the message name and the data value corresponding to the signal name as the second error data, and add the first preset string before the first character of the second error data in the target file.

[0021] For message names and signal names in the communication matrix file, determine whether there are duplicate values ​​in each data value corresponding to the message name and the signal name. The data values ​​corresponding to the message name and the signal name with duplicate values ​​are taken as second error data, and the corresponding prefix or suffix is ​​added to the second error data in the target file.

[0022] For message identifiers in the communication matrix file, determine whether there are duplicate values ​​among the data values ​​corresponding to the message identifiers. If there are duplicate values, use the data values ​​corresponding to the message identifiers as the second error data. In the target file, modify the second error data to an identifier that is different from all the data values ​​corresponding to the message identifiers.

[0023] For each row in the communication matrix file that defines a message name, if the data value of the message type in that row is empty, then the data value of the message type in that row is treated as the second error data, and in the target file, the data value of the message type in that row is modified to the preset message type. If the data value of the message sending type in that row is empty, then the data value of the message sending type in that row is treated as the second error data, and in the target file, the data value of the message sending type in that row is modified to the preset message sending type.

[0024] For each row in the communication matrix file that defines a message name, if the data value of the message sending type in that row is Cycle and the data value of the message cycle time in that row is empty, then the data value of the message cycle time in that row is taken as the second error data, and in the target file, the data value of the message cycle time in that row is modified to the preset cycle duration.

[0025] For at least one of the message identifier, bus minimum value, bus maximum value, initial value, invalid value and non-enabled value in the communication matrix file, determine whether the data value corresponding to the at least one item is a hexadecimal number or empty. If the data value corresponding to the at least one item is not a hexadecimal number and is not empty, take it as the second error data and modify the second error data to the corresponding hexadecimal number in the target file.

[0026] For at least one of the following in the communication matrix file: PGN, message period time, message length, start byte, start bit, SPN, signal length, precision, offset, physical minimum value, physical maximum value, message transmission fast period, number of fast message transmissions, and message delay time, determine whether the data value corresponding to the at least one item is a decimal number or empty. If the data value corresponding to the at least one item is neither a decimal number nor empty, take it as the second error data and modify it to the corresponding decimal number in the target file.

[0027] For the message length in the communication matrix file, determine whether each data value corresponding to the message length is 0 or outside the preset message length value range. If the data value corresponding to the message length is 0 or outside the preset message length value range, take it as the second error data. In the target file, modify the second error data to the preset message length value or the message length value determined according to the last signal in the message containing the second error data.

[0028] For the signal length in the communication matrix file, determine whether the data values ​​corresponding to the signal length are 0 or outside the preset signal length value range. If the data values ​​corresponding to the signal length are 0 or outside the preset signal length value range, use them as the second error data. In the target file, modify the second error data to the signal length value determined according to the data value corresponding to the maximum bus value.

[0029] For the message cycle time in the communication matrix file, determine whether the data values ​​corresponding to each message cycle time are numbers greater than 0 or empty. The data values ​​corresponding to the message cycle time that are neither greater than 0 nor empty are taken as the second error data, and the second error data is modified to the preset message cycle time in the target file.

[0030] For at least one of the start byte, start bit and bus minimum value in the communication matrix file, determine whether the data value corresponding to the at least one item is a number greater than or equal to 0. If the data value corresponding to the at least one item is not a number greater than or equal to 0, take the data value corresponding to the at least one item as the second error data, and modify the second error data to the corresponding preset default number in the target file.

[0031] Regarding the precision in the communication matrix file, determine whether the data values ​​corresponding to the precision are non-zero numbers. Use the data values ​​corresponding to the precision that are zero or non-numeric as the second error data, and modify the second error data to the preset precision value in the target file.

[0032] For the offset in the communication matrix file, determine whether the data values ​​corresponding to the offset are empty. If the data values ​​corresponding to the empty offset are empty, take them as the second error data and modify them to the preset offset values ​​in the target file.

[0033] For each row in the communication matrix file, determine whether the row satisfies ZXX = (WLX × G) + A and ZXD = (WLD × G) + A. If not, determine the second erroneous data based on the preset trust method, and modify the second erroneous data in the target file according to the preset trust method. Wherein, ZXX is the data value of the minimum bus value of the row, WLX is the data value of the minimum physical value of the row, G is the data value of the precision of the row, A is the data value of the offset of the row, ZXD is the data value of the maximum bus value of the row, and WLD is the data value of the maximum physical value of the row.

[0034] For each row in the communication matrix file, determine whether the row satisfies the formula ZXD = 2. L If the condition is not met, the data value of the signal length of that row or the data value of the maximum bus value of that row will be used as the second error data. In the target file, the second error data will be modified so that the modified data satisfies the formula; where L is the data value of the signal length of that row.

[0035] For each line in the communication matrix file, determine whether the data value of the starting byte of the line is greater than or equal to the data value of the starting byte of the previous line in the corresponding message, and less than or equal to the data value of the message length corresponding to the corresponding message. If not, the data value of the starting byte of the line is taken as the second error data, and in the target file, the data value of the starting byte of the line is modified to the data value of the starting byte of the previous line.

[0036] For each row in the communication matrix file, determine whether the data value of the start bit of the row is greater than or equal to the sum of the data value of the start bit of the previous row in the corresponding message and the data value of the signal length of the previous row. If not, treat the data value of the start bit of the row as the second error data, and in the target file, modify the data value of the start bit of the row to the sum of the data value of the start bit of the previous row in the corresponding message and the data value of the signal length of the previous row.

[0037] For each row in the communication matrix file, determine whether the data value of the starting byte of the row is equal to the value obtained by dividing the data value of the starting position of the row by 8 and then rounding it down. If not, then the data value of the starting byte of the row or the data value of the starting position of the row is regarded as the second error data. In the target file, modify the data value of the starting byte of the row or the data value of the starting position of the row so that the data value of the starting byte of the row is equal to the value obtained by dividing the data value of the starting position of the row by 8 and then rounding it down.

[0038] In one possible implementation, the communication matrix file is either a CAN communication matrix file or a LIN communication matrix file.

[0039] Secondly, embodiments of this application provide an error correction device for a communication matrix, comprising:

[0040] The first acquisition module is used to acquire the communication matrix file;

[0041] The second acquisition module is used to acquire the error correction mode;

[0042] The third acquisition module is used to acquire the preset data required for error correction.

[0043] The inspection module is used to check the first error data in the communication matrix file if the error correction mode is the error-only mode, and to display the location of the first error data, the first error data, and the suggested correction data corresponding to the first error data in the preset information prompt area.

[0044] The inspection and correction module is used to check the second error data in the communication matrix file if the error correction mode is the inspection and correction error mode, and correct the second error data in the target file based on preset data, and highlight the second error data and / or the data after the second error data is corrected; the target file is the communication matrix file or a copy of the communication matrix file.

[0045] In one possible implementation, the check and correction module is also used for:

[0046] The location of the second error data, the second error data, and the corrected data are displayed in the preset information prompt area.

[0047] Thirdly, embodiments of this application provide a terminal, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the error correction method for the communication matrix as described in the first aspect or any possible implementation thereof.

[0048] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the error correction method for the communication matrix as described in the first aspect or any possible implementation thereof.

[0049] This application provides a method, apparatus, terminal, and storage medium for error correction of a communication matrix. Through different error correction modes, the communication matrix file can be checked for errors only, or it can be both checked and corrected. In the error-only checking mode, the location of the first erroneous data, the first erroneous data itself, and the corresponding suggested correction data are displayed in a preset information prompt area to indicate the location of the erroneous data and provide modification suggestions, facilitating customer modification, reducing workload, improving efficiency, and lowering the error rate. In the error checking and correction mode, not only can erroneous data be detected, but it can also be automatically corrected. The erroneous data or the corrected data is highlighted in the target file to indicate the modification location to the user, making it convenient for the user to view. Furthermore, the automatic correction of erroneous data without user intervention can further improve efficiency, reduce the error rate, and enhance the development efficiency of CAN or LIN communication protocols. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is a flowchart illustrating the implementation of the error correction method for the communication matrix provided in this application embodiment;

[0052] Figure 2 This is a schematic diagram of the structure of the error correction device for the communication matrix provided in the embodiments of this application;

[0053] Figure 3 This is a schematic diagram of the terminal provided in the embodiments of this application. Detailed Implementation

[0054] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following description will be provided in conjunction with the accompanying drawings and specific embodiments.

[0056] See Figure 1The diagram illustrates the implementation flowchart of the error correction method for the communication matrix provided in this application embodiment. The execution subject of the error correction method for the communication matrix can be a terminal.

[0057] See Figure 1 The method is described in detail below:

[0058] In S101, obtain the communication matrix file.

[0059] The aforementioned communication matrix file is the communication matrix file to be corrected for errors, and it can be an EXCEL file.

[0060] In some embodiments, the communication matrix file described above is a CAN communication matrix file or a LIN communication matrix file.

[0061] A CAN communication matrix file or a LIN communication matrix file is a table that records basic information about messages and signals from each node; it is usually an Excel document.

[0062] For a CAN communication matrix file, the header row includes one or more of the following items: message name, message type, message identifier (message ID), PGN (Parameter Group Number), message transmission type, message cycle time, message length, signal name, signal description, arrangement format, start byte, start bit, SPN (Suspect Parameter Number), signal transmission type, signal length, data type, precision, offset, physical minimum value, physical maximum value, bus minimum value, bus maximum value, initial value, invalid value, disabled value, unit, signal value description, message transmission fast cycle, number of message fast transmissions, and message delay time.

[0063] For a LIN communication matrix file, the header line includes one or more of the following items: message name, message identifier (message ID), protection identifier, message transmission type, checksum method, message length, signal name, signal description, status information bits, start byte, start bit, signal length, precision, offset, physical minimum value, physical maximum value, bus minimum value, bus maximum value, initial value, invalid value, unit, and signal value description.

[0064] In S102, obtain the error correction mode.

[0065] In this embodiment, there are two error correction modes: error-only mode and error-checking and-correcting mode. In error-only mode, only erroneous data is detected in the communication matrix file, but no automatic correction is performed. In error-checking and-correcting mode, not only are erroneous data detected, but they are also automatically corrected. Users can choose which error correction mode to use based on their needs.

[0066] In S103, the preset data required for error correction is obtained.

[0067] In this embodiment, some correction methods in the correction steps require the use of preset data. The preset data may include at least one of the following: a first preset string, a preset message type, a preset message sending type, a preset period duration, a preset message length value, a preset message period time, a preset default number, a preset precision value, and a preset offset value. Users can set these preset contents according to their needs.

[0068] In S104, if the error correction mode is the error-only check mode, the first error data in the communication matrix file is checked and obtained, and the location of the first error data, the first error data, and the suggested correction data corresponding to the first error data are displayed in the preset information prompt area.

[0069] When the user selects the error correction mode as the error-only check mode, the data in the communication matrix file can be read. According to certain rules, the first error data can be obtained from the communication matrix file, the location of the first error data and the corresponding suggested correction data can be determined, and the location of the first error data, the first error data and the suggested correction data corresponding to the first error data can be displayed in the preset information prompt area.

[0070] It should be noted that the first error data may contain at least one first error data value. Each first error data value has a corresponding location and suggested correction data. The preset information prompt area can list the location of each first error data value contained in the first error data, the first error data value, and the suggested correction data corresponding to the first error data value. The location of the first error data value can be represented by the row and column in which the first error data value is located.

[0071] The preset information prompt area can be positioned according to actual needs, but its location must not affect the checking and error correction of the communication matrix file. The location of the first error data, the first error data, and the corresponding suggested correction data displayed in the preset information prompt area can be displayed in a way that does not affect the error checking process, or it can be displayed uniformly in the preset information prompt area after all error data in the communication matrix file has been checked.

[0072] In S105, if the error correction mode is the error check and correction mode, the second error data in the communication matrix file is checked and obtained, and the second error data is corrected in the target file based on the preset data, and the second error data and / or the data after the second error data is corrected is highlighted; the target file is the communication matrix file or a copy of the communication matrix file.

[0073] When the user selects the error correction mode as the error check and correction mode, the data in the communication matrix file can be read. According to certain rules, the second error data can be checked from the communication matrix file. Based on the preset data, the second error data can be corrected in the target file. In order to make the location of the second error data clearly visible to the user, the second error data and / or the data after the second error data correction can be highlighted.

[0074] In some possible implementations, the above-mentioned correction of the second erroneous data in the target file, and the highlighting of the second erroneous data and / or the data after correction of the second erroneous data, may include:

[0075] If the target file is a communication matrix file, then correct the second erroneous data in the communication matrix file and highlight the corrected data in the communication matrix file;

[0076] If the target file is a copy of the communication matrix file, then the second erroneous data is corrected in the copy of the communication matrix file, and the corrected data is highlighted in the copy of the communication matrix file.

[0077] In this embodiment, the correction of the second erroneous data can be made directly in the original communication matrix file; alternatively, a copy of the communication matrix file can be generated, in which the second erroneous data is modified, while remaining unchanged in the original communication matrix file, so that users can compare and view the file before and after the modification.

[0078] One way to highlight the data is to fill the cell containing the second error data with a bright color, such as yellow or red; or you can change the font color of the second error data to a bright color.

[0079] It should be noted that the second error data may include at least one second error data value. Embodiments of this application can modify and highlight each detected second error data value.

[0080] It should be noted that, in order to distinguish between error data in different modes, the error data detected in the communication matrix file under the error-only check mode is referred to as the first error data, and the error data detected in the communication matrix file under the error check and correction mode is referred to as the second error data. In practical applications, the first error data and the second error data are the same for the same communication matrix file.

[0081] This embodiment utilizes different error correction modes to either check only for errors in the communication matrix file or to both check and correct errors. In the error-only mode, the location of the first erroneous data, the first erroneous data itself, and the corresponding suggested correction data are displayed in a preset information prompt area, indicating the location of the erroneous data and providing modification suggestions. This facilitates customer modifications, reduces workload, improves efficiency, and lowers the error rate. In the error-checking and correction mode, not only are erroneous data detected, but erroneous data is also automatically corrected. The erroneous data or the corrected data is highlighted in the target file to indicate the modification location to the user, making it convenient for the user to view. Furthermore, the automatic correction of erroneous data without user intervention further reduces the workload of staff, improves efficiency, lowers the error rate, and enhances the development efficiency of CAN or LIN communication protocols.

[0082] In some embodiments, if the error correction mode is an error checking and correction mode, the above-mentioned error correction method for the communication matrix further includes:

[0083] The location of the second error data, the second error data, and the corrected data are displayed in the preset information prompt area.

[0084] The location of the second error data, the second error data, and the data after the second error data are corrected can be displayed in the preset information prompt area. They can be displayed in a way that does not affect the operation of checking and correcting errors during the process, or they can be displayed uniformly in the preset information prompt area after checking and correcting all error data in the communication matrix file.

[0085] The second error data may contain at least one second error data value. Each second error data value has a corresponding position and corrected data. The preset information prompt area can list the position of each second error data value contained in the second error data, the second error data value, and the corrected data for that second error data value. The position of the second error data value can be represented by the row and column in which the second error data value is located.

[0086] In this embodiment, when checking and correcting errors, the location of the second error data, the second error data, and the corrected data can be displayed in a preset information prompt area so that users can view the overall error data modification status.

[0087] In some embodiments, if the error correction mode is an error-only check mode, the above-mentioned error correction method for the communication matrix further includes:

[0088] In the communication matrix file, the first erroneous data is highlighted.

[0089] In this embodiment, to help users quickly locate the first error data, the first error data can be highlighted in the communication matrix file.

[0090] In some embodiments, step S105 above, which involves checking for second erroneous data in the obtained communication matrix file and correcting the second erroneous data in the target file based on preset data, may include:

[0091] For each item in the communication matrix file, based on preset inspection conditions, second error data is obtained from the data values ​​corresponding to each item, and the second error data is corrected in the target file according to the preset correction strategy corresponding to the preset data and the second error data.

[0092] In this embodiment, different items in the communication matrix file may have different inspection conditions and correction strategies. The second erroneous data can be obtained according to the respective inspection conditions, and the second erroneous data can be corrected according to the preset data and the respective correction strategies.

[0093] It should be noted that, for the same communication matrix file, the process of checking for the first erroneous data in S104 is the same as the process of checking for the second erroneous data in S105. The suggested correction data in S104 is the corrected data for the second erroneous data in S105. Therefore, in the following method, only the checking and correction process for the second erroneous data is described in detail. The process of checking the first erroneous data and providing suggested correction data can be referred to this detailed description.

[0094] In some embodiments, the above-described method for checking each item in the communication matrix file, based on preset check conditions, obtains second erroneous data from the data values ​​corresponding to each item, and corrects the second erroneous data in the target file according to a preset correction strategy corresponding to the preset data and the second erroneous data, including at least one of the following steps one to nineteen. Specifically, for different communication matrix files, steps one to nineteen can be selectively executed based on the items contained in the header row of the communication matrix file.

[0095] Step 1: For the message names and signal names in the communication matrix file, determine whether there are illegal characters in the data values ​​corresponding to the message names and signal names. The data values ​​corresponding to the message names and signal names with illegal characters are taken as the second error data, and the illegal characters in the second error data are deleted in the target file.

[0096] In the communication matrix file, each data value corresponding to an item refers to the data values ​​contained in the column containing that item. For example, the data values ​​corresponding to a message name are the data values ​​contained in the column containing the message name, and the data values ​​corresponding to a signal name are the data values ​​contained in the column containing the signal name.

[0097] Illegal characters can be defined according to actual usage requirements. For example, illegal characters can be any character other than lowercase letters, uppercase letters, numbers, and underscores.

[0098] This embodiment can determine whether there are illegal characters in the data values ​​of the column containing the message name in the communication matrix file, and whether there are illegal characters in the data values ​​of the column containing the signal name. Data values ​​in both the column containing illegal characters and the column containing illegal characters are treated as second-order error data. The correction method is to delete the illegal characters.

[0099] Step 2: For the message name and signal name in the communication matrix file, determine whether the first character of each data value corresponding to the message name and the first character of each data value corresponding to the signal name is a letter. The data values ​​corresponding to the message name and the signal name whose first character is not a letter are taken as the second error data, and a first preset string is added before the first character of the second error data in the target file.

[0100] In the communication matrix file, both message names and signal names begin with a letter. Therefore, the data values ​​corresponding to message names and signal names whose first character is not a letter are treated as second error data. The modification method is to add a first preset string before the first character of each second error data. The first preset string must begin with a letter and can contain at least one character.

[0101] In some possible implementations, it can be pre-set that the first letter of both the message name and the signal name is a capital letter. In this case, the data value corresponding to the message name whose first character is not a capital letter and the data value corresponding to the signal name are used as the second error data, and the first string whose first character is a capital letter.

[0102] Alternatively, it can be preset that the first letter of both the message name and the signal name is a lowercase letter. In this case, the data value corresponding to the message name and the signal name whose first character is not a lowercase letter will be used as the second error data, and the first character of the first string will be a lowercase letter.

[0103] Step 3: For the message names and signal names in the communication matrix file, determine whether there are duplicate values ​​in the data values ​​corresponding to the message names and the signal names. The data values ​​corresponding to the message names and the signal names with duplicate values ​​are taken as the second error data, and the corresponding prefix or suffix is ​​added to the second error data in the target file.

[0104] In the communication matrix file, message names are unique, and all data values ​​corresponding to a message name are unique. Signal names are also unique, and all data values ​​corresponding to a signal name are unique.

[0105] For data values ​​corresponding to message names with duplicate values, a corresponding prefix or suffix can be added to the data value. The prefix or suffix can be a preset string or preset sequence number representing the message sender or message receiver.

[0106] For data values ​​corresponding to signal names with duplicate values, a corresponding prefix or suffix can be added to the data value. The prefix or suffix can be a preset string or preset sequence number representing the signal sender or receiver.

[0107] Step 4: For the message identifier in the communication matrix file, determine whether there are duplicate values ​​among the data values ​​corresponding to the message identifier. The data values ​​corresponding to the message identifiers with duplicate values ​​are taken as the second error data. In the target file, the second error data is modified to an identifier that is different from all the data values ​​corresponding to the message identifier.

[0108] In the communication matrix file, message identifiers are unique. Therefore, data values ​​corresponding to message identifiers with duplicate values ​​can be used as second error data. In the target file, this second error data is modified to a value without duplicates, determined according to the preset encoding method of the message identifier. Here, "without duplicates" means that it does not repeat any other data values ​​corresponding to the message identifiers in the communication matrix file.

[0109] For example, the data value corresponding to the message identifier can be a progressively increasing number. Modifying the second error data to an identifier that is different from all data values ​​corresponding to the message identifier can include:

[0110] The second error data is incremented by 1 to obtain a new identifier. It is then determined whether the new identifier has a duplicate value. If not, the second error data is modified to the new identifier. If it does, the new identifier is incremented by 1 again until the new identifier has no duplicate values. At this point, the second error data is modified to the new identifier with no duplicate values.

[0111] Step 5: For each row in the communication matrix file that defines a message name, if the data value of the message type in that row is empty, then the data value of the message type in that row is treated as the second error data, and in the target file, the data value of the message type in that row is modified to the preset message type. If the data value of the message sending type in that row is empty, then the data value of the message sending type in that row is treated as the second error data, and in the target file, the data value of the message sending type in that row is modified to the preset message sending type.

[0112] In this context, a row with a defined message name is one where the data value corresponding to the message name in that row is not empty. Since a message may contain multiple signals, the message name is defined only in the row containing the first signal of the message; message names are not defined in the rows containing signals other than the first signal in that row.

[0113] For a row that has a defined message name, the data values ​​corresponding to its message type and message sending type must not be empty; if they are empty, an error occurs.

[0114] The preset message type and preset message sending type can be set according to actual needs, and no specific restrictions are imposed here.

[0115] Step 6: For each row in the communication matrix file that defines a message name, if the data value of the message sending type in that row is Cycle and the data value of the message cycle time in that row is empty, then the data value of the message cycle time in that row is taken as the second error data, and in the target file, the data value of the message cycle time in that row is modified to the preset cycle duration.

[0116] Cycle refers to periodicity. If the message sending type is periodic, then it must have a message period time. That is, the data value corresponding to the message period time should not be empty. If it is empty, then there is an error.

[0117] The preset cycle duration can be set according to actual needs, and there are no specific restrictions here. For example, it can be 100, etc.

[0118] Step 7: For at least one of the message identifier, bus minimum value, bus maximum value, initial value, invalid value and non-enabled value in the communication matrix file, determine whether the data value corresponding to the at least one item is a hexadecimal number or empty. The data value corresponding to the at least one item that is neither a hexadecimal number nor empty is taken as the second error data, and the second error data is modified to the corresponding hexadecimal number in the target file.

[0119] In the communication matrix file, the data values ​​corresponding to message identifier, bus minimum value, bus maximum value, initial value, invalid value and non-enabled value should all be hexadecimal numbers or empty. If they are not hexadecimal numbers and are not empty, then there is an error. The erroneous data value can be converted to the corresponding hexadecimal number.

[0120] In some possible implementations, for the message identifier, bus minimum value, bus maximum value, initial value, invalid value, and disabled value in the communication matrix file, it is determined whether the data value corresponding to each of the message identifier, bus minimum value, bus maximum value, initial value, invalid value, and disabled value is a hexadecimal number or empty. The data values ​​corresponding to the message identifier, bus minimum value, bus maximum value, initial value, invalid value, and disabled value that are not hexadecimal numbers and are not empty are taken as second error data, and in the target file, the second error data is modified to the corresponding hexadecimal number.

[0121] Step 8: For at least one of the following in the communication matrix file: PGN, message period time, message length, start byte, start bit, SPN, signal length, precision, offset, physical minimum value, physical maximum value, message transmission fast period, number of fast message transmissions, and message delay time, determine whether the data value corresponding to the at least one item is a decimal number or empty. The data value corresponding to the at least one item that is neither a decimal number nor empty is taken as the second error data, and in the target file, the second error data is modified to the corresponding decimal number.

[0122] In the communication matrix file, the data values ​​corresponding to PGN, message cycle time, message length, start byte, start bit, SPN, signal length, precision, offset, physical minimum value, physical maximum value, message transmission fast cycle, number of fast message transmissions, and message delay time should all be decimal numbers or empty. If they are not decimal numbers and are not empty, then there is an error, and the erroneous data values ​​can be converted to the corresponding decimal numbers.

[0123] In some possible implementations, for the PGN, message cycle time, message length, start byte, start bit, SPN, signal length, precision, offset, physical minimum value, physical maximum value, message transmission fast cycle, number of fast message transmissions, and message delay time in the communication matrix file, it is determined whether the data values ​​corresponding to each of the following are decimal numbers or empty. The data values ​​corresponding to each of the following data that are not decimal numbers and are not empty are taken as second error data, and in the target file, the second error data is modified to the corresponding decimal number.

[0124] Step 9: For the message length in the communication matrix file, determine whether the data values ​​corresponding to the message length are 0 or outside the preset message length value range. Take the data values ​​corresponding to the message length that are 0 or outside the preset message length value range as the second error data. In the target file, modify the second error data to the preset message length value or the message length value determined according to the last signal in the message containing the second error data.

[0125] In the communication matrix file, the message length has a corresponding preset message length value range. The data value corresponding to the message length should be within the preset message length value range and not be 0. If it is 0 or outside the preset message length value range, it is an error. The second error data can be modified to the preset message length value or the message length value determined according to the last signal in the message where the second error data is located.

[0126] The preset message length value is a non-zero value within the preset message length range, such as 8. The message length value determined by the last signal in the message containing the second error data can be the sum of the start bit and the length of the last signal, divided by 8, and then rounded up.

[0127] Step 10: For the signal length in the communication matrix file, determine whether the data values ​​corresponding to the signal length are 0 or outside the preset signal length value range. If the data values ​​corresponding to the signal length that are 0 or outside the preset signal length value range are 0, they are taken as the second error data. In the target file, the second error data is modified to the signal length value determined according to the data value corresponding to the maximum bus value.

[0128] In the communication matrix file, the signal length has a corresponding preset signal length value range. The data value corresponding to the signal length should be within the preset signal length value range and not be 0. If it is 0 or outside the preset signal length value range, it is an error. The second error data can be modified to the signal length value determined according to the data value corresponding to the maximum bus value.

[0129] For example, if a data value corresponding to the signal length is a second erroneous data value, the data value corresponding to the maximum bus value in the row containing that data value can be obtained, and the target signal length value corresponding to that maximum bus value can be obtained by looking up a table. This table stores the correspondence between the maximum bus value and the signal length value.

[0130] Step 11: For the message cycle time in the communication matrix file, determine whether the data values ​​corresponding to each message cycle time are numbers greater than 0 or empty. The data values ​​corresponding to the message cycle time that are neither greater than 0 nor empty are taken as the second error data, and in the target file, the second error data is modified to the preset message cycle time.

[0131] In the communication matrix file, the data value corresponding to the message cycle time should be a number greater than 0 or empty. If it is a number not greater than 0 or a non-numeric value, it is an error and can be modified to the preset message cycle time.

[0132] The preset message cycle time can be set according to actual needs, and there are no specific restrictions here. For example, it can be 100, etc.

[0133] Step 12: For at least one of the start byte, start bit, and bus minimum value in the communication matrix file, determine whether the data value corresponding to the at least one item is a number greater than or equal to 0. The data value corresponding to the at least one item that is not a number greater than or equal to 0 is taken as the second error data, and the second error data is modified to the corresponding preset default number in the target file.

[0134] In the communication matrix file, the data values ​​corresponding to the start byte, start bit, and bus minimum value should all be numbers greater than or equal to 0. If they are numbers less than 0 or non-numeric, it is an error and can be modified to the corresponding preset default numbers.

[0135] The default numbers corresponding to the start byte, start bit, and bus minimum value can be the same or different, and can be set according to actual needs. For example, they can all be 0.

[0136] Step 13: For the precision in the communication matrix file, determine whether the data values ​​corresponding to the precision are non-zero numbers. The data values ​​corresponding to the precision that are zero or non-numeric are taken as the second error data, and the second error data is modified to the preset precision value in the target file.

[0137] In the communication matrix file, all data values ​​corresponding to the precision should be non-zero numbers. If they are 0 or non-numeric, it is an error and can be modified to the preset precision value.

[0138] The preset precision value can be set according to actual needs; for example, it can be 1.

[0139] Step fourteen: For the offsets in the communication matrix file, determine whether the data values ​​corresponding to the offsets are empty. Take the data values ​​corresponding to the empty offsets as the second error data, and modify the second error data to the preset offset value in the target file.

[0140] In the communication matrix file, the data values ​​corresponding to the offsets should not be empty. If they are empty, an error occurs, and they can be modified to the preset offset values. The preset offset values ​​can be set according to actual needs; for example, they can be 0.

[0141] Step 15: For each row in the communication matrix file, determine whether the row satisfies ZXX = (WLX × G) + A and ZXD = (WLD × G) + A. If not, determine the second erroneous data based on the preset trust method, and modify the second erroneous data in the target file according to the preset trust method. Wherein, ZXX is the data value of the minimum bus value of the row, WLX is the data value of the minimum physical value of the row, G is the data value of the precision of the row, A is the data value of the offset of the row, ZXD is the data value of the maximum bus value of the row, and WLD is the data value of the maximum physical value of the row.

[0142] In the communication matrix file, the following conditions should be met: minimum bus value = (minimum physical value * precision) + offset and maximum bus value = (maximum physical value * precision) + offset. If these conditions are not met, an error will occur. The error can be determined based on the preset trust method, whether it is an error in the bus maximum or the physical ...

[0143] If the preset trust method is the preset trust physical maximum value, then if a row does not satisfy ZXX=(WLX×G)+A, the data value of the minimum bus value of that row is determined to be the second erroneous data, and it is modified to the correct minimum bus value calculated according to the formula; if a row does not satisfy ZXD=(WLD×G)+A, the data value of the maximum bus value of that row is determined to be the second erroneous data, and it is modified to the correct maximum bus value calculated according to the formula.

[0144] If the preset trust method is the preset trust bus minimum value, then if a row does not satisfy ZXX = (WLX × G) + A, the data value of the physical minimum value of that row is determined to be the second erroneous data, and it is modified to the correct physical minimum value calculated according to physical minimum value = (bus minimum value - offset) / precision; if a row does not satisfy ZXD = (WLD × G) + A, then the data value of the physical maximum value of that row is determined to be the second erroneous data, and it is modified to the correct physical maximum value calculated according to physical maximum value = (bus maximum value - offset) / precision.

[0145] Step sixteen: For each row in the communication matrix file, determine whether the row satisfies the formula ZXD = 2. L If the condition is not met, the data value of the signal length of that row or the data value of the maximum bus value of that row will be used as the second error data. In the target file, the second error data will be modified so that the modified data satisfies the formula; where L is the data value of the signal length of that row.

[0146] In the communication matrix file, each row of data should satisfy ZXD = 2. L If the condition is not met, then the data value of the signal length in that row or the data value of the maximum bus value in that row is incorrect. The incorrect data is then corrected to make the data in that row satisfy the formula. For example, a trust mode can be preset. If the maximum bus value is trusted, then the data value of the signal length in that row is determined to be incorrect, and the data value of the signal length in that row is corrected to satisfy the formula; if the signal length value is trusted, then the data value of the maximum bus value in that row is determined to be incorrect, and the data value of the maximum bus value in that row is corrected to satisfy the formula.

[0147] Step 17: For each line in the communication matrix file, determine whether the data value of the starting byte of the line is greater than or equal to the data value of the starting byte of the previous line in the corresponding message, and less than or equal to the data value of the message length corresponding to the corresponding message. If not, the data value of the starting byte of the line is taken as the second error data, and in the target file, the data value of the starting byte of the line is modified to the data value of the starting byte of the previous line.

[0148] In the communication matrix file, for each signal in the same message, the data of the starting byte should be continuous line by line, the data can be repeated, and the data should be less than or equal to the message length. If not, there is an error, and the error value can be modified to the data value of the starting byte of the previous line.

[0149] Step 18: For each row in the communication matrix file, determine whether the data value of the start bit of the row is greater than or equal to the sum of the data value of the start bit of the previous row in the corresponding message and the data value of the signal length of the previous row. If not, treat the data value of the start bit of the row as the second error data, and in the target file, modify the data value of the start bit of the row to the sum of the data value of the start bit of the previous row in the corresponding message and the data value of the signal length of the previous row.

[0150] In the communication matrix file, for each signal in the same message, except for the signals in the first row of the message, the following conditions must be met: the start bit of the nth row ≥ the start bit of the (n-1)th row + the signal length of the (n-1)th row. 2 ≤ n ≤ the number of signals contained in the message. If this condition is not met, an error occurs, and the start bit value of that row can be modified to the sum of the start bit value of the previous row in the corresponding message and the signal length of that previous row.

[0151] Step 19: For each row in the communication matrix file, determine whether the data value of the starting byte of the row is equal to the value obtained by dividing the data value of the starting position of the row by 8 and then rounding it down. If not, then take the data value of the starting byte of the row or the data value of the starting position of the row as the second error data, and modify the data value of the starting byte of the row or the data value of the starting position of the row in the target file so that the data value of the starting byte of the row is equal to the value obtained by dividing the data value of the starting position of the row by 8 and then rounding it down.

[0152] In the communication matrix file, each row of data should satisfy the condition that the starting byte = [starting bit / 8], where [] represents the rounding operation. If this condition is not met, an error is identified. The data value of the starting byte or the data value of the starting bit of that row can be used as the second erroneous data, and this second erroneous data can be modified to ensure that the data in that row satisfies the condition that the starting byte = [starting bit / 8]. For example, a trust mode can be preset. If the starting byte is trusted, the data value of the starting bit of that row is determined to be incorrect, and the data value of the starting bit of that row is modified to satisfy the condition that the starting byte = [starting bit / 8]. If the starting bit is trusted, the data value of the starting byte of that row is determined to be incorrect, and the data value of the starting byte of that row is modified to satisfy the condition that the starting byte = [starting bit / 8].

[0153] The error correction method for the communication matrix provided in this embodiment can be implemented using VBA, MATLAB, or Python.

[0154] The error correction method for the communication matrix in this application can check for errors in the communication matrix file, automatically correct errors according to different preset correction methods, and generate a communication matrix file after error correction. It can also indicate the location of the error data, the data before correction, and the data after correction. This can improve the development efficiency of CAN / LIN communication protocols, reduce the error rate, shorten the R&D cycle, reduce R&D costs, and improve vehicle reliability.

[0155] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0156] The following are device embodiments of this application. For details not described in detail, please refer to the corresponding method embodiments described above.

[0157] Figure 2 A schematic diagram of the error correction device for a communication matrix provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown, and are described in detail below:

[0158] like Figure 2 As shown, the error correction device 30 for the communication matrix includes: a first acquisition module 31, a second acquisition module 32, a third acquisition module 33, an inspection module 34, and an inspection and correction module 35.

[0159] The first acquisition module 31 is used to acquire the communication matrix file;

[0160] The second acquisition module 32 is used to acquire the error correction mode;

[0161] The third acquisition module 33 is used to acquire preset data required for error correction.

[0162] The inspection module 34 is used to check the first error data in the communication matrix file if the error correction mode is the error-only inspection mode, and to display the position of the first error data, the first error data, and the suggested correction data corresponding to the first error data in the preset information prompt area;

[0163] The inspection and correction module 35 is used to check the second error data in the communication matrix file if the error correction mode is the inspection and correction error mode, and correct the second error data in the target file based on preset data, and highlight the second error data and / or the data after the second error data is corrected; the target file is the communication matrix file or a copy of the communication matrix file.

[0164] In one possible implementation, the check and correction module 35 can also be used for:

[0165] The location of the second error data, the second error data, and the corrected data are displayed in the preset information prompt area.

[0166] In one possible implementation, the inspection module 34 can also be used for:

[0167] In the communication matrix file, the first erroneous data is highlighted.

[0168] In one possible implementation, the checking and correction module 35 is specifically used for:

[0169] For each item in the communication matrix file, based on preset inspection conditions, second error data is obtained from the data values ​​corresponding to each item, and the second error data is corrected in the target file according to the preset correction strategy corresponding to the preset data and the second error data.

[0170] In one possible implementation, the inspection and correction module 35 is specifically used to implement at least one of the following steps:

[0171] For the message names and signal names in the communication matrix file, determine whether there are illegal characters in the data values ​​corresponding to the message names and signal names. If there are illegal characters, the data values ​​corresponding to the message names and signal names are taken as the second error data. In the target file, the illegal characters in the second error data are deleted.

[0172] For message names and signal names in the communication matrix file, determine whether the first character of each data value corresponding to the message name and each data value corresponding to the signal name is a letter. If the first character of the data value corresponding to the message name and the signal name is not a letter, take the data value corresponding to the message name and the data value corresponding to the signal name as the second error data, and add the first preset string before the first character of the second error data in the target file.

[0173] For message names and signal names in the communication matrix file, determine whether there are duplicate values ​​in each data value corresponding to the message name and the signal name. The data values ​​corresponding to the message name and the signal name with duplicate values ​​are taken as second error data, and the corresponding prefix or suffix is ​​added to the second error data in the target file.

[0174] For message identifiers in the communication matrix file, determine whether there are duplicate values ​​among the data values ​​corresponding to the message identifiers. If there are duplicate values, use the data values ​​corresponding to the message identifiers as the second error data. In the target file, modify the second error data to an identifier that is different from all the data values ​​corresponding to the message identifiers.

[0175] For each row in the communication matrix file that defines a message name, if the data value of the message type in that row is empty, then the data value of the message type in that row is treated as the second error data, and in the target file, the data value of the message type in that row is modified to the preset message type. If the data value of the message sending type in that row is empty, then the data value of the message sending type in that row is treated as the second error data, and in the target file, the data value of the message sending type in that row is modified to the preset message sending type.

[0176] For each row in the communication matrix file that defines a message name, if the data value of the message sending type in that row is Cycle and the data value of the message cycle time in that row is empty, then the data value of the message cycle time in that row is taken as the second error data, and in the target file, the data value of the message cycle time in that row is modified to the preset cycle duration.

[0177] For at least one of the message identifier, bus minimum value, bus maximum value, initial value, invalid value and non-enabled value in the communication matrix file, determine whether the data value corresponding to the at least one item is a hexadecimal number or empty. If the data value corresponding to the at least one item is not a hexadecimal number and is not empty, take it as the second error data and modify the second error data to the corresponding hexadecimal number in the target file.

[0178] For at least one of the following in the communication matrix file: PGN, message period time, message length, start byte, start bit, SPN, signal length, precision, offset, physical minimum value, physical maximum value, message transmission fast period, number of fast message transmissions, and message delay time, determine whether the data value corresponding to the at least one item is a decimal number or empty. If the data value corresponding to the at least one item is neither a decimal number nor empty, take it as the second error data and modify it to the corresponding decimal number in the target file.

[0179] For the message length in the communication matrix file, determine whether each data value corresponding to the message length is 0 or outside the preset message length value range. If the data value corresponding to the message length is 0 or outside the preset message length value range, take it as the second error data. In the target file, modify the second error data to the preset message length value or the message length value determined according to the last signal in the message containing the second error data.

[0180] For the signal length in the communication matrix file, determine whether the data values ​​corresponding to the signal length are 0 or outside the preset signal length value range. If the data values ​​corresponding to the signal length are 0 or outside the preset signal length value range, use them as the second error data. In the target file, modify the second error data to the signal length value determined according to the data value corresponding to the maximum bus value.

[0181] For the message cycle time in the communication matrix file, determine whether the data values ​​corresponding to each message cycle time are numbers greater than 0 or empty. The data values ​​corresponding to the message cycle time that are neither greater than 0 nor empty are taken as the second error data, and the second error data is modified to the preset message cycle time in the target file.

[0182] For at least one of the start byte, start bit and bus minimum value in the communication matrix file, determine whether the data value corresponding to the at least one item is a number greater than or equal to 0. If the data value corresponding to the at least one item is not a number greater than or equal to 0, take the data value corresponding to the at least one item as the second error data, and modify the second error data to the corresponding preset default number in the target file.

[0183] Regarding the precision in the communication matrix file, determine whether the data values ​​corresponding to the precision are non-zero numbers. Use the data values ​​corresponding to the precision that are zero or non-numeric as the second error data, and modify the second error data to the preset precision value in the target file.

[0184] For the offset in the communication matrix file, determine whether the data values ​​corresponding to the offset are empty. If the data values ​​corresponding to the empty offset are empty, take them as the second error data and modify them to the preset offset values ​​in the target file.

[0185] For each row in the communication matrix file, determine whether the row satisfies ZXX = (WLX × G) + A and ZXD = (WLD × G) + A. If not, determine the second erroneous data based on the preset trust method, and modify the second erroneous data in the target file according to the preset trust method. Wherein, ZXX is the data value of the minimum bus value of the row, WLX is the data value of the minimum physical value of the row, G is the data value of the precision of the row, A is the data value of the offset of the row, ZXD is the data value of the maximum bus value of the row, and WLD is the data value of the maximum physical value of the row.

[0186] For each row in the communication matrix file, determine whether the row satisfies the formula ZXD = 2. L If the condition is not met, the data value of the signal length of that row or the data value of the maximum bus value of that row will be used as the second error data. In the target file, the second error data will be modified so that the modified data satisfies the formula; where L is the data value of the signal length of that row.

[0187] For each line in the communication matrix file, determine whether the data value of the starting byte of the line is greater than or equal to the data value of the starting byte of the previous line in the corresponding message, and less than or equal to the data value of the message length corresponding to the corresponding message. If not, the data value of the starting byte of the line is taken as the second error data, and in the target file, the data value of the starting byte of the line is modified to the data value of the starting byte of the previous line.

[0188] For each row in the communication matrix file, determine whether the data value of the start bit of the row is greater than or equal to the sum of the data value of the start bit of the previous row in the corresponding message and the data value of the signal length of the previous row. If not, treat the data value of the start bit of the row as the second error data, and in the target file, modify the data value of the start bit of the row to the sum of the data value of the start bit of the previous row in the corresponding message and the data value of the signal length of the previous row.

[0189] For each row in the communication matrix file, determine whether the data value of the starting byte of the row is equal to the value obtained by dividing the data value of the starting position of the row by 8 and then rounding it down. If not, then the data value of the starting byte of the row or the data value of the starting position of the row is regarded as the second error data. In the target file, modify the data value of the starting byte of the row or the data value of the starting position of the row so that the data value of the starting byte of the row is equal to the value obtained by dividing the data value of the starting position of the row by 8 and then rounding it down.

[0190] In one possible implementation, the communication matrix file is either a CAN communication matrix file or a LIN communication matrix file.

[0191] This application also provides a computer program product having program code that, when run in a corresponding processor, controller, computing device, or terminal, executes the steps in any of the above-described communication matrix error correction method embodiments, for example... Figure 1 S101 to S105 are shown. Those skilled in the art will understand that the methods and apparatus proposed in the embodiments of this application can be implemented in various forms, including hardware, software, firmware, dedicated processors, or combinations thereof. Dedicated processors may include application-specific integrated circuits (ASICs), reduced instruction set computers (RISCs), and / or field-programmable gate arrays (FPGAs). The proposed methods and apparatus are preferably implemented as a combination of hardware and software. The software is preferably installed as an application program on a program storage device. This is typically based on a machine with a computer platform, such as one or more central processing units (CPUs), random access memory (RAM), and one or more input / output (I / O) interfaces. An operating system is also typically installed on the computer platform. The various processes and functions described herein may be part of an application program, or a portion thereof may be executed by an operating system.

[0192] Figure 3 This is a schematic diagram of the terminal provided in an embodiment of this application. For example... Figure 3 As shown, the terminal 4 in this embodiment includes a processor 40 and a memory 41. The memory 41 stores a computer program 42, and the processor 40 calls and runs the computer program 42 stored in the memory 41 to execute the steps in the error correction method embodiments of the various communication matrices described above, for example... Figure 1 S101 to S105 are shown. Alternatively, the processor 40 is used to call and run the computer program 42 stored in the memory 41 to implement the functions of each module / unit in the above-described device embodiments, for example... Figure 2 The functions of modules / units 31 to 35 shown.

[0193] For example, the computer program 42 can be divided into one or more modules / units, which are stored in the memory 41 and executed by the processor 40 to complete / implement the solution provided in this application. The one or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 42 in the terminal 4. For example, the computer program 42 can be divided into... Figure 2 Modules / units 31 to 35 are shown.

[0194] Terminal 4 may include, but is not limited to, processor 40 and memory 41. Those skilled in the art will understand that... Figure 3 This is merely an example of terminal 4 and does not constitute a limitation on terminal 4. It may include more or fewer components than shown, or combine certain components, or different components. For example, the terminal may also include input / output devices, network access devices, buses, etc.

[0195] The processor 40 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0196] The memory 41 can be an internal storage unit of the terminal 4, such as a hard disk or memory of the terminal 4. The memory 41 can also be an external storage device of the terminal 4, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the terminal 4. Furthermore, the memory 41 can include both internal storage units and external storage devices of the terminal 4. The memory 41 is used to store the computer program and other programs and data required by the terminal. The memory 41 can also be used to temporarily store data that has been output or will be output.

[0197] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0198] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0199] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0200] In the embodiments provided in this application, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0201] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0202] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0203] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-described embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the error correction method embodiments for each of the above-described communication matrices. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately added to or subtracted from the content as required by the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium may not include electrical carrier signals and telecommunication signals.

[0204] Furthermore, the features of the embodiments shown in the accompanying drawings or the various embodiments mentioned in this specification should not be construed as independent embodiments. Rather, each feature described in one example of an embodiment can be combined with one or more other desired features from other embodiments to produce other embodiments not described in words or with reference to the accompanying drawings.

[0205] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for error correction of a communication matrix, characterized in that, include: Obtain the communication matrix file; Get error correction mode; Obtain the preset data required for error correction; If the error correction mode is the error-only check mode, then the first error data in the communication matrix file is checked and obtained, and the location of the first error data, the first error data, and the suggested correction data corresponding to the first error data are displayed in the preset information prompt area; If the error correction mode is the error check and correction mode, then the second error data in the communication matrix file is checked and obtained, and based on the preset data, the second error data is corrected in the target file, and the second error data and / or the data after the second error data is corrected are highlighted; The target file is the communication matrix file or a copy of the communication matrix file; The step of correcting the second erroneous data in the target file includes: determining whether each row in the communication matrix file satisfies the following conditions: and If the conditions are not met, then the error is determined whether it is a bus maximum / minimum error or a physical maximum / minimum error based on the preset trust method. A second error data is then determined based on the preset trust method, and this second error data is modified in the target file according to the preset trust method. This is the minimum data value of the bus in that row. The data value representing the physical minimum value of that row. This represents the precision of the data value for that row. This is the data value at the offset of that row. This is the maximum data value of the bus in that row. This is the data value representing the physical maximum value of this row.

2. The error correction method for a communication matrix according to claim 1, characterized in that, If the error correction mode is an error checking and correction mode, the error correction method for the communication matrix further includes: The location of the second error data, the second error data, and the corrected data for the second error data are displayed in the preset information prompt area.

3. The error correction method for a communication matrix according to claim 1, characterized in that, If the error correction mode is an error-only check mode, the error correction method for the communication matrix further includes: In the communication matrix file, the first erroneous data is highlighted.

4. The error correction method for a communication matrix according to claim 1, characterized in that, The inspection obtains second erroneous data in the communication matrix file, and based on the preset data, corrects the second erroneous data in the target file, including: For each item in the communication matrix file, based on preset inspection conditions, second error data is obtained from the data values ​​corresponding to each item, and the second error data is corrected in the target file according to the preset data and the preset correction strategy corresponding to the second error data.

5. The error correction method for a communication matrix according to claim 4, characterized in that, For each item in the communication matrix file, based on preset inspection conditions, second erroneous data is obtained from the data values ​​corresponding to each item. Then, according to the preset data and the preset correction strategy corresponding to the second erroneous data, the second erroneous data is corrected in the target file, including at least one of the following steps: For the message name and signal name in the communication matrix file, determine whether there are illegal characters in each data value corresponding to the message name and each data value corresponding to the signal name. If there are illegal characters in the data values ​​corresponding to the message name and the signal name, they are taken as second error data and the illegal characters in the second error data are deleted in the target file. For the message name and signal name in the communication matrix file, determine whether the first character of each data value corresponding to the message name and each data value corresponding to the signal name is a letter. If the first character of the data value corresponding to the message name and the data value corresponding to the signal name is not a letter, take them as second error data and add a first preset string before the first character of the second error data in the target file. For the message name and signal name in the communication matrix file, determine whether there are duplicate values ​​in each data value corresponding to the message name and whether there are duplicate values ​​in each data value corresponding to the signal name. The data values ​​corresponding to the message name and the data values ​​corresponding to the signal name with duplicate values ​​are taken as second error data, and a corresponding prefix or suffix is ​​added to the second error data in the target file. For the message identifier in the communication matrix file, determine whether there are duplicate values ​​among the data values ​​corresponding to the message identifier. If there are duplicate values, the data values ​​corresponding to the message identifier are taken as second error data. In the target file, the second error data is modified to an identifier that is different from all the data values ​​corresponding to the message identifier. For each row in the communication matrix file that defines a message name, if the data value of the message type in that row is empty, then the data value of the message type in that row is treated as second error data, and in the target file, the data value of the message type in that row is modified to the preset message type. If the data value of the message sending type in that row is empty, then the data value of the message sending type in that row is treated as second error data, and in the target file, the data value of the message sending type in that row is modified to the preset message sending type. For each row in the communication matrix file that defines a message name, if the data value of the message sending type in that row is Cycle and the data value of the message cycle time in that row is empty, then the data value of the message cycle time in that row is taken as the second error data, and in the target file, the data value of the message cycle time in that row is modified to the preset cycle duration. For at least one of the message identifier, bus minimum value, bus maximum value, initial value, invalid value and non-enabled value in the communication matrix file, determine whether the data value corresponding to the at least one item is a hexadecimal number or empty. If the data value corresponding to the at least one item is not a hexadecimal number and is not empty, take it as the second error data and modify the second error data to the corresponding hexadecimal number in the target file. For at least one of the following in the communication matrix file: PGN, message period time, message length, start byte, start bit, SPN, signal length, precision, offset, physical minimum value, physical maximum value, message transmission fast period, number of fast message transmissions, and message delay time, determine whether the data value corresponding to the at least one item is a decimal number or empty. If the data value corresponding to the at least one item is neither a decimal number nor empty, take it as the second error data and modify it to the corresponding decimal number in the target file. For the message length in the communication matrix file, determine whether each data value corresponding to the message length is 0 or outside the preset message length value range. If the data value corresponding to the message length is 0 or outside the preset message length value range, take it as the second error data. In the target file, modify the second error data to the preset message length value or the message length value determined according to the last signal in the message containing the second error data. For the signal length in the communication matrix file, determine whether each data value corresponding to the signal length is 0 or outside the preset signal length value range. If the data value corresponding to the signal length is 0 or outside the preset signal length value range, take it as the second error data. In the target file, modify the second error data to the signal length value determined according to the data value corresponding to the maximum bus value. For the message cycle time in the communication matrix file, determine whether the data values ​​corresponding to the message cycle time are numbers greater than 0 or empty. The data values ​​corresponding to the message cycle time that are neither greater than 0 nor empty are taken as second error data, and the second error data is modified to the preset message cycle time in the target file. For at least one of the start byte, start bit, and bus minimum value in the communication matrix file, determine whether the data value corresponding to the at least one item is a number greater than or equal to 0. If the data value corresponding to the at least one item is not a number greater than or equal to 0, take the data value corresponding to the at least one item as the second error data, and modify the second error data to the corresponding preset default number in the target file. Regarding the precision in the communication matrix file, it is determined whether each data value corresponding to the precision is a non-zero number. Data values ​​corresponding to the precision that are zero or non-zero are taken as second error data, and the second error data is modified to the preset precision value in the target file. For the offset in the communication matrix file, determine whether the data values ​​corresponding to the offset are empty. If the data values ​​corresponding to the empty offset are empty, take them as second error data and modify them to the preset offset value in the target file. For each row in the communication matrix file, determine whether the row satisfies the formula. If the condition is not met, the data value of the signal length of that row or the data value of the maximum bus value of that row will be used as the second error data. In the target file, this second error data will be modified so that the modified data satisfies the formula. This is the data value representing the signal length of that row; For each row in the communication matrix file, determine whether the data value of the starting byte of the row is greater than or equal to the data value of the starting byte of the previous row in the corresponding message, and less than or equal to the data value of the message length corresponding to the corresponding message. If not, the data value of the starting byte of the row is taken as the second error data, and in the target file, the data value of the starting byte of the row is modified to the data value of the starting byte of the previous row. For each row in the communication matrix file, determine whether the data value of the start bit of the row is greater than or equal to the sum of the data value of the start bit of the previous row in the corresponding message and the data value of the signal length of the previous row. If not, the data value of the start bit of the row is taken as the second error data, and in the target file, the data value of the start bit of the row is modified to the sum of the data value of the start bit of the previous row in the corresponding message and the data value of the signal length of the previous row. For each row in the communication matrix file, determine whether the data value of the starting byte of the row is equal to the value obtained by dividing the data value of the starting position of the row by 8 and then rounding it down. If not, then the data value of the starting byte of the row or the data value of the starting position of the row is regarded as the second error data. In the target file, modify the data value of the starting byte of the row or the data value of the starting position of the row so that the data value of the starting byte of the row is equal to the value obtained by dividing the data value of the starting position of the row by 8 and then rounding it down.

6. The error correction method for a communication matrix according to any one of claims 1 to 5, characterized in that, The communication matrix file is either a CAN communication matrix file or a LIN communication matrix file.

7. An error correction device for a communication matrix, characterized in that, include: The first acquisition module is used to acquire the communication matrix file; The second acquisition module is used to acquire the error correction mode; The third acquisition module is used to acquire the preset data required for error correction. The inspection module is used to inspect and obtain the first error data in the communication matrix file if the error correction mode is the error-only inspection mode, and display the position of the first error data, the first error data, and the suggested correction data corresponding to the first error data in the preset information prompt area; The inspection and correction module is used to check and obtain the second error data in the communication matrix file if the error correction mode is the inspection and correction error mode, and correct the second error data in the target file based on the preset data, and highlight the second error data and / or the data after the second error data is corrected; The target file is the communication matrix file or a copy thereof; the checking and correction module is specifically used to: when correcting the second erroneous data in the target file, determine whether each line in the communication matrix file meets the following conditions. and If the conditions are not met, then the error is determined whether it is a bus maximum / minimum error or a physical maximum / minimum error based on the preset trust method. A second error data is then determined based on the preset trust method, and this second error data is modified in the target file according to the preset trust method. This is the minimum data value of the bus in that row. The data value representing the physical minimum value of that row. This represents the precision of the data value for that row. This is the data value at the offset of that row. This is the maximum data value of the bus in that row. This is the data value representing the physical maximum value of this row.

8. The error correction device for a communication matrix according to claim 7, characterized in that, The inspection and correction module is also used for: The location of the second error data, the second error data, and the corrected data for the second error data are displayed in the preset information prompt area.

9. A terminal, characterized in that, The terminal includes a memory and a processor. The memory is used to store computer programs, and the processor is used to call and run the computer programs stored in the memory to perform the error correction method for the communication matrix as described in any one of claims 1 to 6.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the error correction method for the communication matrix as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data conversion method and device

    CN108829647A

  • Error detection method for CAN communication matrix of automobile

    CN112468369A