CN117149242A - Driver batch upgrading method and device - Google Patents

Driver batch upgrading method and device Download PDF

Info

Publication number
CN117149242A
CN117149242A CN202311439405.0A CN202311439405A CN117149242A CN 117149242 A CN117149242 A CN 117149242A CN 202311439405 A CN202311439405 A CN 202311439405A CN 117149242 A CN117149242 A CN 117149242A
Authority
CN
China
Prior art keywords
driver
upgrade
upgraded
firmware
content
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311439405.0A
Other languages
Chinese (zh)
Other versions
CN117149242B (en
Inventor
韩腾飞
徐庭鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Just Motion Control Electromechanics Co ltd
Original Assignee
Shenzhen Just Motion Control Electromechanics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Just Motion Control Electromechanics Co ltd filed Critical Shenzhen Just Motion Control Electromechanics Co ltd
Priority to CN202311439405.0A priority Critical patent/CN117149242B/en
Publication of CN117149242A publication Critical patent/CN117149242A/en
Application granted granted Critical
Publication of CN117149242B publication Critical patent/CN117149242B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications

Landscapes

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

Abstract

The application discloses a driver batch upgrading method and device, relating to driver batch upgrading technology, the method splits the content of upgrading firmware into a plurality of data segments with appointed length, the split upgrading firmware is transmitted to each driver to be upgraded, the transmission process of each data segment comprises three messages, the three messages are a start message, a data message and an end message, the start message comprises segment number information and byte total number information, the data message comprises all the content of the corresponding segment of upgrading firmware, the end message comprises segment number information and CRC check code, and each segment of message is transmitted to each driver to be upgraded in a broadcast mode so that all the drivers to be upgraded can receive data; after the content transmission of the upgrade firmware is completed and the CRC is correct, the driver upgrade is finished, and the problems of low efficiency and high error rate caused by the dependence of manual batch upgrade of drivers in the prior art are solved.

Description

Driver batch upgrading method and device
Technical Field
The application relates to the technical field of driver batch upgrading, in particular to a driver batch upgrading method and device.
Background
In the related art, the drivers are finished in a one-by-one upgrading mode, so that the operation is complicated for the requirement of upgrading the drivers in batches, a large amount of time and manpower resources can be wasted, and in case of upgrading failure, the subsequent processing is troublesome.
Disclosure of Invention
The application aims to solve the technical problems of complex operation and time and labor waste of the drivers in the prior art, and provides a method and a device for upgrading drivers in batches.
In a first aspect, an embodiment of the present disclosure provides a method for upgrading a driver in batches, where the method is implemented by a device for upgrading a driver in batches, and the method includes:
establishing communication connection with at least two target drivers according to a specified connection mode, reading the version and manufacturer codes of each target driver, determining and recording drivers to be upgraded and corresponding numbers, connecting the target drivers through a daisy chain topology structure, reserving upgrading wiring for the first target driver and reserving detecting wiring for the last target driver, wherein the specified connection mode is as follows: the upgrade wiring is connected with an upgrade interface of the driver batch upgrade device, and the detection wiring is connected with a detection interface of the driver batch upgrade device to form an upgrade closed loop;
sending a state preparation instruction to each driver to be upgraded, wherein the state preparation instruction is used for requesting each driver to be upgraded to enter a Bootloader state;
dividing the content of the upgrade firmware into a plurality of data segments with specified length, transmitting the divided upgrade firmware to each driver to be upgraded, wherein the transmission process of each data segment comprises three messages, namely a start message, a data message and an end message, the start message comprises segment number information and byte total number information, the data message comprises all upgrade firmware content of corresponding segments, the end message comprises segment number information and CRC (cyclic redundancy check) codes, and each segment of message is transmitted to each driver to be upgraded in a broadcast mode so that all drivers to be upgraded can receive data;
after the content transmission of the upgrade firmware is completed and the CRC check is correct, the driver upgrade is finished.
Optionally, before the communication connection is established with at least two target drives according to the specified connection mode, the method further comprises: the driver batch upgrading device obtains and stores the content of the upgraded firmware through RS232/USB communication by the upper computer software; or converting the content of the upgrading firmware into a file c through j-flash, loading the file c into a keil project, and storing the file c into the driver batch upgrading device.
Optionally, before splitting the upgraded firmware content into the plurality of data segments of the specified length, the method further comprises: polling whether each driver to be upgraded enters a Bootloader state, if so, sending a state preparation instruction to the drivers to be upgraded which do not enter the Bootloader state again until all the drivers to be upgraded enter the Bootloader state; the splitting the content of the upgrade firmware into a plurality of data segments with specified lengths is as follows: after each driver to be upgraded enters a Bootloader state, splitting the content of the upgraded firmware into a plurality of data segments with specified lengths.
Optionally, the establishing communication connection with at least two target drives according to the specified connection mode is: and connecting the driver batch upgrading device to an RS485 or CAN communication network, and automatically switching the CAN communication and the 485 communication by the driver batch upgrading device and polling each of the at least two target drivers to be upgraded according to different baud rates.
Alternatively, the specified length is 1KB.
Optionally, the upgrade firmware content transfer is complete and the CRC check includes: after the content transmission of each section of upgrading firmware is completed, polling the internal transmission state of the recorded driver to be upgraded, and detecting whether CRC check is wrong; for a driver with correct CRC check, waiting for the transmission of the next segment; and for the driver with CRC check errors, retransmitting the corresponding section of upgrade firmware content and the CRC check code according to the number of the driver to be detected, if the CRC check code is in error in the continuous appointed number of transmission inquiry, recording the inside, and not retransmitting the corresponding section of upgrade firmware content, and directly continuing broadcasting the next section of upgrade firmware content.
Optionally, the method further comprises: and each driver to be upgraded receives the content of the upgrading firmware by using the plug-in flash device, reads a firmware receiving success mark after the driver to be upgraded is electrified again, loads the external flash into the internal part if the last firmware upgrade is successful, and continuously operates the old version if the last firmware upgrade fails and the driver to be upgraded jumps to the old version.
In a second aspect, an embodiment of the present disclosure provides a device for upgrading drives in batches, where the device is provided with an upgrade interface and a detection interface, and the device includes:
the communication connection module is used for establishing communication connection between a designated connection mode and at least two target drivers, reading the version and manufacturer codes of each target driver, determining and recording drivers to be upgraded and corresponding numbers, connecting the target drivers through a daisy chain topological structure, reserving upgrading wiring for the first target driver, and reserving detecting wiring for the last target driver, wherein the designated connection mode is as follows: the upgrade wiring is connected with an upgrade interface of the driver batch upgrade device, and the detection wiring is connected with a detection interface of the driver batch upgrade device to form an upgrade closed loop;
the state notification module is used for sending a state preparation instruction to each driver to be upgraded, wherein the state preparation instruction is used for requesting each driver to be upgraded to enter a Bootloader state;
the upgrade firmware sending module is used for splitting upgrade firmware content into a plurality of data segments with specified length, transmitting the split upgrade firmware to each driver to be upgraded, wherein the transmission process of each data segment comprises three messages, namely a start message, a data message and an end message, the start message comprises segment number information and byte total number information, the data message comprises all upgrade firmware content of corresponding segments, the end message comprises segment number information and CRC (cyclic redundancy check) codes, and each segment of message is sent to each driver to be upgraded in a broadcast mode so that all drivers to be upgraded can receive data;
and the verification module is used for finishing the upgrading of the driver after the content transmission of the upgrading firmware is finished and the CRC is correct.
In a third aspect, the disclosed embodiments of the application also provide a computer device comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory in communication via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect, or any of the possible implementations of the first aspect.
In a fourth aspect, the disclosed embodiments also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the first aspect, or any of the possible implementation manners of the first aspect.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
dividing the content of the upgrade firmware into a plurality of data segments with specified length, transmitting the divided upgrade firmware to each driver to be upgraded, wherein the transmission process of each data segment comprises three messages, namely a start message, a data message and an end message, wherein the start message comprises segment number information and byte total number information, the data message comprises all upgrade firmware content of corresponding segments, the end message comprises segment number information and CRC check codes, and each segment message is transmitted to each driver to be upgraded in a broadcast mode so that all drivers to be upgraded can receive data; after the content transmission of the upgrade firmware is completed and the CRC is correct, the upgrade of the drivers is finished, the batch upgrade of the drivers is realized, the labor cost is reduced, and the upgrade efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart illustrating a method for batch upgrade of drives provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart illustrating another method for drive batch upgrade provided by the disclosed embodiments of the application;
FIG. 3 is a functional block diagram of a device for upgrading drives in batches according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a computer device according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram showing the connection between the device of FIG. 3 and a target drive;
FIG. 6 is a flow chart illustrating yet another method of drive batch upgrade in accordance with an embodiment of the present disclosure;
fig. 7 is a flow chart of a driver upgrade process when communication is not possible due to accident in the driver batch upgrade method according to the embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying summary.
Example 1
As shown in fig. 1, a flow chart of a method for upgrading a driver in batches according to an embodiment of the present application is implemented by a device for upgrading a driver in batches, where the method includes:
s11: and establishing communication connection with at least two target drivers according to a designated connection mode, reading the version and manufacturer codes of each target driver, and determining and recording the drivers to be upgraded and corresponding numbers.
The target drivers are connected through a daisy chain topological structure, the first target driver reserves an upgrade wiring, the last target driver reserves a detection wiring, and the appointed connection mode is as follows: the upgrade wiring is connected with an upgrade interface of the driver batch upgrade device, and the detection wiring is connected with a detection interface of the driver batch upgrade device to form an upgrade closed loop.
S12: and sending a state preparation instruction to each driver to be upgraded, wherein the state preparation instruction is used for requesting each driver to be upgraded to enter a Bootloader state.
S13: dividing the content of the upgrade firmware into a plurality of data segments with specified length, transmitting the divided upgrade firmware to each driver to be upgraded, wherein the transmission process of each data segment comprises three messages, namely a start message, a data message and an end message, wherein the start message comprises segment number information and byte total number information, the data message comprises all upgrade firmware content of corresponding segments, the end message comprises segment number information and CRC check codes, and each segment message is transmitted to each driver to be upgraded in a broadcast mode so that all drivers to be upgraded can receive data.
S14: after the content transmission of the upgrade firmware is completed and the CRC check is correct, the driver upgrade is finished.
It can be understood that, according to the technical scheme provided by the embodiment, a network data acquisition strategy is generated according to user setting, and after a network data acquisition instruction is received, the operation data of the target network is acquired according to the network data acquisition strategy; generating a network diagnosis report according to a preset fault detection strategy based on the operation data of the target network; if the network fault information exists in the network diagnosis report, generating a network optimization scheme according to the network fault information, and optimizing the target network according to the network optimization scheme; generating a network optimization report, automatically completing the network optimization process without manual participation, greatly improving the efficiency of network optimization, saving the cost and effectively ensuring the optimization effect.
Example 2
As shown in fig. 2, another method for upgrading a driver in batches according to an embodiment of the present application is implemented by a device for upgrading a driver in batches, and includes:
s21: the driver batch upgrading device obtains and stores the content of the upgraded firmware through RS232/USB communication by the upper computer software. Or converting the content of the upgrading firmware into a file c through j-flash, loading the file c into a keil project, and downloading and storing the file c in a driver batch upgrading device.
S22: and establishing communication connection with at least two target drivers according to a designated connection mode, reading the version and manufacturer codes of each target driver, and determining and recording the drivers to be upgraded and corresponding numbers.
The target drivers are connected through a daisy chain topological structure, the first target driver reserves an upgrade wiring, the last target driver reserves a detection wiring, and the appointed connection mode is as follows: the upgrade wiring is connected with an upgrade interface of the driver batch upgrade device, and the detection wiring is connected with a detection interface of the driver batch upgrade device to form an upgrade closed loop.
Specifically, in some alternative embodiments, the driver batch upgrade apparatus may be connected to an RS485 or CAN communication network to automatically switch the CAN communication and the 485 communication, and poll each at least two target drivers according to different baud rates.
S23: and sending a state preparation instruction to each driver to be upgraded, wherein the state preparation instruction is used for requesting each driver to be upgraded to enter a Bootloader state.
S24: and polling whether each driver to be upgraded enters a Bootloader state, and if the driver to be upgraded which does not enter the Bootloader state exists, sending a state preparation instruction to the driver to be upgraded which does not enter the Bootloader state again until all the drivers to be upgraded enter the Bootloader state.
S25: after each driver to be upgraded enters a Bootloader state, dividing the content of the upgrade firmware into a plurality of data segments with specified length, transmitting the divided upgrade firmware to each driver to be upgraded, wherein the transmission process of each data segment comprises three messages, namely a start message, a data message and an end message, the start message comprises segment number information and byte total number information, the data message comprises all the content of the upgrade firmware of the corresponding segment, the end message comprises segment number information and CRC check codes, and each segment message is transmitted to each driver to be upgraded in a broadcast mode so that all the drivers to be upgraded can receive data.
In some alternative embodiments, the specified length is 1KB.
S26: after the content transmission of the upgrade firmware is completed and the CRC check is correct, the driver upgrade is finished.
In some alternative embodiments, S26 may be implemented by the following procedure (not shown in the figures):
s261: after the content transmission of each section of upgrading firmware is completed, the internal transmission state of the recorded driver to be upgraded is polled, and whether the CRC check is in error is detected.
S262: for a driver that is CRC checked for correct, the transmission of the next segment is awaited.
S263: and for the driver with CRC check errors, retransmitting the corresponding section of upgrade firmware content and the CRC check code according to the number of the driver to be detected, if the CRC check code is in error in the continuous appointed number of transmission inquiry, recording the inside, and not retransmitting the corresponding section of upgrade firmware content, and directly continuing broadcasting the next section of upgrade firmware content.
S27: and each driver to be upgraded receives the content of the upgraded firmware by using the plug-in flash device, reads a firmware receiving success mark after each driver to be upgraded is powered on again, loads the external flash into the interior if the last firmware is successfully upgraded, and continuously operates the old version if the last firmware is failed to upgrade.
It can be understood that, according to the technical scheme provided by the embodiment, a network data acquisition strategy is generated according to user setting, and after a network data acquisition instruction is received, the operation data of the target network is acquired according to the network data acquisition strategy; generating a network diagnosis report according to a preset fault detection strategy based on the operation data of the target network; if the network fault information exists in the network diagnosis report, generating a network optimization scheme according to the network fault information, and optimizing the target network according to the network optimization scheme; generating a network optimization report, automatically completing the network optimization process without manual participation, greatly improving the efficiency of network optimization, saving the cost and effectively ensuring the optimization effect.
Example 3
As shown in fig. 3, the embodiment of the present application further provides a device for upgrading drives in batches, where the device is provided with an upgrade interface and a detection interface, and the device includes:
the communication connection module 31 is configured to establish a communication connection with at least two target drives in a specified connection manner, read a version and a manufacturer code of each target drive, determine and record a drive to be upgraded and a corresponding number, see fig. 5, where the target drives are connected through a daisy chain topology structure, an upgrade connection is reserved for a first target drive, and a detection connection is reserved for a last target drive, where the specified connection manner is: the upgrade wiring is connected with an upgrade interface of the driver batch upgrade device, and the detection wiring is connected with a detection interface of the driver batch upgrade device to form an upgrade closed loop.
The status notification module 32 is configured to send a status preparation instruction to each of the drivers to be upgraded, where the status preparation instruction is configured to request each of the drivers to be upgraded to enter a Bootloader status.
The upgrade firmware sending module 33 is configured to split the content of the upgrade firmware into a plurality of data segments with a specified length, send the split upgrade firmware to each to-be-upgraded drive, where each data segment includes three messages in a transmission process, where the three messages include a start message, a data message, and an end message, the start message includes segment number information and byte total number information, the data message includes all the content of the upgrade firmware of the corresponding segment, the end message includes segment number information and CRC check code, and each segment message is sent to each to-be-upgraded drive in a broadcast mode, so that all to-be-upgraded drives can receive data.
And a checking module 34, wherein after the transmission of the updated firmware content is completed and the CRC check is correct, the driver is updated.
In some alternative embodiments, the apparatus further comprises:
the upgrade file preparation module 35 is used for obtaining and storing upgrade firmware content through RS232/USB communication by computer upper computer software; or converting the content of the updated firmware into a file c through j-flash, loading the file c into a keil project, and storing the file c.
In some alternative embodiments, the apparatus further comprises:
the state training module 36 is configured to poll each driver to be upgraded whether to enter a Bootloader state, and if there is a driver to be upgraded that does not enter the Bootloader state, send a state preparation instruction to the drivers to be upgraded that do not enter the Bootloader state again until all the drivers to be upgraded enter the Bootloader state; the upgrade firmware transmission module 33 splits the upgrade firmware content into a plurality of data segments of a specified length: after each driver to be upgraded enters a Bootloader state, the upgrade firmware sending module 33 splits the upgrade firmware content into a plurality of data segments with specified lengths.
In some alternative embodiments, the communication connection module 31 is connected to an RS485 or network of CAN communications, switches between CAN communications and 485 communications, and polls each of at least two target drives at different baud rates.
In some alternative embodiments, the specified length is 1KB.
In some alternative embodiments, the verification module 34 includes:
and the polling checking sub-module 341 is configured to poll the internal transmission state of the recorded to-be-upgraded drive after the transmission of each section of the upgraded firmware content is completed, and detect whether the CRC check is in error.
A transmission waiting sub-module 342 for waiting for transmission of the next segment for a driver whose CRC check is correct; and for the driver with CRC check errors, retransmitting the corresponding section of upgrade firmware content and the CRC check code according to the number of the driver to be detected, if the CRC check code is in error in the continuous appointed number of transmission inquiry, recording the inside, and not retransmitting the corresponding section of upgrade firmware content, and directly continuing broadcasting the next section of upgrade firmware content.
In some alternative embodiments, the apparatus further comprises:
the offline upgrade module 37 is configured to receive the content of the upgraded firmware by using the plug-in flash device by each driver to be upgraded, read the success flag of firmware reception after each driver to be upgraded is powered on again, load the external flash into the interior if the last firmware upgrade is successful, and jump the driver to be upgraded to the old version to continue running if the last firmware upgrade is failed.
It can be understood that, according to the technical scheme provided by the embodiment, a network data acquisition strategy is generated according to user setting, and after a network data acquisition instruction is received, the operation data of the target network is acquired according to the network data acquisition strategy; generating a network diagnosis report according to a preset fault detection strategy based on the operation data of the target network; if the network fault information exists in the network diagnosis report, generating a network optimization scheme according to the network fault information, and optimizing the target network according to the network optimization scheme; generating a network optimization report, automatically completing the network optimization process without manual participation, greatly improving the efficiency of network optimization, saving the cost and effectively ensuring the optimization effect.
Example 4
Based on the same technical concept, the embodiment of the application also provides a computer device, which comprises a memory 1 and a processor 2, as shown in fig. 4, the memory 1 stores a computer program, and the processor 2 realizes the batch upgrading method of the drivers of any one of the above when executing the computer program.
The memory 1 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 1 may in some embodiments be an internal storage unit of a drive bulk upgrade system, such as a hard disk. The memory 1 may in other embodiments also be an external storage device of a drive bulk upgrade system, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), etc. Further, the memory 1 may also include both an internal storage unit and an external storage device of the drive batch upgrade system. The memory 1 may be used not only for storing application software installed in a drive batch upgrade system and various types of data, such as code of a drive batch upgrade program, etc., but also for temporarily storing data that has been output or is to be output.
The processor 2 may in some embodiments be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing data stored in the memory 1, e.g. executing a driver batch upgrade program or the like.
It can be understood that, according to the technical scheme provided by the embodiment, a network data acquisition strategy is generated according to user setting, and after a network data acquisition instruction is received, the operation data of the target network is acquired according to the network data acquisition strategy; generating a network diagnosis report according to a preset fault detection strategy based on the operation data of the target network; if the network fault information exists in the network diagnosis report, generating a network optimization scheme according to the network fault information, and optimizing the target network according to the network optimization scheme; generating a network optimization report, automatically completing the network optimization process without manual participation, greatly improving the efficiency of network optimization, saving the cost and effectively ensuring the optimization effect.
In order to facilitate the reader to understand the technical scheme of the embodiment of the application, the technical details in the scheme are described in detail below through specific examples.
The existing drive upgrades have the following problems: most of the drivers need to be upgraded with assistance of a computer upper computer, the dependence on the computer is strong, the independent CAN communication/RS 485 communication is relatively more, the drivers are incompatible, the equipment is upgraded in batches, the equipment is updated after the equipment is updated one by one, the equipment is not upgraded simultaneously in batches, and when unexpected danger occurs in the upgrading process, such as power failure and equipment CAN not be recovered, the driver batch upgrading method and device provided by the embodiment of the application are very suitable for occasions where the computer is inconvenient to carry and enter by caching the firmware sent by the computer upper computer through communication or converting the firmware into a c file, loading the c file into an application program, downloading the c file into the device through J-link, and connecting the device into a CAN/485 network for firmware upgrading. The method is compatible with CAN and RS485 communication, and automatically reads the version of the driver and the code of the manufacturer according to different baud rates after receiving a bus network to be upgraded; if 485 communication does not respond; switching to CAN communication, and reading the version of the driver and the manufacturer code according to different baud rates; finding the driver and the number to be upgraded; the firmware upgrading principle of the application is divided into blocks (1K), broadcast messages are sent, drivers in a bus network are upgraded, and all drivers can simultaneously receive firmware data; every 1K byte needs to check CRC, the device sends CRC check code; the device actively polls the state of each numbered upgrading driver, does not have a transmission error mark, performs next 1K data transmission, and retransmits if transmission errors exist; when unblocked damage occurs in the firmware upgrading process, such as power failure, network cable disconnection and the like, the firmware upgrading is forced to stop; the drive becomes a brick and the upgrade fails. And when the driver is powered on again, a sign that the firmware is successfully received is read, the external flash is loaded into the driver, and if the last firmware upgrade fails, the driver jumps to the old version and continues to operate.
The specific process is as follows:
1, transmitting the firmware data content to the device chip, transmitting the firmware content to the device chip through RS232/USB communication by the upper computer software, or converting the firmware into a file c by j-flash, loading the file c into a keil project, compiling and downloading the file c into the device chip.
And 2, connecting the device module to an RS485 or CAN communication network, switching the device between the CAN communication and the 485 communication, polling according to different baud rates until the version and manufacturer codes of the driver are read, finding out the driver and the number to be upgraded, and making internal records.
And 3, sending an instruction to request the drivers to be upgraded to enter a Bootloader state, and polling whether each site driver enters the Bootloader state, if not, requesting again until all the drivers to be upgraded enter the Bootloader state.
4, the device transmits the content of the updated firmware in segments according to the length of 1KB, wherein three messages are respectively a start message, a data message and an end message in each segment of transmission process; the initial message contains segment number information and byte total number information; the data message contains all firmware upgrade contents of the section; the end message contains the segment number information and CRC check code, so that the transmission of each segment is ensured to be safe and reliable. Each segment of message takes the form of a broadcast, ensuring that all drives can receive the data.
5, after waiting for the transmission of each section of upgrading firmware content, the device polls the recorded internal transmission state of the driver to be upgraded and detects whether CRC check is wrong; the driver with correct CRC check waits for the transmission of the next segment, and for the driver with error CRC check, the device resends the updated firmware content and CRC check code of the segment for the driver according to the station number, if the CRC error is inquired by 3 continuous transmissions, the device can make an internal record and does not retransmit the segment of data; the next segment of upgraded firmware content broadcast is continued.
And 6, ending the firmware upgrading process until the transmission of the firmware data is completed and the CRC is correct. After receiving a request for jumping to a Bootloader instruction, the driver enters a Bootloader state, waits for receiving updated firmware content, stores firmware data into the plug-in flash, and can ensure that the driver can be powered on again to operate the original firmware even if the transmission is damaged unexpectedly. And the Bootloader program stores all the received correct firmware contents into the plug-in flash, locates a successful receiving mark of the firmware and writes the successful receiving mark into the plug-in flash.
The driver Bootloader program detects a firmware receiving success mark in the plug-in flash, and if the firmware receiving success mark is not available, the driver Bootloader program jumps to the original firmware operation; if the mark is present, the firmware content in the plug-in flash is read and loaded into the bootloader, then the main chip of the driver starts to erase the flash content of the original firmware, and after the erasing is completed, the plug-in flash content is written into the flash address of the original firmware; after the writing is completed, the firmware receiving success mark in the plug-in flash is cleared, the flash address can be jumped, and the new firmware is operated.
The scheme has the following beneficial effects: the method comprises the steps that the upgrade firmware sent by a computer upper computer CAN be cached through communication or converted into a firmware, c files are loaded into an application program and downloaded into a device through J-link, the upgrade is carried out independently of the computer upper computer, two communication modes of CAN and RS485 are compatible, the communication mode is automatically switched, and the version of a driver and the code of a manufacturer are read according to different baud rates; the method comprises the steps of finding out drivers and numbers to be upgraded, dividing the drivers and numbers into blocks (1K) by using a firmware upgrading principle of the method, sending broadcast messages/synchronous messages, upgrading the drivers in a bus network, and simultaneously receiving firmware data by all the drivers; every 1K byte needs to check CRC, the device sends CRC check code; the state of each numbered upgrading driver is polled by the driving wheel, if transmission errors exist, the signals are retransmitted, and an externally hung flash device is used for receiving upgrading firmware, so that unexpected situations such as sudden power failure, network cable disconnection and the like are prevented; when the driver is powered on again, a sign that the firmware is successfully received is read, the external flash is loaded into the driver, and if the last firmware upgrade fails, the driver jumps to the old version and continues to operate.
The disclosed embodiments also provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor performs the steps of the drive batch upgrade method in the method embodiments described above. Wherein the storage medium may be a volatile or nonvolatile computer readable storage medium.
The computer program product of the driver batch upgrade method provided in the embodiments of the present application includes a computer readable storage medium storing program codes, and the instructions included in the program codes may be used to execute the steps of the driver batch upgrade method in the embodiments of the method, and specifically, refer to the embodiments of the method and are not repeated herein.
The disclosed embodiments also provide a computer program which, when executed by a processor, implements any of the methods of the previous embodiments. The computer program product may be realized in particular by means of hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium, and in another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
It is to be understood that the same or similar parts in the above embodiments may be referred to each other, and that in some embodiments, the same or similar parts in other embodiments may be referred to.
It should be noted that in the description of the present application, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Furthermore, in the description of the present application, unless otherwise indicated, the meaning of "plurality" means at least two.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and further implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (10)

