CN115333893B - CAN communication matrix error correction method - Google Patents

CAN communication matrix error correction method Download PDF

Info

Publication number
CN115333893B
CN115333893B CN202210774128.8A CN202210774128A CN115333893B CN 115333893 B CN115333893 B CN 115333893B CN 202210774128 A CN202210774128 A CN 202210774128A CN 115333893 B CN115333893 B CN 115333893B
Authority
CN
China
Prior art keywords
space
signal
communication matrix
error correction
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210774128.8A
Other languages
Chinese (zh)
Other versions
CN115333893A (en
Inventor
韩嵩嵬
雷永富
杨华
陶华胜
赵松岭
吴浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chery Automobile Co Ltd
Original Assignee
Chery Commercial Vehicle Anhui Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chery Commercial Vehicle Anhui Co Ltd filed Critical Chery Commercial Vehicle Anhui Co Ltd
Priority to CN202210774128.8A priority Critical patent/CN115333893B/en
Publication of CN115333893A publication Critical patent/CN115333893A/en
Application granted granted Critical
Publication of CN115333893B publication Critical patent/CN115333893B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40267Bus for use in transportation systems
    • H04L2012/40273Bus for use in transportation systems the transportation system being a vehicle
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

The invention discloses a CAN communication matrix error correction method, which comprises the following steps: selecting a CAN communication matrix file to be checked for error correction, caching the CAN communication matrix file in a memory, and then entering an error correction checking step; in the error correction checking step, the CAN communication matrix file is traversed, the space is identified, and after the space is identified, the reminding of the existence of the space is given. The invention has the advantages that: the CAN communication matrix is checked through software or defined functions, so that the error of the CAN communication matrix CAN be checked quickly, reminding CAN be sent out timely, meanwhile, the checking efficiency is high, and the checking result is accurate and reliable.

Description

CAN communication matrix error correction method
Technical Field
The invention relates to the field of automobile communication, in particular to an error correction method of a CAN communication matrix.
Background
CAN is an abbreviation for controller area network (Controller Area Network, CAN) developed by the germany BOSCH company known as developing and producing automotive electronics, and eventually becomes the international standard (ISO 11898), one of the most widely used fieldbuses internationally. As CAN bus communication technology is widely applied to various automobiles, CAN communication matrices become more and more complex. In the development process of the CAN communication matrix, writing errors and calculation errors often occur, how to realize timely checking and quick query of the errors is important for developing the CAN, the system communication errors are caused by the wrong writing and calculation, and the traditional method is manually checked, and the conditions of negligence, omission errors and the like of the checking are caused by the uncertainty of the manual checking.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, and provides a CAN communication matrix error correction method which is used for correcting the CAN communication matrix in a function automatic correction mode, so that the efficiency is improved and the errors are reduced.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows: a CAN communication matrix error correction method comprising:
selecting a CAN communication matrix file to be checked for error correction, caching the CAN communication matrix file in a memory, and then entering an error correction checking step;
in the error correction checking step, the CAN communication matrix file is traversed, the space is identified, and after the space is identified, the reminding of the existence of the space is given.
Traversing the CAN communication matrix file to identify the space comprises the following steps:
defining regex. Matches function to check the space number of the cells in the CAN communication matrix file, adopting regex. Matches function to read the space number of the cells for each cell in the CAN communication matrix file and assign the space number to the variable NUM, judging whether the space exists or not by judging whether the variable NUM return value is larger than 0 after checking one cell, judging that the space exists if the variable NUM return value is larger than 0, otherwise judging that the space does not exist, and entering the cell in the next CAN communication matrix file to check the space.
And when space checking is carried out, traversing all cells from the first row and the first column of cells to the 999 th row and the 19 th column of cells in the CAN communication matrix file in a mode of respectively and sequentially circularly controlling.
Defining a replay function: for replacing the space character with an underlined character "_"; when a space exists in a cell is judged by the NUM return value, all the spaces in the cell are replaced by underlined conforming to "_" by running a Replace function.
In the error correction checking step, overlapping screening is performed on the signal bits and a signal bit screening result is given, wherein the signal bit screening comprises:
converting the message Motorola format sequence in the CAN communication matrix file into a natural sequence, adding the signal start bit of the natural sequence and the corresponding signal length, and judging the signal filling error if the signal start bit exceeds 63.
In the error correction checking step, signal names in cells corresponding to signal names of the CAN communication matrix list are respectively read into defined Str1 and Str2 variables, any two signal names are read into the Str1 and Str2 variables in a cyclic comparison mode for comparison, if the signal names and the positions corresponding to the signal names are the same, the signal names are sent out for repeated reminding, and the corresponding two cells are set with ground color identifiers.
In the error correction checking step, the logic value and the physical value in the CAN communication matrix are compared, the corresponding physical value and the corresponding logic value are firstly read, then the physical value is converted into the calculated logic value through a preset conversion algorithm, the calculated logic value is compared with the read logic value, and if the calculated logic value and the read logic value are inconsistent, an error prompt is sent out.
Converting the physical value into a logical value includes converting the physical value into a decimal logical value, converting the decimal logical value into a 16-system character through a system conversion function, and comparing the 16-system character with the read logical value.
In the error correction checking step, the integrity checking is carried out on the key parameters of each row signal list in the CAN communication matrix file, the key parameters are read into the variable string, whether the variable is empty or not is judged, if yes, an incomplete reminding of the key parameters is sent out, and otherwise, the next row is circularly entered for carrying out the key parameter checking.
The invention has the advantages that: the CAN communication matrix is checked through software or defined functions, so that the error of the CAN communication matrix CAN be checked quickly, reminding CAN be sent out timely, meanwhile, the checking efficiency is high, and the checking result is accurate and reliable.
Drawings
The contents of the drawings and the marks in the drawings of the present specification are briefly described as follows:
FIG. 1 is a schematic diagram of a tool developed by the error correction method of the present invention.
Detailed Description
The following detailed description of the invention refers to the accompanying drawings, which illustrate preferred embodiments of the invention in further detail.
The invention develops a CAN communication matrix error correction method, which forms an error correction tool by software development, and CAN automatically realize error correction and reminding of the CAN communication matrix. The CAN communication matrix file is an xlsm file, which is a table file, and the rows and columns in the table correspond to different communication data, so that error correction control is required to be performed, as shown in fig. 1, which is a software tool obtained after the development of the method is completed, and the error correction check CAN be automatically performed on the CAN communication matrix after the method is software. The specific scheme is as follows:
a CAN communication matrix error correction method comprising:
firstly, selecting a CAN communication matrix file to be checked for error correction, caching the CAN communication matrix file in a memory, and then entering an error correction checking step; the xlsm form file is read into the memory, so that the subsequent checking step can be conveniently and rapidly operated. Clicking the "select communication matrix" button, as shown in fig. 1, automatically pops up the selection window, then selects the communication matrix file to be checked, and clicks the "open" button, and the window prompts the path of the selected communication matrix. After the communication matrix is selected, the software caches the content of the communication matrix into the memory by clicking a 'cache communication matrix' button, so that the purpose of the operation is to improve the operation efficiency.
In the checking step, the present application can realize five-function checking: check "blank", bit overlap screening, signal naming uniqueness screening, logical value? =physical value determination, signal integrity screening, specifically as follows:
in the error correction checking step, a space checking module is adopted to check the space, the start of the space checking module is started after the user interface in fig. 1 triggers the corresponding button, the CAN communication matrix file is subjected to traversal inquiry after the start to identify the space, and the reminding of the space is given after the space is identified.
Traversing the CAN communication matrix file to identify the space comprises the following steps: defining regex. Matches function to check the space number of the cells in the CAN communication matrix file, adopting regex. Matches function to read the space number of the cells for each cell in the CAN communication matrix file and assign the space number to the variable NUM, judging whether the space exists or not by judging whether the variable NUM return value is larger than 0 after checking one cell, judging that the space exists if the variable NUM return value is larger than 0, otherwise judging that the space does not exist, and entering the cell in the next CAN communication matrix file to check the space. And when space checking is carried out, traversing all cells from the first row and the first column of cells to the 999 th row and the 19 th column of cells in the CAN communication matrix file in a mode of respectively and sequentially circularly controlling.
Checking "space" it is noted here that a space is not an allowed character in the communication matrix because the space character, as a spacer for the DBC file, can only be allocated by the system, if a space occurs in our custom message name and signal name, this can lead to a parsing error of the DBC file. We must find all the space characters in the communication matrix and replace them with "_".
After clicking the "check space" button, the space check module performs a space check and gives a reminder through the reminder interface, as shown in FIG. 1 below, which prompts "2020/4/22/9:35:06, line 8, list 4 for a space, suggest adjustment-! "in fig. 1, there is a realistic area corresponding to the cell, and the corresponding cell in the communication matrix is red. If the "replace" option is checked, the software automatically replaces "space" with "_".
Defining a replay function: for replacing the space character with an underlined character "_"; when a space exists in a cell is judged by the NUM return value, all the spaces in the cell are replaced by underlined conforming to "_" by running a Replace function.
The space check module function traverses all cells in the range from the first row first column cell to the 999 row 19 column cell by a double loop control, which is selected because the CAN signal list will not exceed 19 columns 999 rows, which is selected to handle most signal lists. We define a variable NUM for recording the number of spaces in each cell, assign values to NUM by the regex. Matches "function, the assignment statement is as follows: "num=regex. When the return value of num is 0, it indicates that there are no space characters in the cell, and when the return value of num is greater than 0, it indicates that there are num space characters in the cell. Defining i as row and j as column, i as 1-19, j as 1-999, matrix [ i, j ] as i row and j column unit cell, regex. Matches (matrix [ i, j ], ") as Count function as space number in i row and j column unit cell, num=regex. Matches (matrix [ i, j ],") as Count means that space number of i row and j column is assigned to NUM variable, then space checking module compares NUM variable, when period is equal to 0, then no space is indicated, otherwise space reminding is sent out, and space is replaced.
When a space is found, the space is replaced with "_", using a "Replace" function, the replacement statement is as follows: "matrix [ i, j ] = matrix [ i, j ]. Replay (", "_"); "
This design has two distinct advantages:
1. the efficiency is high, and regex. Matches and replay are both used for processing the cells, instead of circularly processing each character in the cells, and only then can the function be ensured to be executed and completed within 1 minute;
2. lossless replacement, which is to replace a space with "_", is very similar in visual space and underline, so that the replacement does not affect reading.
The code is described as follows:
firstly, judging the number of space characters in a cell by using a ' num=regex ' matches (matrix [ i, j ], ') statement, and if a return value num >0, indicating that a space exists in the cell, and processing the content of the cell;
the "space" character within a cell is replaced with an "underline" using the "matrix [ i, j ] = matrix [ i, j ]. Replay (", "_") "statement; "dyg.interier.color=color.fromargb (220,20,60) was used; the statement marks the bottom color of the cell as red, so that the cell is convenient to find.
The above logic needs to be performed for all cells within the page, and the loop logic is as follows:
in the error correction checking step, a signal bit overlapping screening module is adopted to carry out overlapping screening on signal bits and give a signal bit screening result, wherein the signal bit screening comprises the following steps:
converting the message Motorola format sequence in the CAN communication matrix file into a natural sequence, adding the signal start bit of the natural sequence and the corresponding signal length, and judging the signal filling error if the signal start bit exceeds 63. As shown in fig. 1, this function can be activated by a trigger button on the software interface, and when the communication matrix is filled, it must be ensured that each signal bit is used only once, and a situation that two signals occupy one signal bit at the same time cannot occur, so it is necessary to check whether the signal bit is reused or not. After clicking the "bit overlap screening" button, the software will prompt the "2020/4/22 9:44:18HCU_BMS_Ctrl message to be filled with error-! Please check-! The message "hcu_bms_ctrl" has a phenomenon of bit overlapping, and needs to be checked. The principle comprises the following steps: the signal bit formats include inter and Motorola formats to
The definition signal bits of the Chery company are filled according to the Motorola format, if whether the bit filling is overlapped is judged, the Motorola format sequence is converted into a natural sequence,
the following code converts location1 (Motorola sequence) into relocation 1 (natural sequence), which is the core element of the present function.
The motorola format is high-order and is arranged as follows
7-0,15-8,23-16
The natural sequence arrangement is in front
0-7,8-15,16-23
That is, when the 7 th bit of the motorola format is actually the 1 st bit corresponding to the natural sequence, the 6 th bit of the motorola format corresponds to the 2 nd bit of the natural sequence; this correspondence is obviously not a simple algebraic relation. An algorithm is designed, and conversion from a motorola format to a natural sequence can be realized.
Dividing the motorola format number by 8, and taking the remainder, where the remainder is an integer between 1 and 7, each remainder value corresponds to a particular offset, where when the remainder is 7, the offset is-6, i.e., the 7 th bit of the motorola sequence, plus an offset (-6) equal to 1, which coincides with the 7 th bit of the motorola format described above being actually the 1 st bit of the corresponding natural sequence.
As shown in the table, the conversion mode of the method is that the remainder obtained by dividing the motorola format bit sequence number by 8 is marked with a corresponding offset, and the motorola format bit sequence number plus the offset is the natural sequence bit sequence number.
The advantage of this algorithm is two points:
1. the efficiency is high: the offset calculation is equivalent to table lookup, so that the calculation efficiency is much higher than that of the bitwise calculation;
2. the accuracy is high: the obtained value is accurate and error-free;
the implementation code is as follows:
after the natural sequence is obtained, by adding the signal start bit to the signal length, if it exceeds 63, it is determined that the signal is padded with errors to be 64 bits (from 0) at most after one frame of CAN message, and the determination code is as follows:
if((reallocation1+langth1-2)>63)
the hint code is as follows:
ShowMsg (matrix [ j,3] + "message filled with error please check");
in the error correction checking step, signal names in cells corresponding to signal names of the CAN communication matrix list are respectively read into defined Str1 and Str2 variables, any two signal names are read into the Str1 and Str2 variables in a cyclic comparison mode for comparison, if the signal names and the positions corresponding to the signal names are the same, the signal names are sent out for repeated reminding, and the corresponding two cells are set with ground color identifiers.
To avoid confusion, the signal names in the communication matrix must be unique, and the "signal name uniqueness screening" button will compare all signal names one by one, as will be indicated by repetition. "2020/4/22 9:50:44, line 9, same signal name as line 10, recommended adjustment-! 2020/4/22 9:50:44, line 10, and line 9 signal names are the same, recommended adjustment-! And the communication matrix is correspondingly provided with a cell bottom color mark red.
The core algorithm is as follows:
the method comprises the steps of designing a cyclic comparison algorithm, in a signal list, describing signal names in a 4 th column, firstly reading the signal names of the 4 th column and the 1 st row, recording the names in a variable of str1, comparing whether the signal names of str1 and the 2 nd row of the 4 th column are identical, changing the base color of a cell if the signal names are identical, and continuously comparing whether the signal names of str1 and the 3 rd row of the 4 th column are identical if the signal names are not identical, and circulating until the 500 th row of the 4 th column.
The above procedure can check whether the signal names of the 4 th column and the 1 st row are the same as other signal names, next we compare the 4 th column, whether the signal names of the 2 nd row are the same as other signal names, record the 4 th column and the 2 nd row in the variable "str1", and then compare the signal names of the 3 rd row with the 4 th column until 500 th row.
The advantage of this method is that it is efficient and the alignment process is usually completed in one minute.
The code interpretation is as follows:
1. by "string str1=matrix [ i,4]; "obtain the i-th row 4-th column signal name and store in str1 variable;
2. by "string stro2=matrix [ j,4]; "get jth line 4 th column signal name and store in str2 variable;
3. by "if (str1= = str2 &i ≡=j)' the statement determines whether the two signal names are equal, if the signal names are equal, the signal names are repeatedly indicated, the signal names need to be marked red, and an engineer is prompted to correct the signal names.
The above logic needs to be performed on all signals in the signal list, and the cyclic alignment code is as follows:
in the error correction checking step, the logic value and the physical value in the CAN communication matrix are compared, the corresponding physical value and the corresponding logic value are firstly read, then the physical value is converted into the calculated logic value through a preset conversion algorithm, the calculated logic value is compared with the read logic value, and if the calculated logic value and the read logic value are inconsistent, an error prompt is sent out. Converting the physical value into a logical value includes converting the physical value into a decimal logical value, converting the decimal logical value into a 16-system character through a system conversion function, and comparing the 16-system character with the read logical value.
The logic value is expressed in hexadecimal system, the physical value is expressed in decimal system, the logic value and the physical value should be equal, if the logic value and the physical value in the communication matrix are filled in wrong, the signal analysis is incorrect, when the check button of whether the logic value and the physical value are equal is pressed, the system can prompt the wrong row;
the physical value and the logical value in the signal list are manually filled by a network engineer, and errors are unavoidable. In order to check the correctness of the two values, a set of algorithm is designed, the actual logic value is calculated according to the specific calculation relation { logic value= (physical value-offset)/precision }, the logic values filled in the signal list are read for comparison, if the logic values are consistent, the comparison is continued, the signals are fed down, if the logic values are not consistent, the cell ground color is changed, and engineers and modification are prompted.
In addition to calculating the logic value, the algorithm also involves the problem of binary conversion, in general, the logic value in the signal list is expressed in hexadecimal, and the physical value is expressed in decimal, so after the decimal logic value is calculated, a conversion function of the conversion of decimal characters into hexadecimal characters is needed to be used, and then the hexadecimal characters are compared with the logic values filled in the signal list, otherwise, errors can occur.
The advantages of the present algorithm are two:
1. high efficiency and high automation degree: manual operation of engineers is not needed at all;
2. the accuracy is high:
3. the algorithm can check 95% of filling errors and 100% of calculating errors in the signal removal list.
Code interpretation is as follows
string stro2 = matrix [ i,19]; maximum physical value
string stro3 = matrix [ i,14]; accuracy//
string str4 = matrix [ i,15]; load/offset
string str6 = matrix [ i,18]; maximum logic value
double dou7;
int int_7;
The logical value int_7 is calculated through three variables of a physical value str2, an accuracy str3 and an offset str4, and the formula is as follows:
dou7=(Convert.ToDouble(str2)-Convert.ToDouble(str4))/Convert.ToDouble(str3);
int_7=(int)dou7;
then comparing the calculated logical value int_7 with the logical value read from the signal list if it is identical (convert. ToInt32 (str 6, 16) = int_7)
If the two values are not equal, the cell ground color is marked red, and the engineer is prompted to correct.
In the error correction checking step, the integrity checking is carried out on the key parameters of each row signal list in the CAN communication matrix file, the key parameters are read into the variable string, whether the variable is empty or not is judged, if yes, an incomplete reminding of the key parameters is sent out, and otherwise, the next row is circularly entered for carrying out the key parameter checking.
The parameters of the signals in the communication matrix need to be filled completely, if the signals are analyzed by mistake due to the lack of the parameters, a 'signal integrity screening' button is pressed, software automatically detects whether all the parameters of the signals are filled, and if the parameters are not filled, the parameters are prompted.
Because the contents of the signal list are complicated and often missing, an algorithm is designed to detect whether the key parameters necessary to be filled in the signal list are filled in, and if not, the engineer is prompted to fill in. Firstly, key parameters of a signal list are read and recorded in variables str1-str7 respectively, and if one of the variables is empty, the key parameters of the signal list are considered to be incomplete; the algorithm is simple but very effective and is especially suitable for beginners.
The advantage of this function is:
1. unfilled items in the signal list can be quickly searched, and the integrity of the signal list can be basically ensured;
2. the function can not modify the content of the signal list, only prompts, so that misoperation can be avoided by design, and modification operation can be performed only after confirmation by a network engineer.
The corresponding code is explained as follows:
string stro 1 = matrix [ i,17]; /(minimum physical value)
string stro2 = matrix [ i,19]; maximum physical value
string stro3 = matrix [ i,14]; accuracy//
string str4 = matrix [ i,15]; load/offset
string stro5 = matrix [ i,16]; v/min logic-value
string str6 = matrix [ i,18]; is/max? Editing value
string stro7 = matrix [ i,4]; name of the signal
The key parameter values of each signal are read, and whether the values are empty or not is judged, and the judgment statement is as follows:
if(str1==""||str2==""||str3==""||str4==""||str5==""||str6==""||str1=="")
if the value is null, prompting the engineer to modify;
ShowMsg ("" +i+ "line signal" +str7+ "is unfilled, please adjust")
It is obvious that the specific implementation of the present invention is not limited by the above-mentioned modes, and that it is within the scope of protection of the present invention only to adopt various insubstantial modifications made by the method conception and technical scheme of the present invention.

