Equipment upgrading method, device and system, electronic equipment and carrier
By introducing the master-slave node architecture, the problem of low upgrade efficiency of existing OTA equipment is solved, and batch synchronous upgrade of multiple devices is realized, which reduces operation and maintenance costs and improves upgrade efficiency, ensuring the correctness of equipment upgrades.
Patent Information
- Application Number
- CN202410846135.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-11-19
AI Technical Summary
The existing OTA equipment upgrade solutions are inefficient, and operation and maintenance personnel need to operate domain control equipment one by one to upgrade, resulting in large workload and low efficiency.
The master-slave node architecture is introduced. Any device is used as the master node and the upgrade package is synchronized to other devices through the LAN. The slave nodes are upgraded according to the upgrade package of the master node, reducing the workload of operation and maintenance personnel and improving the upgrade efficiency.
Through the master-slave node architecture, batch synchronous upgrade of multiple devices is achieved, which reduces operation and maintenance costs, improves upgrade efficiency, and ensures the correctness of batch upgrade of equipment.
Smart Images

Figure CN118984274A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of equipment upgrade, and in particular to an equipment upgrade method, device, system, electronic device and carrier. Background Art
[0002] Currently, devices that support OTA (Over-the-Air Technology) often face the need to continuously upgrade devices due to changing scene requirements.
[0003] However, the current device upgrade solution that supports OTA mainly adopts a separate upgrade method. For example, when upgrading the vehicle-side domain control device, it is necessary to operate the domain control devices one by one to upgrade them. This upgrade method brings a large workload to the operation and maintenance personnel and has low upgrade efficiency. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, system, electronic device and carrier for upgrading a device, so as to reduce the upgrading cost of the device and improve the upgrading efficiency.
[0005] The present application embodiment adopts the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a method for upgrading a device, wherein the method for upgrading the device is executed by any current device among multiple devices in the same local area network, and the method for upgrading the device includes:
[0007] Determine whether the current device can be used as a master node. If the current device can be used as a master node, use the current device as the master node and use other devices in the same local area network as the current device as slave nodes.
[0008] Determine whether the master node meets the upgrade condition. If the master node meets the upgrade condition, upgrade the master node according to the upgrade package obtained by the master node and send a start upgrade notification to the slave node, so that the slave node synchronizes the upgrade package from the master node and upgrades according to the start upgrade notification;
[0009] Determine the upgrade results of the master node and the slave node, and display the upgrade results of the master node and the slave node.
[0010] Optionally, determining whether the current device can serve as a master node includes:
[0011] Determine whether the current device triggers the upgrade preparation condition;
[0012] If triggered, the IP addresses of all devices in the same LAN will be queried;
[0013] According to the IP addresses of all devices, send a master node flag query request to other devices except the current device;
[0014] Determine whether the current device can serve as the master node based on the master node flag query results returned by other devices.
[0015] Optionally, determining whether the master node meets the upgrade condition includes:
[0016] Determine whether there is an open upgrade interface currently;
[0017] If not, determining that the master node meets the upgrade conditions;
[0018] Otherwise, it is determined that the master node does not meet the upgrade condition.
[0019] Optionally, sending the upgrade start notification to the slave node includes:
[0020] Get the upgrade package and parse the version number to get the version number of the upgrade package;
[0021] Send an upgrade confirmation request to the slave node according to the version number of the upgrade package;
[0022] Generate a list of slave nodes to be upgraded according to the response results of the slave nodes to the upgrade confirmation request;
[0023] A master node flag file is created and the list of slave nodes to be upgraded is traversed, and an upgrade start notification is sent to the slave nodes in the list of slave nodes to be upgraded. The master node flag file is used to identify the current device as a master node.
[0024] Optionally, after sending the upgrade start notification to the slave node, the device upgrade method further includes:
[0025] Receive the upgrade package synchronization request sent by the slave node;
[0026] The upgrade package of the master node is sent to the slave node according to the upgrade package synchronization request, so that the slave node is upgraded according to the synchronized upgrade package.
[0027] Optionally, after upgrading the master node according to the upgrade package acquired by the master node and sending an upgrade start notification to the slave node, the device upgrade method further includes:
[0028] Determine the upgrade progress of the master node and the slave node, where the upgrade progress includes at least one of starting synchronization, completing synchronization, starting upgrade, and completing upgrade;
[0029] The upgrade progress of the master node and the slave node is displayed.
[0030] Optionally, determining the upgrade results of the master node and the slave node includes:
[0031] Receive restart notification from slave nodes;
[0032] Sending a restart query request to the slave node according to the restart notification of the slave node;
[0033] Determining whether the slave node is successfully restarted according to a response result of the slave node to the restart query request;
[0034] If the slave node is successfully restarted, determining whether the slave node enters the designated upgrade partition;
[0035] If yes, then determining that the upgrade result of the slave node is a successful upgrade;
[0036] Otherwise, it is determined that the upgrade result of the slave node is an upgrade failure.
[0037] In a second aspect, an embodiment of the present application further provides an upgrade device for a device, wherein the upgrade device for the device is applied to any current device among multiple devices in the same local area network, and the upgrade device for the device includes:
[0038] A first determining unit is used to determine whether the current device can serve as a master node. If the current device can serve as a master node, the current device is used as the master node and other devices in the same local area network as the current device are used as slave nodes.
[0039] An upgrade unit, configured to determine whether the master node meets the upgrade condition. If the master node meets the upgrade condition, the master node is upgraded according to the upgrade package acquired by the master node and an upgrade start notification is sent to the slave node, so that the slave node synchronizes the upgrade package from the master node and performs the upgrade according to the upgrade start notification;
[0040] The display unit is used to determine the upgrade results of the master node and the slave node, and display the upgrade results of the master node and the slave node.
[0041] In a third aspect, an embodiment of the present application also provides an upgrade system for a device, wherein the upgrade system for the device includes a device serving as a master node and a device serving as a slave node, the device serving as the master node includes a Web front end and a Web back end, and the device serving as the master node is used to execute any of the upgrade methods for the device described above.
[0042] In a fourth aspect, an embodiment of the present application further provides an electronic device, including:
[0043] Processor; and
[0044] A memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the aforementioned device upgrade methods.
[0045] In a fifth aspect, an embodiment of the present application further provides a carrier, which is a computer-readable storage medium, and the computer-readable storage medium stores one or more programs, which, when executed by an electronic device including multiple applications, enables the electronic device to execute any of the aforementioned device upgrade methods.
[0046] At least one of the above technical solutions adopted in the embodiment of the present application can achieve the following beneficial effects: the upgrade method of the device in the embodiment of the present application is executed by any current device among multiple devices in the same local area network, first determining whether the current device can be used as a master node, and in the case where the current device can be used as a master node, the current device is used as the master node and other devices in the same local area network as the current device are used as slave nodes; then determining whether the master node meets the upgrade conditions, in the case where the master node meets the upgrade conditions, the master node is upgraded according to the upgrade package obtained by the master node and a start upgrade notification is sent to the slave node, so that the slave node synchronizes the upgrade package from the master node and upgrades according to the start upgrade notification; finally, determining the upgrade results of the master node and the slave node, and displaying the upgrade results of the master node and the slave node. The upgrade method of the device in the embodiment of the present application introduces the concept of master-slave nodes in the distributed system architecture into the scenario of multi-device upgrade, on the one hand, using the data synchronization relationship between master and slave nodes to realize batch synchronous upgrade of multiple devices, reducing the upgrade cost of operation and maintenance personnel and improving upgrade efficiency; on the other hand, the upgrade trigger operation of the master node is constrained by the judgment of the master node qualification and the judgment of the upgrade conditions, ensuring the correctness of the batch upgrade of the device. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0048] Figure 1 A schematic diagram of a process flow of a device upgrade method in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of a logic for determining whether a current device can serve as a master node in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of the logic for determining whether a master node meets the upgrade conditions in an embodiment of the present application;
[0051] Figure 4This is a schematic diagram of a master-slave node upgrade confirmation process in an embodiment of the present application;
[0052] Figure 5 This is a schematic diagram of a data synchronization process of a master-slave node in an embodiment of the present application;
[0053] Figure 6 A schematic diagram of an upgrade process of a master-slave node in an embodiment of the present application;
[0054] Figure 7 This is a schematic diagram of the structure of an upgrading device for a device in an embodiment of the present application;
[0055] Figure 8 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0057] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0058] The present application embodiment provides a method for upgrading a device, such as Figure 1 As shown, a flow chart of a method for upgrading a device in an embodiment of the present application is provided. The method for upgrading the device is executed by any current device among multiple devices in the same local area network. The method for upgrading the device at least includes the following steps S110 to S130:
[0059] Step S110, determining whether the current device can serve as a master node. If the current device can serve as a master node, the current device is used as a master node and other devices in the same local area network as the current device are used as slave nodes.
[0060] The device upgrade method of the embodiment of the present application is applicable to each device in a plurality of devices in the same local area network, and the plurality of devices in the same local area network can communicate with each other based on the local area network.
[0061] When upgrading a device, it is necessary to first determine whether the current device can serve as a master node. The master node of the embodiment of the present application can be regarded as a node with functions such as triggering the upgrade operation, controlling the upgrade process, and displaying the upgrade results. For multiple devices in the same local area network, there should be only one master node at the same time to ensure the controllability of the entire upgrade process and the correctness of batch upgrades.
[0062] If the current device can serve as a master node, its status as the master node is determined, and all other devices in the LAN are regarded as slave nodes of the master node.
[0063] Step S120, determine whether the master node meets the upgrade conditions. If the master node meets the upgrade conditions, upgrade the master node according to the upgrade package obtained by the master node and send a start upgrade notification to the slave node, so that the slave node synchronizes the upgrade package from the master node and upgrades according to the start upgrade notification.
[0064] After the current device becomes the master node, it is necessary to further determine whether the current master node meets the upgrade conditions. The judgment of the upgrade conditions is mainly set to avoid repeated upgrades. If there is currently an upgrade task, the master node does not meet the upgrade conditions.
[0065] If the master node currently meets the upgrade conditions, then the master node can directly obtain the upgrade package data in a certain way, and send an upgrade start notification to all other slave nodes, so that other slave nodes can determine whether an upgrade is needed based on their actual situation after receiving the upgrade start notification. If an upgrade is required, the slave node can directly synchronize the upgrade package data that the master node has obtained through network communication under the same local area network, without the need for separate download and upgrade operations.
[0066] It should be noted here that after obtaining the upgrade package, the master node does not directly synchronize the upgrade package to all other slave nodes through the network, because each slave node has its own tasks and requirements, and it does not necessarily need to upgrade the firmware. Therefore, in the upgrade package synchronization link, the slave node can be used as the node that actively triggers the synchronization operation, and the master node can be used as the node that passively responds.
[0067] Step S130, determining the upgrade results of the master node and the slave node, and displaying the upgrade results of the master node and the slave node.
[0068] After triggering the upgrade operation of the master node and the slave node, it is necessary to track the upgrade results of the master node and the slave node, such as whether the upgrade is completed, whether the upgrade is successful or failed, etc. Finally, the upgrade results of the master node and the slave node are displayed on the Web front end.
[0069] It should be noted that the device upgrade method of the embodiment of the present application is applicable to various devices that support OTA, such as vehicle-side domain control devices.
[0070] The device upgrade method of the embodiment of the present application introduces the concept of master-slave nodes in the distributed system architecture into the scenario of multi-device upgrade. On the one hand, it utilizes the data synchronization relationship between the master and slave nodes to realize batch synchronous upgrade of multiple devices, thereby reducing the upgrade cost of operation and maintenance personnel and improving upgrade efficiency. On the other hand, it constrains the upgrade trigger operation of the master node by judging the master node qualification and the upgrade conditions, thereby ensuring the correctness of the batch upgrade of the equipment.
[0071] In some embodiments of the present application, determining whether the current device can serve as a master node includes: determining whether the current device triggers the upgrade preparation conditions; if triggered, querying the IP addresses of all devices in the same local area network; sending a master node flag query request to other devices other than the current device based on the IP addresses of all devices; and determining whether the current device can serve as a master node based on the master node flag query results returned by other devices.
[0072] The purpose of determining whether the current device can be used as a master node is to ensure that there is only one master node at present. The status of the master node can be maintained through the status flag file of the master node. Figure 2 As shown, a schematic diagram of the judgment logic of whether the current device can be used as a master node in an embodiment of the present application is provided. The master node in the embodiment of the present application is composed of a Web front end and a Web back end.
[0073] First, monitor whether an OTA upgrade USB flash drive is inserted into the current device or whether an upgrade package sent from the cloud is received. If it is detected that an OTA upgrade USB flash drive is inserted into the current device or an upgrade package sent from the cloud is received, the Web interface is automatically opened and the master node status is automatically queried. The Web front end of the master node can send a request to the Web back end of the master node through the http protocol to obtain the local IP address, and delete the local IP from the IP list. The devices corresponding to the remaining IP addresses serve as slave nodes.
[0074] The master node traverses the slave node IP list and initiates a Post request to determine whether there is a master flag file in the slave node, and feeds back the detection result to the front end. If the slave node has a master flag file, it means that other devices have already been upgraded as master nodes, and the current device is not allowed to be upgraded as the master node, thereby limiting the current device to have only one master node. If all remaining devices do not have a master flag file, it means that other devices have not yet been upgraded as master nodes, and the current device can be allowed to be the master node.
[0075] In some embodiments of the present application, determining whether the master node meets the upgrade conditions includes: determining whether there is an open upgrade interface currently; if not, determining that the master node meets the upgrade conditions; otherwise, determining that the master node does not meet the upgrade conditions.
[0076] To facilitate understanding of the embodiments of the present application, Figure 3 As shown, a schematic diagram of the logic for judging whether a master node meets the upgrade conditions in an embodiment of the present application is provided. Figure 2 The result of the judgment on whether the current device can be used as the master node. If the current node can be upgraded as the master node, it can be further determined whether the current master node meets the upgrade conditions. Specifically, the master node Web front-end can be used to query whether there is an upgrade session in the master node Web back-end database. If it exists, it means that there is currently a Web interface open and OTA upgrade behavior is being performed, then this upgrade is not allowed, that is, the master node does not meet the upgrade conditions. If there is no upgrade session in the master node database, it means that there is currently no Web interface open and OTA upgrade behavior is being performed, then this upgrade is allowed and an upgrade session is created. By judging the upgrade conditions, it is possible to limit the OTA upgrade interface to only one open, preventing the browser from opening multiple OTA upgrade interfaces to cause repeated upgrades, which in turn causes upgrade failures.
[0077] In some embodiments of the present application, sending a notification to start upgrading to the slave nodes includes: obtaining an upgrade package and performing version number parsing to obtain the version number of the upgrade package; sending an upgrade confirmation request to the slave nodes according to the version number of the upgrade package; generating a list of slave nodes to be upgraded according to the response result of the slave nodes to the upgrade confirmation request; creating a master node flag file and traversing the list of slave nodes to be upgraded, and sending a notification to start upgrading to the slave nodes in the list of slave nodes to be upgraded, wherein the master node flag file is used to identify the current device as a master node.
[0078] In order to facilitate the understanding of the embodiments of the present application, Figure 4 As shown, a schematic diagram of the upgrade confirmation process of a master-slave node in an embodiment of the present application is provided. Figure 3 The result of judging whether the master node meets the upgrade conditions is generated. When the current master node meets the upgrade conditions, an upgrade session will be created. Based on the created upgrade session, the upgrade confirmation process of the master and slave nodes will be entered. The master node Web backend can first push the OTA upgrade USB disk mounting status in the device through Websocket real-time message. After the Web frontend detects the mounting message in the Web backend, the Web frontend triggers the display of all device information, such as the slave IP, status, version information, and upgrade package path.
[0079] The master node parses the version number in the upgrade package, and the master node carries the version number to traverse the slave node IP list and initiates a POST upgrade confirmation request to it. If the slave node responds, it proves that the slave node is running normally, otherwise it means that the slave node is abnormal. The slave node obtains the version number carried in the request and compares it to determine whether it can be upgraded, and returns the judgment result to the master node Web backend. Finally, the master node Web backend returns the upgradeable slave node list to the master node Web frontend for display.
[0080] After the master node confirms to start the upgrade, it creates a master status mark file through the master node Web backend and writes it into the master node database to identify the master node upgrade status. Then it traverses the normal slave node list to initiate a POST request to notify the slave node to start the upgrade. After the notification is completed, the master node device is upgraded. After receiving the upgrade message, the slave node triggers the upgrade interface and performs the upgrade.
[0081] In some embodiments of the present application, after sending a notification to start upgrading to the slave node, the upgrading method of the device further includes: receiving an upgrade package synchronization request sent by the slave node; and sending the upgrade package of the master node to the slave node according to the upgrade package synchronization request, so that the slave node is upgraded according to the synchronized upgrade package.
[0082] like Figure 5 As shown, a schematic diagram of a data synchronization process of a master-slave node in an embodiment of the present application is provided. Figure 4 In the process of pushing the progress of the upgrade node, the master and slave nodes can start the data synchronization phase in an asynchronous / child-thread manner. In the data synchronization phase, each slave node actively sends a data synchronization request to the master node according to its own situation and needs. For example, the GET method is used to request to download the files in the upgrade package directory of the master node. The master node returns the corresponding upgrade package file stream to the slave node, and the slave node uses the file stream to save the file in the specified directory. Considering that the file transmission process may be abnormal, after receiving the upgrade package, the slave node can further compare the md5 value of the received upgrade package with the original upgrade package to see if it is consistent. If not, the file synchronization download is re-executed to ensure the correctness of file synchronization.
[0083] In some embodiments of the present application, after upgrading the master node according to the upgrade package obtained by the master node and sending a start upgrade notification to the slave node, the upgrade method of the device also includes: determining the upgrade progress of the master node and the slave node, the upgrade progress including at least one of start synchronization, completion of synchronization, start upgrade, and completion of upgrade; and displaying the upgrade progress of the master node and the slave node.
[0084] The master node can use the download method in the Flask framework to download the upgrade package in the USB flash drive of the master node device, and push it to the master node Web front end in real time through websockets to display the node upgrade progress. The node upgrade progress can be divided into four stages: start synchronization, synchronization completion, start upgrade, and upgrade completion.
[0085] In some embodiments of the present application, determining the upgrade results of the master node and the slave node includes: receiving a restart notification of the slave node; sending a restart query request to the slave node according to the restart notification of the slave node; determining whether the slave node is successfully restarted according to a response result of the slave node to the restart query request; if the slave node is successfully restarted, determining whether the slave node enters a designated upgrade partition; if so, determining that the upgrade result of the slave node is a successful upgrade; otherwise, determining that the upgrade result of the slave node is a failed upgrade.
[0086] like Figure 6 As shown, a schematic diagram of the upgrade process of a master-slave node in an embodiment of the present application is provided. Figure 5 When the slave node determines that the received upgrade package is consistent with the md5 value of the original upgrade package, it means that the upgrade package has completed synchronization, and then the upgrade process of the master and slave nodes begins. The slave node executes the upgrade script and writes the master node IP and upgrade package version information to the data disk to prevent the loss of files in the device system disk after the upgrade. After the upgrade script is successfully executed, the device starts the designated partition, and at the same time initiates a POST request to the master node to notify the master node that the current slave node server is about to restart. After the slave node restarts the system, the master node Web backend initiates a request to the slave node to query whether the slave node has successfully restarted. This request can set a certain timeout time, such as 2 minutes. A timeout indicates that the restart failed, proving that the upgrade of the slave node failed. If the slave node restarts successfully, further determine whether the slave node enters the designated partition, such as partition B. If the slave node successfully enters partition B, the upgrade is confirmed to be successful.
[0087] If the slave node is upgraded successfully, determine whether the slave node has a configuration file. If so, delete the configuration file. The configuration file here mainly refers to the master node IP and upgrade package version information written to the data disk. The slave node initiates a POST request to the master node to report the upgrade success message.
[0088] Finally, the master node Web backend receives the upgrade status of the slave nodes and pushes the master and slave node upgrade status to the Web frontend for display in real time through websocket. After all upgrades are completed, the master node will synchronously distribute the upgrade result information to the slave nodes and use a database such as sqlite to store the upgrade information.
[0089] The present application embodiment also provides a device upgrade apparatus 700, such as Figure 7As shown, a schematic diagram of the structure of an upgrade device of a device in an embodiment of the present application is provided. The upgrade device of the device is applied to any current device among multiple devices in the same local area network. The upgrade device 700 of the device includes: a first determining unit 710, an upgrading unit 720 and a display unit 730, wherein:
[0090] The first determining unit 710 is used to determine whether the current device can serve as a master node. If the current device can serve as a master node, the current device is used as the master node and other devices in the same local area network as the current device are used as slave nodes.
[0091] An upgrading unit 720 is used to determine whether the master node meets the upgrading condition. If the master node meets the upgrading condition, the master node is upgraded according to the upgrading package acquired by the master node and an upgrading start notification is sent to the slave node, so that the slave node synchronizes the upgrading package from the master node and performs the upgrading according to the upgrading start notification;
[0092] The display unit 730 is used to determine the upgrade results of the master node and the slave node, and display the upgrade results of the master node and the slave node.
[0093] In some embodiments of the present application, the first determination unit 710 is specifically used to: determine whether the current device triggers the upgrade preparation condition; if triggered, query the IP addresses of all devices in the same local area network; send a master node flag query request to other devices other than the current device based on the IP addresses of all devices; determine whether the current device can serve as a master node based on the master node flag query results returned by other devices.
[0094] In some embodiments of the present application, the upgrade unit 720 is specifically used to: determine whether there is an open upgrade interface currently; if not, determine that the master node meets the upgrade conditions; otherwise, determine that the master node does not meet the upgrade conditions.
[0095] In some embodiments of the present application, the upgrade unit 720 is specifically used to: obtain the upgrade package and perform version number parsing to obtain the version number of the upgrade package; send an upgrade confirmation request to the slave node according to the version number of the upgrade package; generate a list of slave nodes to be upgraded according to the response result of the slave node to the upgrade confirmation request; create a master node flag file and traverse the list of slave nodes to be upgraded, and send an upgrade start notification to the slave nodes in the list of slave nodes to be upgraded, and the master node flag file is used to identify the current device as the master node.
[0096] In some embodiments of the present application, the upgrade device of the device also includes: a receiving unit, which is used to receive an upgrade package synchronization request sent by the slave node after sending an upgrade start notification to the slave node; and a sending unit, which is used to send the upgrade package of the master node to the slave node according to the upgrade package synchronization request, so that the slave node is upgraded according to the synchronized upgrade package.
[0097] In some embodiments of the present application, the upgrade device of the device also includes: a second determination unit, which is used to determine the upgrade progress of the master node and the slave node after upgrading the master node according to the upgrade package obtained by the master node and sending an upgrade start notification to the slave node, and the upgrade progress includes at least one of starting synchronization, completing synchronization, starting upgrade, and completing upgrade; the display unit is also used to: display the upgrade progress of the master node and the slave node.
[0098] In some embodiments of the present application, the display unit 730 is specifically used to: receive a restart notification from a slave node; send a restart query request to the slave node according to the restart notification of the slave node; determine whether the slave node is successfully restarted according to a response result of the slave node to the restart query request; if the slave node is successfully restarted, determine whether the slave node enters a designated upgrade partition; if so, determine that the upgrade result of the slave node is a successful upgrade; otherwise, determine that the upgrade result of the slave node is a failed upgrade.
[0099] It can be understood that the upgrading device of the above-mentioned device can implement each step of the upgrading method of the device provided in the above-mentioned embodiment, and the relevant explanations about the upgrading method of the device are applicable to the upgrading device of the device, which will not be repeated here.
[0100] An embodiment of the present application also provides an upgrade system for a device, wherein the upgrade system for the device includes a device serving as a master node and a device serving as a slave node, the device serving as the master node includes a Web front end and a Web back end, and the device serving as the master node is used to execute any of the upgrade methods for the device described above.
[0101] In summary, this application has achieved at least the following technical effects:
[0102] 1) Improved the overall upgrade efficiency of equipment and reduced the work cost of operation and maintenance personnel;
[0103] 2) The flexibility of device upgrade is improved. Any device can be used as a master node. The master node only needs to download the upgrade package from the cloud or insert a USB flash drive to obtain the upgrade package. The slave node can automatically obtain the upgrade package of the master node through data synchronization, without the need for all devices to communicate with the cloud or insert USB flash drives;
[0104] 3) The upgrade records are traceable. The master node can synchronize the upgrade records to all devices, and any device can query the upgrade records;
[0105] 4) The entire upgrade process is visualized, and it supports querying equipment upgrade progress, upgrade results, historical records and other information, which is more intuitive and friendly for operation and maintenance personnel.
[0106] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 8 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0107] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0108] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0109] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming an upgrade device for the device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0110] Determine whether the current device can be used as a master node. If the current device can be used as a master node, use the current device as the master node and use other devices in the same local area network as the current device as slave nodes.
[0111] Determine whether the master node meets the upgrade condition. If the master node meets the upgrade condition, upgrade the master node according to the upgrade package obtained by the master node and send a start upgrade notification to the slave node, so that the slave node synchronizes the upgrade package from the master node and upgrades according to the start upgrade notification;
[0112] Determine the upgrade results of the master node and the slave node, and display the upgrade results of the master node and the slave node.
[0113] The above application Figure 1 The method performed by the upgrading device of the device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0114] The present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 1 The method performed by the upgrading device of the device in the embodiment shown is specifically used to perform:
[0115] Determine whether the current device can be used as a master node. If the current device can be used as a master node, use the current device as the master node and use other devices in the same local area network as the current device as slave nodes.
[0116] Determine whether the master node meets the upgrade condition. If the master node meets the upgrade condition, upgrade the master node according to the upgrade package obtained by the master node and send a start upgrade notification to the slave node, so that the slave node synchronizes the upgrade package from the master node and upgrades according to the start upgrade notification;
[0117] Determine the upgrade results of the master node and the slave node, and display the upgrade results of the master node and the slave node.
[0118] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0119] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0120] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0121] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0122] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0123] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0124] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0125] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0126] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0127] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for upgrading a device, wherein: The device upgrade method is executed by any current device among multiple devices in the same local area network, and the device upgrade method includes: Determine whether the current device can be used as a master node. If the current device can be used as a master node, use the current device as the master node and use other devices in the same local area network as the current device as slave nodes. Determine whether the master node meets the upgrade condition. If the master node meets the upgrade condition, upgrade the master node according to the upgrade package obtained by the master node and send a start upgrade notification to the slave node, so that the slave node synchronizes the upgrade package from the master node and upgrades according to the start upgrade notification; Determine the upgrade results of the master node and the slave node, and display the upgrade results of the master node and the slave node.
2. The method for upgrading the device according to claim 1, wherein: Determining whether the current device can serve as a master node includes: Determine whether the current device triggers the upgrade preparation condition; If triggered, the IP addresses of all devices in the same LAN will be queried; According to the IP addresses of all devices, send a master node flag query request to other devices except the current device; Determine whether the current device can serve as the master node based on the master node flag query results returned by other devices.
3. The method for upgrading the device according to claim 1, wherein: Determining whether the master node meets the upgrade condition includes: Determine whether there is an open upgrade interface currently; If not, determining that the master node meets the upgrade conditions; Otherwise, it is determined that the master node does not meet the upgrade condition.
4. The method for upgrading the device according to claim 1, wherein: The sending of the upgrade start notification to the slave node comprises: Get the upgrade package and parse the version number to get the version number of the upgrade package; Send an upgrade confirmation request to the slave node according to the version number of the upgrade package; Generate a list of slave nodes to be upgraded according to the response results of the slave nodes to the upgrade confirmation request; A master node flag file is created and the list of slave nodes to be upgraded is traversed, and an upgrade start notification is sent to the slave nodes in the list of slave nodes to be upgraded. The master node flag file is used to identify the current device as a master node.
5. The method for upgrading the device according to claim 1, wherein: After sending the upgrade start notification to the slave node, the device upgrade method further includes: Receive the upgrade package synchronization request sent by the slave node; The upgrade package of the master node is sent to the slave node according to the upgrade package synchronization request, so that the slave node is upgraded according to the synchronized upgrade package.
6. The method for upgrading the device according to claim 1, wherein: After upgrading the master node according to the upgrade package acquired by the master node and sending an upgrade start notification to the slave node, the device upgrade method further includes: Determine the upgrade progress of the master node and the slave node, where the upgrade progress includes at least one of starting synchronization, completing synchronization, starting upgrade, and completing upgrade; The upgrade progress of the master node and the slave node is displayed.
7. The method for upgrading the device according to claim 1, wherein: Determining the upgrade results of the master node and the slave node includes: Receive restart notification from slave nodes; Sending a restart query request to the slave node according to the restart notification of the slave node; Determining whether the slave node is successfully restarted according to a response result of the slave node to the restart query request; If the slave node is successfully restarted, determining whether the slave node enters the designated upgrade partition; If yes, then determining that the upgrade result of the slave node is a successful upgrade; Otherwise, it is determined that the upgrade result of the slave node is an upgrade failure.
8. A device for upgrading a device, wherein: The device upgrade device is applied to any current device among multiple devices in the same local area network, and the device upgrade device includes: A first determining unit is used to determine whether the current device can serve as a master node. If the current device can serve as a master node, the current device is used as the master node and other devices in the same local area network as the current device are used as slave nodes. An upgrade unit, configured to determine whether the master node meets the upgrade condition. If the master node meets the upgrade condition, the master node is upgraded according to the upgrade package acquired by the master node and an upgrade start notification is sent to the slave node, so that the slave node synchronizes the upgrade package from the master node and performs the upgrade according to the upgrade start notification; The display unit is used to determine the upgrade results of the master node and the slave node, and display the upgrade results of the master node and the slave node.
9. A device upgrade system, wherein: The device upgrade system includes a device as a master node and a device as a slave node, the device as the master node includes a Web front end and a Web back end, and the device as the master node is used to execute the upgrade method of the device described in any one of claims 1 to 7.
10. An electronic device comprising: processor; as well as A memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the method for upgrading the device according to any one of claims 1 to 7.
11. A carrier, wherein the carrier is a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by an electronic device including a plurality of application programs, the electronic device executes the upgrade method of the device according to any one of claims 1 to 7.
Citation Information
Cited By
Electric energy meter topology upgrading method and system and intelligent terminal
CN120492000A
