WO2022116088A1 - Firmware data processing method and apparatus - Google Patents

Firmware data processing method and apparatus Download PDF

Info

Publication number
WO2022116088A1
WO2022116088A1 PCT/CN2020/133622 CN2020133622W WO2022116088A1 WO 2022116088 A1 WO2022116088 A1 WO 2022116088A1 CN 2020133622 W CN2020133622 W CN 2020133622W WO 2022116088 A1 WO2022116088 A1 WO 2022116088A1
Authority
WO
WIPO (PCT)
Prior art keywords
firmware
check code
computer device
data packet
target
Prior art date
Application number
PCT/CN2020/133622
Other languages
French (fr)
Chinese (zh)
Inventor
戴为龙
王宇
林立
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN202080074505.6A priority Critical patent/CN114616544A/en
Priority to PCT/CN2020/133622 priority patent/WO2022116088A1/en
Publication of WO2022116088A1 publication Critical patent/WO2022116088A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present application relates to the technical field of firmware processing, and in particular, to a method and device for processing firmware data.
  • the firmware update of the millimeter-wave radar can be realized by data interaction with the host computer device. After the host computer device generates new firmware, it can establish a transmission channel with the millimeter-wave radar and send the firmware data to the millimeter-wave radar for processing. Load update to replace older firmware in mmWave radar.
  • the present application provides a firmware data processing method, device, camera module and removable device, which can solve the problem that the prior art cannot provide effective supervision for the firmware transmission process, resulting in frequent occurrence of abnormal situations such as data loss in the firmware transmission process, and The problem that the probability of firmware loading error is greatly increased.
  • an embodiment of the present application provides a firmware data processing method, which is applied to a lower computer device, including:
  • the firmware fragmentation data packet includes data fragmentation content, and a first check code corresponding to the data fragmentation content generated according to a preset rule;
  • the second aspect, the embodiment of the present application provides a kind of firmware data processing method, is applied to the host computer equipment, including:
  • a first check code corresponding to the data fragment content of the firmware fragment data packet is generated
  • an embodiment of the present application provides a firmware data processing apparatus, which is applied to a lower computer device, including: a memory and a processor;
  • the memory is used to obtain the firmware fragmentation data packet of the target firmware sent by the host computer device;
  • the firmware fragmentation data packet includes the data fragmentation content, and the corresponding data fragmentation content generated according to the preset rule. the first check code;
  • the processor is configured to, according to the preset rule, generate a second check code corresponding to the data fragment content of the obtained firmware fragment data packet;
  • an embodiment of the present application provides a firmware data processing apparatus, which is applied to a host computer device, and the apparatus includes: a processor;
  • the processor is used to:
  • a first check code corresponding to the data fragment content of the firmware fragment data packet is generated
  • an embodiment of the present application provides a firmware data processing system, the system comprising:
  • the upper computer equipment and the lower computer equipment are The upper computer equipment and the lower computer equipment;
  • the host computer equipment is used to divide the target firmware into a plurality of firmware fragmentation data packets with preset file sizes, and according to preset rules, generate the first data fragment corresponding to the data fragmentation content of the firmware fragmentation data packet. a check code; and send the firmware fragmentation data packet including the first check code to the lower computer device;
  • the lower computer device is used to obtain the firmware fragmentation data packet of the target firmware sent by the upper computer device, and according to the preset rule, generate the first corresponding data fragmentation content of the acquired firmware fragmentation data packet.
  • two check codes and performing corresponding operations according to the check results of the second check codes and the first check codes.
  • the present application provides a computer-readable storage medium, the computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method described in the above aspects.
  • the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method described in the above aspects.
  • an embodiment of the present application provides a vehicle, the vehicle comprising: a body;
  • the firmware data processing device is mounted on the vehicle body.
  • the present application obtains the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes the data fragmentation content, and the corresponding data fragmentation content generated according to preset rules. a first check code; according to a preset rule, generate a second check code corresponding to the data fragment content of the obtained firmware fragment data packet; according to the second check code and the check result of the first check code, Perform the corresponding operation.
  • the lower computer device can perform verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the Abnormal situations such as data packet loss during the transmission process realize the effective supervision of the firmware transmission process and reduce the probability of errors during the transmission process.
  • FIG. 1 is a system architecture diagram of a firmware data processing system provided by an embodiment of the present application.
  • FIG. 2 is a flowchart of a method for processing firmware data on a lower computer device side provided by an embodiment of the present application
  • FIG. 3 is a flowchart of a method for processing firmware data on a host computer device side provided by an embodiment of the present application
  • FIG. 4 is a flow chart of interaction steps of a firmware data processing method provided by an embodiment of the present application.
  • FIG. 5 is a block diagram of a firmware data processing apparatus provided by an embodiment of the present application.
  • FIG. 6 is a block diagram of another firmware data processing apparatus provided by an embodiment of the present application.
  • FIG. 7 is a structural block diagram of a vehicle provided by an embodiment of the present application.
  • millimeter-wave radar In the field of unmanned driving and aerial photography surveying and mapping, millimeter-wave radar, as an all-weather, high-precision sensor, plays a huge role in vehicle perception. Based on the firmware data processing of millimeter-wave radar, the embodiments of the present application provide a Millimeter-wave radar is a lower computer device, which realizes the firmware data interaction with the upper computer device, so that the upper computer device can remotely issue new firmware data to update the old firmware data in the lower computer device. Wave Radar adapts to constantly iterative firmware algorithms. It should be noted that the lower computer device can also be other devices that need firmware upgrade and update, such as lidar, vehicle terminal, etc.
  • FIG. 1 it shows a system architecture diagram of a firmware data processing system provided by the embodiment of the present application, including: an upper computer device 10 and a lower computer device 20 , and the upper computer device 10 may be
  • the host computer device 10 can store or generate firmware data generated after the algorithm update iteration of the millimeter-wave radar, and the host computer device 10 can also establish a wired/wireless connection channel with the lower computer device 20, And send the firmware data to the lower computer device 20 through the connection channel.
  • the lower computer device 20 can load the firmware data under the condition of verifying that the firmware data is correct, so as to work with the new firmware.
  • the processing process for the firmware data includes: a process of transmitting the firmware data, and a process of loading the received firmware data by the lower computer device.
  • the connection channel with the upper computer device 10 is often unstable, thereby causing instability in the process of transmitting firmware data.
  • the storage device of the lower computer device 20 fails, the problem of failure to load the firmware data will also occur.
  • the entire target firmware to be transmitted can be divided into multiple smaller firmware fragment data packets by the host computer device, and the data packets of firmware fragments can be continuously verified during the transmission process. Check whether the check codes generated by the upper computer device and the lower computer device for each firmware fragmentation data packet are consistent to determine whether any firmware fragmentation data packet is lost or wrong in the transmission process. In addition, after the transmission process is completed, it is also possible to determine whether the transmitted target firmware is correct by verifying whether the check codes generated by the upper computer device and the lower computer device for the entire target firmware package are consistent to ensure the stability of the transmission process.
  • the lower computer device can first store the target firmware in the local storage space, and then generate the check code of the target firmware extracted from the storage space, and verify the generated check code and the upper Check whether the check code generated by the host device for the entire target firmware package is consistent to determine whether the lower computer device has a problem of storage failure, so as to ensure the loading stability.
  • FIG. 2 is a flowchart of a firmware data processing method provided by an embodiment of the present application. The method is applied to a lower computer device. As shown in FIG. 2 , the method may include:
  • Step 101 obtain the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes data fragmentation content, and the first calibration corresponding to the data fragmentation content generated according to preset rules. code verification.
  • the host computer device may divide the target firmware into a plurality of firmware fragmentation data packets with a fixed file size, and generate data fragmentation content corresponding to each firmware fragmentation data packet according to preset rules
  • the first check code, the firmware fragmentation data packet containing the first check code is sent to the lower computer equipment in turn, the first check code is unique, and is used for the data distribution of the corresponding firmware fragmentation data packet.
  • the correctness of the content of the slice is verified.
  • the check code of one firmware slice data packet is A.
  • the check code of another firmware slice data packet is A, it can be considered that these two firmware slices The packets are the same.
  • the check code of one firmware fragment data packet is A, and when the check code of another firmware fragment data packet is B, it can be considered that the two firmware fragment data packets are different.
  • the host computer device can convert the data fragment content of the firmware fragment data packet to be sent into a K-bit binary sequence, and generate a first check code corresponding to the binary sequence according to preset rules.
  • the verification code is also a binary sequence with a total of R bits.
  • the upper computer device can append the first check code to the K-bit binary sequence to obtain a K+R-bit binary sequence and send it to the lower computer device.
  • check code involved in the embodiment of the present application may be a Cyclic Redundancy Check (CRC) code
  • CRC Cyclic Redundancy Check
  • the channel coding technology of digital check code is mainly used to detect or verify errors that may occur after data transmission or storage.
  • the cyclic redundancy check is a calculation method used to verify the accuracy of digital transmission on a communication link.
  • the upper computer device uses a certain formula to calculate a value of the information contained in the transmitted data, and appends this value to the value. After the data is transmitted, it is sent to the lower-level computer device, and the lower-level computer device performs the same rule calculation on the same data to obtain the corresponding result. If the two CRC results are inconsistent, it means that there is an error in the transmission, and the lower device can request the upper device to resend the data.
  • Step 102 According to the preset rule, generate a second check code corresponding to the acquired data fragment content of the firmware fragment data packet.
  • the lower computer device after receiving each firmware fragmentation data packet, the lower computer device needs to verify the data fragmentation content of the received firmware fragmentation data packet to determine whether the content is correct.
  • the lower computer device can generate the second check code corresponding to the data fragment content of the firmware fragment data packet according to the preset rules agreed with the upper computer device, so as to compare the second check code with the first check code Compare.
  • the firmware fragmentation data packet when the lower computer device receives a firmware fragmentation data packet sent by the upper computer device, the firmware fragmentation data packet is in the form of a binary sequence of K+R bits, and the lower computer device can extract and reflect the content of its data fragmentation.
  • the K-bit binary sequence is generated, and according to the preset rules agreed with the host computer equipment, a second check code corresponding to the K-bit binary sequence is generated, and the second check code is in the form of an R-bit binary sequence.
  • Step 103 Perform corresponding operations according to the verification results of the second verification code and the first verification code.
  • the second check code is consistent with the first check code
  • the second check code is the same as the first check code. If the verification codes are inconsistent, for the two verification results, the lower computer equipment can perform corresponding operations respectively.
  • the second check code is consistent with the first check code
  • the host device can continue to receive the next firmware fragmentation data packet sent by the host device.
  • the second check code is inconsistent with the first check code
  • the lower computer device can It is considered that there is a transmission error, and the operation of reporting an error to the upper computer device is performed.
  • the lower computer device is a millimeter wave radar.
  • the method may further include:
  • Step 104 in the case of receiving all the firmware fragmentation data packets of the target firmware sent by the host computer equipment, and completing the verification operation of the check code of the firmware fragmentation data packets, the current loading is performed.
  • the firmware of the millimeter wave radar is changed to the target firmware, and the firmware upgrade operation of the millimeter wave radar is completed.
  • millimeter-wave radar as an all-weather, high-precision sensor, plays a huge role in vehicle perception.
  • the lower computer equipment receives the upper computer in sequence.
  • Each firmware fragment data packet sent by the device, and the verification operation based on the check code is performed on the firmware fragment data packet.
  • the lower The host device can confirm that it has received the complete and correct target firmware.
  • the subordinate device can change the currently loaded firmware to the target firmware, so that the host device can remotely issue new firmware data to update the firmware in the subordinate device.
  • the purpose of the old firmware data thus making the millimeter wave radar adapt to the constantly iterative firmware algorithm.
  • a firmware data processing method provided by an embodiment of the present application is obtained by acquiring a firmware fragmentation data packet of target firmware sent by a host computer device; the firmware fragmentation data packet includes data fragmentation content, and is generated according to preset rules.
  • the first check code corresponding to the content of the data fragmentation according to the preset rules, generate the second check code corresponding to the content of the data fragmentation of the obtained firmware fragmentation data packet; according to the second check code and the first check code
  • the verification result of the verification code is performed, and the corresponding operation is performed.
  • the lower computer device can perform verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the Abnormal situations such as data packet loss during the transmission process realize the effective supervision of the firmware transmission process and reduce the probability of errors during the transmission process.
  • FIG. 3 is a specific flowchart of a firmware data processing method provided by an embodiment of the present application. The method is applied to a host computer device. As shown in FIG. 3 , the method may include:
  • Step 201 Divide the target firmware into a plurality of firmware fragment data packets with preset file sizes.
  • developers can develop and generate target firmware on the host computer device, and the host computer device can also receive target firmware sent by other devices. Since the volume of the target firmware is generally large, in order to ensure the stability of the transmission process, To avoid interruptions in the transmission process and the need to retransmit the entire target firmware, the host computer device can divide the target firmware into multiple firmware fragmentation data packets with preset file sizes, and send the firmware fragmentation data packets to the For the lower-level computer device, when there is a situation in which a certain firmware fragment data packet fails to be sent, it only needs to resend the firmware fragment data packet instead of resending the entire target firmware.
  • the step 201 may also be implemented by determining the preset file size according to the length of the check code corresponding to the preset rule and the target bit error rate of the target firmware for transmission.
  • the firmware transmission method provided by the embodiment of the present application can be applied to different application scenarios, and different application scenarios require different target bit error rates when transmitting target firmware.
  • the generation accuracy of the check code is decreased, and the target bit error rate when transmitting the target firmware is increased, thereby affecting the transmission quality. Therefore, in the embodiment of the present application, the host computer device can be based on the current application scenario.
  • Step 202 according to a preset rule, generate a first check code corresponding to the data fragment content of the firmware fragment data packet.
  • the host computer device can convert the data fragment content of the firmware fragment data packet to be sent into a K-bit binary sequence, and generate a first check code corresponding to the binary sequence according to preset rules.
  • the verification code is also a binary sequence with a total of R bits.
  • the upper computer device can append the first check code to the K-bit binary sequence to obtain a K+R-bit binary sequence and send it to the lower computer device.
  • the form of the check code involved in the embodiment of the present application may be a CRC code.
  • Step 203 Send the firmware fragmentation data packet including the first check code to the lower computer device.
  • the upper computer device sequentially sends the firmware fragmentation data packet containing the first check code to the lower computer device, and the first check code is unique, which is used for the data distribution of the firmware fragmentation data packet received by the lower computer device. The correctness of the content of the film is verified.
  • a firmware data processing method by dividing the target firmware into a plurality of firmware fragmentation data packets with preset file sizes; The first check code of the content of the data fragmentation; the firmware fragmentation data packet including the first check code is sent to the lower computer device.
  • the target firmware can be divided into a plurality of firmware fragmentation data packets through the host computer equipment, and the first check code corresponding to each firmware fragmentation data packet is added to the firmware fragmentation data packet and sent to the lower computer.
  • the device, the lower computer device performs verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the transmission process. It can effectively supervise the firmware transmission process and reduce the probability of errors in the transmission process.
  • FIG. 4 is a flowchart of interaction steps of a firmware data processing method provided by an embodiment of the present application. As shown in FIG. 4 , the method may include:
  • Step 301 The upper computer device sends an update command including the first firmware version number of the target firmware to the lower computer device.
  • the firmware version number may be used to reflect the degree of the newness of the firmware.
  • the firmware version number 1 of one firmware 1 is greater than the firmware version number 2 of the other firmware 2, it is indicated that the firmware 1 is the latest firmware.
  • the format of the firmware version number includes: XXX.YYYYYYYZZZ, where XXX represents the device model of the lower computer device, YYYYYYYY represents the date and time of the firmware release (for example, 20200102 represents January 2, 2020), ZZZ represents the version identifier corresponding to the firmware.
  • the device models of the two firmware version numbers When comparing two firmware version numbers, the device models of the two firmware version numbers must be the same, and the firmware version number with a later firmware release date and time is greater than the firmware version number with an earlier firmware release date and time. In addition, when the device model and the firmware release date and time of the two firmware version numbers are consistent, the firmware version number with the larger version ID is larger than the firmware version number with the smaller version ID.
  • the address where the first firmware version number is stored is the firmware data header of the target firmware, and the data header is used to store some verification information of the target firmware, and will not be loaded into the memory when the target firmware is finally loaded by the lower device. run in.
  • Step 302 The lower computer device acquires an update command sent by the upper computer device, where the update command includes the first firmware version number of the target firmware.
  • Step 303 when the first firmware version number of the lower computer device is greater than the second firmware version number of the local firmware of the lower computer device, go to step 307 .
  • the lower computer device before the lower computer device starts to update the firmware, it may first receive an update command including the first firmware version number of the target firmware sent by the upper computer device, and according to the second firmware of the local firmware of the lower computer device According to the comparison result between the version number and the first firmware version number, a corresponding operation is performed.
  • the lower computer device can further receive the target firmware issued by the upper computer device to perform firmware upgrade.
  • the second firmware version number is greater than or equal to the first firmware version number, it indicates that the target firmware is the old firmware, and the lower computer device does not need to perform a firmware upgrade operation at this time.
  • Step 304 The host computer device divides the target firmware into a plurality of firmware fragmentation data packets with preset file sizes.
  • Step 305 The host computer device generates a first check code corresponding to the data fragment content of the firmware fragment data packet according to a preset rule.
  • Step 306 The upper computer device sends the firmware fragmentation data packet including the first check code to the lower computer device.
  • Step 307 The lower computer device obtains the firmware fragmentation data packet of the target firmware sent by the upper computer device.
  • Step 308 The lower computer device generates a second check code corresponding to the acquired data fragment content of the firmware fragment data packet according to the preset rule.
  • the second check code in the case where the second check code is inconsistent with the first check code, it means that the content of the firmware fragmentation data packet received by the lower computer device is inconsistent with the content of the firmware fragmentation data packet sent by the upper computer device , at this time, the lower computer device can think that there is a transmission error, and performs the operation of reporting an error to the upper computer device, and sends a transmission error report request to the upper computer device.
  • Step 310 In the case that the second check code is the same as the first check code, the lower computer device continues to acquire the next firmware fragmentation data packet sent by the upper computer device.
  • the second check code is consistent with the first check code, it means that the content of the firmware fragmentation data packet received by the lower computer device is consistent with the content of the firmware fragmentation data packet sent by the upper computer device.
  • the lower computer device can Execute the operation of continuing to receive the next firmware fragmentation data packet sent by the upper computer device.
  • Step 311 If the upper computer device obtains the transmission error report request sent by the lower computer device, it stops sending the firmware fragmentation data packet to the lower computer device.
  • the upper computer device may, according to the transmission error report request sent by the lower computer device, consider that there is a problem in the transmission channel, and stop sending the firmware fragmentation data packet to the lower computer device, and resume transmission after the problem is resolved. When resuming transmission, it is possible to resend the firmware fragment packets that were transmitted when the transmission error request occurred.
  • Step 312 The lower computer device generates a third check code corresponding to the data fragment content of all the obtained firmware fragment data packets according to the preset rule.
  • the lower computer equipment can generate a third check code corresponding to the data fragment content of all the obtained firmware fragment data packets according to the preset rules agreed with the upper computer equipment, and the third check code is used for the lower computer equipment. Verify that the data content of the entire target firmware received by the host device is correct or not.
  • Step 313 The lower computer device sends the third check code to the upper computer device.
  • the lower computer device can send the third check code to the upper computer device, so that the upper computer device can verify the third check code and the fifth check code generated by itself.
  • Step 314 The upper computer device acquires the third check code sent by the lower computer device.
  • Step 315 The host computer device generates a fifth check code corresponding to the content of all data fragments of the target firmware according to the preset rule.
  • the host computer device may generate a fifth check code corresponding to the content of all data segments of the target firmware based on the preset rules agreed with the subordinate computer device in advance.
  • the third check code is used to reflect the correctness of the data content of the entire target firmware generated by the upper computer device.
  • Step 316 when the third check code is the same as the fifth check code, the upper computer device sends a confirmation instruction for the third check code to the lower computer device.
  • the upper computer device may consider that the entire target firmware received by the lower computer device is the same as the content of the entire target firmware issued by the upper computer device. If they are consistent, the upper computer device sends a confirmation command for the third check code to the lower computer device, so that the lower computer device can confirm the completion of the transmission of the target firmware according to the confirmation command.
  • the environment of the application scenario is more complex, and the transmission link is relatively unstable.
  • the lower computer device sends the actually generated third check code
  • the lower computer is caused by the failure of the transmission link.
  • the device may send an incorrect third check code with each bit of 0 to the upper computer device.
  • the content of the third check code actually generated by the lower computer device is lost.
  • the third check code it can be judged that there is a problem in the transmission link of the target firmware, and the upper computer device can thus report an error to remind the link problem to be corrected.
  • the environment of the application scenario is more complicated, and the transmission link is unstable, so that the lower computer device may send a data stream with each bit of 0 to the upper computer device;
  • the check code of a data stream whose bits are all 0 is still 0, which causes the check code to lose its error detection function.
  • the upper computer device can also send the fifth check code to the lower computer device, and the lower computer device will check the third check code and the fifth check code. Perform verification, and send a firmware error alarm to the upper computer device if the verification is inconsistent.
  • Step 317 when the third check code is different from the fifth check code, the host computer device generates a firmware error alarm, and stops the process for processing the target firmware after a preset time.
  • the upper computer device may consider that the correct target firmware has not been received by the lower computer device, and at this time the upper computer device generates a firmware error
  • the alarm is used to correct firmware errors, and the process for processing the target firmware is stopped after a preset time, so as to avoid errors in the subsequent firmware transmission process caused by errors such as transmission channels.
  • Step 318 when the lower computer device obtains the confirmation instruction for the third check code sent by the upper computer device, it is determined that the transmission of the target firmware is completed.
  • the lower computer device can confirm the completion of the transmission of the target firmware, and continue the subsequent target firmware loading process.
  • the method further includes:
  • Step 319 The lower computer device stores all the firmware fragmentation data packets of the target firmware in the first flash memory space.
  • the lower-level device may load the target firmware through a loader, and before performing the loading operation, the lower-level device may store all firmware fragmentation data packets of the target firmware to the first A flash memory space, the flash memory space is used to temporarily store firmware data, and the data processing speed is extremely fast, and the target firmware can be quickly extracted from the first flash memory space when the subsequent loading operation needs to load the target firmware into the memory space.
  • the method further includes:
  • Step 320 The lower computer device modifies the flag bit of the first flash memory space to the first firmware flag bit.
  • Step 321 The lower computer device loads the target firmware according to the first firmware flag.
  • the loading of the target firmware by the loader is realized by using the flag bit as the loading guide.
  • the flag of the first flash memory space can be stored in the first flash memory space.
  • the bit is modified to the first firmware flag bit for the loader to load the target firmware according to the first firmware flag bit, that is, the loader will load the data in the storage space with the first firmware flag bit.
  • step 321 may include:
  • Sub-step 3211 the lower computer device extracts the firmware fragmentation data packet of the target firmware in the first flash memory space according to the first firmware flag bit, and stores the firmware fragmentation data packet in the memory space.
  • the embodiment of the present application can perform a check code-based target firmware loading check , to verify the memory stability of the lower computer device.
  • the lower computer device can extract the firmware fragmentation data packets of the target firmware from the first flash memory space for temporarily storing the target firmware according to the first firmware flag bit, and store the firmware fragmentation data packets in the memory space in sequence.
  • the memory space is the space for storing the data related to the target firmware when the target firmware is finally run, and the stability of the memory space affects the running quality of the target firmware.
  • Sub-step 3212 the lower computer device generates a fourth check code corresponding to the data fragment content of all firmware fragment data packets of the target firmware according to the preset rule.
  • data fragments corresponding to all firmware fragmentation data packets of the target firmware may be generated based on the preset rules agreed with the host computer device
  • the fourth check code of the content is used to verify whether the data content of the target firmware in the memory space is correct or not.
  • Sub-step 3213 the lower computer device runs the target firmware in the memory space when the fourth check code is the same as the third check code.
  • the lower computer device may consider that the correct and complete target firmware is normally stored in the first flash memory space and memory space, and then it is considered that the flash memory space and memory space of the lower computer device are fault-free and operate normally, and the probability of loading failure due to the failure of the storage space in the subsequent process is low. At this time, the lower computer device can run the memory space through the loader program. target firmware for subsequent operations.
  • the method may also include:
  • Sub-step 3214 In the case that the fourth check code is different from the third check code, the lower computer device sends a loading error report request to the upper computer device.
  • the lower computer device may consider that the target firmware is not normally stored in the first flash memory space and memory space, and then it is considered that there is a fault in the flash memory space and/or memory space of the lower computer device. At this time, the lower computer device can send a loading error request to the upper computer device to notify the fault condition for maintenance personnel to repair.
  • Sub-step 3215 in the case that the fourth check code is different from the third check code, the lower computer device modifies the first firmware flag to a second firmware flag, and the second firmware The flag bit is a flag bit written to the second flash memory space for firmware backup.
  • the lower computer device can also be provided with an independent second flash memory space, and backup firmware can be stored in the second flash memory space to realize disaster recovery of firmware data.
  • the backup is estimated to be an old stable firmware version, so that the lower
  • the host device can run the backup firmware when the new firmware is loaded with errors, so as to prevent the lower device from working normally.
  • the lower computer device can modify the first firmware flag bit to the second firmware flag bit, so as to load according to the second firmware flag bit Backup firmware for emergency.
  • Sub-step 3216 in the case that the value of the second firmware flag is not 0, the lower computer device loads the backup firmware in the second flash memory space according to the second firmware flag.
  • the case where the firmware flag is not 0 is a valid case.
  • the lower computer device loads the backup firmware in the second flash memory space according to the second firmware flag to run, so as to realize the firmware data data disaster recovery.
  • Sub-step 3217 When the number of times of modifying the firmware flag bit reaches a preset number of times, the lower computer device sends a firmware error report request to the upper computer device.
  • the loading program of the lower computer equipment is to load the firmware through the firmware flag bit
  • the firmware flag bit is the starting space address that controls the next loading of the firmware, and this address will be modified in two cases: First, when the firmware upgrade is successful this time, the next firmware load needs to enter the new target firmware to run, so the flag bit needs to be changed to the first flag bit; the second is when the target firmware fails to be loaded. It means that the target firmware corresponding to the first flag bit can no longer run, so it is necessary to modify the flag bit to the second flag bit to ensure that the next time the firmware is loaded into another backup firmware.
  • the preset number of times can be 2, and its initial value is 0
  • the preset number of times can be 2, and its initial value is 0
  • a firmware data processing method provided by an embodiment of the present application is obtained by acquiring a firmware fragmentation data packet of target firmware sent by a host computer device; the firmware fragmentation data packet includes data fragmentation content, and is generated according to preset rules.
  • the first check code corresponding to the content of the data fragmentation according to the preset rules, generate the second check code corresponding to the content of the data fragmentation of the obtained firmware fragmentation data packet; according to the second check code and the first check code
  • the verification result of the verification code is performed, and the corresponding operation is performed.
  • the lower computer device can perform verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the Abnormal situations such as data packet loss during the transmission process realize the effective supervision of the firmware transmission process and reduce the probability of errors during the transmission process.
  • the firmware data processing method provided by the embodiment of the present application can avoid problems such as data loss, loading failure, hardware failure, etc. that occur in the target firmware upgrade process to the greatest extent, and has a perfect error reporting mechanism compared to the firmware upgrade solution in the prior art It can help the host computer to realize real-time error discovery, real-time investigation, etc. It provides a more reliable, robust and user-friendly firmware upgrade solution, and provides an effective method for firmware upgrade and loading and later firmware repair.
  • FIG. 5 is a block diagram of a firmware data processing apparatus provided by an embodiment of the present application.
  • the apparatus is applied to a lower computer device.
  • the firmware data processing apparatus 400 may include: a memory 401 and a processor 402;
  • the memory 401 is used to execute: obtain the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes the data fragmentation content, and the corresponding data fragmentation generated according to preset rules.
  • the processor 402 is configured to execute:
  • the processor is configured to, according to the preset rule, generate a second check code corresponding to the data fragment content of the obtained firmware fragment data packet;
  • the processor is specifically used for:
  • the memory is specifically used for:
  • the second check code is the same as the first check code, continue to acquire the next firmware fragment data packet sent by the upper computer device.
  • the processor is specifically configured to execute:
  • the processor is also used to:
  • the processor is also used for:
  • All firmware fragment data packets of the target firmware are stored in the first flash memory space.
  • the processor is also used for:
  • the processor is specifically used for:
  • the first firmware flag bit extract the firmware fragmentation data packet of the target firmware in the first flash memory space, and store the firmware fragmentation data packet in the memory space;
  • the processor is also used for:
  • the processor is also used for:
  • the fourth check code is different from the third check code
  • the first firmware flag bit is modified to a second firmware flag bit, and the second firmware flag bit is written for The flag bit of the second flash memory space for firmware backup;
  • the backup firmware in the second flash memory space is loaded according to the second firmware flag.
  • the processor is also used for:
  • the memory is also used for:
  • the processor is also used to:
  • the step of obtaining the firmware fragmentation data packet of the target firmware sent by the upper computer device is entered.
  • the lower computer device is a millimeter wave radar.
  • the processor is also used for:
  • the firmware data processing device obtains the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes the data fragmentation content, and the corresponding data generated according to the preset rules.
  • the first check code of the data fragment content according to the preset rules, generate the second check code corresponding to the data fragment content of the obtained firmware fragment data packet; according to the second check code and the first check code the verification result, and perform the corresponding operation.
  • the lower computer device can perform verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the Abnormal situations such as data packet loss during the transmission process realize the effective supervision of the firmware transmission process and reduce the probability of errors during the transmission process.
  • FIG. 6 is a block diagram of a firmware data processing apparatus provided by an embodiment of the present application.
  • the apparatus is applied to a host computer device.
  • the firmware data processing apparatus 500 may include a processor 501;
  • the processor is used to execute:
  • a first check code corresponding to the data fragment content of the firmware fragment data packet is generated
  • the processor is also used for:
  • the processor is also used for:
  • the processor is also used for:
  • the processor is also used for:
  • the processor is also used for:
  • the preset file size is determined according to the length of the check code corresponding to the preset rule and the target bit error rate for transmitting the target firmware.
  • the firmware data processing device divides the target firmware into a plurality of firmware fragmentation data packets with preset file sizes; and generates data packets corresponding to the firmware fragmentation data packets according to the preset rules.
  • the first check code of the content of the slice send the firmware slice data packet including the first check code to the lower computer device.
  • the target firmware can be divided into a plurality of firmware fragmentation data packets through the host computer equipment, and the first check code corresponding to each firmware fragmentation data packet is added to the firmware fragmentation data packet and sent to the lower computer.
  • the device the lower computer device performs verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the transmission process. It can effectively supervise the firmware transmission process and reduce the probability of errors in the transmission process.
  • the vehicle 600 includes: a body 601 ; the firmware data processing apparatus 500 shown in FIG.
  • the body 601 is described.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the computer program is executed by a processor, each process of the above-mentioned embodiments of the firmware data processing method can be achieved, and the same can be achieved. The technical effect, in order to avoid repetition, will not be repeated here.
  • the computer-readable storage medium such as read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), magnetic disk or optical disk and so on.
  • the memory may be an interface for connecting the external control terminal with the firmware data processing device.
  • the external control terminal may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a control terminal with an identification module, an audio input /Output (I/O) ports, video I/O ports, headphone ports, and more.
  • the memory may be used to obtain input (eg, data information, power, etc.) from an external control terminal and transmit the obtained input to one or more elements within the firmware data processing device or may be used in the firmware data processing device and Transfer data between external control terminals.
  • At least one magnetic disk storage device For example at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the processor is the control center of the control terminal. It uses various interfaces and lines to connect various parts of the entire control terminal, and executes control by running or executing the software programs and/or modules stored in the memory and calling the data stored in the memory. Various functions of the terminal and processing data, so as to carry out overall monitoring of the control terminal.
  • the processor may include one or more processing units; preferably, the processor may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor Mainly deals with wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor.
  • the embodiments of the present application may be provided as a method, a control terminal, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising the instruction to control the terminal,
  • the instruction controls the terminal to implement the function specified in one flow or multiple flows of the flowchart and/or one block or multiple blocks of the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

