CN115314384A - Device upgrading method and device upgrading system under RS485 bus and collector - Google Patents

Device upgrading method and device upgrading system under RS485 bus and collector Download PDF

Info

Publication number
CN115314384A
CN115314384A CN202210662230.9A CN202210662230A CN115314384A CN 115314384 A CN115314384 A CN 115314384A CN 202210662230 A CN202210662230 A CN 202210662230A CN 115314384 A CN115314384 A CN 115314384A
Authority
CN
China
Prior art keywords
upgrading
intelligent equipment
bus
equipment
intelligent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210662230.9A
Other languages
Chinese (zh)
Inventor
王常清
陈智勇
饶洋
梅祥松
陈德东
肖辉辉
伍冠宇
刘归
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Pilot Technology Co ltd
Original Assignee
Zhuhai Pilot Technology 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 Zhuhai Pilot Technology Co ltd filed Critical Zhuhai Pilot Technology Co ltd
Priority to CN202210662230.9A priority Critical patent/CN115314384A/en
Publication of CN115314384A publication Critical patent/CN115314384A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation

Abstract

The invention provides an equipment upgrading method under an RS485 bus, an intelligent terminal and a storage medium, wherein the upgrading method comprises the following steps: s101: the collector scans intelligent equipment on an RS485 bus to obtain version information; s102: executing upgrading operation according to the input instruction, and upgrading the intelligent equipment by adopting a predefined broadcast upgrading command based on the upgrading operation, wherein the predefined broadcast upgrading command comprises the model, the address and the target version of the upgraded intelligent equipment; s103: and sending upgrading content to the intelligent equipment according to upgrading information fed back by the upgraded intelligent equipment, updating an upgrading log in real time and outputting an upgrading result. The invention can realize batch upgrading of the intelligent equipment, saves labor and time consumed by upgrading maintenance, can ensure the accuracy of version upgrading, avoids the occurrence of upgrading abnormity, can supervise the upgrading progress of the intelligent equipment, and improves the reliability of broadcast upgrading.

Description

