CN116781211A - Equipment upgrading method and device, electronic equipment and storage medium - Google Patents

Equipment upgrading method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116781211A
CN116781211A CN202310749102.2A CN202310749102A CN116781211A CN 116781211 A CN116781211 A CN 116781211A CN 202310749102 A CN202310749102 A CN 202310749102A CN 116781211 A CN116781211 A CN 116781211A
Authority
CN
China
Prior art keywords
baud rate
data frame
frame length
equipment
upgraded
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
CN202310749102.2A
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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202310749102.2A priority Critical patent/CN116781211A/en
Publication of CN116781211A publication Critical patent/CN116781211A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0002Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
    • H04L1/0007Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format by modifying the frame length
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0015Systems modifying transmission characteristics according to link quality, e.g. power backoff characterised by the adaptation strategy
    • 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
    • H04L12/40169Flexible bus arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)

Abstract

The application relates to a device upgrading method, a device, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring a plurality of baud rates to be selected and a plurality of data frame lengths to be selected of test data; determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy, wherein the product value of the target baud rate and the target data frame length of test data in the optimal test scheme is the largest; and sending a program upgrading fragment to equipment to be upgraded according to the target baud rate and the target data frame length. The application improves the program upgrading efficiency.

Description

Equipment upgrading method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of devices, and in particular, to a device upgrade method, apparatus, electronic device, and storage medium.
Background
The RS485 communication has the characteristics of simple interface and protocol, long communication distance, strong anti-interference performance and less communication wires, so that the communication is widely applied to various industrial equipment. The engineering environment where the equipment is located has differences, such as noise reasons, performance reasons and the like, program update is needed for the equipment program, or because when the equipment leaves a factory, a bug exists in the controller program, and the program update is needed to correct the bug, so that the program update needs to be carried out for the equipment.
With RS485 communication devices, the communication data frames are usually shorter in consideration of long-distance communication of the devices. For example, the network baud rate of air conditioning equipment adopting RS485 communication is generally low, and is mostly about 9600 bps.
Aiming at the above, the program upgrading of the equipment adopting RS485 communication can face the following problems: because the communication baud rate is lower, the length of the data packet of the program upgrading file sent at one time is shorter, the program upgrading time is prolonged, and the program upgrading efficiency is reduced.
Disclosure of Invention
The application provides a device upgrading method, a device, electronic equipment and a storage medium, which are used for solving the problem of low program upgrading efficiency.
In a first aspect, the present application provides a method for upgrading a device, the method comprising:
acquiring a plurality of baud rates to be selected and a plurality of data frame lengths to be selected of test data;
determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy, wherein the product value of the target baud rate and the target data frame length of test data in the optimal test scheme is the largest;
and sending a program upgrading fragment to equipment to be upgraded according to the target baud rate and the target data frame length.
Further, determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy comprises:
determining an ordered sequence according to the baud rate to be selected and the data frame length to be selected, wherein each data in the ordered sequence is a baud rate-data frame length combination, and each baud rate-data frame length combination is orderly arranged according to the corresponding product value of the baud rate to be selected and the data frame length to be selected;
selecting a middle baud rate-data frame length combination positioned at a middle position in the ordered sequence;
transmitting test data to the equipment to be upgraded according to the intermediate baud rate-data frame length combination;
if the response information sent by the equipment to be upgraded is received, determining adjacent baud rate-data frame length combinations of the intermediate baud rate-data frame length combinations along the ascending direction of the ordered sequence;
transmitting test data to the equipment to be upgraded according to the adjacent baud rate-data frame length combination;
and if the response information sent by the equipment to be upgraded is received, sending test data according to the next adjacent baud rate-data frame length combination along the ascending direction until the response information is not received, wherein the baud rate-data frame length combination corresponding to the last response information is the optimal test scheme.
Further, after sending test data to the device to be upgraded according to the intermediate baud rate-data frame length combination or after sending test data to the device to be upgraded according to the adjacent baud rate-data frame length combination, the method further includes:
if the response information sent by the equipment to be upgraded is not received, determining the descending direction of the ordered sequence;
selecting adjacent baud rate-data frame length combinations to send test data along the descending order direction from the middle baud rate-data frame length combinations;
and if the response information sent by the equipment to be upgraded is not received, sending test data according to the next adjacent baud rate-data frame length combination along the descending order direction until the response information is received, wherein the baud rate-data frame length combination corresponding to the response information is the optimal test scheme.
Further, determining an ordered sequence according to the baud rate to be selected and the data frame length to be selected includes:
according to the sequence arrangement of the data frames to be selected, which are from low to high in the baud rate to be selected and correspond to the same baud rate to be selected, from short to long in the length, determining an ascending sequence; or alternatively, the first and second heat exchangers may be,
And according to the sequence of the data frames to be selected, which are from high to low in the baud rate to be selected and correspond to the same baud rate to be selected, from long to short, determining a descending sequence.
Further, determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy comprises:
determining an ascending sequence according to the sequence from low to high of the baud rate to be selected and the sequence from short to long of the frame length of the data to be selected corresponding to the same baud rate to be selected, wherein each data in the ascending sequence is a baud rate-data frame length combination;
according to the first baud rate-data frame length combination in the ascending sequence, test data are sent to the equipment to be upgraded;
and if the response information sent by the equipment to be upgraded is received, sending test data to the equipment to be upgraded according to the next baud rate-data frame length combination, wherein the baud rate-data frame length combination corresponding to the last response information is an optimal test scheme.
Further, before determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy, the method further comprises:
Acquiring an initial baud rate of the equipment to be upgraded, wherein the initial baud rate and the baud rate to be selected are different;
transmitting a data frame to the equipment to be upgraded according to the initial baud rate;
and if the reply information fed back by the equipment to be upgraded is received within the preset time, switching the initial baud rate to the baud rate to be selected.
Further, the device to be upgraded includes at least one sub-device of the same device type, and after the program upgrade fragment is sent to the device to be upgraded at the target baud rate and the target data frame length, the method further includes:
if the upgrade confirmation information fed back by all the sub-devices is not received, retransmitting the program upgrade fragment according to the target baud rate and the target data frame length;
and if the upgrade confirmation information fed back by all the sub-equipment is received, transmitting a next program upgrade fragment according to the target baud rate and the target data frame length.
In a second aspect, there is provided an apparatus for upgrading a device, the apparatus comprising:
the acquisition module is used for acquiring a plurality of baud rates to be selected and a plurality of data frame lengths to be selected of the test data;
the determining module is used for determining an optimal test scheme according to a preset communication quality test strategy and the to-be-selected baud rate and the to-be-selected data frame length, wherein the product value of the target baud rate and the target data frame length of test data in the optimal test scheme is the largest;
And the transmitting module is used for transmitting the program upgrading fragments to the equipment to be upgraded according to the target baud rate and the target data frame length.
In a third aspect, the present application provides a device upgrade terminal/device/server, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; at least one memory coupled to the at least one bus, wherein the processor is configured to:
acquiring a plurality of baud rates to be selected and a plurality of data frame lengths to be selected of test data;
determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy, wherein the product value of the target baud rate and the target data frame length of test data in the optimal test scheme is the largest;
and sending a program upgrading fragment to equipment to be upgraded according to the target baud rate and the target data frame length.
Further, determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy comprises:
determining an ordered sequence according to the baud rate to be selected and the data frame length to be selected, wherein each data in the ordered sequence is a baud rate-data frame length combination, and each baud rate-data frame length combination is orderly arranged according to the corresponding product value of the baud rate to be selected and the data frame length to be selected;
Selecting a middle baud rate-data frame length combination positioned at a middle position in the ordered sequence;
transmitting test data to the equipment to be upgraded according to the intermediate baud rate-data frame length combination;
if the response information sent by the equipment to be upgraded is received, determining adjacent baud rate-data frame length combinations of the intermediate baud rate-data frame length combinations along the ascending direction of the ordered sequence;
transmitting test data to the equipment to be upgraded according to the adjacent baud rate-data frame length combination;
and if the response information sent by the equipment to be upgraded is received, sending test data according to the next adjacent baud rate-data frame length combination along the ascending direction until the response information is not received, wherein the baud rate-data frame length combination corresponding to the last response information is the optimal test scheme.
Further, after sending test data to the device to be upgraded according to the intermediate baud rate-data frame length combination or after sending test data to the device to be upgraded according to the adjacent baud rate-data frame length combination, the method further includes:
if the response information sent by the equipment to be upgraded is not received, determining the descending direction of the ordered sequence;
Selecting adjacent baud rate-data frame length combinations to send test data along the descending order direction from the middle baud rate-data frame length combinations;
and if the response information sent by the equipment to be upgraded is not received, sending test data according to the next adjacent baud rate-data frame length combination along the descending order direction until the response information is received, wherein the baud rate-data frame length combination corresponding to the response information is the optimal test scheme.
Further, determining an ordered sequence according to the baud rate to be selected and the data frame length to be selected includes:
according to the sequence arrangement of the data frames to be selected, which are from low to high in the baud rate to be selected and correspond to the same baud rate to be selected, from short to long in the length, determining an ascending sequence; or alternatively, the first and second heat exchangers may be,
and according to the sequence of the data frames to be selected, which are from high to low in the baud rate to be selected and correspond to the same baud rate to be selected, from long to short, determining a descending sequence.
Further, determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy comprises:
determining an ascending sequence according to the sequence from low to high of the baud rate to be selected and the sequence from short to long of the frame length of the data to be selected corresponding to the same baud rate to be selected, wherein each data in the ascending sequence is a baud rate-data frame length combination;
According to the first baud rate-data frame length combination in the ascending sequence, test data are sent to the equipment to be upgraded;
and if the response information sent by the equipment to be upgraded is received, sending test data to the equipment to be upgraded according to the next baud rate-data frame length combination, wherein the baud rate-data frame length combination corresponding to the last response information is an optimal test scheme.
Further, before determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy, the method further comprises:
acquiring an initial baud rate of the equipment to be upgraded, wherein the initial baud rate and the baud rate to be selected are different;
transmitting a data frame to the equipment to be upgraded according to the initial baud rate;
and if the reply information fed back by the equipment to be upgraded is received within the preset time, switching the initial baud rate to the baud rate to be selected.
Further, the device to be upgraded includes at least one sub-device of the same device type, and after the program upgrade fragment is sent to the device to be upgraded at the target baud rate and the target data frame length, the method further includes:
If the upgrade confirmation information fed back by all the sub-devices is not received, retransmitting the program upgrade fragment according to the target baud rate and the target data frame length;
and if the upgrade confirmation information fed back by all the sub-equipment is received, transmitting a next program upgrade fragment according to the target baud rate and the target data frame length.
In a third aspect, the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; a memory for storing a computer program; and the processor is used for realizing any one of the methods when executing the program stored in the memory.
In a fourth aspect, the present application also provides a computer storage medium storing computer executable instructions for performing the device upgrade method according to any one of the above-described embodiments of the present application.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: and before equipment is upgraded, a communication quality test is performed first, the optimal target baud rate and the target data frame length are determined, and in the process of the formal equipment upgrading, a program upgrading fragment is sent by adopting the target baud rate and the target data frame length, so that the communication efficiency and the data transmission reliability are both considered in the process of the equipment upgrading, and the program upgrading efficiency is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements, and in which the figures of the drawings are not to be taken in a limiting sense, unless otherwise indicated.
FIG. 1 is a flowchart of a method for upgrading a device according to an embodiment of the present application;
fig. 2 is a schematic diagram of an RS485 communication unit network of an air conditioner according to an embodiment of the present application;
fig. 3 is a flowchart for improving the program upgrading efficiency of an RS485 communication air conditioning unit according to an embodiment of the present application;
Fig. 4 is a schematic structural diagram of an apparatus upgrade device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The following disclosure provides many different embodiments, or examples, for implementing different structures of the application. In order to simplify the present disclosure, components and arrangements of specific examples are described below. They are, of course, merely examples and are not intended to limit the application. Furthermore, the present application may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed.
The application provides a device upgrading method, which is applied to program upgrading equipment, as shown in fig. 1, and comprises the following steps:
step 101: and acquiring a plurality of baud rates to be selected and a plurality of data frame lengths to be selected of the test data.
The communication network of the RS485 communication unit is provided with only one master device, and the program upgrading device is accessed only when the unit has program upgrading requirements, and the program upgrading device has a slave device role when the program upgrading requirements are accessed. Fig. 2 is a network schematic diagram of an RS485 communication unit of an air conditioner, wherein a line controller or an external device is a main device.
When the problem is solved by carrying out program upgrading on the equipment to be upgraded, a technician stores the program files to be upgraded into the program upgrading equipment, wherein the upgrading program files can be the program files of a certain type of equipment to be upgraded or the program files of various kinds of equipment to be upgraded.
The program upgrading equipment is connected to an RS485 communication network through communication to acquire communication parameters of the communication network, including baud rate, polarity and the like. The upgrade tool sends a program upgrade instruction to the RS485 communication network according to the equipment type of the equipment to be upgraded, and the equipment to be upgraded of the equipment type can feed back the equipment address of the equipment to the RS485 communication network, so that the program upgrade equipment can accurately send test data and program upgrade fragments according to the equipment address. And the program upgrading device selects an upgrading program file required by the device to be upgraded according to the device type of the device to be upgraded.
The device to be upgraded is a controller with IAP (In Application Programming, in application programming, that is, erasing/programming operation is performed on the Flash memory on chip according to application codes of end users), the program is composed of two parts, namely a bootloader and an application part program, the bootloader is a boot loader, the initialization operation after the chip is reset is controlled, the function of programming the Flash memory is provided, the boot codes can reprogram the chip which has been programmed in advance, and the application part program realizes the specific logic function of the controller.
The test data is required to be sent at a certain baud rate and a certain data frame length, and the program upgrading equipment firstly obtains a plurality of baud rates to be selected and a plurality of data frame lengths to be selected of the test data.
Step 102: and determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy.
And the product value of the target baud rate of the test data and the target data frame length in the optimal test scheme is the largest.
The program upgrading equipment determines a target baud rate and a target data frame length according to a preset communication quality testing strategy, wherein the product value of the target baud rate and the target data frame length is the largest in all the baud rates to be selected and the data frame length to be selected, and thus the communication efficiency and the data transmission reliability can be simultaneously considered.
Step 103: and transmitting the program upgrading fragments to the equipment to be upgraded according to the target baud rate and the target data frame length.
In the actual program upgrading process, the program upgrading device sends a program upgrading fragment to the device to be upgraded according to the target baud rate and the target data frame length.
In the application, communication quality test is carried out before equipment upgrading, the optimal target baud rate and target data frame length are determined, and in the process of equipment formal upgrading, program upgrading fragments are sent by adopting the target baud rate and the target data frame length, so that the communication efficiency and the data transmission reliability are both considered in the process of equipment upgrading, and the program upgrading efficiency is improved.
The whole process of the application is between the program upgrading equipment and the equipment to be upgraded, the internet and the server are not required to be connected, and the application is particularly suitable for the chip program upgrading of the singlechip with limited chip resources.
The method comprises the steps of determining an optimal test scheme according to a preset communication quality test strategy, a to-be-selected baud rate and a to-be-selected data frame length, and at least three embodiments.
For the first embodiment:
the program upgrading device forms a baud rate-data frame length combination according to the baud rate to be selected and the data frame length to be selected, for example, there are 3 baud rates to be selected: baudrate1, baudrate2, baudrate3,3 candidate data frame lengths: l1, L2, L3, a total of 9 baud rate-data frame length combinations: baudrate1-L1, baudrate1-L2, baudrate1-L3, baudrate2-L1, baudrate2-L2, baudrate2-L3, baudrate3-L1, baudrate3-L2, and Baudrate3-L3.
Because of the characteristics of the program address space, the multiple of L1-L3 is preferably 128, and can also be other values, wherein L1-L3 is the length of a program file data segment, and a header code, address information, data frame length information, a function code, a frame code, check information and the like are required to be added to an actual data frame.
And the program upgrading equipment sends test data to the equipment to be upgraded according to each baud rate-data frame length combination, and if response information of the equipment to be upgraded for the test data is received, the baud rate and the target data frame length with the largest product value of the baud rate and the data frame length are selected from the baud rate-data frame length combination corresponding to the response information.
For each baud rate-data frame length combination, n (n > =3) times of test data are sent to the device to be upgraded, so that the test accuracy is improved. If the equipment to be upgraded does not receive the response information, namely the program receiving upgrading equipment does not receive the response information fed back by the equipment to be upgraded, the baud rate-data frame length combination is directly canceled.
For the second embodiment:
the program upgrading equipment determines an ordered sequence according to the baud rate to be selected and the length of the data frame to be selected, wherein each data in the ordered sequence is a baud rate-data frame length combination, and each baud rate-data frame length combination is orderly arranged according to the product value of the corresponding baud rate to be selected and the length of the data frame to be selected.
The ordered sequence comprises an ascending sequence or a descending sequence, wherein the ascending sequence is determined according to the sequence arrangement of the data frame length corresponding to the one-baud rate to be selected from low to high, and the data frame length corresponding to the one-baud rate to be selected from short to long, and the descending sequence is determined according to the sequence arrangement of the data frame length corresponding to the one-baud rate to be selected from high to low, and the data frame length corresponding to the one-baud rate to be selected from long to short.
The program upgrading device selects an intermediate baud rate-data frame length combination positioned at an intermediate position in the ordered sequence, and determines a target baud rate and a target data frame length by taking the intermediate baud rate-data frame length combination as a starting point.
If the ordered sequence contains odd number of combinations, the most middle position is used as the middle baud rate-data frame length combination; if the ordered sequence contains an even number of combinations, any combination with a nearby middle position is used as the middle baud rate-data frame length combination.
Specifically, the program upgrading device sends test data to the device to be upgraded according to the intermediate baud rate-data frame length combination, and for a situation, if the program upgrading device does not receive response information sent by the device to be upgraded, which indicates that in the intermediate baud rate-data frame length combination, the product value of the baud rate and the data frame length is too large, the product value needs to be reduced, so that adjacent baud rate-data frame length combinations of the intermediate baud rate-data frame length combination are selected to send the test data along the descending direction of the ordered sequence. If the response information is not received, continuously selecting the next baud rate-data frame length combination along the descending order direction to send the test data until the response information can be received, and then the baud rate-data frame length combination corresponding to the response information is the target baud rate and the target data frame length, namely the optimal test scheme.
For another situation, if the program upgrading device receives the response information sent by the device to be upgraded, which indicates that the device to be upgraded can adopt the baud rate-data frame length combination, in order to achieve better communication efficiency and data transmission reliability, the product value of the baud rate and the data frame length can be improved, and then the program upgrading device continues to send test data according to the next adjacent baud rate-data frame length combination along the ascending direction of the ordered sequence until the response information is not received, and then the baud rate-data frame length combination corresponding to the last response information is the optimal test scheme.
For the third embodiment:
the program upgrading device determines an ascending sequence according to the sequence from low to high of the baud rate to be selected and the length of the data frame to be selected corresponding to the same baud rate to be selected from short to long, wherein each data in the ascending sequence is a baud rate-data frame length combination. Starting from the first baud rate-data frame length combination in the ascending sequence, the program upgrading device sends test data to the device to be upgraded according to the first baud rate-data frame length combination. If the program upgrading device receives the response information sent by the device to be upgraded, the program upgrading device can continue to take the product value of the larger baud rate and the data frame length, and then test data is sent to the device to be upgraded according to the next baud rate-data frame length combination, wherein the baud rate-data frame length combination corresponding to the last response information is the optimal test scheme.
Compared with the first embodiment, the optimal test scheme can be determined by sending test data for multiple times according to each baud rate-data frame length combination, the second embodiment and the third embodiment can determine the optimal test scheme by sending test data only according to partial baud rate-data frame length combinations, and the efficiency of determining the optimal test scheme is improved.
As an optional implementation manner, before determining the optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to the preset communication quality test strategy, the method further includes: acquiring initial baud rate of equipment to be upgraded, wherein the initial baud rate and the baud rate to be selected are different; transmitting a data frame to equipment to be upgraded according to the initial baud rate; and if the reply information fed back by the equipment to be upgraded is received within the preset time, switching the initial baud rate to the baud rate to be selected.
When the baud rate changes, the program upgrading device needs to confirm according to the initial baud rate before sending out test data, and the initial baud rate can be the baud rate adopted by the daily work of the device to be upgraded. For example, when the initial baud rate of the unit is switched to baudrate1, the program upgrading device sends out a baud rate data frame at the initial baud rate, after the program upgrading device sends out the data frame, a certain period of time is reserved for waiting for the upgrading device to answer, if the program upgrading device receives answer information fed back by the equipment to be upgraded in the preset period of time, which indicates that the equipment to be upgraded can normally communicate, the initial baud rate is switched to the baud rate to be selected of test data, and a communication quality test is started.
As an optional implementation manner, after the device to be upgraded includes at least one sub-device of the same device type and the program upgrade fragment is sent to the device to be upgraded at the target baud rate and the target data frame length, the method further includes: if the upgrade confirmation information fed back by all the sub-devices is not received, retransmitting the program upgrade fragments according to the target baud rate and the target data frame length; and if the upgrade confirmation information fed back by all the sub-equipment is received, transmitting a next program upgrade fragment according to the target baud rate and the target data frame length.
After the program upgrading device sends the program upgrading fragments to the device to be upgraded according to the target baud rate and the target data frame length, the program upgrading device sends the program upgrading fragments to a plurality of sub-devices of the same device type, and if the program upgrading device does not receive upgrading confirmation information fed back by all the sub-devices, which indicates that some sub-devices are failed to upgrade, the program upgrading fragments need to be retransmitted according to the target baud rate and the target data frame length.
And after the equipment to be upgraded receives all the program upgrading files and checks, erasing, burning, checking and the like are performed. The program upgrading equipment sends an equipment starting operation instruction according to the communication baud rate of the original unit, the equipment to be upgraded operates according to the updated program, at the moment, the program upgrading equipment exits the role of the main equipment, and the original main equipment is switched to the role of the main equipment by the slave equipment to perform normal communication of the unit.
Fig. 3 is a flowchart for improving the program upgrading efficiency of the RS485 communication air conditioner set.
Based on the same technical concept, the application also provides a device upgrading device, as shown in fig. 4, which comprises:
an obtaining module 401, configured to obtain a plurality of baud rates to be selected and a plurality of data frame lengths to be selected of the test data;
a determining module 402, configured to determine an optimal test scheme according to a preset communication quality testing policy and according to a to-be-selected baud rate and a to-be-selected data frame length, where a product value of a target baud rate of test data and a target data frame length in the optimal test scheme is the largest;
a sending module 403, configured to send the program upgrade fragment to the device to be upgraded at the target baud rate and the target data frame length.
Further, the determining module 402 is configured to:
determining an ordered sequence according to the baud rate to be selected and the length of the data frame to be selected, wherein each data in the ordered sequence is a baud rate-data frame length combination, and each baud rate-data frame length combination is orderly arranged according to the product value of the corresponding baud rate to be selected and the corresponding data frame length to be selected;
selecting a middle baud rate-data frame length combination positioned at a middle position in the ordered sequence;
transmitting test data to the equipment to be upgraded according to the intermediate baud rate-data frame length combination;
If the response information sent by the equipment to be upgraded is received, determining adjacent baud rate-data frame length combinations of the intermediate baud rate-data frame length combinations along the ascending direction of the ordered sequence;
transmitting test data to the equipment to be upgraded according to the adjacent baud rate-data frame length combination;
if the response information sent by the equipment to be upgraded is received, sending test data according to the next adjacent baud rate-data frame length combination along the ascending order direction until the response information is not received, wherein the baud rate-data frame length combination corresponding to the last response information is the optimal test scheme.
Further, the device is also used for:
if the response information sent by the equipment to be upgraded is not received, determining the descending direction of the ordered sequence;
selecting adjacent baud rate-data frame length combinations to send test data along the descending order direction from the middle baud rate-data frame length combinations;
if the response information sent by the equipment to be upgraded is not received, sending test data according to the next adjacent baud rate-data frame length combination along the descending order direction until the response information is received, wherein the baud rate-data frame length combination corresponding to the response information is the optimal test scheme.
Further, the determining module 402 is configured to:
according to the sequence arrangement of the data frames to be selected, which are from low to high in the baud rate to be selected and correspond to the same baud rate to be selected, from short to long in the length, determining an ascending sequence; or alternatively, the first and second heat exchangers may be,
and according to the sequence of the data frames to be selected, which are from high to low in the baud rate to be selected and correspond to the same baud rate to be selected, from long to short, determining a descending sequence.
Further, the determining module 402 is configured to:
determining an ascending sequence according to the sequence from low to high of the baud rate to be selected and the sequence from short to long of the frame length of the data to be selected corresponding to the same baud rate to be selected, wherein each data in the ascending sequence is a baud rate-data frame length combination;
according to the first baud rate-data frame length combination in the ascending sequence, sending test data to the equipment to be upgraded;
and if the response information sent by the equipment to be upgraded is received, sending test data to the equipment to be upgraded according to the next baud rate-data frame length combination, wherein the baud rate-data frame length combination corresponding to the last response information is the optimal test scheme.
Further, the device is also used for:
acquiring initial baud rate of equipment to be upgraded, wherein the initial baud rate and the baud rate to be selected are different;
Transmitting a data frame to equipment to be upgraded according to the initial baud rate;
and if the reply information fed back by the equipment to be upgraded is received within the preset time, switching the initial baud rate to the baud rate to be selected.
Further, the device is also used for:
if the upgrade confirmation information fed back by all the sub-devices is not received, retransmitting the program upgrade fragments according to the target baud rate and the target data frame length;
and if the upgrade confirmation information fed back by all the sub-equipment is received, transmitting a next program upgrade fragment according to the target baud rate and the target data frame length.
As shown in fig. 5, an embodiment of the present application provides an air conditioner control device, which includes a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, the memory 503 complete communication with each other through the communication bus 504,
a memory 503 for storing a computer program;
in one embodiment of the present application, the processor 501 is configured to implement the method for upgrading a device provided in any one of the foregoing method embodiments when executing a program stored on the memory 503, where the method includes:
acquiring a plurality of baud rates to be selected and a plurality of data frame lengths to be selected of test data;
Determining an optimal test scheme according to a preset communication quality test strategy and the to-be-selected baud rate and the to-be-selected data frame length, wherein the product value of the target baud rate and the target data frame length of test data in the optimal test scheme is the largest;
and transmitting the program upgrading fragments to the equipment to be upgraded according to the target baud rate and the target data frame length.
Further, according to a preset communication quality testing strategy, determining an optimal testing scheme according to the baud rate to be selected and the data frame length to be selected comprises:
determining an ordered sequence according to the baud rate to be selected and the length of the data frame to be selected, wherein each data in the ordered sequence is a baud rate-data frame length combination, and each baud rate-data frame length combination is orderly arranged according to the product value of the corresponding baud rate to be selected and the corresponding data frame length to be selected;
selecting a middle baud rate-data frame length combination positioned at a middle position in the ordered sequence;
transmitting test data to the equipment to be upgraded according to the intermediate baud rate-data frame length combination;
if the response information sent by the equipment to be upgraded is received, determining adjacent baud rate-data frame length combinations of the intermediate baud rate-data frame length combinations along the ascending direction of the ordered sequence;
Transmitting test data to the equipment to be upgraded according to the adjacent baud rate-data frame length combination;
if the response information sent by the equipment to be upgraded is received, sending test data according to the next adjacent baud rate-data frame length combination along the ascending order direction until the response information is not received, wherein the baud rate-data frame length combination corresponding to the last response information is the optimal test scheme.
Further, after sending the test data to the device to be upgraded according to the intermediate baud rate-data frame length combination or after sending the test data to the device to be upgraded according to the adjacent baud rate-data frame length combination, the method further comprises:
if the response information sent by the equipment to be upgraded is not received, determining the descending direction of the ordered sequence;
selecting adjacent baud rate-data frame length combinations to send test data along the descending order direction from the middle baud rate-data frame length combinations;
if the response information sent by the equipment to be upgraded is not received, sending test data according to the next adjacent baud rate-data frame length combination along the descending order direction until the response information is received, wherein the baud rate-data frame length combination corresponding to the response information is the optimal test scheme.
Further, determining an ordered sequence based on the baud rate to be selected and the length of the frame of data to be selected includes:
according to the sequence arrangement of the data frames to be selected, which are from low to high in the baud rate to be selected and correspond to the same baud rate to be selected, from short to long in the length, determining an ascending sequence; or alternatively, the first and second heat exchangers may be,
and according to the sequence of the data frames to be selected, which are from high to low in the baud rate to be selected and correspond to the same baud rate to be selected, from long to short, determining a descending sequence.
Further, according to a preset communication quality testing strategy, determining an optimal testing scheme according to the baud rate to be selected and the data frame length to be selected comprises:
determining an ascending sequence according to the sequence from low to high of the baud rate to be selected and the sequence from short to long of the frame length of the data to be selected corresponding to the same baud rate to be selected, wherein each data in the ascending sequence is a baud rate-data frame length combination;
according to the first baud rate-data frame length combination in the ascending sequence, sending test data to the equipment to be upgraded;
and if the response information sent by the equipment to be upgraded is received, sending test data to the equipment to be upgraded according to the next baud rate-data frame length combination, wherein the baud rate-data frame length combination corresponding to the last response information is the optimal test scheme.
Further, before determining the optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to the preset communication quality test strategy, the method further comprises:
acquiring initial baud rate of equipment to be upgraded, wherein the initial baud rate and the baud rate to be selected are different;
transmitting a data frame to equipment to be upgraded according to the initial baud rate;
and if the reply information fed back by the equipment to be upgraded is received within the preset time, switching the initial baud rate to the baud rate to be selected.
Further, after the device to be upgraded includes at least one sub-device of the same device type and the program upgrade fragment is sent to the device to be upgraded at the target baud rate and the target data frame length, the method further includes:
if the upgrade confirmation information fed back by all the sub-devices is not received, retransmitting the program upgrade fragments according to the target baud rate and the target data frame length;
and if the upgrade confirmation information fed back by all the sub-equipment is received, transmitting a next program upgrade fragment according to the target baud rate and the target data frame length.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the device upgrade method provided in any one of the method embodiments described above.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
From the above description of embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus a general purpose hardware platform, or may be implemented by hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the related art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the method described in the respective embodiments or some parts of the embodiments.
It is to be understood that the terminology used herein is for the purpose of describing particular example embodiments only, and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "comprises," "comprising," "includes," "including," and "having" are inclusive and therefore specify the presence of stated features, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and/or groups thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring their performance in the particular order described or illustrated, unless an order of performance is explicitly stated. It should also be appreciated that additional or alternative steps may be used.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the 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. A method of upgrading a device, the method comprising:
acquiring a plurality of baud rates to be selected and a plurality of data frame lengths to be selected of test data;
determining an optimal test scheme according to the to-be-selected baud rate and the to-be-selected data frame length according to a preset communication quality test strategy, wherein the product value of the target baud rate and the target data frame length of test data in the optimal test scheme is the largest;
and sending a program upgrading fragment to equipment to be upgraded according to the target baud rate and the target data frame length.
2. The method of claim 1, wherein determining an optimal test scheme according to the baud rate to be selected and the data frame length to be selected according to a preset communication quality test policy comprises:
determining an ordered sequence according to the baud rate to be selected and the data frame length to be selected, wherein each data in the ordered sequence is a baud rate-data frame length combination, and each baud rate-data frame length combination is orderly arranged according to the corresponding product value of the baud rate to be selected and the data frame length to be selected;
selecting a middle baud rate-data frame length combination positioned at a middle position in the ordered sequence;
Transmitting test data to the equipment to be upgraded according to the intermediate baud rate-data frame length combination;
if the response information sent by the equipment to be upgraded is received, determining adjacent baud rate-data frame length combinations of the intermediate baud rate-data frame length combinations along the ascending direction of the ordered sequence;
transmitting test data to the equipment to be upgraded according to the adjacent baud rate-data frame length combination;
and if the response information sent by the equipment to be upgraded is received, sending test data according to the next adjacent baud rate-data frame length combination along the ascending direction until the response information is not received, wherein the baud rate-data frame length combination corresponding to the last response information is the optimal test scheme.
3. The method of claim 2, wherein after transmitting test data to the device to be upgraded in the intermediate baud rate-data frame length combination or after transmitting test data to the device to be upgraded in the adjacent baud rate-data frame length combination, the method further comprises:
if the response information sent by the equipment to be upgraded is not received, determining the descending direction of the ordered sequence;
Selecting adjacent baud rate-data frame length combinations to send test data along the descending order direction from the middle baud rate-data frame length combinations;
and if the response information sent by the equipment to be upgraded is not received, sending test data according to the next adjacent baud rate-data frame length combination along the descending order direction until the response information is received, wherein the baud rate-data frame length combination corresponding to the response information is the optimal test scheme.
4. The method of claim 2, wherein determining an ordered sequence based on the baud rate to be selected and the data frame length to be selected comprises:
according to the sequence arrangement of the data frames to be selected, which are from low to high in the baud rate to be selected and correspond to the same baud rate to be selected, from short to long in the length, determining an ascending sequence; or alternatively, the first and second heat exchangers may be,
and according to the sequence of the data frames to be selected, which are from high to low in the baud rate to be selected and correspond to the same baud rate to be selected, from long to short, determining a descending sequence.
5. The method of claim 1, wherein determining an optimal test scheme according to the baud rate to be selected and the data frame length to be selected according to a preset communication quality test policy comprises:
Determining an ascending sequence according to the sequence from low to high of the baud rate to be selected and the sequence from short to long of the frame length of the data to be selected corresponding to the same baud rate to be selected, wherein each data in the ascending sequence is a baud rate-data frame length combination;
according to the first baud rate-data frame length combination in the ascending sequence, test data are sent to the equipment to be upgraded;
and if the response information sent by the equipment to be upgraded is received, sending test data to the equipment to be upgraded according to the next baud rate-data frame length combination, wherein the baud rate-data frame length combination corresponding to the last response information is an optimal test scheme.
6. The method of claim 1, wherein before determining an optimal test scheme according to the baud rate to be selected and the data frame length to be selected according to a preset communication quality test policy, the method further comprises:
acquiring an initial baud rate of the equipment to be upgraded, wherein the initial baud rate and the baud rate to be selected are different;
transmitting a data frame to the equipment to be upgraded according to the initial baud rate;
and if the reply information fed back by the equipment to be upgraded is received within the preset time, switching the initial baud rate to the baud rate to be selected.
7. The method of claim 1, wherein the device to be upgraded comprises at least one sub-device of the same device type, and wherein after transmitting the program upgrade fragments to the device to be upgraded at the target baud rate and the target data frame length, the method further comprises:
if the upgrade confirmation information fed back by all the sub-devices is not received, retransmitting the program upgrade fragment according to the target baud rate and the target data frame length;
and if the upgrade confirmation information fed back by all the sub-equipment is received, transmitting a next program upgrade fragment according to the target baud rate and the target data frame length.
8. A device upgrade apparatus, the apparatus comprising:
the acquisition module is used for acquiring a plurality of baud rates to be selected and a plurality of data frame lengths to be selected of the test data;
the determining module is used for determining an optimal test scheme according to a preset communication quality test strategy and the to-be-selected baud rate and the to-be-selected data frame length, wherein the product value of the target baud rate and the target data frame length of test data in the optimal test scheme is the largest;
and the transmitting module is used for transmitting the program upgrading fragments to the equipment to be upgraded according to the target baud rate and the target data frame length.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method of any of claims 1-7 when executing a program stored on a memory.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-7.
CN202310749102.2A 2023-06-21 2023-06-21 Equipment upgrading method and device, electronic equipment and storage medium Pending CN116781211A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310749102.2A CN116781211A (en) 2023-06-21 2023-06-21 Equipment upgrading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310749102.2A CN116781211A (en) 2023-06-21 2023-06-21 Equipment upgrading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116781211A true CN116781211A (en) 2023-09-19