1. A method for upgrading a driver in batches, the method being implemented by a driver batch upgrading device, the method comprising:
establishing communication connection with at least two target drivers according to a specified connection mode, reading the version and manufacturer codes of each target driver, determining and recording drivers to be upgraded and corresponding numbers, connecting the target drivers through a daisy chain topology structure, reserving upgrading wiring for the first target driver and reserving detecting wiring for the last target driver, wherein the specified connection mode is as follows: the upgrade wiring is connected with an upgrade interface of the driver batch upgrade device, and the detection wiring is connected with a detection interface of the driver batch upgrade device to form an upgrade closed loop;
sending a state preparation instruction to each driver to be upgraded, wherein the state preparation instruction is used for requesting each driver to be upgraded to enter a Bootloader state;
dividing the content of the upgrade firmware into a plurality of data segments with specified length, transmitting the divided upgrade firmware to each driver to be upgraded, wherein the transmission process of each data segment comprises three messages, namely a start message, a data message and an end message, the start message comprises segment number information and byte total number information, the data message comprises all upgrade firmware content of corresponding segments, the end message comprises segment number information and CRC (cyclic redundancy check) codes, and each segment of message is transmitted to each driver to be upgraded in a broadcast mode so that all drivers to be upgraded can receive data;
after the content transmission of the upgrade firmware is completed and the CRC check is correct, the driver upgrade is finished.
2. The drive batch upgrade method of claim 1, wherein before establishing a communication connection with at least two target drives in a specified connection manner, the method further comprises:
the driver batch upgrading device obtains and stores the content of the upgraded firmware through RS232/USB communication by the upper computer software;
or converting the content of the upgraded firmware into a file c through j-flash, loading the file c into a keil project, and downloading and storing the file c into the driver batch upgrading device.
3. The drive batch upgrade method of claim 2, wherein before splitting the upgraded firmware content into a plurality of data segments of specified length, the method further comprises:
polling whether each driver to be upgraded enters a Bootloader state, if so, sending a state preparation instruction to the drivers to be upgraded which do not enter the Bootloader state again until all the drivers to be upgraded enter the Bootloader state;
the splitting the content of the upgrade firmware into a plurality of data segments with specified lengths is as follows: after each driver to be upgraded enters a Bootloader state, splitting the content of the upgraded firmware into a plurality of data segments with specified lengths.
4. The method for batch upgrade of drives according to claim 3, wherein the establishing communication connection with at least two target drives according to the specified connection mode is: and connecting the driver batch upgrading device to an RS485 or CAN communication network, automatically switching the CAN communication and the 485 communication by the driver batch upgrading device, and polling each of the at least two target drivers to be upgraded according to different baud rates.
5. The drive batch upgrade method of claim 4, wherein the specified length is 1KB.
6. The drive batch upgrade method of claim 5, wherein upgrading firmware content transmission is complete and CRC checking comprises:
after the content transmission of each section of upgrading firmware is completed, polling the internal transmission state of the recorded driver to be upgraded, and detecting whether CRC check is wrong;
for a driver with correct CRC check, waiting for the transmission of the next segment;
and for the driver with CRC check errors, retransmitting the corresponding section of upgrade firmware content and the CRC check code according to the number of the driver to be detected, if the CRC check code is in error in the continuous appointed number of transmission inquiry, recording the inside, and not retransmitting the corresponding section of upgrade firmware content, and directly continuing broadcasting the next section of upgrade firmware content.
7. The drive batch upgrade method of claim 6, further comprising:
and each driver to be upgraded receives the content of the upgrading firmware by using the plug-in flash device, reads a firmware receiving success mark after the driver to be upgraded is electrified again, loads the external flash into the internal part if the last firmware upgrade is successful, and continuously operates the old version if the last firmware upgrade fails and the driver to be upgraded jumps to the old version.
8. A drive batch upgrade apparatus, the apparatus having an upgrade interface and a detection interface, the apparatus comprising:
the communication connection module is used for establishing communication connection between a designated connection mode and at least two target drivers, reading the version and manufacturer codes of each target driver, determining and recording drivers to be upgraded and corresponding numbers, connecting the target drivers through a daisy chain topological structure, reserving upgrading wiring for the first target driver, and reserving detecting wiring for the last target driver, wherein the designated connection mode is as follows: the upgrade wiring is connected with an upgrade interface of the driver batch upgrade device, and the detection wiring is connected with a detection interface of the driver batch upgrade device to form an upgrade closed loop;
the state notification module is used for sending a state preparation instruction to each driver to be upgraded, wherein the state preparation instruction is used for requesting each driver to be upgraded to enter a Bootloader state;
the upgrade firmware sending module is used for splitting upgrade firmware content into a plurality of data segments with specified length, transmitting the split upgrade firmware to each driver to be upgraded, wherein the transmission process of each data segment comprises three messages, namely a start message, a data message and an end message, the start message comprises segment number information and byte total number information, the data message comprises all upgrade firmware content of corresponding segments, the end message comprises segment number information and CRC (cyclic redundancy check) codes, and each segment of message is sent to each driver to be upgraded in a broadcast mode so that all drivers to be upgraded can receive data;
and the verification module is used for finishing the upgrading of the driver after the content transmission of the upgrading firmware is finished and the CRC is correct.
9. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory in communication via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the driver batch upgrade method of any one of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, performs the drive batch upgrade method according to any one of claims 1 to 7.
CN202311439405.0A 2023-11-01 2023-11-01 Driver batch upgrading method and device Active CN117149242B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311439405.0A CN117149242B (en) 2023-11-01 2023-11-01 Driver batch upgrading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311439405.0A CN117149242B (en) 2023-11-01 2023-11-01 Driver batch upgrading method and device

