CN113343314A - Data verification method and device for data flashing - Google Patents

Data verification method and device for data flashing Download PDF

Info

Publication number
CN113343314A
CN113343314A CN202110746961.7A CN202110746961A CN113343314A CN 113343314 A CN113343314 A CN 113343314A CN 202110746961 A CN202110746961 A CN 202110746961A CN 113343314 A CN113343314 A CN 113343314A
Authority
CN
China
Prior art keywords
data
verification
result
flash file
check result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110746961.7A
Other languages
Chinese (zh)
Inventor
边京
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BAIC Group ORV Co ltd
Original Assignee
BAIC Group ORV 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 BAIC Group ORV Co ltd filed Critical BAIC Group ORV Co ltd
Priority to CN202110746961.7A priority Critical patent/CN113343314A/en
Publication of CN113343314A publication Critical patent/CN113343314A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Detection And Correction Of Errors (AREA)

Abstract

The invention provides a data verification method and a device for data flashing, wherein the method comprises the following steps: performing data verification on the flash file by using a computer according to a preset rule to obtain a first verification result; the flash file is flashed into an electronic controller, and the electronic controller performs data verification on the flash file according to the preset rule to obtain a second verification result; and comparing the first check result with the second check result, if the first check result is consistent with the second check result, determining that the flash file is successfully flashed, and otherwise, determining that the flash file is failed to be flashed. In the invention, the reliability of the flash is verified by comparing the verification result automatically calculated by the computer with the verification result calculated in the electronic controller, thereby improving the efficiency of screening data errors.

Description