Claims (1)

1. A CAN communication matrix error correction method is characterized in that: comprising the following steps:
selecting a CAN communication matrix file to be checked for error correction, caching the CAN communication matrix file in a memory, and then entering an error correction checking step;
in the error correction checking step, the CAN communication matrix file is traversed, inquired and identified to form a space, and a space existence reminding is given after the space is identified; traversing the CAN communication matrix file to identify the space comprises the following steps:
defining regex. Matches function to check the space number of the cells in the CAN communication matrix file, adopting regex. Matches function to read the space number of the cells for each cell in the CAN communication matrix file and assign the space number to variable NUM, judging whether space exists or not by judging whether the variable NUM return value is larger than 0 after checking one cell, judging that space exists if the variable NUM return value is larger than 0, otherwise judging that space does not exist, and entering the cell in the next CAN communication matrix file to check the space; when space checking is carried out, traversing all cells in the range from the first row and the first column of cells to the 999 th row and the 19 th column of cells in the CAN communication matrix file in a mode of respectively and sequentially circularly controlling; defining a replay function: for replacing the space character with an underlined character "_"; when judging that the space exists in the cell through the NUM return value, replacing all the spaces in the cell with underlined conforming to "_" _through running a Replace function;
in the error correction checking step, overlapping screening is performed on the signal bits and a signal bit screening result is given, wherein the signal bit screening comprises:
converting a message Motorola format sequence in the CAN communication matrix file into a natural sequence, adding a signal start bit of the natural sequence and a corresponding signal length, and judging signal filling errors if the signal start bit exceeds 63;
in the error correction checking step, signal names in cells corresponding to signal names of a CAN communication matrix list are respectively read into defined Str1 and Str2 variables, any two signal names are read into the Str1 and Str2 variables in a cyclic comparison mode for comparison, if the signal names and the positions corresponding to the signal names are the same, the signal names are sent out for repeated reminding, and the corresponding two cells are set with ground color identifiers;
in the error correction checking step, comparing a logic value with a physical value in the CAN communication matrix, firstly reading the corresponding physical value and the corresponding logic value, then converting the physical value into a calculated logic value through a preset conversion algorithm, comparing the calculated logic value with the read logic value, and if the calculated logic value and the read logic value are inconsistent, sending out an error prompt;
converting the physical value into a logic value comprises converting the physical value into a decimal logic value, converting the decimal logic value into a 16-system character through a system conversion function, and then comparing the 16-system character with the read logic value; in the error correction checking step, the integrity checking is carried out on the key parameters of each row signal list in the CAN communication matrix file, the key parameters are read into the variable string, whether the variable is empty or not is judged, if yes, an incomplete reminding of the key parameters is sent out, and otherwise, the next row is circularly entered for carrying out the key parameter checking.
CN202210774128.8A 2022-07-01 2022-07-01 CAN communication matrix error correction method Active CN115333893B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210774128.8A CN115333893B (en) 2022-07-01 2022-07-01 CAN communication matrix error correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210774128.8A CN115333893B (en) 2022-07-01 2022-07-01 CAN communication matrix error correction method