Equipment upgrading method and equipment upgrading system under RS485 bus and collector
Technical Field
The invention relates to the field of data transmission, in particular to intelligent equipment, an equipment upgrading system and a collector under an RS485 bus.
Background
RS485 is a standard defined to balance the electrical characteristics of drivers and receivers in digital multipoint systems, which is defined by the telecommunications industry association and the electronics industry consortium. The digital communication network using the standard can effectively transmit signals under long-distance conditions and in environments with large electronic noise. RS-485 enables the configuration of connecting local networks and multi-drop communication links.
When the intelligent device is applied on site, due to the characteristics of the RS485 bus, a plurality of or even about 30 intelligent devices can be connected to one RS485 bus; if upgrading is needed, generally, a manual control upgrading tool is adopted to upgrade the intelligent equipment by using RS485 communication.
Because the RS485 bus is in half-duplex communication, in order to ensure the success rate of upgrading, the upgrading is basically carried out in a communication mode of one question and one answer in the upgrading process. Therefore, the complete upgrade file is sent to each intelligent device to be upgraded independently each time. The transmission time of the upgrading method is the transmission time of each intelligent device multiplied by the number of the intelligent devices, and when the number of the intelligent devices to be upgraded is large, the transmission time is long. Moreover, when the network is unstable, such an upgrade method cannot continuously transmit a complete file, so when the network is unstable, the conventional upgrade method reports an error or abandons the upgrade. Even when the upgrade file is large, errors can be frequently reported and upgrade cannot be performed, so that the upgrade progress of the intelligent equipment is seriously influenced.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides an upgrading method of equipment under an RS485 bus, an intelligent terminal and a storage medium, the intelligent equipment on the RS485 bus is subjected to broadcast upgrading through a predefined broadcast upgrading command, and an upgrading log and an upgrading result are recorded in real time, so that batch upgrading of the intelligent equipment can be realized, labor and time consumed by upgrading maintenance are saved, the accuracy of version upgrading can be ensured, the occurrence of upgrading abnormity is avoided, the upgrading progress of the intelligent equipment can be supervised, and the reliability of broadcast upgrading is improved.
In order to solve the above problems, the present invention adopts a technical solution as follows: a method for upgrading equipment under an RS485 bus comprises the following steps: s101: the collector scans intelligent equipment on an RS485 bus to obtain version information; s102: executing upgrading operation according to an input instruction, and upgrading the intelligent equipment by adopting a predefined broadcast upgrading command based on the upgrading operation, wherein the predefined broadcast upgrading command comprises the model, the address and the target version of the upgraded intelligent equipment; s103: and sending upgrading content to the intelligent equipment according to upgrading information fed back by the upgraded intelligent equipment, updating an upgrading log in real time and outputting an upgrading result.
Further, the step of scanning the intelligent device on the RS485 bus by the collector to obtain the version information specifically includes: and acquiring an address interval of the intelligent equipment, scanning the intelligent equipment on the RS485 bus according to the address interval, and acquiring version information on each intelligent equipment.
Further, the step of scanning the intelligent devices on the RS485 bus according to the address interval to obtain the version information on each intelligent device specifically includes: issuing an instruction for reading the intelligent equipment information according to the address interval, and judging whether the received intelligent equipment response information meets a preset condition; if yes, analyzing the response information of the intelligent equipment, and updating an intelligent equipment information list according to an analysis result; and if not, scanning the next intelligent device according to the address interval.
Further, the step of executing the upgrade operation according to the input instruction specifically includes: and displaying the information of the intelligent equipment, configuring version information according to the input instruction, acquiring a firmware file and verifying the firmware file.
Further, the step of verifying the firmware file specifically includes: judging whether the firmware is normal or not; if yes, upgrading the intelligent equipment by adopting a predefined broadcast upgrading command based on the upgrading operation information; if not, prompting exception and reconfiguring version information.
Further, the step of upgrading the smart device with a predefined broadcast upgrade command based on the upgrade operation includes: and acquiring information of the firmware and the upgraded intelligent equipment based on the upgrading operation, putting the information into a predefined broadcast upgrading command with a preset format, and sending the predefined broadcast upgrading command through an RS485 bus.
Further, the step of upgrading the smart device with a predefined broadcast upgrade command based on the upgrade operation further comprises: and acquiring the number of intelligent equipment to be upgraded, setting the slave station address in the predefined broadcast upgrading command according to the number of the intelligent equipment, and upgrading the intelligent equipment by the intelligent equipment receiving the predefined broadcast upgrading command according to the type, address, target version and slave station address of the intelligent equipment to be upgraded in the predefined broadcast upgrading command.
Further, the step of sending the upgrade content to the smart device according to the upgrade information fed back by the upgraded smart device specifically includes: polling the upgraded intelligent equipment which requires response, and judging whether the upgraded intelligent equipment is upgraded or not according to the fed-back upgrading information; if yes, confirming the upgrading results of the upgraded intelligent equipment one by one; if not, performing breakpoint resume of the upgrade content on the upgraded intelligent equipment, and judging whether the upgraded intelligent equipment is abnormal or not according to the breakpoint resume times.
Based on the same inventive concept, the invention also provides an equipment upgrading system based on the RS485 bus, the equipment upgrading system based on the RS485 bus comprises a collector, the RS485 bus and at least one intelligent device, the collector is in communication connection with the intelligent device through the RS485 bus, and the equipment upgrading system based on the RS485 bus realizes the equipment upgrading method under the RS485 bus through the collector, the RS485 bus and the intelligent device.
Based on the same inventive concept, the invention further provides a collector, which comprises a processor and a memory, wherein the memory stores a computer program, the processor is in communication connection with the memory, and the device upgrading method under the RS485 bus is executed according to the computer program in the memory.
Compared with the prior art, the invention has the beneficial effects that: the intelligent equipment on the RS485 bus is subjected to broadcast upgrading through the predefined broadcast upgrading command, and the upgrading log and the upgrading result are recorded in real time, so that batch upgrading of the intelligent equipment can be realized, labor and time consumed by upgrading maintenance are saved, the accuracy of version upgrading can be guaranteed, the occurrence of upgrading abnormity is avoided, the upgrading progress of the intelligent equipment can be supervised, and the reliability of broadcast upgrading is improved.
Drawings
Fig. 1 is a flowchart of an embodiment of a method for upgrading a device under an RS485 bus according to the present invention;
fig. 2 is a flowchart of an embodiment of intelligent device scanning in the method for upgrading a device under an RS485 bus according to the present invention;
FIG. 3 is a flowchart illustrating an embodiment of performing an upgrade operation in the method for upgrading a device under an RS485 bus according to the present invention;
FIG. 4 is a schematic diagram of an embodiment of upgrading in a unicast mode in the method for upgrading a device under an RS485 bus according to the present invention;
FIG. 5 is a schematic diagram of an embodiment of upgrading in a broadcast mode in the method for upgrading a device under an RS485 bus according to the present invention;
FIG. 6 is a flowchart of an embodiment of an upgrade logic of a collector in the method for upgrading a device under an RS485 bus according to the present invention;
FIG. 7 is a flowchart of an embodiment of an upgrade logic of an intelligent device in the method for upgrading a device under an RS485 bus according to the present invention;
FIG. 8 is a block diagram of an embodiment of an RS485 bus based device upgrade system of the present invention;
fig. 9 is a structural diagram of an embodiment of the collector of the present invention.
Detailed Description
The following description of the embodiments of the present application is provided by way of specific examples, and other advantages and effects of the present application will be readily apparent to those skilled in the art from the disclosure herein. The present application is capable of other and different embodiments and its several details are capable of modifications and/or changes in various respects, all without departing from the spirit of the present application. It should be noted that the various embodiments of the present disclosure, described and illustrated in the figures herein generally, may be combined with each other without conflict, and that the structural members or functional modules therein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
The terminology used in the description of the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1-7, fig. 1 is a flowchart illustrating an upgrade method for devices under an RS485 bus according to an embodiment of the present invention; FIG. 2 is a flowchart illustrating an embodiment of intelligent device scanning in the method for upgrading a device under an RS485 bus according to the present invention; FIG. 3 is a flowchart illustrating an embodiment of performing an upgrade operation in the method for upgrading a device under an RS485 bus according to the present invention; FIG. 4 is a schematic diagram of an embodiment of upgrading in a unicast mode in the method for upgrading a device under an RS485 bus according to the present invention; fig. 5 is a schematic diagram of an embodiment of upgrading in a broadcast mode in the method for upgrading a device under an RS485 bus according to the present invention; FIG. 6 is a flowchart of an embodiment of an upgrade logic of a collector in the method for upgrading a device under an RS485 bus according to the present invention; fig. 7 is a flowchart of an embodiment of an upgrade logic of an intelligent device in the method for upgrading a device under an RS485 bus according to the present invention. The method for upgrading the equipment under the RS485 bus is described in detail with reference to FIGS. 1-7.
In this embodiment, a system applying the device upgrading method under the RS485 bus is a device upgrading system based on the RS485 bus, where the device upgrading system includes a collector, the RS485 bus, and an intelligent device, and the collector is connected with a plurality of intelligent devices through the RS485 bus. The intelligent device is a device which is provided with an RS485 bus port and can load firmware and upgrade according to the transmitted firmware, and the collector can be a computer, a single chip microcomputer, a PLC and an intelligent terminal which can transmit the firmware and an upgrade command to the intelligent device through the RS485 bus.
In this embodiment, the method for upgrading a device under an RS485 bus includes:
s101: and the collector scans the intelligent equipment on the RS485 bus to obtain version information.
In this embodiment, the collector is connected to N (generally 32 maximum) devices through an RS485 bus by hand pulling, and communicates using ModbusRTU protocol on site. In other embodiments, the collector may also be connected to multiple intelligent devices through multiple RS485 buses, and each RS485 bus is configured with different or the same number of intelligent devices.
The collector scans intelligent equipment on an RS485 bus, and the step of obtaining the version information specifically comprises the following steps: and acquiring an address interval of the intelligent equipment, scanning the intelligent equipment on the RS485 bus according to the address interval, and acquiring version information on each intelligent equipment.
The method comprises the following steps of scanning intelligent devices on an RS485 bus according to an address interval, and acquiring version information of each intelligent device, wherein the steps specifically comprise: issuing an instruction for reading the intelligent equipment information according to the address interval, and judging whether the received intelligent equipment response information meets a preset condition; if yes, analyzing the response information of the intelligent equipment, and updating an intelligent equipment information list according to an analysis result; and if not, scanning the next intelligent device according to the address interval. The collector issues reading according to the standard ModbusRTU message 03H reading function code, issues an instruction for reading the equipment information general information register, and acquires the information of the intelligent equipment according to the information of the intelligent equipment general information register fed back by the intelligent equipment.
Specifically, in the standard ModbusRTU protocol, information such as the model and version of the smart device can be obtained through the function code of the general information register of the smart device, wherein the information corresponding to different function codes is shown in table one:
Figure BDA0003690964980000071
Figure BDA0003690964980000081
table one, register
In a specific embodiment, a user sets an address scanning interval (for example, a search start address startAddr and a search end address EndAddr) through a web configuration page (an upgrade page) of a collector, clicks to start searching, the collector searches devices one by one, and judges whether a current search start address is greater than a search end address during searching, if so, determines that the searching is finished, displays a final scanning result, if not, requests a device message according to the current search start address, analyzes the device information and updates a device information list when a format corresponding to the device message is correct, and after the completion, changes the current search start address to search for a device corresponding to a next address.
When searching for an equipment address N, a collector reads a function code according to a standard ModbusRTU message 03H (the ModbusRTU protocol has a standard function code, the 03H function code is used for reading a register, the invention utilizes the 03H function code of the ModbusRTU protocol to read the general information of the equipment), issues a general information register for reading the equipment information (issues an instruction for reading the equipment information), if equipment response information is received, the message is analyzed, a special identification register is judged (after the instruction for reading the equipment general information is issued, the response of the equipment aiming at the instruction is received, if the equipment responds, the format of the response is judged to be correct, if the message is correct, the collector compares the value in the specific identification register of a manufacturer, the message is not the specific identification content of the preset manufacturer, if the message is correct, the collector considers that the equipment needs to be searched, analyzes various version numbers, otherwise, the equipment of other manufacturers is considered to be equipment without recording), judges whether the list is the specific content of the manufacturer according to the judgment result, if the intelligent equipment is considered to be scanned, and updates the intelligent equipment information, updates the hardware version number, the SN and the hardware number and the equipment information according to the analysis list; and if the correct device response is not received, searching the next device until all the preset search addresses in the address interval are searched.
S102: and executing upgrading operation according to the input instruction, and upgrading the intelligent equipment by adopting a predefined broadcast upgrading command based on the upgrading operation, wherein the predefined broadcast upgrading command comprises the model, the address and the target version of the intelligent equipment to be upgraded.
In this embodiment, the step of executing the upgrade operation according to the input instruction specifically includes: and displaying the information of the intelligent equipment, configuring version information according to the input instruction, acquiring a firmware file and verifying the firmware file.
The step of verifying the firmware file specifically comprises the following steps: judging whether the firmware is normal; if yes, upgrading the intelligent equipment by adopting a predefined broadcast upgrading command based on the upgrading operation information; if not, prompting abnormity and reconfiguring version information.
In a specific embodiment, the collector displays the searched information of the intelligent device through a web page, configures version information (setting version information before upgrading the intelligent device and a target version to be upgraded) according to a user instruction, sets a model (instrument model) of the intelligent device to be upgraded, receives firmware uploaded by the user, and checks whether the firmware package is normal. If not, prompting the abnormity, asking the user to confirm again, and returning to the step of configuring version information, if so, displaying an 'upgrade' key, clicking the 'upgrade' key by the user, and starting the upgrade by the collector.
In this embodiment, the step of upgrading the smart device with a predefined broadcast upgrade command based on the upgrade operation includes: and acquiring the firmware and the information of the upgraded intelligent equipment based on the upgrading operation, putting the information into a predefined broadcast upgrading command with a preset format, and sending the predefined broadcast upgrading command through an RS485 bus.
Wherein, the step of upgrading the smart device by adopting the predefined broadcast upgrading command based on the upgrading operation further comprises: and acquiring the number of intelligent equipment to be upgraded, setting the slave station address in the predefined broadcast upgrading command according to the number of the intelligent equipment, and upgrading the intelligent equipment by the intelligent equipment receiving the predefined broadcast upgrading command according to the type, address and target version of the upgraded intelligent equipment in the predefined broadcast upgrading command and the slave station address.
Specifically, the Modbus national standard provides that the user can define function codes, wherein, in the Modbus protocol, there are two areas of function codes defined by the user, i.e. 65-72 decimal and 100-110 decimal, and the user can select one area to realize the definition of one function code without any approval from the Modbus organization. Therefore, we choose to define 67 of the firmware issued function code decimal. The specific definition of the firmware file (function code 67) issued in the predefined broadcast upgrade command is described by table two, table three, and table four.
Figure BDA0003690964980000101
Data format for communication interaction in form II
Figure BDA0003690964980000102
Figure BDA0003690964980000111
TABLE III, upgrade firmware wrapper format
Figure BDA0003690964980000112
TABLE IV, upgrade fixed response package format
And the issuing of the upgrade firmware and the upgrade of the firmware are realized through the broadcast upgrade command with the preset format and the response of the intelligent equipment. The advantages of the firmware upgrading mode are as follows:
1. and the method not only supports single equipment upgrading, but also supports equipment broadcast upgrading.
2. When equipment is upgraded, model confirmation and target equipment version confirmation are added, confirmation of different models of equipment and different target versions for upgrading can be supported in a bus, and unnecessary upgrading abnormity is avoided.
3. The firmware verification information is added in the firmware updating package, so that the safety of updating the firmware is ensured, and the interference or the tampering in the middle is avoided.
4. When the broadcast is upgraded, a mechanism for responding by polling the appointed equipment is adopted, so that the timeliness of monitoring the upgrading progress of the single equipment in the upgrading process is improved, and meanwhile, the reliability of the broadcast upgrading is also improved. When upgrading is carried out in the unicast mode, the slave station address is set to the address (effective address is 1-247) of the intelligent equipment to be upgraded in the instruction with the preset format of the collector, and the intelligent equipment carries out upgrading according to the instruction when determining that the address is the address of the equipment. When upgrading is carried out in the broadcast mode, the slave station address is set to be 0, namely all equipment receiving the broadcast upgrading instruction is upgraded, and the intelligent equipment receiving the instruction judges whether to receive the upgrading firmware package according to the slave station address information.
In this embodiment, the acquisition device issues the broadcast message, the slave station address is set to 0, and all devices on the whole bus can receive the upgrade message. If the equipment receiving the upgrade message determines that the equipment type in the upgrade message is inconsistent with the equipment type or the current version of the equipment is inconsistent with the equipment type, the equipment is ignored by default. If the device type and the current version of the device are matched in the upgrade request packet (upgrade packet), the device needs to execute a predefined broadcast upgrade instruction. In particular, for the intelligent device requiring reply in the upgrade instruction, the upgrade response is required according to the format.
S103: and sending upgrading content to the intelligent equipment according to upgrading information fed back by the upgraded intelligent equipment, updating an upgrading log in real time and outputting an upgrading result.
When the collector is upgraded, one device is switched according to the obtained upgrade list every time an upgrade request packet is issued, and the corresponding device is required to perform upgrade response. The step runs through the whole upgrading process, and the specific upgrading state can be clearly seen in the upgrading process.
In this embodiment, the step of sending the upgrade content to the smart device according to the upgrade information fed back by the upgraded smart device specifically includes: polling the upgraded intelligent equipment which requires response, and judging whether the upgraded intelligent equipment is upgraded or not according to the fed-back upgrading information; if yes, confirming the upgrading results of the upgraded intelligent equipment one by one; if not, performing breakpoint resume of the upgrade content on the upgraded intelligent equipment, and judging whether the upgraded intelligent equipment is abnormal or not according to the breakpoint resume times.
In this embodiment, if during the broadcast upgrade process, if a certain device causes incomplete firmware complete reception due to field interference or other reasons, the reception is suspended in the middle of the upgrade. To avoid the need to upgrade the device from scratch, the get upgrade information interface is specifically designed. The function code corresponding to the device upgrade information interface is obtained as function code 68. Specifically, the function code 68 is set in the write register wrapping format of the collector and the response format of the smart device as shown in table five:
Figure BDA0003690964980000131
table five, format setting of function code 68
The device type is the name of the current upgraded device and is used for device verification to prevent the wrong upgraded device. The total length of the firmware is the total length of the firmware which is not upgraded last time, if the intelligent device is not upgraded or the firmware in the upgrade message is not consistent with the firmware received last time by the device (if the upgrade is just started or the upgrade needs to be restarted because the firmware of the collector is switched, the downloaded length is returned to be 0, so that the collector upgrades the underlying intelligent device, the upgrade is restarted from the offset address 0 of the firmware), and the total length of the firmware is filled in if the firmware in the current device is completely consistent with the firmware to be upgraded. And filling 0 if the firmware in the current equipment is completely consistent with the firmware to be upgraded, filling the firmware verification code of the current firmware. The current downloaded length represents the downloaded length of the upgrade firmware package that has not completed all downloads the last time. And filling 0 if the intelligent equipment is not upgraded or the firmware in the upgrade message is not consistent with the firmware received by the equipment last time. If the firmware in the current device is completely consistent with the firmware to be upgraded, the total length of the current firmware is filled. And realizing breakpoint continuous transmission of the firmware through the upgrade firmware response package format of the intelligent equipment.
The upgrading method has the following advantages:
1. the method not only supports single equipment upgrading, but also supports equipment broadcast upgrading, greatly shortens the time for batch upgrading (if the equipment needs to be upgraded in batch, 24 pieces of equipment are connected in one RS485 bus, if the time for upgrading one piece of equipment for firmware is about 5 minutes, the time is required to be 2 hours according to the traditional mode (equipment of one bus is upgraded one by one), and after the method is optimized, the time for batch upgrading on one bus is only 5-6 minutes, so that the labor and the time for the maintenance process are greatly reduced).
2. When equipment is upgraded, model confirmation and target equipment version confirmation are added, confirmation of different models of equipment and different target versions for upgrading can be supported in the bus, and unnecessary upgrading abnormity is avoided.
3. The firmware verification information is added in the firmware updating package, so that the safety of updating the firmware is ensured, and the interference or the tampering in the middle is avoided.
4. When the broadcast is upgraded, a mechanism for polling the designated equipment to respond is adopted, so that the timeliness of monitoring the upgrade progress of the single equipment in the upgrading process is improved, and meanwhile, the reliability of the broadcast upgrade is also improved.
5. The upgrading method supports the continuous transmission of the upgrading breakpoint, and the upgrading is continued from the last upgrading exception, so that the upgrading efficiency is greatly improved.
Based on the same inventive concept, the present invention further provides an apparatus upgrading system based on RS485 bus, please refer to fig. 8, wherein fig. 8 is a structural diagram of an embodiment of the apparatus upgrading system based on RS485 bus of the present invention. The device upgrading system based on the RS485 bus of the present invention is explained in detail with reference to fig. 8.
In this embodiment, the device upgrading system based on the RS485 bus includes a collector, the RS485 bus, and at least one intelligent device, where the collector is in communication connection with the intelligent device through the RS485 bus, and the device upgrading system based on the RS485 bus realizes the device upgrading method under the RS485 bus according to the above embodiment through the collector, the RS485 bus, and the intelligent device.
Based on the same inventive concept, the present invention further provides a collector, please refer to fig. 9, fig. 9 is a structural diagram of an embodiment of the collector of the present invention, and the collector of the present invention is described with reference to fig. 9.
In this embodiment, the collector includes a processor and a memory, the memory stores a computer program, the processor is in communication connection with the memory, and the method for upgrading a device under the RS485 bus according to the computer program in the memory is executed.
In some embodiments, memory may include, but is not limited to, high speed random access memory, non-volatile memory. Such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable functional device, a discrete Gate or transistor functional device, or a discrete hardware component.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. The method for upgrading the equipment under the RS485 bus is characterized by comprising the following steps:
s101: the collector scans intelligent equipment on an RS485 bus to obtain version information;
s102: executing upgrading operation according to an input instruction, and upgrading the intelligent equipment by adopting a predefined broadcast upgrading command based on the upgrading operation, wherein the predefined broadcast upgrading command comprises the model, the address and the target version of the upgraded intelligent equipment;
s103: and sending upgrading content to the intelligent equipment according to upgrading information fed back by the upgraded intelligent equipment, updating an upgrading log in real time and outputting an upgrading result.
2. The method for upgrading a device under an RS485 bus according to claim 1, wherein the step of the collector scanning the intelligent device on the RS485 bus to obtain the version information specifically includes:
and acquiring an address interval of the intelligent equipment, scanning the intelligent equipment on the RS485 bus according to the address interval, and acquiring version information on each intelligent equipment.
3. The method for upgrading a device under an RS485 bus according to claim 2, wherein the step of scanning the smart devices on the RS485 bus according to the address interval to obtain the version information on each smart device specifically includes:
issuing an instruction for reading the information of the intelligent equipment according to the address interval, and judging whether the received response information of the intelligent equipment meets a preset condition or not;
if yes, analyzing the response information of the intelligent equipment, and updating an intelligent equipment information list according to an analysis result;
and if not, scanning the next intelligent device according to the address interval.
4. The method for upgrading a device under an RS485 bus as claimed in claim 1, wherein the step of performing an upgrade operation according to the input command specifically comprises:
and displaying the information of the intelligent equipment, configuring version information according to the input instruction, acquiring a firmware file and verifying the firmware file.
5. The method for upgrading equipment under an RS485 bus as claimed in claim 4, wherein the step of verifying the firmware file specifically comprises:
judging whether the firmware is normal or not;
if yes, upgrading the intelligent equipment by adopting a predefined broadcast upgrading command based on the upgrading operation information;
if not, prompting exception and reconfiguring version information.
6. The method for upgrading a device under an RS485 bus as claimed in claim 1, wherein the step of upgrading the smart device with a predefined broadcast upgrade command based on the upgrade operation comprises:
and acquiring information of the firmware and the upgraded intelligent equipment based on the upgrading operation, putting the information into a predefined broadcast upgrading command with a preset format, and sending the predefined broadcast upgrading command through an RS485 bus.
7. The method for upgrading devices under an RS485 bus as claimed in claim 1, wherein the step of upgrading smart devices with predefined broadcast upgrade commands based on upgrade operations further comprises:
and acquiring the number of intelligent equipment to be upgraded, setting the slave station address in the predefined broadcast upgrading command according to the number of the intelligent equipment, and upgrading the intelligent equipment by the intelligent equipment receiving the predefined broadcast upgrading command according to the model, the address, the target version and the slave station address of the intelligent equipment to be upgraded in the predefined broadcast upgrading command.
8. The method for upgrading a device under an RS485 bus according to claim 1, wherein the step of sending the upgrade content to the smart device according to the upgrade information fed back by the upgraded smart device specifically includes:
polling the upgraded intelligent equipment requiring response, and judging whether the upgraded intelligent equipment is upgraded or not according to the fed-back upgrade information;
if yes, confirming the upgrading results of the upgraded intelligent equipment one by one;
if not, performing breakpoint continuous transmission of the updated content on the updated intelligent equipment, and judging whether the updated intelligent equipment is abnormal or not according to the breakpoint continuous transmission times.
9. An equipment upgrading system based on an RS485 bus is characterized by comprising a collector, the RS485 bus and at least one intelligent device, wherein the collector is in communication connection with the intelligent device through the RS485 bus, and the equipment upgrading system based on the RS485 bus realizes the equipment upgrading method under the RS485 bus according to any one of claims 1 to 8 through the collector, the RS485 bus and the intelligent device.
10. A collector, comprising a processor and a memory, wherein the memory stores a computer program, the processor is in communication with the memory, and the method for upgrading a device under an RS485 bus according to any one of claims 1-8 is performed according to the computer program in the memory.
CN202210662230.9A 2022-06-13 2022-06-13 Device upgrading method and device upgrading system under RS485 bus and collector Pending CN115314384A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210662230.9A CN115314384A (en) 2022-06-13 2022-06-13 Device upgrading method and device upgrading system under RS485 bus and collector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210662230.9A CN115314384A (en) 2022-06-13 2022-06-13 Device upgrading method and device upgrading system under RS485 bus and collector