Data verification method and device for data flashing
Technical Field
The present invention relates to the field of data verification, and in particular, to a data verification method and apparatus for data flashing.
Background
With the wide application of CAN (Controller Area Network) and UDS (Unified Diagnostic Services) Diagnostic protocols, UDS flash is widely applied to a plurality of aspects such as the development phase of vehicles, production line packaging, after-sales version updating, and the like. Therefore, how to verify the correctness and the integrity of the flash data, screen the situations of flash data loss, data distortion and the like, and improve the flash reliability is very important work content.
However, at present, the flash development work based on the UDS protocol is still in a transition stage, and a host factory needs to make a flash service flow according to different requirement definitions in data details of a plurality of finished automobile flashes. For the processing of the flash data, the formulation of the verification method is not complete, and a uniform processing scheme is lacked.
Disclosure of Invention
The invention provides a data verification method and device for data flashing, which are used for solving the problems of incomplete establishment of a verification method and lack of a uniform processing scheme in the existing flashing data processing.
In order to solve the above problems, the present invention is realized by:
in a first aspect, the present invention provides a data verification method for data flashing, including:
performing data verification on the flash file by using a computer according to a preset rule to obtain a first verification result;
the flash file is flashed into an electronic controller, and the electronic controller performs data verification on the flash file according to the preset rule to obtain a second verification result;
and comparing the first check result with the second check result, if the first check result is consistent with the second check result, determining that the flash file is successfully flashed, and otherwise, determining that the flash file is failed to be flashed.
Optionally, comparing the first check result with the second check result includes:
inputting the second check result into the computer, and comparing the first check result with the second check result by using the computer;
or,
and inputting the first checking result into the electronic controller, and comparing the first checking result with the second checking result by adopting the electronic controller.
Optionally, the performing data verification on the flash file according to the preset rule includes:
screening effective data information in the flash file;
dividing the effective data information in each row in the flash file into a group according to every two bytes, and supplementing a byte 0 to form a group if the data of a single byte exists at last;
accumulating the values of all the groups to obtain a final checksum;
and carrying out non-carry reservation on the final check sum, and reserving the last four bits of data to obtain a check result.
Optionally, the flash file includes at least one of the following: the method comprises the following steps of marking data to be checked, recording extended linear addresses, data length, data offset addresses, data base addresses, data check sums and recording end of file; and the data marked by the data to be detected is effective data information.
In a second aspect, the present invention provides a data verification apparatus for data flashing, including:
the first verification module is used for performing data verification on the flash file by adopting a computer according to a preset rule to obtain a first verification result;
the second checking module is used for flashing the flash file into the electronic controller, and the electronic controller performs data checking on the flash file according to the preset rule to obtain a second checking result;
and the result comparison module is used for comparing the first check result with the second check result, if the first check result is consistent with the second check result, determining that the flash file is successfully flashed, and otherwise, determining that the flash file is failed to be flashed.
Optionally, the result comparing module includes:
the first comparison sub-module is used for inputting the second check result into the computer and comparing the first check result with the second check result by adopting the computer;
or,
and the second comparison sub-module is used for inputting the first verification result into the electronic controller and comparing the first verification result with the second verification result by adopting the electronic controller.
Optionally, the first check module and the second check module include:
the verification submodule is used for screening effective data information in the flash file; dividing the effective data information in each row in the flash file into a group according to every two bytes, and supplementing a byte 0 to form a group if the data of a single byte exists at last; accumulating the values of all the groups to obtain a final checksum; and carrying out non-carry reservation on the final check sum, and reserving the last four bits of data to obtain a check result.
Optionally, the flash file includes at least one of the following: the method comprises the following steps of marking data to be checked, recording extended linear addresses, data length, data offset addresses, data base addresses, data check sums and recording end of file; and the data marked by the data to be detected is effective data information.
In a third aspect, the present invention provides a server, including a processor, a memory, and a program or an instruction stored on the memory and executable on the processor, where the program or the instruction when executed by the processor implements the steps of the data verification method for data flashing as described in the first aspect.
In a fourth aspect, the present invention provides a readable storage medium on which a program or instructions are stored, which program or instructions, when executed by a processor, implement the steps of the data verification method of data flashing as described in the first aspect.
In the invention, the verification result automatically calculated by the computer is compared with the verification result calculated in the electronic controller to verify the reliability of the flash, thereby solving the problem that the existing flash data processing and verifying method lacks a uniform processing scheme and improving the data error screening efficiency.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart of a data verification method for data flashing according to an embodiment of the present invention;
fig. 2 is a schematic general flow chart of a data verification method for data flashing according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data verification apparatus for data flashing according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention provides a data verification method for data flashing, including:
step 11: performing data verification on the flash file by using a computer according to a preset rule to obtain a first verification result;
step 12: the flash file is flashed into an electronic controller, and the electronic controller performs data verification on the flash file according to the preset rule to obtain a second verification result;
step 13: and comparing the first check result with the second check result, if the first check result is consistent with the second check result, determining that the flash file is successfully flashed, and otherwise, determining that the flash file is failed to be flashed.
Referring to fig. 1 and fig. 2, in the embodiment of the present invention, a developer designs a verification scheme for the reliability of a flash file design, that is, preset rules; in step 11, the computer performs data verification on the flash file through programming, and may adopt, but is not limited to, Python development software for programming, and rapidly complete huge data calculation work by using the programming software, so that the file can be directly processed, the purposes of batch processing, verification and accurate calculation of data are achieved, the development progress is improved, and the working cost is saved; in step 12, the flash file is subjected to design of a control algorithm and a control logic under a Simulink environment, the flash file is generated into a file in an HEX format through a compiler, and the UDS flash is to flash the file in the HEX format into an electronic controller and perform data verification on the flash file in the electronic controller; in order to ensure the integrity of the data, a specified algorithm, that is, a preset rule is usually used to calculate a verification result, so that the computer and the electronic controller calculate a verification structure by using the same algorithm, if the verification results obtained by the two calculations are consistent, the data is complete and reliable, and if the verification results obtained by the two calculations are inconsistent, the data is failed to write.
In this embodiment of the present invention, optionally, the comparing the first check result and the second check result includes:
inputting the second check result into the computer, and comparing the first check result with the second check result by using the computer;
or,
and inputting the first checking result into the electronic controller, and comparing the first checking result with the second checking result by adopting the electronic controller.
In the embodiment of the present invention, the comparison between the first and second verification results may be performed in the computer or the electronic controller, and may be selected by the user.
In this embodiment of the present invention, optionally, the performing data verification on the flash file according to the preset rule includes:
screening effective data information in the flash file;
dividing the effective data information in each row in the flash file into a group according to every two bytes, and supplementing a byte 0 to form a group if the data of a single byte exists at last;
accumulating the values of all the groups to obtain a final checksum;
and carrying out non-carry reservation on the final check sum, and reserving the last four bits of data to obtain a check result.
In the embodiment of the invention, the preset rules adopted by the computer and the electronic controller are ensured to be the same preset rule, and the checking result comprises the first checking result and the second checking result; by means of Python software programming, a quick verification algorithm is developed, direct processing of files is achieved, and the purposes of data batch processing, verification and accurate calculation are achieved.
In the embodiment of the present invention, optionally, the flash file includes at least one of the following items: the method comprises the following steps of marking data to be checked, recording extended linear addresses, data length, data offset addresses, data base addresses, data check sums and recording end of file; and the data marked by the data to be detected is effective data information.
In the embodiment of the present invention, effective data information in the flash file is screened, that is, an identifier of data to be checked in the flash file is screened, for example, if data of a certain row in the file is 10C00000504800208DC2020095C2020097C2020073, the row is split and interpreted, that is, split into 10C00000504800208DC2020095C2020097C2020073, where 00 is the identifier of the data to be checked, the data length is 16 bytes, and the checksum is 73, so that data after 00 is identified as data after the identifier of the data to be checked, that is, effective data information, the effective data information in each row is divided into one group by every two bytes, and if the row is grouped to the data of which a single byte appears at last, one byte 0 is supplemented to form one group; and calculating according to rules after grouping to obtain a final verification result.
In the embodiment of the invention, the reliability of the flash is verified by comparing the verification result automatically calculated by the computer with the verification result calculated in the electronic controller, so that the problem that the conventional flash data processing and verifying method lacks a uniform processing scheme is solved, and the data error screening efficiency is improved.
Referring to fig. 3, the present invention provides a data verification apparatus for data flashing, including:
the first verification module 31 is configured to perform data verification on the flash file according to a preset rule by using a computer to obtain a first verification result;
the second checking module 32 is configured to flush the flushed file to the electronic controller, and the electronic controller performs data checking on the flushed file according to the preset rule to obtain a second checking result;
and the result comparison module 33 is configured to compare the first check result with the second check result, determine that the write-over of the write-over file is successful if the first check result is consistent with the second check result, and otherwise determine that the write-over of the write-over file is failed.
In the embodiment of the present invention, optionally, the result comparing module includes:
the first comparison sub-module is used for inputting the second check result into the computer and comparing the first check result with the second check result by adopting the computer;
or,
and the second comparison sub-module is used for inputting the first verification result into the electronic controller and comparing the first verification result with the second verification result by adopting the electronic controller.
In this embodiment of the present invention, optionally, the first check module and the second check module include:
the verification submodule is used for screening effective data information in the flash file; dividing the effective data information in each row in the flash file into a group according to every two bytes, and supplementing a byte 0 to form a group if the data of a single byte exists at last; accumulating the values of all the groups to obtain a final checksum; and carrying out non-carry reservation on the final check sum, and reserving the last four bits of data to obtain a check result.
In the embodiment of the present invention, optionally, the flash file includes at least one of the following items: the method comprises the following steps of marking data to be checked, recording extended linear addresses, data length, data offset addresses, data base addresses, data check sums and recording end of file; and the data marked by the data to be detected is effective data information.
The data verification device for data flashing provided in the embodiment of the present invention can implement each process implemented by the data verification method for data flashing in the method embodiment of fig. 1, and is not described herein again to avoid repetition.
Referring to fig. 4, an embodiment of the present invention further provides a server 40, which includes a processor 41, a memory 42, and a computer program stored in the memory 42 and capable of running on the processor 41, where the computer program is executed by the processor 41 to implement the processes of the data verification method for data flashing embodiment, and can achieve the same technical effects, and no further description is provided herein to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the data verification method for data flash, and can achieve the same technical effect, and is not described herein again to avoid repetition. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a terminal) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A data verification method for data flash is characterized by comprising the following steps:
performing data verification on the flash file by using a computer according to a preset rule to obtain a first verification result;
the flash file is flashed into an electronic controller, and the electronic controller performs data verification on the flash file according to the preset rule to obtain a second verification result;
and comparing the first check result with the second check result, if the first check result is consistent with the second check result, determining that the flash file is successfully flashed, and otherwise, determining that the flash file is failed to be flashed.
2. The data verification method of data scrubbing of claim 1, wherein comparing the first verification result and the second verification result comprises:
inputting the second check result into the computer, and comparing the first check result with the second check result by using the computer;
or,
and inputting the first checking result into the electronic controller, and comparing the first checking result with the second checking result by adopting the electronic controller.
3. The data verification method of a data flash of claim 1,
the data verification of the flash file according to the preset rule comprises the following steps:
screening effective data information in the flash file;
dividing the effective data information in each row in the flash file into a group according to every two bytes, and supplementing a byte 0 to form a group if the data of a single byte exists at last;
accumulating the values of all the groups to obtain a final checksum;
and carrying out non-carry reservation on the final check sum, and reserving the last four bits of data to obtain a check result.
4. The data verification method of data brushing of claim 3,
the flash file comprises at least one of the following items: the method comprises the following steps of marking data to be checked, recording extended linear addresses, data length, data offset addresses, data base addresses, data check sums and recording end of file; and the data marked by the data to be detected is effective data information.
5. A data verification apparatus for data flashing, comprising:
the first verification module is used for performing data verification on the flash file by adopting a computer according to a preset rule to obtain a first verification result;
the second checking module is used for flashing the flash file into the electronic controller, and the electronic controller performs data checking on the flash file according to the preset rule to obtain a second checking result;
and the result comparison module is used for comparing the first check result with the second check result, if the first check result is consistent with the second check result, determining that the flash file is successfully flashed, and otherwise, determining that the flash file is failed to be flashed.
6. The data verification device of claim 1, wherein the result comparison module comprises:
the first comparison sub-module is used for inputting the second check result into the computer and comparing the first check result with the second check result by adopting the computer;
or,
and the second comparison sub-module is used for inputting the first verification result into the electronic controller and comparing the first verification result with the second verification result by adopting the electronic controller.
7. The data verification apparatus of data scrubbing of claim 1, wherein said first and second verification modules comprise:
the verification submodule is used for screening effective data information in the flash file; dividing the effective data information in each row in the flash file into a group according to every two bytes, and supplementing a byte 0 to form a group if the data of a single byte exists at last; accumulating the values of all the groups to obtain a final checksum; and carrying out non-carry reservation on the final check sum, and reserving the last four bits of data to obtain a check result.
8. The data verification apparatus of data scrubbing of claim 7,
the flash file comprises at least one of the following items: the method comprises the following steps of marking data to be checked, recording extended linear addresses, data length, data offset addresses, data base addresses, data check sums and recording end of file; and the data marked by the data to be detected is effective data information.
9. A server, comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the data verification method of data flashing as claimed in any one of claims 1 to 4.
10. A readable storage medium, on which a program or instructions are stored, which program or instructions, when executed by a processor, carry out the steps of the data verification method of data flashing as claimed in any one of claims 1 to 4.
CN202110746961.7A 2021-07-02 2021-07-02 Data verification method and device for data flashing Pending CN113343314A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110746961.7A CN113343314A (en) 2021-07-02 2021-07-02 Data verification method and device for data flashing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110746961.7A CN113343314A (en) 2021-07-02 2021-07-02 Data verification method and device for data flashing