Publications (2)

Publication Number Publication Date
CN115333893A CN115333893A (en) 2022-11-11
CN115333893B true CN115333893B (en) 2024-04-05

Family

ID=83918124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210774128.8A Active CN115333893B (en) 2022-07-01 2022-07-01 CAN communication matrix error correction method

Country Status (1)

Country Link
CN (1) CN115333893B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156565A (en) * 2014-07-21 2014-11-19 北京航天发射技术研究所 System state analysis method and analysis device based on offline CAN bus data
CN112468369A (en) * 2020-11-30 2021-03-09 北京新能源汽车技术创新中心有限公司 Error detection method for CAN communication matrix of automobile
CN112491648A (en) * 2020-11-17 2021-03-12 重庆美沣秦安汽车驱动系统有限公司 Automobile communication data conversion method based on CAN communication matrix and storage medium
CN113342319A (en) * 2021-05-24 2021-09-03 重庆长安汽车股份有限公司 Method and system for automatically generating software code for CAN fault diagnosis
CN113904967A (en) * 2021-09-01 2022-01-07 重庆长安新能源汽车科技有限公司 Automatic testing device and testing method for interface software of automobile CAN communication module

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156565A (en) * 2014-07-21 2014-11-19 北京航天发射技术研究所 System state analysis method and analysis device based on offline CAN bus data
CN112491648A (en) * 2020-11-17 2021-03-12 重庆美沣秦安汽车驱动系统有限公司 Automobile communication data conversion method based on CAN communication matrix and storage medium
CN112468369A (en) * 2020-11-30 2021-03-09 北京新能源汽车技术创新中心有限公司 Error detection method for CAN communication matrix of automobile
CN113342319A (en) * 2021-05-24 2021-09-03 重庆长安汽车股份有限公司 Method and system for automatically generating software code for CAN fault diagnosis
CN113904967A (en) * 2021-09-01 2022-01-07 重庆长安新能源汽车科技有限公司 Automatic testing device and testing method for interface software of automobile CAN communication module