Publications (1)

Publication Number Publication Date
CN115314384A true CN115314384A (en) 2022-11-08

Family

ID=83855220

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210662230.9A Pending CN115314384A (en) 2022-06-13 2022-06-13 Device upgrading method and device upgrading system under RS485 bus and collector

Country Status (1)

Country Link
CN (1) CN115314384A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546784A (en) * 2011-12-29 2012-07-04 深圳市迈进科技有限公司 Method based on controller area network (CAN) bus and used for conducting batch upgrading for device firmware
CN104283749A (en) * 2014-09-25 2015-01-14 烽火通信科技股份有限公司 Communication system based on RS-485 half-duplex bus and service disc communication upgrading method
CN107329784A (en) * 2017-06-27 2017-11-07 广东美的暖通设备有限公司 Firmware upgrade method and Distributed-tier system
CN108319565A (en) * 2017-12-20 2018-07-24 珠海派诺科技股份有限公司 A kind of meter address searching method and device based on bus
CN111767068A (en) * 2020-06-01 2020-10-13 北京智芯微电子科技有限公司 Equipment for carrying out batch upgrading on communication modules and batch upgrading system
CN113342375A (en) * 2021-06-18 2021-09-03 河南力安测控科技有限公司 Method and system for upgrading intelligent terminal under gateway

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546784A (en) * 2011-12-29 2012-07-04 深圳市迈进科技有限公司 Method based on controller area network (CAN) bus and used for conducting batch upgrading for device firmware
CN104283749A (en) * 2014-09-25 2015-01-14 烽火通信科技股份有限公司 Communication system based on RS-485 half-duplex bus and service disc communication upgrading method
CN107329784A (en) * 2017-06-27 2017-11-07 广东美的暖通设备有限公司 Firmware upgrade method and Distributed-tier system
CN108319565A (en) * 2017-12-20 2018-07-24 珠海派诺科技股份有限公司 A kind of meter address searching method and device based on bus
CN111767068A (en) * 2020-06-01 2020-10-13 北京智芯微电子科技有限公司 Equipment for carrying out batch upgrading on communication modules and batch upgrading system
CN113342375A (en) * 2021-06-18 2021-09-03 河南力安测控科技有限公司 Method and system for upgrading intelligent terminal under gateway