A firmware data processing method and apparatus, and a photographic module and a mobile device. The method comprises: acquiring a firmware fragment data packet of target firmware that is sent by an upper computer device, wherein the firmware fragment data packet comprises data fragment content and a first check code, which is generated according to a preset rule and corresponds to the data fragment content (101); according to the preset rule, generating a second check code corresponding to the data fragment content of the acquired firmware fragment data packet (102); and according to check results of the second check code and the first check code, executing a corresponding operation (103). In the method, check-code-based verification can be performed on the content of each received firmware fragment data packet of target firmware by means of a lower computer device to determine whether the firmware fragment data packet is a correct data packet, so as to identify abnormal conditions such as data packet loss during a transmission process, thereby effectively supervising a firmware transmission process, and reducing the probability of errors during the transmission process.

Description

固件数据处理方法及装置Firmware data processing method and device 技术领域technical field
本申请涉及固件处理技术领域,特别是涉及一种固件数据处理方法及装置。The present application relates to the technical field of firmware processing, and in particular, to a method and device for processing firmware data.
背景技术Background technique
近年来,无人驾驶异常火热,在众多车载传感器中,毫米波雷达作为一种全天候、高精度的传感器在整车感知中发挥了巨大的作用,提升了无人驾驶技术的精确性和实用性。In recent years, unmanned driving has become extremely popular. Among many on-board sensors, millimeter-wave radar, as an all-weather, high-precision sensor, has played a huge role in vehicle perception, improving the accuracy and practicability of unmanned driving technology. .
毫米波雷达的使用过程中,算法软件等方案会时常更新迭代,因此毫米波雷达需要经常进行固件更新,来适应不断迭代的算法。目前,毫米波雷达的固件更新可以通过与上位机设备的数据交互来实现,上位机设备在生成新的固件后,可以建立与毫米波雷达的传输通道,并将固件数据发送至毫米波雷达进行加载更新,以替换毫米波雷达中较旧的固件。During the use of the millimeter-wave radar, the algorithm software and other solutions will be updated and iterated frequently. Therefore, the millimeter-wave radar needs to be frequently updated with firmware to adapt to the iterative algorithm. At present, the firmware update of the millimeter-wave radar can be realized by data interaction with the host computer device. After the host computer device generates new firmware, it can establish a transmission channel with the millimeter-wave radar and send the firmware data to the millimeter-wave radar for processing. Load update to replace older firmware in mmWave radar.
但是,目前方案中,由于毫米波雷达使用场景的复杂性,导致固件在传输过程中经常出现数据丢失等异常情况,而目前传输方案对固件传输过程不能提供有效监管,导致固件加载出错的几率大幅上升。However, in the current solution, due to the complexity of the millimeter-wave radar usage scenarios, abnormal situations such as data loss often occur in the firmware during the transmission process, and the current transmission solution cannot provide effective supervision for the firmware transmission process, resulting in a large probability of firmware loading errors. rise.
发明内容SUMMARY OF THE INVENTION
本申请提供一种固件数据处理方法、装置、摄像模组及可移动设备,可以解决现有技术中对固件传输过程不能提供有效监管,导致固件在传输过程中经常出现数据丢失等异常情况,且固件加载出错的几率大幅上升的问题。The present application provides a firmware data processing method, device, camera module and removable device, which can solve the problem that the prior art cannot provide effective supervision for the firmware transmission process, resulting in frequent occurrence of abnormal situations such as data loss in the firmware transmission process, and The problem that the probability of firmware loading error is greatly increased.
第一方面,本申请实施例提供了一种固件数据处理方法,应用于下位机设备,包括:In a first aspect, an embodiment of the present application provides a firmware data processing method, which is applied to a lower computer device, including:
获取上位机设备发送的目标固件的固件分片数据包;所述固件分片数据包中包括数据分片内容,以及按照预设规则生成的对应所述数据分片内容的第一校验码;Obtain the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes data fragmentation content, and a first check code corresponding to the data fragmentation content generated according to a preset rule;
按照所述预设规则,生成对应获取到的所述固件分片数据包的数据分片内容的第二校验码;According to the preset rule, generate a second check code corresponding to the data fragment content of the obtained firmware fragment data packet;
根据所述第二校验码和所述第一校验码的校验结果,执行对应的操作。Corresponding operations are performed according to the verification results of the second check code and the first check code.
第二方面,本申请实施例提供了一种固件数据处理方法,应用于上位机 设备,包括:The second aspect, the embodiment of the present application provides a kind of firmware data processing method, is applied to the host computer equipment, including:
将目标固件切分为多个具有预设文件大小的固件分片数据包;Divide the target firmware into multiple firmware shard packets with preset file sizes;
按照预设规则,生成对应所述固件分片数据包的数据分片内容的第一校验码;According to a preset rule, a first check code corresponding to the data fragment content of the firmware fragment data packet is generated;
将包括所述第一校验码的固件分片数据包发送至所述下位机设备。Send the firmware fragmentation data packet including the first check code to the lower computer device.
第三方面,本申请实施例提供了一种固件数据处理装置,应用于下位机设备,包括:存储器和处理器;In a third aspect, an embodiment of the present application provides a firmware data processing apparatus, which is applied to a lower computer device, including: a memory and a processor;
所述存储器用于,获取上位机设备发送的目标固件的固件分片数据包;所述固件分片数据包中包括数据分片内容,以及按照预设规则生成的对应所述数据分片内容的第一校验码;The memory is used to obtain the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes the data fragmentation content, and the corresponding data fragmentation content generated according to the preset rule. the first check code;
所述处理器用于,按照所述预设规则,生成对应获取到的所述固件分片数据包的数据分片内容的第二校验码;The processor is configured to, according to the preset rule, generate a second check code corresponding to the data fragment content of the obtained firmware fragment data packet;
根据所述第二校验码和所述第一校验码的校验结果,执行对应的操作。第四方面,本申请实施例提供了固件数据处理装置,应用于上位机设备,所述装置包括:处理器;Corresponding operations are performed according to the verification results of the second check code and the first check code. In a fourth aspect, an embodiment of the present application provides a firmware data processing apparatus, which is applied to a host computer device, and the apparatus includes: a processor;
所述处理器用于:The processor is used to:
将目标固件切分为多个具有预设文件大小的固件分片数据包;Divide the target firmware into multiple firmware shard packets with preset file sizes;
按照预设规则,生成对应所述固件分片数据包的数据分片内容的第一校验码;According to a preset rule, a first check code corresponding to the data fragment content of the firmware fragment data packet is generated;
将包括所述第一校验码的固件分片数据包发送至所述下位机设备。Send the firmware fragmentation data packet including the first check code to the lower computer device.
第五方面,本申请实施例提供了一种固件数据处理系统,所述系统包括:In a fifth aspect, an embodiment of the present application provides a firmware data processing system, the system comprising:
上位机设备和下位机设备;The upper computer equipment and the lower computer equipment;
所述上位机设备用于,将目标固件切分为多个具有预设文件大小的固件分片数据包,并按照预设规则,生成对应所述固件分片数据包的数据分片内容的第一校验码;以及将包括所述第一校验码的固件分片数据包发送至所述下位机设备;The host computer equipment is used to divide the target firmware into a plurality of firmware fragmentation data packets with preset file sizes, and according to preset rules, generate the first data fragment corresponding to the data fragmentation content of the firmware fragmentation data packet. a check code; and send the firmware fragmentation data packet including the first check code to the lower computer device;
所述下位机设备用于,获取上位机设备发送的目标固件的固件分片数据包,并按照所述预设规则,生成对应获取到的所述固件分片数据包的数据分片内容的第二校验码;以及根据所述第二校验码和所述第一校验码的校验结 果,执行对应的操作。The lower computer device is used to obtain the firmware fragmentation data packet of the target firmware sent by the upper computer device, and according to the preset rule, generate the first corresponding data fragmentation content of the acquired firmware fragmentation data packet. two check codes; and performing corresponding operations according to the check results of the second check codes and the first check codes.
第六方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质包括指令,当其在计算机上运行时,使得计算机执行上述方面所述的方法。In a sixth aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method described in the above aspects.
第七方面,本申请提供一种计算机程序产品,所述计算机程序产品包括指令,当其在计算机上运行时,使得计算机执行上述方面所述的方法。In a seventh aspect, the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method described in the above aspects.
第八方面,本申请实施例提供了一种车辆,所述车辆包括:车身;In an eighth aspect, an embodiment of the present application provides a vehicle, the vehicle comprising: a body;
所述的固件数据处理装置,所述固件数据处理装置安装于所述车身。The firmware data processing device is mounted on the vehicle body.
在本申请实施例中,本申请通过获取上位机设备发送的目标固件的固件分片数据包;固件分片数据包中包括数据分片内容,以及按照预设规则生成的对应数据分片内容的第一校验码;按照预设规则,生成对应获取到的固件分片数据包的数据分片内容的第二校验码;根据第二校验码和第一校验码的校验结果,执行对应的操作。本申请可以通过下位机设备对接收到的目标固件的每个固件分片数据包的内容,进行基于校验码的验证,来判断该固件分片数据包是否是正确的数据包,从而识别到传输过程中出现的数据包丢失等异常情况,实现了对固件传输过程的有效监管,降低了传输过程中出错的几率。In the embodiment of the present application, the present application obtains the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes the data fragmentation content, and the corresponding data fragmentation content generated according to preset rules. a first check code; according to a preset rule, generate a second check code corresponding to the data fragment content of the obtained firmware fragment data packet; according to the second check code and the check result of the first check code, Perform the corresponding operation. In the present application, the lower computer device can perform verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the Abnormal situations such as data packet loss during the transmission process realize the effective supervision of the firmware transmission process and reduce the probability of errors during the transmission process.
附图说明Description of drawings
图1是本申请实施例提供的一种固件数据处理系统的系统架构图;1 is a system architecture diagram of a firmware data processing system provided by an embodiment of the present application;
图2是本申请实施例提供的一种下位机设备侧固件数据处理方法的流程图;2 is a flowchart of a method for processing firmware data on a lower computer device side provided by an embodiment of the present application;
图3是本申请实施例提供的一种上位机设备侧固件数据处理方法的流程图;3 is a flowchart of a method for processing firmware data on a host computer device side provided by an embodiment of the present application;
图4是本申请实施例提供的一种固件数据处理方法的交互步骤流程图;4 is a flow chart of interaction steps of a firmware data processing method provided by an embodiment of the present application;
图5是本申请实施例提供的一种固件数据处理装置的框图;5 is a block diagram of a firmware data processing apparatus provided by an embodiment of the present application;
图6是本申请实施例提供的另一种固件数据处理装置的框图;6 is a block diagram of another firmware data processing apparatus provided by an embodiment of the present application;
图7是本申请实施例提供的车辆的结构框图。FIG. 7 is a structural block diagram of a vehicle provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
在无人驾驶、航拍测绘领域,毫米波雷达作为一种全天候、高精度的传感器在整车感知中发挥了巨大的作用,基于毫米波雷达的固件数据处理,本申请实施例提供了一种以毫米波雷达为下位机设备,实现与上位机设备之间的固件数据交互,从而达到上位机设备远程下发新的固件数据,以更新下位机设备中的旧的固件数据的目的,从而使得毫米波雷达适应不断迭代的固件算法。需要说明的是,下位机设备也可以为其他需要进行固件升级、更新的设备,如,激光雷达、车载终端等。In the field of unmanned driving and aerial photography surveying and mapping, millimeter-wave radar, as an all-weather, high-precision sensor, plays a huge role in vehicle perception. Based on the firmware data processing of millimeter-wave radar, the embodiments of the present application provide a Millimeter-wave radar is a lower computer device, which realizes the firmware data interaction with the upper computer device, so that the upper computer device can remotely issue new firmware data to update the old firmware data in the lower computer device. Wave Radar adapts to constantly iterative firmware algorithms. It should be noted that the lower computer device can also be other devices that need firmware upgrade and update, such as lidar, vehicle terminal, etc.
在本申请实施例中,参照图1,其示出了本申请实施例提供的一种固件数据处理系统的系统架构图,包括:上位机设备10和下位机设备20,上位机设备10可以为移动终端、服务器等设备,上位机设备10可以存储或生成毫米波雷达的算法更新迭代后产生的固件数据,上位机设备10还可以建立有与下位机设备20之间的有线/无线连接通道,并将固件数据通过连接通道下发至下位机设备20。下位机设备20在接收到完整正确的固件数据后,可以在验证固件数据无误的情况下,加载该固件数据,以通过新的固件进行工作。In the embodiment of the present application, referring to FIG. 1 , it shows a system architecture diagram of a firmware data processing system provided by the embodiment of the present application, including: an upper computer device 10 and a lower computer device 20 , and the upper computer device 10 may be For devices such as mobile terminals and servers, the host computer device 10 can store or generate firmware data generated after the algorithm update iteration of the millimeter-wave radar, and the host computer device 10 can also establish a wired/wireless connection channel with the lower computer device 20, And send the firmware data to the lower computer device 20 through the connection channel. After receiving the complete and correct firmware data, the lower computer device 20 can load the firmware data under the condition of verifying that the firmware data is correct, so as to work with the new firmware.
具体的,针对固件数据的处理过程包括:传输固件数据的过程、下位机设备加载接收完毕的固件数据的过程。在下位机设备20处于较复杂工作环境时,常常会导致与上位机设备10之间的连接通道不稳定,从而造成传输固件数据过程的不稳定,具体体现在传输过程中出现数据丢失、传输完毕时发现传错了固件数据等,另外,在下位机设备20的存储装置出现故障的情况下,也会出现对固件数据加载失败的问题。Specifically, the processing process for the firmware data includes: a process of transmitting the firmware data, and a process of loading the received firmware data by the lower computer device. When the lower computer device 20 is in a relatively complex working environment, the connection channel with the upper computer device 10 is often unstable, thereby causing instability in the process of transmitting firmware data. When it is found that the firmware data is wrongly transmitted, etc., in addition, when the storage device of the lower computer device 20 fails, the problem of failure to load the firmware data will also occur.
本申请实施例为了提高对固件数据的传输稳定性的保障,可以由上位机设备将待传输的整个目标固件切分为多个体积较小的固件分片数据包,并在传输过程中持续验证上位机设备和下位机设备针对每个固件分片数据包生成的校验码是否一致,来确定传输过程中是否有固件分片数据包丢失或出错。另外,在传输过程完成后,还可以通过验证上位机设备和下位机设备针对整个目标固件包生成的校验码是否一致,来确定传输的目标固件是否正确,保证传输过程稳定性。最后,下位机设备在加载目标固件的过程中,可以先将目标固件存储在本地的存储空间,再生成从该存储空间提取的目标固件的校验码,并通过验证生成的校验码与上位机设备针对整个目标固件包生成的校验码是否一致,来确定下位机设备是否出现存储失效的问题,从而保证加载稳定性。In order to improve the guarantee of the transmission stability of firmware data in the embodiment of the present application, the entire target firmware to be transmitted can be divided into multiple smaller firmware fragment data packets by the host computer device, and the data packets of firmware fragments can be continuously verified during the transmission process. Check whether the check codes generated by the upper computer device and the lower computer device for each firmware fragmentation data packet are consistent to determine whether any firmware fragmentation data packet is lost or wrong in the transmission process. In addition, after the transmission process is completed, it is also possible to determine whether the transmitted target firmware is correct by verifying whether the check codes generated by the upper computer device and the lower computer device for the entire target firmware package are consistent to ensure the stability of the transmission process. Finally, in the process of loading the target firmware, the lower computer device can first store the target firmware in the local storage space, and then generate the check code of the target firmware extracted from the storage space, and verify the generated check code and the upper Check whether the check code generated by the host device for the entire target firmware package is consistent to determine whether the lower computer device has a problem of storage failure, so as to ensure the loading stability.
图2是本申请实施例提供的一种固件数据处理方法的流程图,所述方法,应用于下位机设备,如图2所示,该方法可以包括:FIG. 2 is a flowchart of a firmware data processing method provided by an embodiment of the present application. The method is applied to a lower computer device. As shown in FIG. 2 , the method may include:
步骤101、获取上位机设备发送的目标固件的固件分片数据包;所述固件分片数据包中包括数据分片内容,以及按照预设规则生成的对应所述数据分片内容的第一校验码。 Step 101, obtain the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes data fragmentation content, and the first calibration corresponding to the data fragmentation content generated according to preset rules. code verification.
在本申请实施例中,上位机设备可以将目标固件切分为多个固定文件大小的固件分片数据包,并按照预设规则,生成对应每个固件分片数据包中的数据分片内容的第一校验码,将包含第一校验码的固件分片数据包依次下发给下位机设备,该第一校验码唯一,用于对其对应的固件分片数据包的数据分片内容的正确与否进行验证,如,一个固件分片数据包的校验码为A,当存在另一个固件分片数据包的校验码为A时,则可以认为这两个固件分片数据包相同。一个固件分片数据包的校验码为A,当存在另一个固件分片数据包的校验码为B时,则可以认为这两个固件分片数据包不相同。In the embodiment of the present application, the host computer device may divide the target firmware into a plurality of firmware fragmentation data packets with a fixed file size, and generate data fragmentation content corresponding to each firmware fragmentation data packet according to preset rules The first check code, the firmware fragmentation data packet containing the first check code is sent to the lower computer equipment in turn, the first check code is unique, and is used for the data distribution of the corresponding firmware fragmentation data packet. The correctness of the content of the slice is verified. For example, the check code of one firmware slice data packet is A. When the check code of another firmware slice data packet is A, it can be considered that these two firmware slices The packets are the same. The check code of one firmware fragment data packet is A, and when the check code of another firmware fragment data packet is B, it can be considered that the two firmware fragment data packets are different.
具体的,上位机设备可以将待发送的固件分片数据包的数据分片内容转换为K位的二进制序列,并按照预设规则,生成对应该二进制序列的第一校验码,第一校验码也为一个二进制序列,共R位,之后,上位机设备可以将第一校验码附加在K位的二进制序列之后,得到一个K+R位的二进制序列并发送给下位机设备。Specifically, the host computer device can convert the data fragment content of the firmware fragment data packet to be sent into a K-bit binary sequence, and generate a first check code corresponding to the binary sequence according to preset rules. The verification code is also a binary sequence with a total of R bits. After that, the upper computer device can append the first check code to the K-bit binary sequence to obtain a K+R-bit binary sequence and send it to the lower computer device.
需要说明的是,本申请实施例中涉及的校验码的形式可以为循环冗余校验(Cyclic Redundancy Check,CRC)码,CRC是一种根据网络数据包或计算机文件等数据产生简短固定位数校验码的信道编码技术,主要用来检测或校验数据传输或者保存后可能出现的错误。It should be noted that the form of the check code involved in the embodiment of the present application may be a Cyclic Redundancy Check (CRC) code, and CRC is a short fixed bit generated according to data such as network data packets or computer files. The channel coding technology of digital check code is mainly used to detect or verify errors that may occur after data transmission or storage.
具体的,循环冗余校验是一种用于校验通信链路上数字传输准确性的计算方法,上位机设备使用某公式计算出被传送数据所含信息的一个值,并将此值附在被传送数据后发送至下位机设备,下位机设备则对同一数据进行相同规则的计算,得到对应的结果。如果这两个CRC结果不一致,则说明发送中出现了差错,下位机设备可要求上位机设备重新发送该数据。Specifically, the cyclic redundancy check is a calculation method used to verify the accuracy of digital transmission on a communication link. The upper computer device uses a certain formula to calculate a value of the information contained in the transmitted data, and appends this value to the value. After the data is transmitted, it is sent to the lower-level computer device, and the lower-level computer device performs the same rule calculation on the same data to obtain the corresponding result. If the two CRC results are inconsistent, it means that there is an error in the transmission, and the lower device can request the upper device to resend the data.
步骤102、按照所述预设规则,生成对应获取到的所述固件分片数据包的数据分片内容的第二校验码。Step 102: According to the preset rule, generate a second check code corresponding to the acquired data fragment content of the firmware fragment data packet.
在本申请实施例中,下位机设备在接收到每个固件分片数据包之后,需要对接收到的固件分片数据包的数据分片内容进行验证,确定内容是否正确。In the embodiment of the present application, after receiving each firmware fragmentation data packet, the lower computer device needs to verify the data fragmentation content of the received firmware fragmentation data packet to determine whether the content is correct.
因此,下位机设备可以按照与上位机设备约定一致的预设规则,生成对应固件分片数据包的数据分片内容的第二校验码,以将第二校验码与第一校 验码进行比较。Therefore, the lower computer device can generate the second check code corresponding to the data fragment content of the firmware fragment data packet according to the preset rules agreed with the upper computer device, so as to compare the second check code with the first check code Compare.
具体的,下位机设备在接收到上位机设备发送的一个固件分片数据包时,该固件分片数据包为K+R位的二进制序列的形式,下位机设备可以提取反映其数据分片内容的K位的二进制序列,并按照与上位机设备约定一致的预设规则,生成对应该K位的二进制序列的第二校验码,该第二校验码为R位的二进制序列的形式。Specifically, when the lower computer device receives a firmware fragmentation data packet sent by the upper computer device, the firmware fragmentation data packet is in the form of a binary sequence of K+R bits, and the lower computer device can extract and reflect the content of its data fragmentation. The K-bit binary sequence is generated, and according to the preset rules agreed with the host computer equipment, a second check code corresponding to the K-bit binary sequence is generated, and the second check code is in the form of an R-bit binary sequence.
步骤103、根据所述第二校验码和所述第一校验码的校验结果,执行对应的操作。Step 103: Perform corresponding operations according to the verification results of the second verification code and the first verification code.
在本申请实施例中,第二校验码和第一校验码进行校验具有两种校验结果:第二校验码和第一校验码一致、第二校验码和第一校验码不一致,针对这两种校验结果,下位机设备可以分别执行对应的操作。In the embodiment of the present application, there are two kinds of verification results when the second check code and the first check code are checked: the second check code is consistent with the first check code, and the second check code is the same as the first check code. If the verification codes are inconsistent, for the two verification results, the lower computer equipment can perform corresponding operations respectively.
具体的,在第二校验码和第一校验码一致的情况下,说明下位机设备接收到的固件分片数据包与上位机设备发送的固件分片数据包的内容一致,此时下位机设备可以执行继续接收上位机设备发送的下一个固件分片数据包的操作。在第二校验码和第一校验码不一致的情况下,说明下位机设备接收到的固件分片数据包与上位机设备发送的固件分片数据包的内容不一致,此时下位机设备可以认为出现传输错误,并执行向上位机设备报错的操作。Specifically, in the case where the second check code is consistent with the first check code, it means that the content of the firmware fragmentation data packet received by the lower computer device is consistent with the content of the firmware fragmentation data packet sent by the upper computer device. The host device can continue to receive the next firmware fragmentation data packet sent by the host device. In the case where the second check code is inconsistent with the first check code, it means that the content of the firmware fragmentation data packet received by the lower computer device is inconsistent with the content of the firmware fragmentation data packet sent by the upper computer device. At this time, the lower computer device can It is considered that there is a transmission error, and the operation of reporting an error to the upper computer device is performed.
可选的,下位机设备为毫米波雷达。在步骤103之后,所述方法还可以包括:Optionally, the lower computer device is a millimeter wave radar. After step 103, the method may further include:
步骤104、在接收完毕所述上位机设备发送的所述目标固件的所有固件分片数据包,且完成对所述固件分片数据包的校验码的校验操作的情况下,将当前加载的固件变更为所述目标固件,完成所述毫米波雷达的固件的升级操作。Step 104, in the case of receiving all the firmware fragmentation data packets of the target firmware sent by the host computer equipment, and completing the verification operation of the check code of the firmware fragmentation data packets, the current loading is performed. The firmware of the millimeter wave radar is changed to the target firmware, and the firmware upgrade operation of the millimeter wave radar is completed.
在实际应用中,毫米波雷达作为一种全天候、高精度的传感器在整车感知中发挥了巨大的作用,基于毫米波雷达的固件数据处理,本申请实施例中,下位机设备依次接收上位机设备发送的每个固件分片数据包,并对固件分片数据包进行基于校验码的验证操作,在所有的固件分片数据包的校验码的校验操作完成并验证正确后,下位机设备可以确认接收到完整正确的目标固件,此时下位机设备可以将当前加载的固件变更为所述目标固件,从而达到上位机设备远程下发新的固件数据,以更新下位机设备中的旧的固件数据的目的,从而使得毫米波雷达适应不断迭代的固件算法。In practical applications, millimeter-wave radar, as an all-weather, high-precision sensor, plays a huge role in vehicle perception. Based on the firmware data processing of millimeter-wave radar, in the embodiment of this application, the lower computer equipment receives the upper computer in sequence. Each firmware fragment data packet sent by the device, and the verification operation based on the check code is performed on the firmware fragment data packet. After the check code verification operation of all firmware fragment data packets is completed and verified correctly, the lower The host device can confirm that it has received the complete and correct target firmware. At this time, the subordinate device can change the currently loaded firmware to the target firmware, so that the host device can remotely issue new firmware data to update the firmware in the subordinate device. The purpose of the old firmware data, thus making the millimeter wave radar adapt to the constantly iterative firmware algorithm.
综上,本申请实施例提供的一种固件数据处理方法,通过获取上位机设备发送的目标固件的固件分片数据包;固件分片数据包中包括数据分片内容,以及按照预设规则生成的对应数据分片内容的第一校验码;按照预设规则,生成对应获取到的固件分片数据包的数据分片内容的第二校验码;根据第二校验码和第一校验码的校验结果,执行对应的操作。本申请可以通过下位机设备对接收到的目标固件的每个固件分片数据包的内容,进行基于校验码的验证,来判断该固件分片数据包是否是正确的数据包,从而识别到传输过程中出现的数据包丢失等异常情况,实现了对固件传输过程的有效监管,降低了传输过程中出错的几率。To sum up, a firmware data processing method provided by an embodiment of the present application is obtained by acquiring a firmware fragmentation data packet of target firmware sent by a host computer device; the firmware fragmentation data packet includes data fragmentation content, and is generated according to preset rules. The first check code corresponding to the content of the data fragmentation; according to the preset rules, generate the second check code corresponding to the content of the data fragmentation of the obtained firmware fragmentation data packet; according to the second check code and the first check code The verification result of the verification code is performed, and the corresponding operation is performed. In the present application, the lower computer device can perform verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the Abnormal situations such as data packet loss during the transmission process realize the effective supervision of the firmware transmission process and reduce the probability of errors during the transmission process.
图3是本申请实施例提供的一种固件数据处理方法的具体流程图,所述方法应用于上位机设备,如图3所示,该方法可以包括:FIG. 3 is a specific flowchart of a firmware data processing method provided by an embodiment of the present application. The method is applied to a host computer device. As shown in FIG. 3 , the method may include:
步骤201、将目标固件切分为多个具有预设文件大小的固件分片数据包。Step 201: Divide the target firmware into a plurality of firmware fragment data packets with preset file sizes.
在本申请实施例中,开发人员可以在上位机设备上开发生成目标固件,上位机设备也可以接收其他设备发送的目标固件,由于目标固件的体积一般较大,为了保证传输过程的稳定性,避免传输过程中出现中断导致需要重新传输整个目标固件,上位机设备可以将目标固件切分为多个具有预设文件大小的固件分片数据包,并将所述固件分片数据包依次发送至下位机设备,当存在某个固件分片数据包发送失败的情况,也仅需重新发送该固件分片数据包,而非重新发送整个目标固件。In the embodiment of the present application, developers can develop and generate target firmware on the host computer device, and the host computer device can also receive target firmware sent by other devices. Since the volume of the target firmware is generally large, in order to ensure the stability of the transmission process, To avoid interruptions in the transmission process and the need to retransmit the entire target firmware, the host computer device can divide the target firmware into multiple firmware fragmentation data packets with preset file sizes, and send the firmware fragmentation data packets to the For the lower-level computer device, when there is a situation in which a certain firmware fragment data packet fails to be sent, it only needs to resend the firmware fragment data packet instead of resending the entire target firmware.
可选的,所述步骤201还可以通过根据所述预设规则对应的校验码的长度,以及传输所述目标固件的目标误比特率,确定所述预设文件大小的方式进行实现。Optionally, the step 201 may also be implemented by determining the preset file size according to the length of the check code corresponding to the preset rule and the target bit error rate of the target firmware for transmission.
具体的,本申请实施例提供的固件传输方法可以应用于不同的应用场景中,且不同应用场景传输目标固件时所需求的目标误比特率不同,固件分片数据包的文件大小过大,会导致校验码的生成精确度下降,且传输目标固件时的目标误比特率提高,从而影响传输质量,因此,本申请实施例中,上位机设备可以根据当前应用场景所需求的目标误比特率,以及所采用的校验码的长度,来确定每个的固件分片数据包的文件大小,从而使得传输目标固件时的实际误比特率不会与目标误比特率相差过大。Specifically, the firmware transmission method provided by the embodiment of the present application can be applied to different application scenarios, and different application scenarios require different target bit error rates when transmitting target firmware. As a result, the generation accuracy of the check code is decreased, and the target bit error rate when transmitting the target firmware is increased, thereby affecting the transmission quality. Therefore, in the embodiment of the present application, the host computer device can be based on the current application scenario. The required target bit error rate , and the length of the check code used to determine the file size of each firmware fragment data packet, so that the actual bit error rate when transmitting the target firmware will not be too different from the target bit error rate.
步骤202、按照预设规则,生成对应所述固件分片数据包的数据分片内容的第一校验码。 Step 202 , according to a preset rule, generate a first check code corresponding to the data fragment content of the firmware fragment data packet.
具体的,上位机设备可以将待发送的固件分片数据包的数据分片内容转换为K位的二进制序列,并按照预设规则,生成对应该二进制序列的第一校验码,第一校验码也为一个二进制序列,共R位,之后,上位机设备可以将第一校验码附加在K位的二进制序列之后,得到一个K+R位的二进制序列并发送给下位机设备。需要说明的是,本申请实施例中涉及的校验码的形式可以为CRC码。Specifically, the host computer device can convert the data fragment content of the firmware fragment data packet to be sent into a K-bit binary sequence, and generate a first check code corresponding to the binary sequence according to preset rules. The verification code is also a binary sequence with a total of R bits. After that, the upper computer device can append the first check code to the K-bit binary sequence to obtain a K+R-bit binary sequence and send it to the lower computer device. It should be noted that the form of the check code involved in the embodiment of the present application may be a CRC code.
步骤203、将包括所述第一校验码的固件分片数据包发送至所述下位机设备。Step 203: Send the firmware fragmentation data packet including the first check code to the lower computer device.
上位机设备将包含第一校验码的固件分片数据包依次下发给下位机设备,该第一校验码唯一,用于让下位机设备对其接收的固件分片数据包的数据分片内容的正确与否进行验证。The upper computer device sequentially sends the firmware fragmentation data packet containing the first check code to the lower computer device, and the first check code is unique, which is used for the data distribution of the firmware fragmentation data packet received by the lower computer device. The correctness of the content of the film is verified.
综上,本申请实施例提供的一种固件数据处理方法,通过将目标固件切分为多个具有预设文件大小的固件分片数据包;按照预设规则,生成对应固件分片数据包的数据分片内容的第一校验码;将包括第一校验码的固件分片数据包发送至下位机设备。本申请可以通过上位机设备将目标固件切分为多个固件分片数据包,并将每个固件分片数据包对应的第一校验码添加至固件分片数据包中下发给下位机设备,下位机设备对接收到的目标固件的每个固件分片数据包的内容,进行基于校验码的验证,来判断该固件分片数据包是否是正确的数据包,从而识别到传输过程中出现的数据包丢失等异常情况,实现了对固件传输过程的有效监管,降低了传输过程中出错的几率。To sum up, a firmware data processing method provided by the embodiments of the present application, by dividing the target firmware into a plurality of firmware fragmentation data packets with preset file sizes; The first check code of the content of the data fragmentation; the firmware fragmentation data packet including the first check code is sent to the lower computer device. In this application, the target firmware can be divided into a plurality of firmware fragmentation data packets through the host computer equipment, and the first check code corresponding to each firmware fragmentation data packet is added to the firmware fragmentation data packet and sent to the lower computer. The device, the lower computer device performs verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the transmission process. It can effectively supervise the firmware transmission process and reduce the probability of errors in the transmission process.
图4是本申请实施例提供的一种固件数据处理方法的交互步骤流程图,如图4所示,该方法可以包括:FIG. 4 is a flowchart of interaction steps of a firmware data processing method provided by an embodiment of the present application. As shown in FIG. 4 , the method may include:
步骤301、上位机设备发送包括所述目标固件的第一固件版本号的更新命令至所述下位机设备。Step 301: The upper computer device sends an update command including the first firmware version number of the target firmware to the lower computer device.
在本申请实施例中,可以采用固件版本号来反映固件的新旧程度,当一个固件1的固件版本号1大于另一个固件2的固件版本号2时,说明该固件1为最新的固件。In the embodiment of the present application, the firmware version number may be used to reflect the degree of the newness of the firmware. When the firmware version number 1 of one firmware 1 is greater than the firmware version number 2 of the other firmware 2, it is indicated that the firmware 1 is the latest firmware.
在一种实现方式中,固件版本号的格式包括:XXX.YYYYYYYY.ZZZ,其中,XXX代表下位机设备的设备型号,YYYYYYYY代表固件发布的日 期时间(如20200102表示2020年1月2日),ZZZ代表固件对应的版本标识。In an implementation manner, the format of the firmware version number includes: XXX.YYYYYYYY.ZZZ, where XXX represents the device model of the lower computer device, YYYYYYYY represents the date and time of the firmware release (for example, 20200102 represents January 2, 2020), ZZZ represents the version identifier corresponding to the firmware.
在进行两个固件版本号的比较时,这两个固件版本号的设备型号需一致,固件发布的日期时间较晚的固件版本号大于固件发布的日期时间较早的固件版本号。另外,当两个固件版本号的设备型号、固件发布的日期时间都一致时,具有较大版本标识的固件版本号大于具有较小版本标识的固件版本号。When comparing two firmware version numbers, the device models of the two firmware version numbers must be the same, and the firmware version number with a later firmware release date and time is greater than the firmware version number with an earlier firmware release date and time. In addition, when the device model and the firmware release date and time of the two firmware version numbers are consistent, the firmware version number with the larger version ID is larger than the firmware version number with the smaller version ID.
需要说明的是,该第一固件版本号存放的地址是在目标固件的固件数据头,该数据头用于存放目标固件的一些验证信息,在下位机设备最后加载目标固件时不会加载到内存中运行。It should be noted that the address where the first firmware version number is stored is the firmware data header of the target firmware, and the data header is used to store some verification information of the target firmware, and will not be loaded into the memory when the target firmware is finally loaded by the lower device. run in.
步骤302、下位机设备获取所述上位机设备发送的更新命令,所述更新命令包括所述目标固件的第一固件版本号。Step 302: The lower computer device acquires an update command sent by the upper computer device, where the update command includes the first firmware version number of the target firmware.
步骤303、下位机设备在所述第一固件版本号,大于所述下位机设备的本地的固件的第二固件版本号的情况下,进入步骤307。Step 303 , when the first firmware version number of the lower computer device is greater than the second firmware version number of the local firmware of the lower computer device, go to step 307 .
在本申请实施例中,下位机设备开始进行固件更新之前,可以先接收上位机设备发送的包括目标固件的第一固件版本号的更新命令,并根据下位机设备的本地的固件的第二固件版本号与第一固件版本号的比较结果,执行对应的操作。In the embodiment of the present application, before the lower computer device starts to update the firmware, it may first receive an update command including the first firmware version number of the target firmware sent by the upper computer device, and according to the second firmware of the local firmware of the lower computer device According to the comparison result between the version number and the first firmware version number, a corresponding operation is performed.
具体的,在第二固件版本号小于第一固件版本号的情况下,说明目标固件为新固件,下位机设备可以进一步接收上位机设备下发的目标固件,以进行固件升级。Specifically, when the second firmware version number is smaller than the first firmware version number, it indicates that the target firmware is new firmware, and the lower computer device can further receive the target firmware issued by the upper computer device to perform firmware upgrade.
在第二固件版本号大于或等于第一固件版本号的情况下,说明目标固件为旧固件,下位机设备此时并不需要进行固件升级操作。In the case that the second firmware version number is greater than or equal to the first firmware version number, it indicates that the target firmware is the old firmware, and the lower computer device does not need to perform a firmware upgrade operation at this time.
步骤304、上位机设备将目标固件切分为多个具有预设文件大小的固件分片数据包。Step 304: The host computer device divides the target firmware into a plurality of firmware fragmentation data packets with preset file sizes.
该步骤具体可以参照上述步骤201,此处不再赘述。For details of this step, reference may be made to the foregoing step 201, which will not be repeated here.
步骤305、上位机设备按照预设规则,生成对应所述固件分片数据包的数据分片内容的第一校验码。Step 305: The host computer device generates a first check code corresponding to the data fragment content of the firmware fragment data packet according to a preset rule.
该步骤具体可以参照上述步骤202,此处不再赘述。For details of this step, reference may be made to the foregoing step 202, which will not be repeated here.
步骤306、上位机设备将包括所述第一校验码的固件分片数据包发送至所述下位机设备。Step 306: The upper computer device sends the firmware fragmentation data packet including the first check code to the lower computer device.
该步骤具体可以参照上述步骤203,此处不再赘述。For details of this step, reference may be made to the foregoing step 203, which will not be repeated here.
步骤307、下位机设备获取上位机设备发送的目标固件的固件分片数据包。Step 307: The lower computer device obtains the firmware fragmentation data packet of the target firmware sent by the upper computer device.
该步骤具体可以参照上述步骤101,此处不再赘述。For details of this step, reference may be made to the foregoing step 101, which will not be repeated here.
步骤308、下位机设备按照所述预设规则,生成对应获取到的所述固件分片数据包的数据分片内容的第二校验码。Step 308: The lower computer device generates a second check code corresponding to the acquired data fragment content of the firmware fragment data packet according to the preset rule.
该步骤具体可以参照上述步骤102,此处不再赘述。For details of this step, reference may be made to the foregoing step 102, which will not be repeated here.
步骤309、下位机设备在所述第二校验码与所述第一校验码不相同的情况下,向所述上位机设备发送传输报错请求。Step 309 , when the second check code is different from the first check code, the lower computer device sends a transmission error report request to the upper computer device.
在本申请实施例中,在第二校验码和第一校验码不一致的情况下,说明下位机设备接收到的固件分片数据包与上位机设备发送的固件分片数据包的内容不一致,此时下位机设备可以认为出现传输错误,并执行向上位机设备报错的操作,发送传输报错请求至上位机设备。In the embodiment of this application, in the case where the second check code is inconsistent with the first check code, it means that the content of the firmware fragmentation data packet received by the lower computer device is inconsistent with the content of the firmware fragmentation data packet sent by the upper computer device , at this time, the lower computer device can think that there is a transmission error, and performs the operation of reporting an error to the upper computer device, and sends a transmission error report request to the upper computer device.
步骤310、下位机设备在所述第二校验码与所述第一校验码相同的情况下,继续获取所述上位机设备发送的下一个固件分片数据包。Step 310: In the case that the second check code is the same as the first check code, the lower computer device continues to acquire the next firmware fragmentation data packet sent by the upper computer device.
在第二校验码和第一校验码一致的情况下,说明下位机设备接收到的固件分片数据包与上位机设备发送的固件分片数据包的内容一致,此时下位机设备可以执行继续接收上位机设备发送的下一个固件分片数据包的操作。In the case that the second check code is consistent with the first check code, it means that the content of the firmware fragmentation data packet received by the lower computer device is consistent with the content of the firmware fragmentation data packet sent by the upper computer device. At this time, the lower computer device can Execute the operation of continuing to receive the next firmware fragmentation data packet sent by the upper computer device.
步骤311、上位机设备若获取到所述下位机设备发送的传输报错请求,则停止向所述下位机设备发送所述固件分片数据包。Step 311: If the upper computer device obtains the transmission error report request sent by the lower computer device, it stops sending the firmware fragmentation data packet to the lower computer device.
在本申请实施例中,上位机设备可以根据下位机设备发送的传输报错请求,认为传输通道出现了问题,并停止向下位机设备发送固件分片数据包,待问题解除后再恢复传输。恢复传输时,可以对出现传输报错请求时传输的固件分片数据包进行重新发送。In the embodiment of the present application, the upper computer device may, according to the transmission error report request sent by the lower computer device, consider that there is a problem in the transmission channel, and stop sending the firmware fragmentation data packet to the lower computer device, and resume transmission after the problem is resolved. When resuming transmission, it is possible to resend the firmware fragment packets that were transmitted when the transmission error request occurred.
可选的,在获取到所述上位机设备发送的所有固件分片数据包,且最后一次获取到的固件分片数据包的第二校验码和第一校验码相同的情况下,所述方法还包括:Optionally, under the condition that all firmware fragmentation data packets sent by the host computer device are obtained, and the second check code of the firmware fragmentation data packet obtained for the last time is the same as the first check code, the The method also includes:
步骤312、下位机设备按照所述预设规则,生成对应已获取到的所有固件分片数据包的数据分片内容的第三校验码。Step 312: The lower computer device generates a third check code corresponding to the data fragment content of all the obtained firmware fragment data packets according to the preset rule.
在本申请实施例中,在上位机设备和下位机设备对目标固件的传输过程中,通过第二校验码和第一校验码的校验操作,可以确定传输的每个固件分 片数据包是否有误,在下位机设备接收到上位机设备发送的所有固件分片数据包,且最后一次获取到的固件分片数据包的第二校验码和第一校验码相同的情况下,下位机设备可以按照与上位机设备约定的预设规则,生成对应已获取到的所有固件分片数据包的数据分片内容的第三校验码,该第三校验码用于对下位机设备接收到的整个目标固件的数据内容的正确与否进行验证。In the embodiment of the present application, during the transmission process of the target firmware from the host computer device and the subordinate computer device, through the verification operation of the second check code and the first check code, it is possible to determine the transmitted data of each firmware fragment Whether the package is wrong, when the lower computer device receives all the firmware fragmentation data packets sent by the upper computer device, and the second check code of the last acquired firmware fragmentation data packet is the same as the first check code. , the lower computer equipment can generate a third check code corresponding to the data fragment content of all the obtained firmware fragment data packets according to the preset rules agreed with the upper computer equipment, and the third check code is used for the lower computer equipment. Verify that the data content of the entire target firmware received by the host device is correct or not.
步骤313、下位机设备将所述第三校验码发送至所述上位机设备。Step 313: The lower computer device sends the third check code to the upper computer device.
在生成了第三校验码之后,下位机设备可以将第三校验码发送至上位机设备,以供上位机设备将第三校验码与自身生成的第五校验码进行校验。After the third check code is generated, the lower computer device can send the third check code to the upper computer device, so that the upper computer device can verify the third check code and the fifth check code generated by itself.
步骤314、上位机设备获取所述下位机设备发送的第三校验码。Step 314: The upper computer device acquires the third check code sent by the lower computer device.
步骤315、上位机设备按照所述预设规则,生成对应所述目标固件的所有数据分片内容的第五校验码。Step 315: The host computer device generates a fifth check code corresponding to the content of all data fragments of the target firmware according to the preset rule.
在本申请实施例中,在产生目标固件后,上位机设备可以事先基于与下位机设备约定的预设规则,生成对应目标固件的所有数据分片内容的第五校验码。该第三校验码用于反映对上位机设备生成的整个目标固件的数据内容的正确性。In this embodiment of the present application, after generating the target firmware, the host computer device may generate a fifth check code corresponding to the content of all data segments of the target firmware based on the preset rules agreed with the subordinate computer device in advance. The third check code is used to reflect the correctness of the data content of the entire target firmware generated by the upper computer device.
步骤316、上位机设备在所述第三校验码与所述第五校验码相同的情况下,发送针对所述第三校验码的确认指令至所述下位机设备。Step 316 , when the third check code is the same as the fifth check code, the upper computer device sends a confirmation instruction for the third check code to the lower computer device.
在本申请实施例中,在第三校验码与第五校验码相同的情况下,上位机设备可以认为下位机设备接收到的整个目标固件,与上位机设备下发的整个目标固件内容一致,此时上位机设备发送针对第三校验码的确认指令至所述下位机设备,以供下位机设备根据该确认指令,确认目标固件的传输结束。In this embodiment of the present application, when the third check code is the same as the fifth check code, the upper computer device may consider that the entire target firmware received by the lower computer device is the same as the content of the entire target firmware issued by the upper computer device. If they are consistent, the upper computer device sends a confirmation command for the third check code to the lower computer device, so that the lower computer device can confirm the completion of the transmission of the target firmware according to the confirmation command.
进一步的,在一些情况下,应用场景的环境较为复杂,传输链路存在较不稳定的问题,下位机设备在发送实际生成的第三校验码时,由于传输链路出现故障而导致下位机设备可能会发送一个各个位为0的错误的第三校验码至上位机设备,此时下位机设备实际生成的第三校验码的内容丢失,当上位机设备接收到各个位为0的第三校验码时,可以判断目标固件的发送链路出现问题,上位机设备由此可以进行报错,以提醒对链路问题进行修正。或者,在一些情况下,应用场景的环境较为复杂,传输链路存在较不稳定的问题,导致下位机设备可能会发送一个各个位均为0的数据流至上位机设备;此时, 由于各个位均为0的数据流的校验码依然为0,导致校验码丧失检错功能。Further, in some cases, the environment of the application scenario is more complex, and the transmission link is relatively unstable. When the lower computer device sends the actually generated third check code, the lower computer is caused by the failure of the transmission link. The device may send an incorrect third check code with each bit of 0 to the upper computer device. At this time, the content of the third check code actually generated by the lower computer device is lost. When the third check code is used, it can be judged that there is a problem in the transmission link of the target firmware, and the upper computer device can thus report an error to remind the link problem to be corrected. Or, in some cases, the environment of the application scenario is more complicated, and the transmission link is unstable, so that the lower computer device may send a data stream with each bit of 0 to the upper computer device; The check code of a data stream whose bits are all 0 is still 0, which causes the check code to lose its error detection function.
需要说明的是,在不考虑对上述链路问题的情况下,上位机设备也可以将第五校验码发送至下位机设备,由下位机设备对第三校验码与第五校验码进行校验,在出现校验不一致的情况下,向上位机设备发送固件错误告警。It should be noted that, without considering the above-mentioned link problems, the upper computer device can also send the fifth check code to the lower computer device, and the lower computer device will check the third check code and the fifth check code. Perform verification, and send a firmware error alarm to the upper computer device if the verification is inconsistent.
步骤317、上位机设备在所述第三校验码与所述第五校验码不相同的情况下,生成固件错误告警,并在预设时间后停止用于处理所述目标固件的进程。Step 317 , when the third check code is different from the fifth check code, the host computer device generates a firmware error alarm, and stops the process for processing the target firmware after a preset time.
在本申请实施例中,在第三校验码与第五校验码不相同的情况下,上位机设备可以认为下位机设备未接收到的正确的目标固件,此时上位机设备生成固件错误告警,以供对固件错误进行修正,并在预设时间后停止用于处理所述目标固件的进程,避免因传输通道等错误导致后续固件传输过程出错。In the embodiment of the present application, in the case where the third check code is different from the fifth check code, the upper computer device may consider that the correct target firmware has not been received by the lower computer device, and at this time the upper computer device generates a firmware error The alarm is used to correct firmware errors, and the process for processing the target firmware is stopped after a preset time, so as to avoid errors in the subsequent firmware transmission process caused by errors such as transmission channels.
步骤318、下位机设备在获取到所述上位机设备发送的针对所述第三校验码的确认指令的情况下,确定所述目标固件传输完毕。Step 318 , when the lower computer device obtains the confirmation instruction for the third check code sent by the upper computer device, it is determined that the transmission of the target firmware is completed.
下位机设备根据该确认指令,可以确认目标固件的传输结束,并继续进行后续的目标固件加载过程。According to the confirmation instruction, the lower computer device can confirm the completion of the transmission of the target firmware, and continue the subsequent target firmware loading process.
可选的,在步骤318之后,所述方法还包括:Optionally, after step 318, the method further includes:
步骤319、下位机设备将所述目标固件的所有固件分片数据包存储至第一闪存空间。Step 319: The lower computer device stores all the firmware fragmentation data packets of the target firmware in the first flash memory space.
在本申请实施例中,下位机设备在接收到目标固件之后,可以通过加载程序进行目标固件的加载,在执行加载操作之前,下位机设备可以将目标固件的所有固件分片数据包存储至第一闪存空间,闪存空间用于暂存固件数据,其处理数据的速度极快,能够在后续加载操作需要将目标固件加载至内存空间时,快速的从该第一闪存空间中提取目标固件。In this embodiment of the present application, after receiving the target firmware, the lower-level device may load the target firmware through a loader, and before performing the loading operation, the lower-level device may store all firmware fragmentation data packets of the target firmware to the first A flash memory space, the flash memory space is used to temporarily store firmware data, and the data processing speed is extremely fast, and the target firmware can be quickly extracted from the first flash memory space when the subsequent loading operation needs to load the target firmware into the memory space.
可选的,在步骤319之后,所述方法还包括:Optionally, after step 319, the method further includes:
步骤320、下位机设备将所述第一闪存空间的标志位修改为第一固件标志位。Step 320: The lower computer device modifies the flag bit of the first flash memory space to the first firmware flag bit.
步骤321、下位机设备按照所述第一固件标志位加载所述目标固件。Step 321: The lower computer device loads the target firmware according to the first firmware flag.
具体的,加载程序加载目标固件是通过以标志位为加载指引进行实现的,下位机设备在将目标固件的所有固件分片数据包存储至第一闪存空间之后,可以将第一闪存空间的标志位修改为第一固件标志位,以供加载程序按照第 一固件标志位加载目标固件,即加载程序会加载具有第一固件标志位的存储空间中的数据。Specifically, the loading of the target firmware by the loader is realized by using the flag bit as the loading guide. After the lower computer device stores all the firmware fragmentation data packets of the target firmware in the first flash memory space, the flag of the first flash memory space can be stored in the first flash memory space. The bit is modified to the first firmware flag bit for the loader to load the target firmware according to the first firmware flag bit, that is, the loader will load the data in the storage space with the first firmware flag bit.
可选的,步骤321可以包括:Optionally, step 321 may include:
子步骤3211、下位机设备按照所述第一固件标志位,提取所述第一闪存空间中所述目标固件的固件分片数据包,并将所述固件分片数据包存储至内存空间。Sub-step 3211, the lower computer device extracts the firmware fragmentation data packet of the target firmware in the first flash memory space according to the first firmware flag bit, and stores the firmware fragmentation data packet in the memory space.
在实际应用中,会存在由于下位机设备的内存出现故障而导致对目标固件的加载失败的问题,为了降低该问题发生的几率,本申请实施例可以进行基于校验码的目标固件加载校验,以验证下位机设备的内存稳定性。In practical applications, there may be a problem that the target firmware fails to be loaded due to the failure of the memory of the lower computer device. In order to reduce the probability of this problem, the embodiment of the present application can perform a check code-based target firmware loading check , to verify the memory stability of the lower computer device.
具体的,下位机设备可以按照第一固件标志位,从用于暂存目标固件的第一闪存空间中提取目标固件的固件分片数据包,并将固件分片数据包依次存储至内存空间中,内存空间为最终运行目标固件时存储目标固件相关数据的空间,内存空间的稳定性影响到目标固件的运行质量。Specifically, the lower computer device can extract the firmware fragmentation data packets of the target firmware from the first flash memory space for temporarily storing the target firmware according to the first firmware flag bit, and store the firmware fragmentation data packets in the memory space in sequence. , the memory space is the space for storing the data related to the target firmware when the target firmware is finally run, and the stability of the memory space affects the running quality of the target firmware.
子步骤3212、下位机设备按照所述预设规则,生成对应所述目标固件的所有固件分片数据包的数据分片内容的第四校验码。Sub-step 3212, the lower computer device generates a fourth check code corresponding to the data fragment content of all firmware fragment data packets of the target firmware according to the preset rule.
在本申请实施例中,在将目标固件的固件分片数据包存储至内存空间后,可以基于与上位机设备约定的预设规则,生成对应目标固件的所有固件分片数据包的数据分片内容的第四校验码,该第四校验码用于验证内存空间中的目标固件的数据内容的正确与否。In the embodiment of the present application, after the firmware fragmentation data packets of the target firmware are stored in the memory space, data fragments corresponding to all firmware fragmentation data packets of the target firmware may be generated based on the preset rules agreed with the host computer device The fourth check code of the content is used to verify whether the data content of the target firmware in the memory space is correct or not.
子步骤3213、下位机设备在所述第四校验码与所述第三校验码相同的情况下,运行所述内存空间中的目标固件。Sub-step 3213, the lower computer device runs the target firmware in the memory space when the fourth check code is the same as the third check code.
在本申请实施例中,当第四校验码与之前传输过程中计算得到的第三校验码相同时,下位机设备可以认为正确完整的目标固件被正常的存储至了第一闪存空间和内存空间,进而认为下位机设备的闪存空间和内存空间无故障,且运行正常,后续过程中因存储空间出现故障导致加载失效的几率较低,此时下位机设备可以通过加载程序运行内存空间中的目标固件,进行后续作业。In the embodiment of the present application, when the fourth check code is the same as the third check code calculated in the previous transmission process, the lower computer device may consider that the correct and complete target firmware is normally stored in the first flash memory space and memory space, and then it is considered that the flash memory space and memory space of the lower computer device are fault-free and operate normally, and the probability of loading failure due to the failure of the storage space in the subsequent process is low. At this time, the lower computer device can run the memory space through the loader program. target firmware for subsequent operations.
可选的,所述方法还可以包括:Optionally, the method may also include:
子步骤3214、下位机设备在所述第四校验码与所述第三校验码不相同的情况下,向所述上位机设备发送加载报错请求。Sub-step 3214: In the case that the fourth check code is different from the third check code, the lower computer device sends a loading error report request to the upper computer device.
在本申请实施例中,当第四校验码与之前传输过程中计算得到的第三校验码不相同时,下位机设备可以认为目标固件并未被正常的存储至了第一闪存空间和内存空间,进而认为下位机设备的闪存空间和/或内存空间存在故障,此时下位机设备可以向上位机设备发送加载报错请求,以告知该故障情况,以供维修人员进行维修。In the embodiment of the present application, when the fourth check code is different from the third check code calculated in the previous transmission process, the lower computer device may consider that the target firmware is not normally stored in the first flash memory space and memory space, and then it is considered that there is a fault in the flash memory space and/or memory space of the lower computer device. At this time, the lower computer device can send a loading error request to the upper computer device to notify the fault condition for maintenance personnel to repair.
子步骤3215、下位机设备在所述第四校验码与所述第三校验码不相同的情况下,将所述第一固件标志位修改为第二固件标志位,所述第二固件标志位为写入用于进行固件备份的第二闪存空间的标志位。Sub-step 3215, in the case that the fourth check code is different from the third check code, the lower computer device modifies the first firmware flag to a second firmware flag, and the second firmware The flag bit is a flag bit written to the second flash memory space for firmware backup.
具体的,下位机设备还可以设置有独立的第二闪存空间,该第二闪存空间中可以存储有备份固件,以实现固件数据的容灾,备份估计可以为旧的稳定的固件版本,使得下位机设备可以在新固件加载出错的情况下可以运行备份固件,避免下位机设备无法正常工作。Specifically, the lower computer device can also be provided with an independent second flash memory space, and backup firmware can be stored in the second flash memory space to realize disaster recovery of firmware data. The backup is estimated to be an old stable firmware version, so that the lower The host device can run the backup firmware when the new firmware is loaded with errors, so as to prevent the lower device from working normally.
因此,下位机设备可以在第四校验码与所述第三校验码不相同的情况下,将所述第一固件标志位修改为第二固件标志位,以按照第二固件标志位加载备份固件进行应急。Therefore, under the condition that the fourth check code is different from the third check code, the lower computer device can modify the first firmware flag bit to the second firmware flag bit, so as to load according to the second firmware flag bit Backup firmware for emergency.
子步骤3216、下位机设备在所述第二固件标志位的值不为0的情况下,则按照所述第二固件标志位加载所述第二闪存空间中的备份固件。Sub-step 3216, in the case that the value of the second firmware flag is not 0, the lower computer device loads the backup firmware in the second flash memory space according to the second firmware flag.
在本申请实施例中,固件标志为不为0的情况为有效情况,此时下位机设备按照所述第二固件标志位加载所述第二闪存空间中的备份固件进行运行,以实现固件数据的数据容灾。In the embodiment of the present application, the case where the firmware flag is not 0 is a valid case. At this time, the lower computer device loads the backup firmware in the second flash memory space according to the second firmware flag to run, so as to realize the firmware data data disaster recovery.
子步骤3217、下位机设备在对固件标志位的修改次数达到预设次数的情况下,向所述上位机设备发送固件报错请求。Sub-step 3217: When the number of times of modifying the firmware flag bit reaches a preset number of times, the lower computer device sends a firmware error report request to the upper computer device.
在本申请实施例中,下位机设备的加载程序是通过固件标志位进行固件的加载的,固件标志位是控制下次加载固件的起始空间地址,该地址在两种情况下会被修改:一是本次固件升级成功时,下次固件加载需要进入到新的目标固件中运行,因此需要修改标志位为第一标志位;二是加载目标固件失败时,此时由于本次加载失败,代表该第一标志位对应的目标固件已经无法运行,因此需要进行修改标志位为第二标志位,保证下次加载固件进入的是另一个备份固件。此外,当修改标志位次数满预设次数时(预设次数可以为 2,其初始值为0)代表两个固件都无法使用,此时需要向上位机设备发送固件报错请求,以进行后续的固件修复。如此便保证了固件加载的合理顺畅,不会因为一个固件的损坏而使得整个下位机设备无法运行。In the embodiment of the present application, the loading program of the lower computer equipment is to load the firmware through the firmware flag bit, and the firmware flag bit is the starting space address that controls the next loading of the firmware, and this address will be modified in two cases: First, when the firmware upgrade is successful this time, the next firmware load needs to enter the new target firmware to run, so the flag bit needs to be changed to the first flag bit; the second is when the target firmware fails to be loaded. It means that the target firmware corresponding to the first flag bit can no longer run, so it is necessary to modify the flag bit to the second flag bit to ensure that the next time the firmware is loaded into another backup firmware. In addition, when the number of modified flag bits reaches the preset number of times (the preset number of times can be 2, and its initial value is 0), it means that both firmwares cannot be used. At this time, it is necessary to send a firmware error request to the upper computer device for follow-up Firmware fixes. This ensures that the firmware is loaded reasonably smoothly, and the entire lower-level computer device will not be rendered inoperable due to the damage of one firmware.
综上,本申请实施例提供的一种固件数据处理方法,通过获取上位机设备发送的目标固件的固件分片数据包;固件分片数据包中包括数据分片内容,以及按照预设规则生成的对应数据分片内容的第一校验码;按照预设规则,生成对应获取到的固件分片数据包的数据分片内容的第二校验码;根据第二校验码和第一校验码的校验结果,执行对应的操作。本申请可以通过下位机设备对接收到的目标固件的每个固件分片数据包的内容,进行基于校验码的验证,来判断该固件分片数据包是否是正确的数据包,从而识别到传输过程中出现的数据包丢失等异常情况,实现了对固件传输过程的有效监管,降低了传输过程中出错的几率。To sum up, a firmware data processing method provided by an embodiment of the present application is obtained by acquiring a firmware fragmentation data packet of target firmware sent by a host computer device; the firmware fragmentation data packet includes data fragmentation content, and is generated according to preset rules. The first check code corresponding to the content of the data fragmentation; according to the preset rules, generate the second check code corresponding to the content of the data fragmentation of the obtained firmware fragmentation data packet; according to the second check code and the first check code The verification result of the verification code is performed, and the corresponding operation is performed. In the present application, the lower computer device can perform verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the Abnormal situations such as data packet loss during the transmission process realize the effective supervision of the firmware transmission process and reduce the probability of errors during the transmission process.
另外,本申请实施例提供的固件数据处理方法对比现有技术的固件升级方案,可以在最大程度上避免目标固件升级过程中出现的数据丢失、加载失败、硬件失效等问题,且完善的报错机制可以帮助上位机设备实现错误实时发现,实时排查等作用,提供了更加可靠、更加鲁棒和人性化的固件升级方案,为固件的升级加载和后期固件修复提供了一个有效办法。In addition, the firmware data processing method provided by the embodiment of the present application can avoid problems such as data loss, loading failure, hardware failure, etc. that occur in the target firmware upgrade process to the greatest extent, and has a perfect error reporting mechanism compared to the firmware upgrade solution in the prior art It can help the host computer to realize real-time error discovery, real-time investigation, etc. It provides a more reliable, robust and user-friendly firmware upgrade solution, and provides an effective method for firmware upgrade and loading and later firmware repair.
图5是本申请实施例提供的一种固件数据处理装置的框图,所述装置应用于下位机设备,如图5所示,该固件数据处理装置400可以包括:存储器401和处理器402;FIG. 5 is a block diagram of a firmware data processing apparatus provided by an embodiment of the present application. The apparatus is applied to a lower computer device. As shown in FIG. 5 , the firmware data processing apparatus 400 may include: a memory 401 and a processor 402;
所述存储器401用于执行:获取上位机设备发送的目标固件的固件分片数据包;所述固件分片数据包中包括数据分片内容,以及按照预设规则生成的对应所述数据分片内容的第一校验码;The memory 401 is used to execute: obtain the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes the data fragmentation content, and the corresponding data fragmentation generated according to preset rules. The first check code of the content;
所述处理器402用于执行:The processor 402 is configured to execute:
所述处理器用于,按照所述预设规则,生成对应获取到的所述固件分片数据包的数据分片内容的第二校验码;The processor is configured to, according to the preset rule, generate a second check code corresponding to the data fragment content of the obtained firmware fragment data packet;
根据所述第二校验码和所述第一校验码的校验结果,执行对应的操作。Corresponding operations are performed according to the verification results of the second check code and the first check code.
可选的,所述处理器具体用于:Optionally, the processor is specifically used for:
在所述第二校验码与所述第一校验码不相同的情况下,向所述上位机设备发送传输报错请求。In the case that the second check code is different from the first check code, a transmission error report request is sent to the upper computer device.
可选的,所述存储器具体用于:Optionally, the memory is specifically used for:
在所述第二校验码与所述第一校验码相同的情况下,继续获取所述上位机设备发送的下一个固件分片数据包。In the case that the second check code is the same as the first check code, continue to acquire the next firmware fragment data packet sent by the upper computer device.
可选的,所述处理器具体用于执行:Optionally, the processor is specifically configured to execute:
所述处理器还用于:The processor is also used to:
按照所述预设规则,生成对应已获取到的所有固件分片数据包的数据分片内容的第三校验码;According to the preset rule, generate a third check code corresponding to the data fragment content of all the obtained firmware fragment data packets;
将所述第三校验码发送至所述上位机设备;sending the third check code to the host computer device;
在获取到所述上位机设备发送的针对所述第三校验码的确认指令的情况下,确定所述目标固件传输完毕。In the case of acquiring the confirmation instruction for the third check code sent by the host computer device, it is determined that the target firmware is transmitted.
可选的,所述处理器还用于:Optionally, the processor is also used for:
将所述目标固件的所有固件分片数据包存储至第一闪存空间。All firmware fragment data packets of the target firmware are stored in the first flash memory space.
可选的,所述处理器还用于:Optionally, the processor is also used for:
将所述第一闪存空间的标志位修改为第一固件标志位;Modifying the flag bit of the first flash memory space to the first firmware flag bit;
按照所述第一固件标志位加载所述目标固件。Load the target firmware according to the first firmware flag.
可选的,所述处理器具体用于:Optionally, the processor is specifically used for:
按照所述第一固件标志位,提取所述第一闪存空间中所述目标固件的固件分片数据包,并将所述固件分片数据包存储至内存空间;According to the first firmware flag bit, extract the firmware fragmentation data packet of the target firmware in the first flash memory space, and store the firmware fragmentation data packet in the memory space;
按照所述预设规则,生成对应所述目标固件的所有固件分片数据包的数据分片内容的第四校验码;According to the preset rule, generate a fourth check code corresponding to the data fragment content of all firmware fragment data packets of the target firmware;
在所述第四校验码与所述第三校验码相同的情况下,运行所述内存空间中的目标固件。When the fourth check code is the same as the third check code, run the target firmware in the memory space.
可选的,所述处理器还用于:Optionally, the processor is also used for:
在所述第四校验码与所述第三校验码不相同的情况下,向所述上位机设备发送加载报错请求。In the case that the fourth check code is different from the third check code, a loading error report request is sent to the upper computer device.
可选的,所述处理器还用于:Optionally, the processor is also used for:
在所述第四校验码与所述第三校验码不相同的情况下,将所述第一固件标志位修改为第二固件标志位,所述第二固件标志位为写入用于进行固件备份的第二闪存空间的标志位;In the case where the fourth check code is different from the third check code, the first firmware flag bit is modified to a second firmware flag bit, and the second firmware flag bit is written for The flag bit of the second flash memory space for firmware backup;
在所述第二固件标志位的值不为0的情况下,则按照所述第二固件标志位加载所述第二闪存空间中的备份固件。If the value of the second firmware flag is not 0, the backup firmware in the second flash memory space is loaded according to the second firmware flag.
可选的,所述处理器还用于:Optionally, the processor is also used for:
在对固件标志位的修改次数达到预设次数的情况下,向所述上位机设备发送固件报错请求。When the number of times of modification to the firmware flag reaches a preset number of times, a firmware error report request is sent to the upper computer device.
可选的,所述存储器还用于:Optionally, the memory is also used for:
获取所述上位机设备发送的更新命令,所述更新命令包括所述目标固件的第一固件版本号;Obtain the update command sent by the host computer equipment, and the update command includes the first firmware version number of the target firmware;
所述处理器还用于:The processor is also used to:
在所述第一固件版本号,大于所述下位机设备的本地的固件的第二固件版本号的情况下,进入所述获取上位机设备发送的目标固件的固件分片数据包的步骤。In the case that the first firmware version number is greater than the second firmware version number of the local firmware of the lower computer device, the step of obtaining the firmware fragmentation data packet of the target firmware sent by the upper computer device is entered.
可选的,所述下位机设备为毫米波雷达。Optionally, the lower computer device is a millimeter wave radar.
可选的,所述处理器还用于:Optionally, the processor is also used for:
在接收完毕所述上位机设备发送的所述目标固件的所有固件分片数据包,且完成对所述固件分片数据包的校验码的校验操作的情况下,将当前加载的固件变更为所述目标固件,完成所述毫米波雷达的固件的升级操作。After receiving all the firmware fragmentation data packets of the target firmware sent by the host computer device, and completing the verification operation of the check code of the firmware fragmentation data packet, change the currently loaded firmware For the target firmware, an upgrade operation of the firmware of the millimeter-wave radar is completed.
综上,本申请实施例提供的固件数据处理装置,通过获取上位机设备发送的目标固件的固件分片数据包;固件分片数据包中包括数据分片内容,以及按照预设规则生成的对应数据分片内容的第一校验码;按照预设规则,生成对应获取到的固件分片数据包的数据分片内容的第二校验码;根据第二校验码和第一校验码的校验结果,执行对应的操作。本申请可以通过下位机设备对接收到的目标固件的每个固件分片数据包的内容,进行基于校验码的验证,来判断该固件分片数据包是否是正确的数据包,从而识别到传输过程中出现的数据包丢失等异常情况,实现了对固件传输过程的有效监管,降低了传输过程中出错的几率。To sum up, the firmware data processing device provided by the embodiment of the present application obtains the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes the data fragmentation content, and the corresponding data generated according to the preset rules. The first check code of the data fragment content; according to the preset rules, generate the second check code corresponding to the data fragment content of the obtained firmware fragment data packet; according to the second check code and the first check code the verification result, and perform the corresponding operation. In the present application, the lower computer device can perform verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the Abnormal situations such as data packet loss during the transmission process realize the effective supervision of the firmware transmission process and reduce the probability of errors during the transmission process.
图6是本申请实施例提供的一种固件数据处理装置的框图,所述装置应用于上位机设备,如图6所示,该固件数据处理装置500可以包括处理器501;FIG. 6 is a block diagram of a firmware data processing apparatus provided by an embodiment of the present application. The apparatus is applied to a host computer device. As shown in FIG. 6 , the firmware data processing apparatus 500 may include a processor 501;
所述处理器用于执行:The processor is used to execute:
将目标固件切分为多个具有预设文件大小的固件分片数据包;Divide the target firmware into multiple firmware shard packets with preset file sizes;
按照预设规则,生成对应所述固件分片数据包的数据分片内容的第一校验码;According to a preset rule, a first check code corresponding to the data fragment content of the firmware fragment data packet is generated;
将包括所述第一校验码的固件分片数据包发送至所述下位机设备。Send the firmware fragmentation data packet including the first check code to the lower computer device.
可选的,所述处理器还用于:Optionally, the processor is also used for:
若获取到所述下位机设备发送的传输报错请求,则停止向所述下位机设备发送所述固件分片数据包。If the transmission error report request sent by the lower computer device is obtained, stop sending the firmware fragment data packet to the lower computer device.
可选的,所述处理器还用于:Optionally, the processor is also used for:
按照所述预设规则,生成对应所述目标固件的所有数据分片内容的第五校验码;According to the preset rule, generate a fifth check code corresponding to the content of all data fragments of the target firmware;
获取所述下位机设备发送的第三校验码;Obtain the third check code sent by the lower computer device;
在所述第三校验码与所述第五校验码相同的情况下,发送针对所述第三校验码的确认指令至所述下位机设备。In the case that the third check code is the same as the fifth check code, a confirmation instruction for the third check code is sent to the lower computer device.
可选的,所述处理器还用于:Optionally, the processor is also used for:
在所述第三校验码与所述第五校验码不相同的情况下,生成固件错误告警,并在预设时间后停止用于处理所述目标固件的进程。In the case that the third check code is different from the fifth check code, a firmware error alarm is generated, and the process for processing the target firmware is stopped after a preset time.
可选的,所述处理器还用于:Optionally, the processor is also used for:
发送包括所述目标固件的第一固件版本号的更新命令至所述下位机设备。Send an update command including the first firmware version number of the target firmware to the lower computer device.
可选的,所述处理器还用于:Optionally, the processor is also used for:
根据所述预设规则对应的校验码的长度,以及传输所述目标固件的目标误比特率,确定所述预设文件大小。The preset file size is determined according to the length of the check code corresponding to the preset rule and the target bit error rate for transmitting the target firmware.
综上,本申请实施例提供的固件数据处理装置,通过将目标固件切分为多个具有预设文件大小的固件分片数据包;按照预设规则,生成对应固件分片数据包的数据分片内容的第一校验码;将包括第一校验码的固件分片数据包发送至下位机设备。本申请可以通过上位机设备将目标固件切分为多个固件分片数据包,并将每个固件分片数据包对应的第一校验码添加至固件分片数据包中下发给下位机设备,下位机设备对接收到的目标固件的每个固件分片数据包的内容,进行基于校验码的验证,来判断该固件分片数据包是否是正确的数据包,从而识别到传输过程中出现的数据包丢失等异常情况,实现 了对固件传输过程的有效监管,降低了传输过程中出错的几率。To sum up, the firmware data processing device provided by the embodiments of the present application divides the target firmware into a plurality of firmware fragmentation data packets with preset file sizes; and generates data packets corresponding to the firmware fragmentation data packets according to the preset rules. The first check code of the content of the slice; send the firmware slice data packet including the first check code to the lower computer device. In this application, the target firmware can be divided into a plurality of firmware fragmentation data packets through the host computer equipment, and the first check code corresponding to each firmware fragmentation data packet is added to the firmware fragmentation data packet and sent to the lower computer. The device, the lower computer device performs verification based on the check code on the content of each firmware fragmentation data packet of the received target firmware to determine whether the firmware fragmentation data packet is a correct data packet, thereby identifying the transmission process. It can effectively supervise the firmware transmission process and reduce the probability of errors in the transmission process.
参照图7,其示出了本申请实施例提供的一种车辆的结构框图,车辆600包括:车身601;如图6所示的固件数据处理装置500,所述固件数据处理装置500安装于所述车身601。Referring to FIG. 7 , which shows a structural block diagram of a vehicle provided by an embodiment of the present application, the vehicle 600 includes: a body 601 ; the firmware data processing apparatus 500 shown in FIG. The body 601 is described.
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述固件数据处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, each process of the above-mentioned embodiments of the firmware data processing method can be achieved, and the same can be achieved. The technical effect, in order to avoid repetition, will not be repeated here. Wherein, the computer-readable storage medium, such as read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), magnetic disk or optical disk and so on.
存储器可以为外部控制终端与固件数据处理装置连接的接口。例如,外部控制终端可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的控制终端的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。存储器可以用于获取来自外部控制终端的输入(例如,数据信息、电力等等)并且将获取到的输入传输到固件数据处理装置内的一个或多个元件或者可以用于在固件数据处理装置和外部控制终端之间传输数据。The memory may be an interface for connecting the external control terminal with the firmware data processing device. For example, the external control terminal may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a control terminal with an identification module, an audio input /Output (I/O) ports, video I/O ports, headphone ports, and more. The memory may be used to obtain input (eg, data information, power, etc.) from an external control terminal and transmit the obtained input to one or more elements within the firmware data processing device or may be used in the firmware data processing device and Transfer data between external control terminals.
例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。For example at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
处理器是控制终端的控制中心,利用各种接口和线路连接整个控制终端的各个部分,通过运行或执行存储在存储器内的软件程序和/或模块,以及调用存储在存储器内的数据,执行控制终端的各种功能和处理数据,从而对控制终端进行整体监控。处理器可包括一个或多个处理单元;优选的,处理器可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器中。The processor is the control center of the control terminal. It uses various interfaces and lines to connect various parts of the entire control terminal, and executes control by running or executing the software programs and/or modules stored in the memory and calling the data stored in the memory. Various functions of the terminal and processing data, so as to carry out overall monitoring of the control terminal. The processor may include one or more processing units; preferably, the processor may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor Mainly deals with wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments may be referred to each other.
本领域内的技术人员应明白,本申请的实施例可提供为方法、控制终端、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘 存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that the embodiments of the present application may be provided as a method, a control terminal, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的控制终端。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal equipment to produce a machine that causes the instructions to be executed by the processor of the computer or other programmable data processing terminal equipment A control terminal is generated for implementing the functions specified in a flow or flow of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令控制终端的制造品,该指令控制终端实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising the instruction to control the terminal, The instruction controls the terminal to implement the function specified in one flow or multiple flows of the flowchart and/or one block or multiple blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing terminal equipment, so that a series of operational steps are performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby executing on the computer or other programmable terminal equipment The instructions executed on the above provide steps for implementing the functions specified in the flowchart or blocks and/or the block or blocks of the block diagrams.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiments of the present application have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of this application.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or terminal device comprising a list of elements includes not only those elements, but also a non-exclusive list of elements. other elements, or also include elements inherent to such a process, method, article or terminal equipment. Without further limitation, an element defined by the phrase "comprises a..." does not preclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.
以上对本申请进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在 具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The application has been introduced in detail above, and specific examples are used to illustrate the principles and implementations of the application. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the application; According to the idea of the present application, there will be changes in the specific embodiments and application scope for those skilled in the art. To sum up, the content of this specification should not be construed as a limitation on the present application.