Also Published As

Publication number Publication date
CN115333893A (en) 2022-11-11

Similar Documents

Publication Publication Date Title
CN101206467B (en) Universal numerical control code analysis method
US20080281575A1 (en) Simulation device for programmable controller
CN112468369B (en) Error detection method for CAN communication matrix of automobile
CN112810323B (en) System and method for marking identification code
CN112347047B (en) Vehicle data file generation method and device
CN115333893B (en) CAN communication matrix error correction method
CN112445160B (en) Automatic generation method and device of ECU configuration code
CN111610744A (en) Logic control program generation method and system based on process time sequence and storage medium
CN113049935A (en) Semiconductor intelligent detection system, intelligent detection method and storage medium
CN109871405B (en) Method and device for importing Excel table data into database
CN112149764A (en) Printing method of label printing system and label printing system
CN113065315B (en) Conversion control method for describing file of register
CN117033855A (en) Filter mask generation method, device, electronic equipment and storage medium
JP3394694B2 (en) Format information registration method and OCR system
CN114942745A (en) Automatic configuration method for UDS protocol stack of motor controller
CN118449969B (en) Data acquisition method for building design
CN101887738A (en) Error correcting device and error correcting method
CN112861454A (en) Method for realizing top-level automatic instantiation of chip system based on python
WO1993025974A1 (en) An automated method for checking patent applications
CN112804186A (en) CAN general message database generation method
CN112784540A (en) Document number proofreading method and device
CN116088420B (en) Numerical control machine tool code type identification and anomaly detection method based on random forest
CN115542882B (en) Controller interface configuration method and device
EP0191861A1 (en) Method of correcting system program
CN114647580A (en) Python-based automatic driving vehicle interface signal inspection tool and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240419

Address after: 241000 No. 8, Changchun Road, Wuhu economic and Technological Development Zone, Anhui, China

Patentee after: CHERY AUTOMOBILE Co.,Ltd.

Country or region after: China

Address before: 241000 Building 8, science and Technology Industrial Park, 717 Zhongshan South Road, Yijiang District, Wuhu City, Anhui Province

Patentee before: Chery Commercial Vehicles (Anhui) Co., Ltd.

Country or region before: China