Family

ID=87989100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310749102.2A Pending CN116781211A (en) 2023-06-21 2023-06-21 Equipment upgrading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116781211A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116980290A (en) * 2023-09-22 2023-10-31 北京智芯微电子科技有限公司 Infrared communication upgrading method and device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116980290A (en) * 2023-09-22 2023-10-31 北京智芯微电子科技有限公司 Infrared communication upgrading method and device and electronic equipment
CN116980290B (en) * 2023-09-22 2024-01-26 北京智芯微电子科技有限公司 Infrared communication upgrading method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN107976986B (en) Method for programming an electronic control module of a vehicle
CN101778378B (en) Firmware node updating method, device and system
CN109976767B (en) Software burning method and device
CN108279910B (en) Program code programming method and device, computer equipment and storage medium
CN109428773B (en) Communication method and device
CN104793975B (en) The update method and device of application program in electronic control unit
CN1031025C (en) Method and apparatus for communicating variable length messages between register modeled radio devices
CN111930406B (en) Vehicle-mounted terminal micro control unit software upgrading method, electronic equipment and storage medium
CN107425943A (en) Message data transmission method and device, electronic equipment and computer storage medium
CN116781211A (en) Equipment upgrading method and device, electronic equipment and storage medium
CN107357595A (en) A kind of multiple driver firmware online updating system based on bus
CN106713044B (en) Data upgrading method and device
CN111538515A (en) Method, device and equipment for upgrading electric energy meter program
CN107404535B (en) Remote upgrading method and device for equipment
CN108028767A (en) For the method for adapter upgrade, mobile terminal and adapter
CN110401794A (en) Video camera remote upgrade method, device, electronic equipment and readable storage medium storing program for executing
CN116466986B (en) Equipment software upgrading method and device of energy storage system, communication module and medium
CN101197959A (en) Terminal control method, system and equipment
CN112767722B (en) Control method and device of traffic signal machine, computer equipment and storage medium
CN116095064A (en) File downloading method, computer equipment and storage medium
CN103973581A (en) Method, device and system for processing message data
CN106412657B (en) A kind of method and system of set-top box programming sequence code
KR20110039066A (en) Reprogramming method of plural controllers
CN118869474A (en) Method and system for upgrading microcontroller
CN106445571B (en) Mainboard and starting method

Legal Events

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