Publications (2)

Publication Number Publication Date
CN117149242A true CN117149242A (en) 2023-12-01
CN117149242B CN117149242B (en) 2024-02-23

Family

ID=88906667

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311439405.0A Active CN117149242B (en) 2023-11-01 2023-11-01 Driver batch upgrading method and device

Country Status (1)

Country Link
CN (1) CN117149242B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357595A (en) * 2016-05-09 2017-11-17 上海安浦鸣志自动化设备有限公司 A kind of multiple driver firmware online updating system based on bus
CN109388422A (en) * 2018-09-26 2019-02-26 威胜集团有限公司 Updating firmware program method and its electric energy meter
CN209373581U (en) * 2019-03-14 2019-09-10 上海安浦鸣志自动化设备有限公司 A kind of updating device of multiple driver
WO2019192244A1 (en) * 2018-04-03 2019-10-10 京东方科技集团股份有限公司 Parameter configuration method and device, and display device
CN113741944A (en) * 2021-08-16 2021-12-03 南京苏美达智能技术有限公司 Machine program system with upgrading function, upgrading method and application
WO2021253854A1 (en) * 2020-06-19 2021-12-23 浪潮电子信息产业股份有限公司 Method and apparatus for remotely updating firmware in batches, and computer-readable storage medium
CN114691178A (en) * 2022-05-31 2022-07-01 深圳市杰美康机电有限公司 Firmware upgrading method and device based on EtherCAT communication driver
CN114691170A (en) * 2022-03-21 2022-07-01 北京和利时电机技术有限公司 Driver software upgrading method and device, controller and driver
CN115357262A (en) * 2022-08-04 2022-11-18 珠海格力电器股份有限公司 Method for upgrading driver firmware in batch
CN115718610A (en) * 2022-11-28 2023-02-28 深圳市智锂能源科技有限公司 Reliable method for updating application program of single chip microcomputer

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357595A (en) * 2016-05-09 2017-11-17 上海安浦鸣志自动化设备有限公司 A kind of multiple driver firmware online updating system based on bus
WO2019192244A1 (en) * 2018-04-03 2019-10-10 京东方科技集团股份有限公司 Parameter configuration method and device, and display device
CN109388422A (en) * 2018-09-26 2019-02-26 威胜集团有限公司 Updating firmware program method and its electric energy meter
CN209373581U (en) * 2019-03-14 2019-09-10 上海安浦鸣志自动化设备有限公司 A kind of updating device of multiple driver
WO2021253854A1 (en) * 2020-06-19 2021-12-23 浪潮电子信息产业股份有限公司 Method and apparatus for remotely updating firmware in batches, and computer-readable storage medium
CN113741944A (en) * 2021-08-16 2021-12-03 南京苏美达智能技术有限公司 Machine program system with upgrading function, upgrading method and application
CN114691170A (en) * 2022-03-21 2022-07-01 北京和利时电机技术有限公司 Driver software upgrading method and device, controller and driver
CN114691178A (en) * 2022-05-31 2022-07-01 深圳市杰美康机电有限公司 Firmware upgrading method and device based on EtherCAT communication driver
CN115357262A (en) * 2022-08-04 2022-11-18 珠海格力电器股份有限公司 Method for upgrading driver firmware in batch
CN115718610A (en) * 2022-11-28 2023-02-28 深圳市智锂能源科技有限公司 Reliable method for updating application program of single chip microcomputer