Similar Documents

Publication Publication Date Title
CN111371638B (en) Intelligent equipment testing method and device, server and storage medium
JP4723648B2 (en) Device manufacturing using wireless technology embedded in the device
CN110134415A (en) A kind of controller and its method for upgrading software and device
CN112286170B (en) Vehicle ECU (electronic control Unit) flashing method, device and equipment and storage medium
CN112649717A (en) Test method, test device, terminal equipment and storage medium
CN111580480A (en) Production management method and device and computer readable storage medium
EP2664988A1 (en) Method, device and system for installing terminal software
CN111736866A (en) One-to-one and one-to-many compatible online upgrading method and terminal equipment
CN111190621A (en) Firmware burning method, device, system, terminal equipment and storage medium
CN112788576B (en) Equipment offline processing method and system, storage medium and electronic device
CN111224835A (en) Automatic switching method, device and system for serial port communication modes
CN108958786B (en) Matching and updating processing method and device for refrigerator software
CN106775818B (en) ECU (electronic control Unit) upgrading method and ECU upgrading equipment based on CAN (controller area network) bus
CN115314384A (en) Device upgrading method and device upgrading system under RS485 bus and collector
CN111385300B (en) Method and system for self-adapting of multiple communication protocols of energy storage system
CN111447231A (en) Vehicle protocol identification method and device
CN113127227B (en) Instruction processing method and device for module communication, microcontroller and medium
CN114064485A (en) Software testing method, system, computer equipment and readable storage medium
CN114326673A (en) Vehicle remote diagnosis method and device, connector and storage medium
CN114817097A (en) Single-wire communication method, system, device and storage medium
CN112748943A (en) Upgrading method and upgrading system for non-intelligent interactive electronic whiteboard
CN112084076A (en) Test method, electronic device, and storage medium
CN113179181A (en) Data acquisition method, device and system, data processing device and electronic equipment
CN101459919B (en) Network selecting method and apparatus
CN115278649B (en) Telephone number acquisition method, equipment, system and medium based on machine learning

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