CN113590152A - Equipment upgrading method and system, embedded equipment, upper computer and storage medium - Google Patents
Equipment upgrading method and system, embedded equipment, upper computer and storage medium Download PDFInfo
- Publication number
- CN113590152A CN113590152A CN202110837665.8A CN202110837665A CN113590152A CN 113590152 A CN113590152 A CN 113590152A CN 202110837665 A CN202110837665 A CN 202110837665A CN 113590152 A CN113590152 A CN 113590152A
- Authority
- CN
- China
- Prior art keywords
- equipment
- upgrading
- data frame
- upgrade
- link information
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The application relates to the technical field of embedded systems, and provides an equipment upgrading method, an equipment upgrading system, embedded equipment, an upper computer and a storage medium. The method comprises the following steps: the method comprises the steps that first equipment receives an upgrading data frame sent by an upper computer, wherein the upgrading data frame comprises link information and an upgrading packet, and the link information comprises equipment information of each piece of equipment in a communication link from second equipment to the first equipment; and the first equipment transmits the upgrading data frame to the second equipment through each equipment in the communication link in sequence according to the link information so as to control the second equipment to finish upgrading based on the upgrading packet. According to the method and the device, the link information is added into the upgrading data frame, the whole system can clearly determine the specific data flow direction of the equipment upgrading process, and the information trend does not need to be judged at each level of equipment, so that the program of each level of equipment does not need to be modified simultaneously, and the convenience of upgrading each equipment in the embedded system is improved.
Description
Technical Field
The present application relates to the field of embedded system technologies, and in particular, to a device upgrading method and system, an embedded device, an upper computer, and a storage medium.
Background
In the field of embedded systems, online upgrade of devices is a common function, and reliability, security and usability of device upgrade need to be ensured. Currently, in some application scenarios, multiple devices are generally required to jointly complete an application function, and these devices do not all open a communication interface to the outside, that is, some devices need to go through communication relay to communicate with the outside. When upgrading the part of the devices, the programs of a plurality of devices in the system need to be modified at the same time, and the operation is inconvenient. For example, for an embedded system in which the device 1, the device 2, and the device 3 are cascaded, where only the device 1 can communicate with an external upper computer, when the device 3 is upgraded, the programs of the device 1 and the device 2 need to be modified simultaneously.
Disclosure of Invention
In view of this, embodiments of the present application provide an apparatus upgrading method and system, an embedded apparatus, an upper computer, and a storage medium, which can improve convenience of upgrading each apparatus in the embedded system.
In a first aspect, an embodiment of the present application provides an apparatus upgrading method applied to a first apparatus, including:
receiving an upgrade data frame sent by an upper computer, wherein the upgrade data frame comprises link information and an upgrade packet, and the link information comprises equipment information of each piece of equipment in a communication link from second equipment to first equipment;
and according to the link information, sequentially sending the upgrading data frame to the second equipment through each equipment in the communication link so as to control the second equipment to finish upgrading based on the upgrading packet.
In this embodiment, the first device is a device capable of communicating with an external upper computer, the second device is a device that needs to be upgraded, and there may be an unlimited number of other devices between the communication links of the first device and the second device. When the second equipment needs to be upgraded, firstly, an upgrading data frame is sent to the first equipment by the upper computer, and the upgrading data frame comprises link information and an upgrading packet; after receiving the upgrade data frame, the first device may determine a communication link from the first device to the second device according to link information therein, and may further sequentially send the upgrade data frame to the second device through each device in the communication link; the second device may complete the upgrade based on the upgrade package therein after receiving the upgrade data frame. By adding the link information into the upgrading data frame, the whole system can clearly determine the specific data flow direction of the equipment upgrading process, and does not need to judge the information trend at each level of equipment, so that the program of each level of equipment does not need to be modified simultaneously, and the convenience of upgrading each equipment in the embedded system is improved.
In one implementation manner of the present application, the device information includes a device identifier and a port address; the sending the upgrade data frame to the second device sequentially through each device in the communication link according to the link information may include:
acquiring a target device identifier and a target port address corresponding to the first device from the link information;
and if the target equipment identifier is consistent with the prestored actual equipment identifier of the first equipment, sending the upgrading data frame to the next equipment adjacent to the first equipment in the communication link through a port corresponding to the target port address, so that the next equipment executes the same processing as the first equipment after receiving the upgrading data frame until the upgrading data frame is sent to the second equipment.
Further, the sending the upgrade data frame to a next device adjacent to the first device in the communication link through a port corresponding to the target port address may include:
deleting the target equipment identifier and the target port address contained in the link information to obtain an updated data frame of the link information;
and sending the updated upgrading data frame of the link information to the next device adjacent to the first device in the communication link.
In an implementation manner of the present application, before receiving an upgrade data frame sent by an upper computer, the method may further include:
caching the link information obtained by each device in the communication link sending respective device information upwards stage by stage;
and uploading the cached link information to the upper computer.
In a second aspect, an embodiment of the present application provides an apparatus upgrading method applied to a second apparatus, including:
receiving an upgrade data frame, wherein the upgrade data frame comprises link information and an upgrade package, the link information comprises equipment information of each equipment in a communication link from the second equipment to the first equipment, and the first equipment sends the upgrade data frame to the second equipment through each equipment in the communication link in sequence according to the link information after receiving the upgrade data frame sent by an upper computer;
and finishing upgrading based on the upgrading packet.
In a third aspect, an embodiment of the present application provides an apparatus upgrading method applied to an upper computer, including:
constructing an upgrade data frame, the upgrade data frame including link information and an upgrade package, the link information including device information of each device in a communication link from a second device to a first device;
and sending the upgrading data frame to the first equipment so that the first equipment sends the upgrading data frame to the second equipment sequentially through each equipment in the communication link according to the link information to control the second equipment to finish upgrading based on the upgrading packet.
In a fourth aspect, an embodiment of the present application provides an embedded device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where when the processor executes the computer program, the embedded device implements the device upgrade method provided in the first aspect of the embodiment of the present application, or implements the device upgrade method provided in the second aspect of the embodiment of the present application.
In a fifth aspect, an embodiment of the present application provides an upper computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where when the processor executes the computer program, the upper computer implements the device upgrade method according to the third aspect of the embodiment of the present application.
In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed, the apparatus upgrading method provided in the first aspect of the embodiment of the present application is implemented, or the apparatus upgrading method provided in the second aspect of the embodiment of the present application is implemented, or the apparatus upgrading method provided in the third aspect of the embodiment of the present application is implemented.
In a seventh aspect, an embodiment of the present application provides an apparatus upgrading system, where the system includes an embedded apparatus as set forth in the fourth aspect of the present application and an upper computer as set forth in the fifth aspect of the present application.
It is to be understood that, the beneficial effects of the second to seventh aspects may be referred to the relevant description of the first aspect, and are not repeated herein.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of an equipment upgrading system according to an embodiment of the present application;
FIG. 2 is a schematic diagram of another device upgrade system proposed by an embodiment of the present application;
fig. 3 is a flowchart of a device upgrade method applied to a first device according to an embodiment of the present application;
fig. 4 is a flowchart of a device upgrade method applied to a second device according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a program partition of a second device according to an embodiment of the present application;
fig. 6 is a flowchart of an apparatus upgrading method applied to an upper computer according to an embodiment of the present application;
fig. 7 is a schematic diagram of an embedded device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail. Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Fig. 1 is a schematic diagram of an apparatus upgrading system according to an embodiment of the present application. In fig. 1, the first device is a device that can communicate with the outside, which is typically the top-level device of the entire embedded system; the second device is a device requiring upgrading, which cannot directly communicate with the outside; between a first device and a second device, 0-N devices are cascaded (i.e., at least 0 devices, at most N devices, where N is an integer greater than 0), and data sent by the first device needs to pass through the 0-N devices in sequence to reach the second device; the upper computer is connected with the first equipment. Note that, in the embodiments of the present application, the communication connection method between the devices is not limited. When the second equipment needs to be upgraded, the upper computer initiates an upgrade command, and upgrade data is sent to the second equipment through communication links of the first equipment, the 0-N equipment and the second equipment in sequence, so that the upgrade of the second equipment is completed.
Fig. 2 is a schematic diagram of another device upgrade system according to an embodiment of the present application. In fig. 2, the first device is directly connected to the external upper computer, and the other device 1 (connected through the UART1 interface) and the other device 2 (connected through the UART2 interface) are connected downward, and the other device 2 is connected downward to the second device (connected through the CAN1 interface) and the other device 3 (connected through the CAN2 interface). When the second equipment needs to be upgraded, the upper computer initiates an upgrade command, and upgrade data is sent to the second equipment through communication links of the first equipment, the other equipment 2 and the second equipment in sequence, so that the upgrade of the second equipment is completed. It should be understood that fig. 2 is only a structural schematic of an apparatus upgrading system proposed in the present application, and is not limited thereto, and a communication link from a first apparatus to a second apparatus can be determined for any multi-branch cascade structure system, that is, the apparatus upgrading method proposed in the present application can be used to complete upgrading of each apparatus in the system.
For the specific working principle of the device upgrade system, please refer to the method embodiments described below.
Referring to fig. 3, a device upgrade method applied to a first device provided in an embodiment of the present application is shown, including:
301. receiving an upgrade data frame sent by an upper computer, wherein the upgrade data frame comprises link information and an upgrade packet, and the link information comprises equipment information of each piece of equipment in a communication link from second equipment to first equipment;
the method embodiment can be applied to the embedded system of FIG. 1, FIG. 2 or other arbitrary structures. The first device is a top-level device of the system, and can communicate with an external upper computer (any wired or wireless communication mode can be adopted). The second device is a device that needs to be upgraded, and in the embodiment of the present application, link information (or information of all communication links that the entire embedded system has) from the first device to the second device is stored in the upper computer in advance, where the link information may include information of each device in the communication links, such as a device ID, device connection port information, and the like.
When the second device needs to be upgraded, an upper mechanism firstly constructs an upgrade data frame, the upgrade data frame may be constructed according to a communication protocol provided by the present application, a field of the upgrade data frame includes link information from the first device to the second device and an upgrade packet required for upgrading the second device, and may also include information such as a frame header, a frame tail, a command number, a command length, a check symbol, and the like of a conventional protocol, and a field content of a certain upgrade data frame is shown in table 1 below:
TABLE 1
| Frame header | Link information | Command number | Data content (upgrade package) | Check symbol | Frame end |
In table 1, the header is used to indicate the start of the upgrade data frame, the trailer is used to indicate the end of the upgrade data frame, the check character is used to perform data check (such as CRC check), the core content is link information (information such as ID or port number of each device in the communication link from the second device to the first device), the command number (used to indicate specific operation instructions, such as write operation, read operation, etc., for device upgrade, generally write operation), and the data content (i.e., specific upgrade data, upgraded package).
For the embedded system shown in fig. 2, the structure of the link information may be as shown in table 2 below:
TABLE 2
| Second device ID | First port number | Other device 2-ID | Second port number | First device ID |
In embedded systems, each device should set an ID value, which is unique in the system. For a communication link "first device-other device 2-second device", the first device is the uppermost device, which is subordinate to the other device 1 and the other device 2, and the first device is connected to the other device 2 through a second port (for example, UART2 interface in fig. 2), and the other device 2 is connected to the second device through a first port (for example, CAN1 interface in fig. 2). For example, if a certain link information is "0 x 300 x 210 x 200 x 110 x 10", it indicates that the first device (ID 0x10) is connected to the other device 2(ID 0x20) through port number 0x11, and the other device 2 is connected to the second device (ID 0x30) through port number 0x 21. Since the device ID and the port address (port number) are uniquely determined in an embedded system, the specific data flow direction of the whole communication link can be specified through the link information without determining the information trend at each level of devices.
If extended to a general system, the structure of the link information may be as shown in table 3 below:
TABLE 3
And after constructing the upgrading data frame, the upper computer issues the upgrading data frame to the first equipment. If the first device is designed to represent the writing FLASH operation, the upper computer can construct a corresponding upgrading data frame according to the protocol and directly control the first device to write the FLASH address without changing the protocol of each device in the embedded system.
302. And according to the link information, sequentially sending the upgrading data frame to the second equipment through each equipment in the communication link so as to control the second equipment to finish upgrading based on the upgrading packet.
After receiving the upgrade data frame, the upper computer can know the specific data flow direction of the equipment upgrade process according to the link information in the upgrade data frame, and sequentially sends the upgrade data frame to the second equipment through each piece of equipment in the communication link. For example, for the system shown in fig. 2, the first device transmits the upgrade data frame to the other device 2, and then the other device 2 transmits the upgrade data frame to the second device. After receiving the upgrade data frame, the second device may complete corresponding upgrade processing based on the upgrade package therein.
In one implementation manner of the present application, the device information includes a device identifier and a port address; the sending the upgrade data frame to the second device sequentially through each device in the communication link according to the link information may include:
(1) acquiring a target device identifier and a target port address corresponding to the first device from the link information;
(2) and if the target equipment identifier is consistent with the prestored actual equipment identifier of the first equipment, sending the upgrading data frame to the next equipment adjacent to the first equipment in the communication link through a port corresponding to the target port address, so that the next equipment executes the same processing as the first equipment after receiving the upgrading data frame until the upgrading data frame is sent to the second equipment.
The first device may obtain, through the link information of the upgrade data frame, a target device identifier (i.e., an ID corresponding to the top-level device in the link information) and a target port address therein, and then first determine whether the target device identifier is matched, that is, whether the target device identifier is consistent with a pre-stored actual device identifier of the first device; if the link information is consistent with the target port address, the first device sends data to the lower device through the port corresponding to the target port address recorded in the link information. After receiving the upgrade data frame sent by the first device, the lower device also obtains the corresponding device identifier and the port address from the link information, then judges whether the device identifiers are matched, if so, continuously sends the upgrade data frame to the next level device in cascade connection through the corresponding port address, and so on until sending the upgrade data frame to the second device.
Further, the sending the upgrade data frame to a next device adjacent to the first device in the communication link through a port corresponding to the target port address may include:
(1) deleting the target equipment identifier and the target port address contained in the link information to obtain an updated data frame of the link information;
(2) and sending the updated upgrading data frame of the link information to the next device adjacent to the first device in the communication link.
When the first device forwards the upgrade data frame to the next-stage device, the next-stage device only needs to know the ID of the next-stage device for data forwarding and the port address corresponding to the data forwarding, so the first device can delete the target device identifier and the target port address recorded in the original link information, and then send the upgrade data frame with updated link information to the next-stage device, and the next-stage device can also update the link information in this way. By processing in this way, the data amount transmitted by the system can be reduced to a certain extent, and particularly, the system with a large number of device cascade layers can be realized.
Taking the system shown in fig. 2 as an example for explanation, the first device receives a complete upgrade data frame sent by the upper computer, and the contents of the core part of the first device are as follows:
0x30 0x21 0x20 0x11 0x10;0xAA;0x08000000;0x01;0x55
where 0x 300 x 210 x 200 x 110 x10 denotes link information, 0xAA denotes a command number for writing a FLASH operation, 0x08000000 denotes a write address (i.e., a FLASH write address of the second device), 0x01 denotes a data length, and 0x55 denotes data to be written.
After receiving the upgrade data frame, the first device first determines whether the device ID (0x10) in the link information matches, and if the device ID (0x10) matches, sends the upgrade data frame from which the corresponding link information is deleted to the other device 2 according to a designated port (0x11, which may be a certain serial port), as follows:
0x30 0x21 0x20;0xAA;0x08000000;0x01;0x55
the other device 2 is processed in the same manner as the first device, and first determines whether the device ID (0x20) in the link information matches, and if yes, sends an upgrade data frame with the corresponding link information deleted to the second device according to a designated port (0x21, which may be a certain CAN interface), as follows:
0xAA;0x08000000;0x01;0x55
after receiving the upgrade data frame, the second device executes a FLASH write operation according to the command number 0xAA, and writes data 0x55 into a FLASH address 0x 08000000. Therefore, the devices at all levels do not care about the command number and the data content, and only need to make a clear communication link relationship, and the upper computer can conveniently send the upgrading data frame to the second device through the devices at all levels. That is, the scheme provided by the application can meet the command intercommunication requirement of external upper computer software and any device in the embedded system, so that the effects of simplifying control of the newly added device of the multilevel integrated system and enabling the transmission of commands to be free across devices are achieved.
In an implementation manner of the present application, before receiving an upgrade data frame sent by an upper computer, the method may further include:
(1) the first device caches the link information obtained by each device in the communication link sending respective device information upwards stage by stage;
(2) and the first equipment uploads the cached link information to the upper computer.
Generally, in an embedded system, an upper device of each device is determined, but there may be a plurality of lower devices, so when constructing link information, only a link port of the upper device needs to be specified. Before sending the device upgrade command, the upper computer needs to obtain link information of the embedded system, the link information can be sent to the first device in a layer-by-layer reporting mode through each level of device, and then the first device uploads the link information to the upper computer. For example, in the system shown in fig. 2, the second device reports the ID of the second device to the other device 2 (0x 30); after receiving the information reported by the second device through the designated port, the other device 2 associates the information (0x30) with the corresponding port identifier (0x21), and then adds the device ID (0x20) to obtain the link information of '0 x 300 x 210 x 20' and sends the link information to the first device; after receiving the link information sent by the other device 2 through the designated port, the first device adds the corresponding port identifier (0x11) and its own device ID (0x10), thereby obtaining complete link information "0 x 300 x 210 x 200 x 110 x 10"; and finally, the first equipment uploads the complete link information to an upper computer. Therefore, the first device (top device) can cache link information of all devices in the system, and the first device can freely communicate with the external upper computer, so that the external upper computer can freely interact with any device in the system through the acquired link information.
In this embodiment, the first device is a device capable of communicating with an external upper computer, the second device is a device that needs to be upgraded, and there may be an unlimited number of other devices between the communication links of the first device and the second device. When the second equipment needs to be upgraded, firstly, an upgrading data frame is sent to the first equipment by the upper computer, and the upgrading data frame comprises link information and an upgrading packet; after receiving the upgrade data frame, the first device may determine a communication link from the first device to the second device according to link information therein, and may further sequentially send the upgrade data frame to the second device through each device in the communication link; the second device may complete the upgrade based on the upgrade package therein after receiving the upgrade data frame. By adding the link information into the upgrading data frame, the whole system can clearly determine the specific data flow direction of the equipment upgrading process, and does not need to judge the information trend at each level of equipment, so that the program of each level of equipment does not need to be modified simultaneously, and the convenience of upgrading each equipment in the embedded system is improved.
Referring to fig. 4, a device upgrade method applied to a second device provided in an embodiment of the present application is shown, including:
401. receiving an upgrade data frame, wherein the upgrade data frame comprises link information and an upgrade packet, and the link information comprises equipment information of each equipment in a communication link from the second equipment to the first equipment;
the execution main body of the embodiment of the application is a second device to be upgraded, and the second device receives the upgrade data frame through a specified communication link. The upgrade data frame contains link information containing information of each device in a communication link from the second device to the first device (top-level device connectable to the upper computer) and an upgrade package. For a detailed description of the upgrade data frame and the link information, reference may be made to an embodiment of the present application. The method comprises the steps that firstly, an upgrade data frame is sent to first equipment by an upper computer, and after the first equipment receives the upgrade data frame sent by the upper computer, the upgrade data frame can be sent to second equipment through each piece of equipment in a communication link in sequence according to link information in the upgrade data frame.
402. And finishing upgrading based on the upgrading packet.
And after receiving the upgrading data frame, the second device completes upgrading based on the upgrading packet in the upgrading data frame.
In one implementation of the present application, a device partition diagram of the second device is shown in fig. 5. In fig. 5, the default launch area of the program is a program jump point for selecting the currently launched application area. The application program area 1 and the application program area 2 are two areas in which an application program can be run, and are also areas in which an upgrade program runs, and a common processing mode is to upgrade the application program area 2 through the application program area 1 and upgrade the application program area 1 through the application program area 2, that is, if a current program runs in the application program area 1, upgrade data should be written into the application program area 2 during upgrading. The parameter storage area is used for storing parameters such as program area operation flags, start addresses and version information of the application program area 1 and the application program area 2. Generally, the default boot area and the parameter storage area can reduce the size of the partition and preferentially ensure the partition capacity of the application program area under the condition of ensuring normal use.
After the second device finishes upgrading, in order to ensure the validity of the data, CRC and other verification can be carried out on the upgrading data frame, and if the verification fails, the upgrading is cancelled. And if the upgrading is successful, jumping the program of the second equipment from the current operation area to the area of the upgrading, and directly operating the program after the upgrading. When the system of the second device is started, the program firstly enters the default starting area, the starting information such as the address of the program area, the version number of the program and the like is read from the parameter storage area, and the program area is preferentially jumped to the address of the program area with the higher version number to run. By adopting the mechanism, if a certain APP version needs to be backed, only the upper computer sends a command, and the corresponding APP version number is erased.
In the embedded system, the core content of the equipment upgrading is the writing FLASH operation. In the embodiment of the application, for an embedded system with multiple cascaded devices, the agreed protocol is used, and only the device ID and the data write address need to be determined, so that any one device in the system can be upgraded. According to the method and the device, the link information is added into the upgrading data frame, the whole system can clearly determine the specific data flow direction of the equipment upgrading process, information trend does not need to be judged at each stage of equipment, and therefore the program of each stage of equipment does not need to be modified simultaneously, and convenience of upgrading each equipment in the embedded system is improved.
Referring to fig. 6, a device upgrading method applied to an upper computer according to an embodiment of the present application is shown, including:
601. constructing an upgrade data frame, the upgrade data frame including link information and an upgrade package, the link information including device information of each device in a communication link from a second device to a first device;
the execution main body of the embodiment of the application is the upper computer, when the second device in the system needs to be upgraded, the upper computer firstly obtains the link information from the second device to the first device (the top-layer device capable of communicating with the upper computer) and the upgrade corresponding upgrade package, and then constructs an upgrade data frame according to the protocol.
In an implementation manner of the present application, the upper computer may read link information such as a required device ID, a communication port number, and an upgrade address from a certain pre-stored file by accessing the file. In a certain embedded system, the various communication links it has are known. Therefore, a file (which may be a cfg format, for example) may be made in advance, and the link information required for the upgrade may be written into the file, as shown below:
app1_file_name:motor_app1.bin
app2_file_name:motor_app2.bin
device_id:0x30
link_info:0x30 0x21 0x20 0x11 0x10
through the arrangement, the upper computer can obtain corresponding link information by reading the file, so that the upgrading operation of the equipment can be directly started without inquiring the link information.
602. And sending the upgrading data frame to the first equipment so that the first equipment sends the upgrading data frame to the second equipment sequentially through each equipment in the communication link according to the link information to control the second equipment to finish upgrading based on the upgrading packet.
After constructing the upgrading data frame, the upper computer sends the upgrading data frame to the first equipment; the first device sends the upgrading data frame to the second device sequentially through each device in the communication link according to the link information in the upgrading data frame, so that the second device is controlled to finish upgrading based on the upgrading packet in the upgrading data frame. The specific working principle of this process can be referred to the previous method embodiment of the present application.
The method and the device are suitable for upgrading each device in the embedded system, and are particularly suitable for the condition of multistage device cascade. Through the agreement protocol, the upper computer can freely interact with any equipment in the embedded system, so that the equipment upgrading work can be conveniently completed.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
An embodiment of the present application further provides an embedded device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where when the processor executes the computer program, the embedded device implements the device upgrade method shown in fig. 3 of the present application, or implements the device upgrade method shown in fig. 4 of the present application.
The embodiment of the application also provides an upper computer, which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein when the processor executes the computer program, the upper computer realizes the equipment upgrading method shown in the figure 6 of the application.
An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the respective device upgrading methods as set forth in the present application.
Fig. 7 is a schematic diagram of an embedded device (or a host computer) according to an embodiment of the present application. As shown in fig. 7, the embedded device 7 includes: a processor 70, a memory 71 and a computer program 72 stored in said memory 71 and executable on said processor 70. The processor 70, when executing the computer program 72, implements the steps in the various device upgrade method embodiments described above, such as steps 301 to 302 shown in fig. 3.
The computer program 72 may be divided into one or more modules/units, which are stored in the memory 71 and executed by the processor 70 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 72 in the embedded device 7.
The Processor 70 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may be an internal storage unit of the embedded device 7, such as a hard disk or a memory of the embedded device 7. The memory 71 may also be an external storage device of the embedded device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the embedded device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the embedded device 7. The memory 71 is used to store the computer program and other programs and data required by the embedded device. The memory 71 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (10)
1. A device upgrading method is applied to a first device, and is characterized by comprising the following steps:
receiving an upgrade data frame sent by an upper computer, wherein the upgrade data frame comprises link information and an upgrade packet, and the link information comprises equipment information of each piece of equipment in a communication link from second equipment to first equipment;
and according to the link information, sequentially sending the upgrading data frame to the second equipment through each equipment in the communication link so as to control the second equipment to finish upgrading based on the upgrading packet.
2. The method of claim 1, wherein the device information includes a device identification and a port address; the sending the upgrade data frame to the second device sequentially through each device in the communication link according to the link information includes:
acquiring a target device identifier and a target port address corresponding to the first device from the link information;
and if the target equipment identifier is consistent with the prestored actual equipment identifier of the first equipment, sending the upgrading data frame to the next equipment adjacent to the first equipment in the communication link through a port corresponding to the target port address, so that the next equipment executes the same processing as the first equipment after receiving the upgrading data frame until the upgrading data frame is sent to the second equipment.
3. The method of claim 2, wherein the sending the upgrade data frame to a next device adjacent to the first device in the communication link through a port corresponding to the target port address comprises:
deleting the target equipment identifier and the target port address contained in the link information to obtain an updated data frame of the link information;
and sending the updated upgrading data frame of the link information to the next device adjacent to the first device in the communication link.
4. The method of any one of claims 1 to 3, wherein before receiving the upgrade data frame sent by the upper computer, further comprising:
caching the link information obtained by each device in the communication link sending respective device information upwards stage by stage;
and uploading the cached link information to the upper computer.
5. A device upgrading method is applied to a second device, and is characterized by comprising the following steps:
receiving an upgrade data frame, wherein the upgrade data frame comprises link information and an upgrade package, the link information comprises equipment information of each equipment in a communication link from the second equipment to the first equipment, and the first equipment sends the upgrade data frame to the second equipment through each equipment in the communication link in sequence according to the link information after receiving the upgrade data frame sent by an upper computer;
and finishing upgrading based on the upgrading packet.
6. An equipment upgrading method is applied to an upper computer and is characterized by comprising the following steps:
constructing an upgrade data frame, the upgrade data frame including link information and an upgrade package, the link information including device information of each device in a communication link from a second device to a first device;
and sending the upgrading data frame to the first equipment so that the first equipment sends the upgrading data frame to the second equipment sequentially through each equipment in the communication link according to the link information to control the second equipment to finish upgrading based on the upgrading packet.
7. An embedded device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the embedded device implements the device upgrade method according to any one of claims 1 to 4 or implements the device upgrade method according to claim 5 when the processor executes the computer program.
8. An upper computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the upper computer implements the device upgrade method of claim 6 when the processor executes the computer program.
9. A computer-readable storage medium storing a computer program, wherein the computer program is configured to implement the device upgrade method according to any one of claims 1 to 4, or the device upgrade method according to claim 5, or the device upgrade method according to claim 6, when executed.
10. An equipment upgrading system, characterized by comprising an embedded equipment according to claim 7 and an upper computer according to claim 8.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110837665.8A CN113590152A (en) | 2021-07-23 | 2021-07-23 | Equipment upgrading method and system, embedded equipment, upper computer and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110837665.8A CN113590152A (en) | 2021-07-23 | 2021-07-23 | Equipment upgrading method and system, embedded equipment, upper computer and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN113590152A true CN113590152A (en) | 2021-11-02 |
Family
ID=78249269
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110837665.8A Pending CN113590152A (en) | 2021-07-23 | 2021-07-23 | Equipment upgrading method and system, embedded equipment, upper computer and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113590152A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114417354A (en) * | 2021-12-30 | 2022-04-29 | 北京千方科技股份有限公司 | A software upgrade system, method and storage medium for ETC electronic label |
| CN115437664A (en) * | 2022-07-20 | 2022-12-06 | 山东大学 | An internal forwarding BootLoader application program update method, battery management method and system |
| CN115904418A (en) * | 2023-02-23 | 2023-04-04 | 南京芯驰半导体科技有限公司 | A system and method for burning PCIE cascade chip firmware |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104281470A (en) * | 2014-05-09 | 2015-01-14 | 浙江大学 | Method for upgrading multi-MCU (Microprogrammed Control Unit) system software on basis of single external serial port |
| CN110187906A (en) * | 2019-05-16 | 2019-08-30 | 天地(常州)自动化股份有限公司 | Embedded device firmware update under multilayer heterogeneous network |
| CN112333022A (en) * | 2020-11-04 | 2021-02-05 | 国网江苏省电力有限公司营销服务中心 | A system and method for remote upgrading of smart electric energy meters based on multi-layer transparent transmission |
-
2021
- 2021-07-23 CN CN202110837665.8A patent/CN113590152A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104281470A (en) * | 2014-05-09 | 2015-01-14 | 浙江大学 | Method for upgrading multi-MCU (Microprogrammed Control Unit) system software on basis of single external serial port |
| CN110187906A (en) * | 2019-05-16 | 2019-08-30 | 天地(常州)自动化股份有限公司 | Embedded device firmware update under multilayer heterogeneous network |
| CN112333022A (en) * | 2020-11-04 | 2021-02-05 | 国网江苏省电力有限公司营销服务中心 | A system and method for remote upgrading of smart electric energy meters based on multi-layer transparent transmission |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114417354A (en) * | 2021-12-30 | 2022-04-29 | 北京千方科技股份有限公司 | A software upgrade system, method and storage medium for ETC electronic label |
| CN115437664A (en) * | 2022-07-20 | 2022-12-06 | 山东大学 | An internal forwarding BootLoader application program update method, battery management method and system |
| CN115904418A (en) * | 2023-02-23 | 2023-04-04 | 南京芯驰半导体科技有限公司 | A system and method for burning PCIE cascade chip firmware |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12355853B2 (en) | Memory system allowing host to easily transmit and receive data | |
| CN113590152A (en) | Equipment upgrading method and system, embedded equipment, upper computer and storage medium | |
| US6389321B2 (en) | Simultaneous wired and wireless remote in-system programming of multiple remote systems | |
| EP2474916B1 (en) | Device identifier selection | |
| CN111562933B (en) | Air conditioner upgrading method and air conditioner system | |
| US20090198770A1 (en) | System and method of updating codes in controller | |
| US7774382B2 (en) | Method and apparatus for configuring a control device, and corresponding control device | |
| CN103257869B (en) | A kind of ECU program smart download method | |
| CN110851163A (en) | Software updating method compatible with multi-device platform based on CAN communication | |
| CN111813432B (en) | FPGA configuration upgrading method and FPGA platform | |
| CN116866172A (en) | Diagnostic flashing system, method, device and medium in automobile OTA upgrading process | |
| CN112305924B (en) | Control method and device of household appliance, electronic equipment and storage medium | |
| TW201931127A (en) | Flash memory controller, SD card device, method used in flash memory controller, and host device coupled to SD card device | |
| JP5185231B2 (en) | Access management system and access management method | |
| CN115421745A (en) | Equipment remote upgrading method, device, terminal and storage medium | |
| CN110837485A (en) | Interface configuration method and device, electronic device and electronic equipment | |
| CN104461589A (en) | Single-chip microcomputer updating method and system | |
| CN101197959B (en) | Terminal control method, system and equipment | |
| JP2006146460A (en) | COMMUNICATION SYSTEM, STORAGE DEVICE, AND CONTROL DEVICE | |
| CN117829043B (en) | Chip design verification platform, method, terminal, medium and system | |
| CN109983442B (en) | System and method for emergency maintenance of vehicle computer | |
| CN117793697A (en) | Bluetooth patch downloading method and device, electronic equipment and storage medium | |
| CN113553079A (en) | Upgrading method and device for Internet of things equipment, electronic equipment and storage medium | |
| CN113556294B (en) | Data transceiving method, data transceiving device, server and storage medium | |
| CN101131649A (en) | Updating speed improving method for read-only memory of device with flash memory |
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 | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20211102 |
|
| RJ01 | Rejection of invention patent application after publication |