Publications (1)

Publication Number Publication Date
CN113343314A true CN113343314A (en) 2021-09-03

Family

ID=77482162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110746961.7A Pending CN113343314A (en) 2021-07-02 2021-07-02 Data verification method and device for data flashing

Country Status (1)

Country Link
CN (1) CN113343314A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778061A (en) * 2021-09-16 2021-12-10 广州锦红源电子科技有限公司 Method and device for verifying program integrity of electronic controller and electronic controller

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107026741A (en) * 2017-03-31 2017-08-08 科世达(上海)管理有限公司 Method and device is write with a brush dipped in Chinese ink in a kind of encryption based on network security
CN109933348A (en) * 2019-01-21 2019-06-25 宁波普瑞均胜汽车电子有限公司 The update method and device of Bootloader in a kind of electronic control unit
CN110109690A (en) * 2019-07-02 2019-08-09 潍柴动力股份有限公司 A kind of ECU data writes with a brush dipped in Chinese ink method and system
CN110955916A (en) * 2018-09-26 2020-04-03 深信服科技股份有限公司 Data integrity protection method, system and related equipment
CN111142886A (en) * 2019-12-25 2020-05-12 宁波奥克斯电气股份有限公司 Data programming method and related device
CN112491651A (en) * 2020-11-17 2021-03-12 北京天融信网络安全技术有限公司 Message matching method and device
CN113050957A (en) * 2019-12-26 2021-06-29 厦门雅迅网络股份有限公司 OTA (over the air) upgrading method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107026741A (en) * 2017-03-31 2017-08-08 科世达(上海)管理有限公司 Method and device is write with a brush dipped in Chinese ink in a kind of encryption based on network security
CN110955916A (en) * 2018-09-26 2020-04-03 深信服科技股份有限公司 Data integrity protection method, system and related equipment
CN109933348A (en) * 2019-01-21 2019-06-25 宁波普瑞均胜汽车电子有限公司 The update method and device of Bootloader in a kind of electronic control unit
CN110109690A (en) * 2019-07-02 2019-08-09 潍柴动力股份有限公司 A kind of ECU data writes with a brush dipped in Chinese ink method and system
CN111142886A (en) * 2019-12-25 2020-05-12 宁波奥克斯电气股份有限公司 Data programming method and related device
CN113050957A (en) * 2019-12-26 2021-06-29 厦门雅迅网络股份有限公司 OTA (over the air) upgrading method and system
CN112491651A (en) * 2020-11-17 2021-03-12 北京天融信网络安全技术有限公司 Message matching method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778061A (en) * 2021-09-16 2021-12-10 广州锦红源电子科技有限公司 Method and device for verifying program integrity of electronic controller and electronic controller
CN113778061B (en) * 2021-09-16 2023-03-28 广州锦红源电子科技有限公司 Method and device for verifying program integrity of electronic controller and electronic controller