Claims (42)

  1. 一种固件数据处理方法,应用于下位机设备,其特征在于,所述方法包括:A firmware data processing method, applied to a lower computer device, characterized in that the method comprises:
    获取上位机设备发送的目标固件的固件分片数据包;所述固件分片数据包中包括数据分片内容,以及按照预设规则生成的对应所述数据分片内容的第一校验码;Obtain the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes data fragmentation content, and a first check code corresponding to the data fragmentation content generated according to a preset rule;
    按照所述预设规则,生成对应获取到的所述固件分片数据包的数据分片内容的第二校验码;According to the preset rule, generate a second check code corresponding to the data fragment content of the obtained firmware fragment data packet;
    根据所述第二校验码和所述第一校验码的校验结果,执行对应的操作。Corresponding operations are performed according to the verification results of the second check code and the first check code.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述第二校验码和所述第一校验码的校验结果,执行对应的操作,包括:The method according to claim 1, wherein the performing a corresponding operation according to the check result of the second check code and the first check code, comprising:
    在所述第二校验码与所述第一校验码不相同的情况下,向所述上位机设备发送传输报错请求。In the case that the second check code is different from the first check code, a transmission error report request is sent to the upper computer device.
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述第二校验码和所述第一校验码的校验结果,执行对应的操作,包括:The method according to claim 1, wherein the performing a corresponding operation according to the check result of the second check code and the first check code, comprising:
    在所述第二校验码与所述第一校验码相同的情况下,继续获取所述上位机设备发送的下一个固件分片数据包。In the case that the second check code is the same as the first check code, continue to acquire the next firmware fragment data packet sent by the upper computer device.
  4. 根据权利要求1所述的方法,其特征在于,在获取到所述上位机设备发送的所有固件分片数据包,且最后一次获取到的固件分片数据包的第二校验码和第一校验码相同的情况下,所述方法还包括:The method according to claim 1, characterized in that, after obtaining all firmware fragmentation data packets sent by the host computer device, and the second check code of the firmware fragmentation data packet obtained last time and the first In the case where the check codes are the same, the method further includes:
    按照所述预设规则,生成对应已获取到的所有固件分片数据包的数据分片内容的第三校验码;According to the preset rule, generate a third check code corresponding to the data fragment content of all the obtained firmware fragment data packets;
    将所述第三校验码发送至所述上位机设备;sending the third check code to the host computer device;
    在获取到所述上位机设备发送的针对所述第三校验码的确认指令的情况下,确定所述目标固件传输完毕。In the case of acquiring the confirmation instruction for the third check code sent by the host computer device, it is determined that the target firmware is transmitted.
  5. 根据权利要求4所述的方法,其特征在于,在所述确定所述目标固件传输完毕之后,所述方法还包括:The method according to claim 4, wherein after the determining that the target firmware is transferred, the method further comprises:
    将所述目标固件的所有固件分片数据包存储至第一闪存空间。All firmware fragment data packets of the target firmware are stored in the first flash memory space.
  6. 根据权利要求5所述的方法,其特征在于,在所述将所述目标固件 的所有固件分片数据包存储至第一闪存空间之后,所述方法还包括:method according to claim 5, is characterized in that, after described by described target firmware All firmware fragmentation data packets are stored in the first flash memory space, described method also comprises:
    将所述第一闪存空间的标志位修改为第一固件标志位;Modifying the flag bit of the first flash memory space to the first firmware flag bit;
    按照所述第一固件标志位加载所述目标固件。Load the target firmware according to the first firmware flag.
  7. 根据权利要求6所述的方法,其特征在于,所述按照所述第一固件标志位加载所述目标固件,包括:The method according to claim 6, wherein the loading the target firmware according to the first firmware flag comprises:
    按照所述第一固件标志位,提取所述第一闪存空间中所述目标固件的固件分片数据包,并将所述固件分片数据包存储至内存空间;According to the first firmware flag bit, extract the firmware fragmentation data packet of the target firmware in the first flash memory space, and store the firmware fragmentation data packet in the memory space;
    按照所述预设规则,生成对应所述目标固件的所有固件分片数据包的数据分片内容的第四校验码;According to the preset rule, generate a fourth check code corresponding to the data fragment content of all firmware fragment data packets of the target firmware;
    在所述第四校验码与所述第三校验码相同的情况下,运行所述内存空间中的目标固件。When the fourth check code is the same as the third check code, run the target firmware in the memory space.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method according to claim 7, wherein the method further comprises:
    在所述第四校验码与所述第三校验码不相同的情况下,向所述上位机设备发送加载报错请求。In the case that the fourth check code is different from the third check code, a loading error report request is sent to the upper computer device.
  9. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method according to claim 7, wherein the method further comprises:
    在所述第四校验码与所述第三校验码不相同的情况下,将所述第一固件标志位修改为第二固件标志位,所述第二固件标志位为写入用于进行固件备份的第二闪存空间的标志位;In the case where the fourth check code is different from the third check code, the first firmware flag bit is modified to a second firmware flag bit, and the second firmware flag bit is written for The flag bit of the second flash memory space for firmware backup;
    在所述第二固件标志位的值不为0的情况下,则按照所述第二固件标志位加载所述第二闪存空间中的备份固件。If the value of the second firmware flag is not 0, the backup firmware in the second flash memory space is loaded according to the second firmware flag.
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, wherein the method further comprises:
    在对固件标志位的修改次数达到预设次数的情况下,向所述上位机设备发送固件报错请求。When the number of times of modification to the firmware flag reaches a preset number of times, a firmware error report request is sent to the upper computer device.
  11. 根据权利要求1所述的方法,其特征在于,在所述获取上位机设备发送的目标固件的固件分片数据包之前,所述方法还包括:The method according to claim 1, characterized in that, before acquiring the firmware fragmentation data packet of the target firmware sent by the host computer device, the method further comprises:
    获取所述上位机设备发送的更新命令,所述更新命令包括所述目标固件的第一固件版本号;Obtain the update command sent by the host computer equipment, and the update command includes the first firmware version number of the target firmware;
    在所述第一固件版本号,大于所述下位机设备的本地的固件的第二固件版本号的情况下,进入所述获取上位机设备发送的目标固件的固件分片数据 包的步骤。In the described first firmware version number, under the situation that is greater than the second firmware version number of the local firmware of described lower computer equipment, enter the described step of obtaining the firmware fragmentation data packet of the target firmware sent by upper computer equipment.
  12. 根据权利要求1所述的方法,其特征在于,所述下位机设备为毫米波雷达。The method according to claim 1, wherein the lower computer device is a millimeter wave radar.
  13. 根据权利要求12所述的方法,其特征在于,所述方法还包括:The method of claim 12, wherein the method further comprises:
    在接收完毕所述上位机设备发送的所述目标固件的所有固件分片数据包,且完成对所述固件分片数据包的校验码的校验操作的情况下,将当前加载的固件变更为所述目标固件,完成所述毫米波雷达的固件的升级操作。After receiving all the firmware fragmentation data packets of the target firmware sent by the host computer device, and completing the verification operation of the check code of the firmware fragmentation data packet, change the currently loaded firmware For the target firmware, an upgrade operation of the firmware of the millimeter-wave radar is completed.
  14. 一种固件数据处理方法,应用于上位机设备,其特征在于,所述方法包括:A firmware data processing method, applied to a host computer device, wherein the method comprises:
    将目标固件切分为多个具有预设文件大小的固件分片数据包;Divide the target firmware into multiple firmware shard packets with preset file sizes;
    按照预设规则,生成对应所述固件分片数据包的数据分片内容的第一校验码;According to a preset rule, a first check code corresponding to the data fragment content of the firmware fragment data packet is generated;
    将包括所述第一校验码的固件分片数据包发送至所述下位机设备。Send the firmware fragmentation data packet including the first check code to the lower computer device.
  15. 根据权利要求14所述的方法,其特征在于,在将包括所述第一校验码的固件分片数据包发送至所述下位机设备的过程中,所述方法还包括:The method according to claim 14, wherein in the process of sending the firmware fragmentation data packet including the first check code to the lower computer device, the method further comprises:
    若获取到所述下位机设备发送的传输报错请求,则停止向所述下位机设备发送所述固件分片数据包。If the transmission error report request sent by the lower computer device is obtained, stop sending the firmware fragment data packet to the lower computer device.
  16. 根据权利要求14所述的方法,其特征在于,所述方法还包括:The method of claim 14, wherein the method further comprises:
    按照所述预设规则,生成对应所述目标固件的所有数据分片内容的第五校验码;According to the preset rule, generate a fifth check code corresponding to the content of all data fragments of the target firmware;
    获取所述下位机设备发送的第三校验码;Obtain the third check code sent by the lower computer device;
    在所述第三校验码与所述第五校验码相同的情况下,发送针对所述第三校验码的确认指令至所述下位机设备。In the case that the third check code is the same as the fifth check code, a confirmation instruction for the third check code is sent to the lower computer device.
  17. 根据权利要求16所述的方法,其特征在于,所述方法还包括:The method of claim 16, wherein the method further comprises:
    在所述第三校验码与所述第五校验码不相同的情况下,生成固件错误告警,并在预设时间后停止用于处理所述目标固件的进程。In the case that the third check code is different from the fifth check code, a firmware error alarm is generated, and the process for processing the target firmware is stopped after a preset time.
  18. 根据权利要求14所述的方法,其特征在于,在所述将包括所述第一校验码的固件分片数据包发送至所述下位机设备之前,所述方法还包括:The method according to claim 14, wherein before the sending the firmware fragmentation data packet including the first check code to the lower computer device, the method further comprises:
    发送包括所述目标固件的第一固件版本号的更新命令至所述下位机设备。Send an update command including the first firmware version number of the target firmware to the lower computer device.
  19. 根据权利要求14所述的方法,其特征在于,所述方法还包括:The method of claim 14, wherein the method further comprises:
    根据所述预设规则对应的校验码的长度,以及传输所述目标固件的目标误比特率,确定所述预设文件大小。The preset file size is determined according to the length of the check code corresponding to the preset rule and the target bit error rate for transmitting the target firmware.
  20. 一种固件数据处理装置,其特征在于,应用于下位机设备,所述装置包括:存储器和处理器;A firmware data processing device, characterized in that, applied to a lower computer device, the device comprises: a memory and a processor;
    所述存储器用于,获取上位机设备发送的目标固件的固件分片数据包;所述固件分片数据包中包括数据分片内容,以及按照预设规则生成的对应所述数据分片内容的第一校验码;The memory is used to obtain the firmware fragmentation data packet of the target firmware sent by the host computer device; the firmware fragmentation data packet includes the data fragmentation content, and the corresponding data fragmentation content generated according to the preset rule. the first check code;
    所述处理器用于,按照所述预设规则,生成对应获取到的所述固件分片数据包的数据分片内容的第二校验码;The processor is configured to, according to the preset rule, generate a second check code corresponding to the data fragment content of the obtained firmware fragment data packet;
    根据所述第二校验码和所述第一校验码的校验结果,执行对应的操作。Corresponding operations are performed according to the verification results of the second check code and the first check code.
  21. 根据权利要求20所述的装置,其特征在于,所述处理器具体用于:The apparatus according to claim 20, wherein the processor is specifically configured to:
    在所述第二校验码与所述第一校验码不相同的情况下,向所述上位机设备发送传输报错请求。In the case that the second check code is different from the first check code, a transmission error report request is sent to the upper computer device.
  22. 根据权利要求20所述的装置,其特征在于,所述存储器具体用于:The apparatus according to claim 20, wherein the memory is specifically used for:
    在所述第二校验码与所述第一校验码相同的情况下,继续获取所述上位机设备发送的下一个固件分片数据包。In the case that the second check code is the same as the first check code, continue to acquire the next firmware fragment data packet sent by the upper computer device.
  23. 根据权利要求20所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 20, wherein the processor is further configured to:
    按照所述预设规则,生成对应已获取到的所有固件分片数据包的数据分片内容的第三校验码;According to the preset rule, generate a third check code corresponding to the data fragment content of all the obtained firmware fragment data packets;
    将所述第三校验码发送至所述上位机设备;sending the third check code to the host computer device;
    在获取到所述上位机设备发送的针对所述第三校验码的确认指令的情况下,确定所述目标固件传输完毕。In the case of acquiring the confirmation instruction for the third check code sent by the host computer device, it is determined that the target firmware is transmitted.
  24. 根据权利要求23所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 23, wherein the processor is further configured to:
    将所述目标固件的所有固件分片数据包存储至第一闪存空间。All firmware fragment data packets of the target firmware are stored in the first flash memory space.
  25. 根据权利要求24所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 24, wherein the processor is further configured to:
    将所述第一闪存空间的标志位修改为第一固件标志位;Modifying the flag bit of the first flash memory space to the first firmware flag bit;
    按照所述第一固件标志位加载所述目标固件。Load the target firmware according to the first firmware flag.
  26. 根据权利要求25所述的装置,其特征在于,所述处理器具体用于:The apparatus according to claim 25, wherein the processor is specifically configured to:
    按照所述第一固件标志位,提取所述第一闪存空间中所述目标固件的固件分片数据包,并将所述固件分片数据包存储至内存空间;According to the first firmware flag bit, extract the firmware fragmentation data packet of the target firmware in the first flash memory space, and store the firmware fragmentation data packet in the memory space;
    按照所述预设规则,生成对应所述目标固件的所有固件分片数据包的数据分片内容的第四校验码;According to the preset rule, generate a fourth check code corresponding to the data fragment content of all firmware fragment data packets of the target firmware;
    在所述第四校验码与所述第三校验码相同的情况下,运行所述内存空间中的目标固件。When the fourth check code is the same as the third check code, run the target firmware in the memory space.
  27. 根据权利要求26所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 26, wherein the processor is further configured to:
    在所述第四校验码与所述第三校验码不相同的情况下,向所述上位机设备发送加载报错请求。In the case that the fourth check code is different from the third check code, a loading error report request is sent to the upper computer device.
  28. 根据权利要求27所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 27, wherein the processor is further configured to:
    在所述第四校验码与所述第三校验码不相同的情况下,将所述第一固件标志位修改为第二固件标志位,所述第二固件标志位为写入用于进行固件备份的第二闪存空间的标志位;In the case where the fourth check code is different from the third check code, the first firmware flag bit is modified to a second firmware flag bit, and the second firmware flag bit is written for The flag bit of the second flash memory space for firmware backup;
    在所述第二固件标志位的值不为0的情况下,则按照所述第二固件标志位加载所述第二闪存空间中的备份固件。If the value of the second firmware flag is not 0, the backup firmware in the second flash memory space is loaded according to the second firmware flag.
  29. 根据权利要求28所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 28, wherein the processor is further configured to:
    在对固件标志位的修改次数达到预设次数的情况下,向所述上位机设备发送固件报错请求。When the number of times of modification to the firmware flag reaches a preset number of times, a firmware error report request is sent to the upper computer device.
  30. 根据权利要求20所述的装置,其特征在于,所述存储器还用于:The apparatus according to claim 20, wherein the memory is further used for:
    获取所述上位机设备发送的更新命令,所述更新命令包括所述目标固件的第一固件版本号;Obtain the update command sent by the host computer equipment, and the update command includes the first firmware version number of the target firmware;
    所述处理器还用于:The processor is also used to:
    在所述第一固件版本号,大于所述下位机设备的本地的固件的第二固件版本号的情况下,进入所述获取上位机设备发送的目标固件的固件分片数据包的步骤。In the case that the first firmware version number is greater than the second firmware version number of the local firmware of the lower computer device, the step of obtaining the firmware fragmentation data packet of the target firmware sent by the upper computer device is entered.
  31. 根据权利要求20所述的装置,其特征在于,所述下位机设备为毫米波雷达。The device according to claim 20, wherein the lower computer equipment is a millimeter wave radar.
  32. 根据权利要求31所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 31, wherein the processor is further configured to:
    在接收完毕所述上位机设备发送的所述目标固件的所有固件分片数据包,且完成对所述固件分片数据包的校验码的校验操作的情况下,将当前加载的固件变更为所述目标固件,完成所述毫米波雷达的固件的升级操作。After receiving all the firmware fragmentation data packets of the target firmware sent by the host computer device, and completing the verification operation of the check code of the firmware fragmentation data packet, change the currently loaded firmware For the target firmware, an upgrade operation of the firmware of the millimeter-wave radar is completed.
  33. 一种固件数据处理装置,其特征在于,应用于上位机设备,所述装置包括:处理器;A firmware data processing device, characterized in that it is applied to a host computer device, and the device comprises: a processor;
    所述处理器用于:The processor is used to:
    将目标固件切分为多个具有预设文件大小的固件分片数据包;Divide the target firmware into multiple firmware shard packets with preset file sizes;
    按照预设规则,生成对应所述固件分片数据包的数据分片内容的第一校验码;According to a preset rule, a first check code corresponding to the data fragment content of the firmware fragment data packet is generated;
    将包括所述第一校验码的固件分片数据包发送至所述下位机设备。Send the firmware fragmentation data packet including the first check code to the lower computer device.
  34. 根据权利要求33所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 33, wherein the processor is further configured to:
    若获取到所述下位机设备发送的传输报错请求,则停止向所述下位机设备发送所述固件分片数据包。If the transmission error report request sent by the lower computer device is obtained, stop sending the firmware fragment data packet to the lower computer device.
  35. 根据权利要求33所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 33, wherein the processor is further configured to:
    按照所述预设规则,生成对应所述目标固件的所有数据分片内容的第五校验码;According to the preset rule, generate a fifth check code corresponding to the content of all data fragments of the target firmware;
    获取所述下位机设备发送的第三校验码;Obtain the third check code sent by the lower computer device;
    在所述第三校验码与所述第五校验码相同的情况下,发送针对所述第三校验码的确认指令至所述下位机设备。In the case that the third check code is the same as the fifth check code, a confirmation instruction for the third check code is sent to the lower computer device.
  36. 根据权利要求33所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 33, wherein the processor is further configured to:
    在所述第三校验码与所述第五校验码不相同的情况下,生成固件错误告警,并在预设时间后停止用于处理所述目标固件的进程。In the case that the third check code is different from the fifth check code, a firmware error alarm is generated, and the process for processing the target firmware is stopped after a preset time.
  37. 根据权利要求33所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 33, wherein the processor is further configured to:
    发送包括所述目标固件的第一固件版本号的更新命令至所述下位机设备。Send an update command including the first firmware version number of the target firmware to the lower computer device.
  38. 根据权利要求33所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 33, wherein the processor is further configured to:
    根据所述预设规则对应的校验码的长度,以及传输所述目标固件的目标 误比特率,确定所述预设文件大小。According to the length of the check code corresponding to the preset rule, and the target bit error rate of transmitting the target firmware, determine the preset file size.
  39. 一种固件数据处理系统,其特征在于,所述系统包括:A firmware data processing system, characterized in that the system comprises:
    上位机设备和下位机设备;The upper computer equipment and the lower computer equipment;
    所述上位机设备用于,将目标固件切分为多个具有预设文件大小的固件分片数据包,并按照预设规则,生成对应所述固件分片数据包的数据分片内容的第一校验码;以及将包括所述第一校验码的固件分片数据包发送至所述下位机设备;The host computer equipment is used to divide the target firmware into a plurality of firmware fragmentation data packets with preset file sizes, and according to preset rules, generate the first data fragment corresponding to the data fragmentation content of the firmware fragmentation data packet. a check code; and send the firmware fragmentation data packet including the first check code to the lower computer device;
    所述下位机设备用于,获取上位机设备发送的目标固件的固件分片数据包,并按照所述预设规则,生成对应获取到的所述固件分片数据包的数据分片内容的第二校验码;以及根据所述第二校验码和所述第一校验码的校验结果,执行对应的操作。The lower computer device is used to obtain the firmware fragmentation data packet of the target firmware sent by the upper computer device, and according to the preset rule, generate the first corresponding data fragmentation content of the acquired firmware fragmentation data packet. two check codes; and performing corresponding operations according to the check results of the second check codes and the first check codes.
  40. 一种电子设备,其特征在于,包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至19中任一项所述的固件数据处理方法。An electronic device, characterized in that it comprises a processor, a memory and a computer program stored on the memory and running on the processor, the computer program being executed by the processor to achieve as claimed in claim 1 The firmware data processing method described in any one of to 19.
  41. 一种车辆,其特征在于,包括:A vehicle, characterized in that it includes:
    车身;body;
    权利要求20至32任一项所述的装置,所述装置安装于所述车身。The device of any one of claims 20 to 32, which is mounted to the vehicle body.
  42. 一种计算机可读存储介质,其特征在于,包括指令,当其在计算机上运行时,使得所述计算机执行权利要求1至19中任一项所述的固件数据处理方法。A computer-readable storage medium, characterized in that it includes instructions that, when executed on a computer, cause the computer to execute the firmware data processing method according to any one of claims 1 to 19 .