Also Published As

Publication number Publication date
CN117149242B (en) 2024-02-23

Similar Documents

Publication Publication Date Title
CN110083374B (en) Upgrade rollback method, system and terminal equipment
CN105183515B (en) The method and device of holder firmware upgrade
CN110134415A (en) A kind of controller and its method for upgrading software and device
US7650388B2 (en) Wireless identification protocol with confirmation of successful transmission
CN110730104A (en) Method for upgrading multi-device batch firmware of mesh network device
CN105511929A (en) Remote wireless upgrading method for equipment
CN109002310A (en) firmware upgrade method
CN106708988A (en) Urban rail transit electronic map sharing method and system
CN110262820A (en) Method, apparatus, system and storage medium based on MQTT protocol realization OTA upgrading
CN104820609A (en) Embedded system and upgrade maintenance method thereof
CN113746892B (en) Remote upgrading method and wireless terminal equipment
CN111309363A (en) Contiki operating system-based online upgrading method and device
CN102857380A (en) Remote upgrading method for power line carrier communication routing
CN102750175A (en) Method for realizing FPGA (Field Programmable Gate Array) loading technology based on Nand Flash multiversion programs
CN117149242B (en) Driver batch upgrading method and device
CN115113901A (en) Remote upgrading method, device and medium for electric control software of intelligent household appliance
EP2409224B1 (en) System and method for remote device application upgrades
KR101436135B1 (en) software update apparatus for slave device
CN112395237A (en) Method and system for communication between at least two controllers
CN102236571B (en) Data card upgrading method, personal computer and data card
CN113626057B (en) Camera remote firmware upgrading system and method based on GigE Vision interface
CN103631611A (en) Method and equipment for updating optical transmitter and receiver
CN110716733A (en) ONT product software mutual upgrading method
CN116009908A (en) Device upgrading method, device, computer device and computer readable storage medium
CN113127227B (en) Instruction processing method and device for module communication, microcontroller and medium

Legal Events

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