Similar Documents

Publication Publication Date Title
EP3678346B1 (en) Blockchain smart contract verification method and apparatus, and storage medium
CN109542415B (en) Code merging method supporting parallel research and development of application programs and related equipment
CN111290742A (en) Parameter verification method and device, electronic equipment and readable storage medium
CN111933199B (en) Data read-write method and device based on memory and storage medium
CN111124871A (en) Interface test method and device
CN113343314A (en) Data verification method and device for data flashing
CN113128168A (en) Pad parameter checking and correcting method and device, computer equipment and storage medium
CN113760312A (en) Base station data upgrading method, base station and computer readable medium
CA3138761A1 (en) Method, device, computer equipment and storage medium for verifying inter-system data admission
CN111586202B (en) Network mask checking method and device, electronic equipment and storage medium
CN112433935A (en) Test method, test device, electronic equipment and storage medium
CN112306041A (en) Vehicle configuration information writing method and device and electronic equipment
CN117033855A (en) Filter mask generation method, device, electronic equipment and storage medium
CN116401229A (en) Database data verification method, device and equipment
CN113807975B (en) Method, device, computer equipment and storage medium for checking information
CN111736917B (en) Data verification method and device, computer equipment and storage medium
CN114579147A (en) Burning verification method and device, terminal equipment and storage medium
CN111241082B (en) Data correction method and device
CN114463002A (en) Method and device for verifying legality of cross-link transaction, computer equipment and medium
CN112579340B (en) Data verification method, device and equipment of electronic control unit and storage medium
CN111225075A (en) Configuration method and device for Internet of things directional access service
CN113010424B (en) Interface automatic test processing method, system, computer equipment and storage medium
CN112463704B (en) Method, device and equipment for identifying topology of case and storage medium
CN114448851B (en) Automatic data testing method and system
CN115718680B (en) Data reading method, system, computer and readable storage medium

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