PCT/CN2020/133622 2020-12-03 2020-12-03 Firmware data processing method and apparatus WO2022116088A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080074505.6A CN114616544A (en) 2020-12-03 2020-12-03 Firmware data processing method and device
PCT/CN2020/133622 WO2022116088A1 (en) 2020-12-03 2020-12-03 Firmware data processing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/133622 WO2022116088A1 (en) 2020-12-03 2020-12-03 Firmware data processing method and apparatus

Publications (1)

Publication Number Publication Date
WO2022116088A1 true WO2022116088A1 (en) 2022-06-09

Family

ID=81853786

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/133622 WO2022116088A1 (en) 2020-12-03 2020-12-03 Firmware data processing method and apparatus

Country Status (2)

Country Link
CN (1) CN114616544A (en)
WO (1) WO2022116088A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884624A (en) * 2022-07-08 2022-08-09 广州思德医疗科技有限公司 Data processing method and device
CN115085869A (en) * 2022-06-30 2022-09-20 咪咕动漫有限公司 Data transmission method, device, equipment and storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118718B (en) * 2022-08-30 2022-12-16 深圳市华曦达科技股份有限公司 Android terminal device upgrade updating method and system and readable storage medium
CN116185512B (en) * 2023-04-25 2023-07-21 深圳艾为电气技术有限公司 Drive loading method, device, equipment and medium for PTC driver
CN116166332B (en) * 2023-04-25 2023-09-29 深圳艾为电气技术有限公司 Method, device, equipment and medium for parallel loading of compressor driver

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354070A (en) * 2015-12-11 2016-02-24 成都广达新网科技股份有限公司 Method for upgrading equipment firmware through I2C
CN106911428A (en) * 2017-02-23 2017-06-30 北京龙鼎源科技股份有限公司 The transmission method and device of information
CN111460437A (en) * 2020-04-03 2020-07-28 江苏芯盛智能科技有限公司 Firmware running method and device, firmware burning method and device and computer equipment
US20200257520A1 (en) * 2019-02-13 2020-08-13 International Business Machines Corporation Updating firmware of a microcontroller

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991326A (en) * 2017-03-02 2017-07-28 深圳怡化电脑股份有限公司 The upgrade method and its equipment of a kind of equipment firmware
US11163886B2 (en) * 2018-09-28 2021-11-02 Dell Products L.P. Information handling system firmware bit error detection and correction

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354070A (en) * 2015-12-11 2016-02-24 成都广达新网科技股份有限公司 Method for upgrading equipment firmware through I2C
CN106911428A (en) * 2017-02-23 2017-06-30 北京龙鼎源科技股份有限公司 The transmission method and device of information
US20200257520A1 (en) * 2019-02-13 2020-08-13 International Business Machines Corporation Updating firmware of a microcontroller
CN111460437A (en) * 2020-04-03 2020-07-28 江苏芯盛智能科技有限公司 Firmware running method and device, firmware burning method and device and computer equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115085869A (en) * 2022-06-30 2022-09-20 咪咕动漫有限公司 Data transmission method, device, equipment and storage medium
CN114884624A (en) * 2022-07-08 2022-08-09 广州思德医疗科技有限公司 Data processing method and device
CN114884624B (en) * 2022-07-08 2022-12-09 广州思德医疗科技有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN114616544A (en) 2022-06-10

Similar Documents

Publication Publication Date Title
WO2022116088A1 (en) Firmware data processing method and apparatus
US9021462B2 (en) Systems and methods for provisioning equipment
CN108848163B (en) Upgrading method of TWS earphone and TWS earphone
EP3933573B1 (en) Zero differential upgrade method, non-volatile storage medium and electronic device
CN111262868B (en) Message sending method and receiving method based on intelligent network card
CN111290769B (en) Method for updating configuration data on line
WO2012012933A1 (en) Processing devices and methods for transmitting and receiving data
US11575469B2 (en) Multi-bit feedback protocol systems and methods
CN105743610A (en) Technologies for data integrity of multi-network packet operations
JP2018521411A (en) Node configuration management in the network
CN111611002B (en) Data upgrading method, device, computer equipment and storage medium
CN112463067A (en) Data protection method and equipment in NVMe-oF scene
CN115514644B (en) Entry consistency checking method, electronic equipment and storage medium
CN109286472B (en) Concurrent data asynchronous transmission method based on Beidou satellite navigation system
US10901952B2 (en) Method for transferring a difference file
CN114172894A (en) Data transmission method and device, server and computer equipment
US20220312211A1 (en) System and device for verifying function of radio base station
CN113971287A (en) LoRa communication-based batch upgrading method and upgrading system
CN112688905B (en) Data transmission method, device, client, server and storage medium
CN110620800B (en) Method and device for synchronously processing configuration data of power secondary system across safety zones
CN108334424B (en) Method for filtering redundant data of network communication management platform based on LPWAN technology
KR20170108739A (en) Method and system for data transfer in a Non-Volatile Memory Express (NVMe) interface in Data Integrity Extension (DIX) mode
CN114268624B (en) Version file transmission method and device and server
US11868758B2 (en) Method for improving the updating of firmware and system applying the method
CN117486085A (en) Tower crane control method, device and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20963935

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20963935

Country of ref document: EP

Kind code of ref document: A1