Multi-system gateway upgrade method, device and storage medium
The version is regularly queried through the gateway system and adopted appropriate upgrade strategies based on the emergency tasks and independent upgrade capabilities of the module system, which solved the problem of failed upgrade of multi-module integrated gateway equipment, and improved the robustness and efficiency of the upgrade.
Patent Information
- Application Number
- CN202111230270.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2041-10-20
AI Technical Summary
When multi-module integrated gateway devices are upgraded at the same time, the problem of upgrading failure is caused by the lack of effective mechanisms.
The gateway system regularly checks version information, and upgrades the gateway system and module system separately or simultaneously according to the detected new version. By judging the emergency tasks and independent upgrade capabilities of the module system, different upgrade strategies are adopted to ensure the smooth upgrade of each system.
It improves the robustness of multi-system gateway equipment upgrades, avoids the upgrade failure caused by traditional single method, and improves the upgrade efficiency.
Smart Images

Figure CN114138296B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of gateway upgrades, and in particular to a multi-system gateway upgrade method, device, and storage medium. Background Art
[0002] OTA (Over-the-air) technology is often integrated into many modules. Using this technology, modules can proactively obtain firmware upgrades from a server and independently upgrade. However, multi-module integrated gateway devices encounter a challenge: when the gateway system and the systems built into multiple modules are upgraded simultaneously, the upgrade often fails due to the lack of an effective mechanism.
[0003] However, the existing technology does not take into account that the built-in systems in multiple modules include both module systems that rely on the gateway system for upgrades and module systems that do not rely on the gateway system and can be upgraded independently. In addition, the gateway system itself also needs to be upgraded. Therefore, upgrading all three or two of them at the same time is a very complicated process and cannot be simply upgraded using traditional methods, which often leads to upgrade failures. Summary of the Invention
[0004] To address the deficiencies in the prior art, the present application proposes a multi-system gateway upgrade method, device, and storage medium.
[0005] In a first aspect, the present application proposes a multi-system gateway upgrade method, comprising the following steps:
[0006] Step S1: The gateway system regularly queries the server for gateway system and module system version information;
[0007] Step S2: If only a new version of the gateway system is detected, the gateway system is upgraded to the new version, completing the multi-system gateway upgrade and going to step S1;
[0008] Step S3: If only a new version of the module system is detected, the module system that needs to be upgraded is upgraded, and after the module system upgrade is completed, the process goes to step S8;
[0009] Step S4: If new versions of the gateway system and the module system are detected at the same time, the gateway system sends a version update notification to the corresponding module system. The module system checks the urgency of its own running task and sends an update notification reply message to the gateway system;
[0010] Step S5: Based on the update notification reply message, the gateway system determines whether the corresponding module system needs the gateway system as an intermediary for upgrading;
[0011] Step S6: If the corresponding module system requires the gateway system as an intermediary for upgrading, the corresponding module system is upgraded first, and then the gateway system is upgraded, and then the process goes to step S8;
[0012] Step S7: If the corresponding module system does not require the gateway system as an intermediary for upgrading, the corresponding module system is upgraded immediately and the gateway system is upgraded at the same time;
[0013] Step S8: After the module system upgrade is completed, an upgrade completion notification is sent to the gateway system. The gateway system saves the upgrade information. For module systems that have not completed the upgrade, repeated attempts will be made until the set number of times threshold is reached. If the upgrade fails after reaching the number of times threshold, the error result and reason will be marked and saved.
[0014] Step S9: After the gateway system confirms that the status of all systems to be upgraded is upgraded or not upgraded, it goes to step S1.
[0015] Furthermore, the gateway system periodically queries the server for gateway system and module system version information, including the following steps:
[0016] Step S1.1: The gateway system periodically queries the server for gateway system and module system version information, and records the information in the flash memory.
[0017] Step S1.2: The gateway system background upgrade program parses the version information;
[0018] Step S1.3: If it is confirmed that a version that needs to be upgraded is detected, the gateway system is disabled from periodically querying the server for gateway system and module system version information, and a version update notification is sent to the module system that needs to be upgraded.
[0019] In step S4, the module system checks the urgency of its own running task and sends an update notification reply message to the gateway system, including the following steps:
[0020] Step S4.1: Checking whether the module system is running an emergency task;
[0021] Step S4.2: If the module system has an urgent task, the upgrade information in the update notification reply message is set to no, and the check result information is set to try later or an accurate time point;
[0022] Step S4.3: The gateway system monitors and parses the update notification reply message;
[0023] Step S4.4: If the upgrade information in the update notification reply message is "No" and the check result information is "Try Later", the gateway system will start a timer, then notify the module system to upgrade again, and record its status as "Try Later" in the flash memory;
[0024] Step S4.5: If there is no urgent task, set the upgrade information in the update notification reply message to yes;
[0025] Step S4.6: The module system checks whether it has the function of independently obtaining the new version of firmware from the server;
[0026] Step S4.7: If there is no function to independently obtain the new version of firmware from the server, the message of the upgrade method is that the gateway system needs to be used as an intermediary for the upgrade;
[0027] Step S4.8: If there is a function of independently obtaining a new version of firmware from a server, the message of the upgrade mode is that the corresponding module system directly obtains the upgrade information from the server.
[0028] The corresponding module system in step S6 is upgraded first, including the following steps:
[0029] Step S6.1.1: The gateway system downloads the module firmware file from the server;
[0030] Step S6.1.2: After the file is downloaded and verified, the gateway system sends a file ready message to the module system;
[0031] Step S6.1.3: After receiving the Ready message, the module system returns an identification message of waiting for file download to the gateway system;
[0032] Step S6.1.4: After receiving the file, the module system sends an upgrade identification message to the gateway system and performs the upgrade;
[0033] Step S6.1.5: After receiving the message with the upgrade identification, the gateway system records the status of the corresponding module system as being upgraded in the flash memory.
[0034] Furthermore, the gateway system is upgraded, including the following steps:
[0035] Step S6.2.1: Detect the system upgrade status of the non-independent upgrade module;
[0036] Step S6.2.2: If the status of the dependent upgrade module is not yet upgraded, wait for it to enter the upgrade state;
[0037] Step S6.2.3: If the system status of the non-independently upgraded module is "Upgrading" or "Upgrade Completed", check whether there are other independently upgraded modules with the system status of "Notify Later";
[0038] Step S6.2.4: If the system status of the independently upgraded module is "notified later", the timer is deleted and the timer is restarted after the gateway system upgrade is completed;
[0039] Step S6.2.5: If the system status of none of the independently upgraded modules is to be notified later, the gateway system is upgraded immediately.
[0040] Furthermore, the corresponding module system in step S7 is immediately upgraded, including the following steps:
[0041] Step S7.1: The gateway system sends the module system a download address for the new module firmware and records the status of the corresponding module system as being upgraded in the flash memory;
[0042] Step S7.2: The module system directly requests firmware from the server;
[0043] Step S7.3: Module system verification and upgrade.
[0044] Furthermore, the step S8 includes the following steps:
[0045] Step S8.1: The gateway system queries the module system for the upgrade result;
[0046] Step S8.2: The module system returns the query result to the gateway system;
[0047] Step S8.3: If the module system is successfully upgraded, the upgrade result is immediately recorded in the flash memory; if the module system is not successfully upgraded within the specified time, the upgrade failure result and reason are recorded in the flash memory.
[0048] In a second aspect, a multi-system gateway device is provided, the gateway device comprising one or more modules, the gateway device having a built-in gateway system, the modules having a built-in module system, and the gateway device being upgraded using the multi-system gateway upgrade method;
[0049] Data communication can be performed between the gateway system and the module system;
[0050] The module system is a non-independently upgraded module system or an independently upgraded module system or a combination of the two;
[0051] The gateway system is used to regularly query the server for version information of the gateway system and the module system. If only a new version of the gateway system is detected, the gateway system is upgraded to the new version; if only a new version of the module system is detected, the module system that needs to be upgraded is upgraded; if new versions of both the gateway system and the module system are detected, a version update notification is sent to the corresponding module system;
[0052] The dependent upgrade module system is defined as a module system that requires the gateway system as an intermediary for upgrading. It is used to receive version update notifications sent by the gateway system and return update notification reply information. If both the dependent upgrade module system and the gateway system need to be upgraded, the dependent upgrade module system will be upgraded first, and then the gateway system will be upgraded.
[0053] The independently upgradeable module system is defined as a module system that does not require a gateway system as an intermediary for upgrading and can be upgraded independently. It is used to receive version update notifications sent by the gateway system and return update notification reply information. If both the independently upgradeable module system and the gateway system need to be upgraded, the independently upgradeable module system will be upgraded immediately and the gateway system will be upgraded at the same time.
[0054] The module system also includes the following functions: after the upgrade is completed, sending an upgrade completion notification to the gateway system;
[0055] The gateway system also includes the following functions: the gateway system saves upgrade information, and for module systems that have not completed the upgrade, it will try repeatedly until the set number threshold is reached. If the upgrade fails after reaching the number threshold, the error result and reason will be marked and saved.
[0056] In a third aspect, the present application proposes a computer-readable storage medium storing a computer program for implementing the multi-system gateway upgrade method.
[0057] Beneficial effects achieved by this application:
[0058] The inventive method of the present application utilizes a multi-channel download function to solve the upgrade failure problem that may occur due to the single download method in the prior art and the download of a large complete firmware by the update system, thereby improving the upgrade efficiency of multi-system gateway devices and increasing the robustness of the gateway upgrade function. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 This is a flow chart of the multi-system gateway upgrade method according to an embodiment of the present application;
[0060] Figure 2 This is a flow chart of the gateway system of an embodiment of the present application periodically querying the server for version information;
[0061] Figure 3 This is a flowchart of the module system checking running tasks and replying messages in an embodiment of the present application;
[0062] Figure 4 This is a flowchart of upgrading the dependent module system when the gateway system and the dependent module system need to be upgraded at the same time according to an embodiment of the present application;
[0063] Figure 5 This is a flowchart of a gateway system upgrade when the gateway system and the dependent module system of the embodiment of the present application need to be upgraded at the same time;
[0064] Figure 6 This is a flowchart of the independent upgrade module system upgrade of an embodiment of the present application;
[0065] Figure 7 The subsequent flow chart for the module system upgrade of the embodiment of the present application is completed;
[0066] Figure 8 This is a flowchart of the independent upgrade module system upgrade of Example 1 of the present application;
[0067] Figure 9 This is a flowchart of the module system upgrade for the non-independent upgrade of Example 2 of the present application;
[0068] Figure 10 This is a flowchart of the gateway system upgrade in Example 3 of this application;
[0069] Figure 11 This is a functional block diagram of a multi-system gateway device according to an embodiment of the present application. DETAILED DESCRIPTION
[0070] The present application will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and are not intended to limit the scope of protection of the present application.
[0071] In the first aspect, a multi-system gateway upgrade method, such as Figure 1 As shown, the following steps are included:
[0072] Step S1: The gateway system regularly queries the server for gateway system and module system version information;
[0073] Step S2: If only a new version of the gateway system is detected, the gateway system is upgraded to the new version, completing the multi-system gateway upgrade and going to step S1;
[0074] Step S3: If only a new version of the module system is detected, the module system that needs to be upgraded is upgraded, and after the upgrade of the module system is completed, the process goes to step S8; if the module system requires the gateway system as an intermediary for upgrading, the process is the same as steps S6.1.1 to S6.1.5; if the module system does not require the gateway system as an intermediary for upgrading, the process is the same as steps S7.1 to S7.3;
[0075] Step S4: If new versions of the gateway system and the module system are detected at the same time, the gateway system sends a version update notification to the corresponding module system. The module system checks the urgency of its own running task and sends an update notification reply message to the gateway system;
[0076] The update notification reply message includes information on whether the upgrade is allowed and information on the check result. If no update is required, the update notification reply message indicates "no," and the corresponding module system is not upgraded, the gateway system upgrades autonomously, and the process proceeds to step S9. If an upgrade is required, the update notification reply message indicates "yes," and the update notification reply message includes an upgrade method message, and the corresponding module system enters the upgrade state.
[0077] Step S5: Based on the update notification reply message, the gateway system determines whether the corresponding module system needs the gateway system as an intermediary for upgrading;
[0078] Step S6: If the corresponding module system requires the gateway system as an intermediary for upgrading, the corresponding module system is upgraded first, and then the gateway system is upgraded, and then the process goes to step S8;
[0079] Step S7: If the corresponding module system does not require the gateway system as an intermediary for upgrading, the corresponding module system is upgraded immediately and the gateway system is upgraded at the same time;
[0080] Step S8: After the module system upgrade is completed, an upgrade completion notification is sent to the gateway system. The gateway system saves the upgrade information. For module systems that have not completed the upgrade, repeated attempts will be made until the set number of times threshold is reached. If the upgrade fails after reaching the number of times threshold, the error result and reason will be marked and saved.
[0081] Step S9: After the gateway system confirms that the status of all systems to be upgraded is upgraded or not upgraded, it goes to step S1.
[0082] Furthermore, the gateway system periodically queries the server for gateway system and module system version information, such as Figure 2 As shown, the following steps are included:
[0083] Step S1.1: The gateway system periodically queries the server for gateway system and module system version information, and records the information in the flash memory.
[0084] The version information includes the latest version number of the gateway system and module system, whether to force an upgrade, the file download address, and the file MD5 value.
[0085] Step S1.2: The gateway system background upgrade program parses the version information. If the latest version number of the gateway system and module system is greater than the version number of the corresponding system recorded in the flash memory, or there is a forced upgrade mark in the version information, it is considered that a version that needs to be upgraded is detected.
[0086] Step S1.3: If it is confirmed that a version that needs to be upgraded is detected, the gateway system is disabled from periodically querying the server for gateway system and module system version information, and a version update notification is sent to the module system that needs to be upgraded.
[0087] In step S4, the module system checks the urgency of its own running task and sends an update notification reply message to the gateway system, such as Figure 3 As shown, the following steps are included:
[0088] Step S4.1: Checking whether the module system is running an emergency task;
[0089] Step S4.2: If the module system has an urgent task, the upgrade information in the update notification reply message is set to no, and the check result information is set to try later or an accurate time point;
[0090] Step S4.3: The gateway system monitors and parses the update notification reply message;
[0091] Step S4.4: If the upgrade information in the update notification reply message is "No" and the check result information is "Try Later", the gateway system will start a timer, then notify the module system to upgrade again, and record its status as "Try Later" in the flash memory;
[0092] The specific time threshold for the later attempt can be set manually, for example, setting an attempt after 5 minutes.
[0093] Step S4.5: If there is no urgent task, set the upgrade information in the update notification reply message to yes;
[0094] Step S4.6: The module system checks whether it has the function of independently obtaining the new version of firmware from the server;
[0095] Step S4.7: If there is no function to independently obtain the new version of firmware from the server, the upgrade method message is that the gateway system is required to be upgraded as an intermediary; the module system that uses the gateway system as an intermediary for upgrading is defined as a non-independent upgrade module system, and the module system that directly obtains upgrade information from the server is defined as an independent upgrade module system;
[0096] Step S4.8: If there is a function of independently obtaining a new version of firmware from a server, the message of the upgrade mode is that the corresponding module system directly obtains the upgrade information from the server.
[0097] In step S6, if the corresponding module system needs the gateway system as an intermediary for upgrading, the corresponding module system is upgraded first, and then the gateway system is upgraded;
[0098] The corresponding module system is upgraded first, such as Figure 4 As shown, the steps include:
[0099] Step S6.1.1: The gateway system downloads the module firmware file from the server;
[0100] Step S6.1.2: After the file is downloaded and verified, the gateway system sends a file ready message to the module system;
[0101] Step S6.1.3: After receiving the Ready message, the module system returns an identification message of waiting for file download to the gateway system;
[0102] Step S6.1.4: After receiving the file, the module system sends an upgrade identification message to the gateway system and performs the upgrade;
[0103] Step S6.1.5: After receiving the message with the upgrade identification, the gateway system records the status of the corresponding module system as being upgraded in the flash memory.
[0104] Furthermore, the gateway system is upgraded, such as Figure 5 As shown, the steps include:
[0105] Step S6.2.1: Detect the system upgrade status of the non-independent upgrade module;
[0106] Step S6.2.2: If the status of the dependent upgrade module is not yet upgraded, wait for it to enter the upgrade state;
[0107] Step S6.2.3: If the system status of the non-independently upgraded module is "Upgrading" or "Upgrade Completed", check whether there are other independently upgraded modules with the system status of "Notify Later";
[0108] Step S6.2.4: If the system status of the independently upgraded module is "notified later", the timer is deleted and the timer is restarted after the gateway system upgrade is completed;
[0109] Step S6.2.5: If the system status of none of the independently upgraded modules is to be notified later, the gateway system is upgraded immediately.
[0110] Furthermore, in step S7, if the corresponding module system does not require the gateway system as an intermediary for upgrading, the corresponding module system is upgraded immediately and the gateway system is upgraded at the same time;
[0111] The corresponding module system is upgraded immediately, such as Figure 6 As shown, the steps include:
[0112] Step S7.1: The gateway system sends the module system a download address for the new module firmware and records the status of the corresponding module system as being upgraded in the flash memory;
[0113] Step S7.2: The module system directly requests firmware from the server;
[0114] Step S7.3: Module system verification and upgrade.
[0115] Furthermore, the step S8 is as follows: Figure 7 As shown, the following steps are included:
[0116] Step S8.1: The gateway system queries the module system for the upgrade result;
[0117] Step S8.2: The module system returns the query result to the gateway system;
[0118] Step S8.3: The gateway system records the upgrade result.
[0119] If the module system is successfully upgraded, the gateway system will immediately record the upgrade result in the flash memory; if the module system is not successfully upgraded within the specified time, the failure result and reason will be recorded in the flash memory.
[0120] After the gateway system confirms that all systems to be upgraded are in upgraded or unupgraded states, it will restart the program to request software version information from the server. The systems to be upgraded include the gateway system, module systems that are not independently upgraded, and module systems that are independently upgraded.
[0121] The following three examples will be listed to illustrate the specific processes of upgrading the module system independently, the module system dependently, and the gateway system in the application;
[0122] Example 1:
[0123] like Figure 8As shown, the gateway system detects that the independently upgraded module system has a new version that needs to be upgraded. The upgrade process of the independently upgraded module system is as follows:
[0124] Step 100: The gateway system periodically queries the server for gateway system and module system version information;
[0125] Step 101: Receive the latest version information from the server;
[0126] Step 102: The gateway checks whether the module system is updated;
[0127] That is, the gateway system background upgrade program parses the version information. If the latest version number of the gateway system and module system is greater than the version number of the corresponding system recorded in the flash memory, or there is a forced upgrade mark in the version information, it is considered that a version that needs to be upgraded has been detected.
[0128] Step 103: If an update is found to be required, the module system is notified;
[0129] Specifically: if it is confirmed that a version that needs to be upgraded is detected, the gateway system will be closed to regularly query the server for gateway system and module system version information, and a version update notification will be sent to the module system that needs to be upgraded.
[0130] Step 104: The module system queries the current task to confirm whether there is an urgent task;
[0131] Step 105: If an urgent task is found, update the notification reply message;
[0132] The update notification reply message is set to "No" for the upgrade information, and the check result information is set to "Try later" or an exact time point
[0133] Step 106: The gateway re-executes step 103 later;
[0134] Step 107: If no urgent tasks are found, update the notification reply message;
[0135] Specifically: set the upgrade information in the update notification reply message to yes.
[0136] Step 108: The gateway system sends the server firmware address to the module system and sets the system status to being upgraded;
[0137] Step 109: The module system requests the server to upgrade the firmware;
[0138] Step 110: Module system upgrade;
[0139] Step 111: Gateway system queries upgrade results
[0140] Step 112: The gateway system receives the returned result.
[0141] Example 2:
[0142] like Figure 9 As shown, the gateway system detects that the module system that is not independently upgraded has a new version that needs to be upgraded. That is, the module system needs to rely on the gateway to upgrade. The upgrade process of the module system that is not independently upgraded is as follows:
[0143] Step 200: The gateway system periodically queries the server for gateway system and module system version information;
[0144] Step 201: Receive the latest version information from the server;
[0145] Step 202: The gateway checks whether the module system is updated;
[0146] That is, the gateway system background upgrade program parses the version information. If the latest version number of the gateway system and module system is greater than the version number of the corresponding system recorded in the flash memory, or there is a forced upgrade mark in the version information, it is considered that a version that needs to be upgraded has been detected.
[0147] Step 203: If an update is found to be required, the module system is notified;
[0148] Specifically: if it is confirmed that a version that needs to be upgraded is detected, the gateway system will be closed to regularly query the server for gateway system and module system version information, and a version update notification will be sent to the module system that needs to be upgraded.
[0149] Step 204: The module system queries the current task to confirm whether there is an urgent task;
[0150] Step 205: The gateway re-executes step 203 later;
[0151] Step 206: The gateway system sends the server firmware address to the module system and sets the system status to being upgraded;
[0152] Step 207: The gateway system requests the server to upgrade the firmware;
[0153] Step 208: The gateway system sends the firmware and receives a confirmation message;
[0154] At this time, the gateway system downloads the firmware required by the module system, and then sends the downloaded firmware to the module system. This module system is a non-independent upgrade module system.
[0155] Step 209: The gateway system completes sending and sets the module status to upgrading;
[0156] Step 210: Module system upgrade
[0157] Step 211: Gateway system queries upgrade results
[0158] Step 212: The gateway system receives the returned result.
[0159] Example 3:
[0160] like Figure 10 As shown, the gateway system detects that it needs to be upgraded. The specific process is as follows:
[0161] Step 300: The gateway system parses the upgrade file to confirm that it needs to be upgraded;
[0162] Step 301: Notify the module system to upgrade, perform related operations, and wait for the results;
[0163] At this time, if there are module systems that need to be upgraded but are not independently upgraded, wait until the upgrade of the module systems is completed before upgrading the gateway system.
[0164] If there is an independently upgraded module system that needs to be upgraded, the gateway can also be upgraded at the same time as the independent module is upgraded. The two do not conflict.
[0165] Step 302: Check whether there are any independent upgrade module systems to be upgraded that will be notified later;
[0166] Step 303: If yes, stop the relevant timer and record it, then the gateway will be upgraded immediately;
[0167] Step 304: After the gateway upgrade is completed, query the record and notify the independent upgrade module system that needs to be upgraded.
[0168] If there is an independently upgraded module system that needs to be notified later, that is, the independently upgraded module system now has an urgent task to do. Although it needs to be upgraded, the urgent task is run first. Then, when the gateway system detects the information with later notification, it needs to delete the timer for later notification. After the gateway is upgraded, the timer is restarted to upgrade the independent module.
[0169] In a second aspect, a multi-system gateway device, such as Figure 11 As shown, the gateway device has one or more modules, the gateway device has a built-in gateway system, the modules have a built-in module system, and the gateway device is upgraded using the upgrade method of the multi-system gateway;
[0170] Data communication can be performed between the gateway system and the module system;
[0171] The module system is a non-independently upgraded module system or an independently upgraded module system or a combination of the two;
[0172] The gateway system is used to regularly query the server for version information of the gateway system and the module system. If only a new version of the gateway system is detected, the gateway system is upgraded to the new version; if only a new version of the module system is detected, the module system that needs to be upgraded is upgraded; if new versions of both the gateway system and the module system are detected, a version update notification is sent to the corresponding module system;
[0173] The dependent upgrade module system is defined as a module system that requires the gateway system as an intermediary for upgrading. It is used to receive version update notifications sent by the gateway system and return update notification reply information. If both the dependent upgrade module system and the gateway system need to be upgraded, the dependent upgrade module system will be upgraded first, and then the gateway system will be upgraded.
[0174] The independently upgradeable module system is defined as a module system that does not require a gateway system as an intermediary for upgrading and can be upgraded independently. It is used to receive version update notifications sent by the gateway system and return update notification reply information. If both the independently upgradeable module system and the gateway system need to be upgraded, the independently upgradeable module system will be upgraded immediately and the gateway system will be upgraded at the same time.
[0175] The module system also includes the following functions: after the upgrade is completed, sending an upgrade completion notification to the gateway system;
[0176] The gateway system also includes the following functions: the gateway system saves upgrade information, and for module systems that have not completed the upgrade, it will try repeatedly until the set number threshold is reached. If the upgrade fails after reaching the number threshold, the error result and reason will be marked and saved.
[0177] In a third aspect, the present application proposes a computer-readable storage medium storing a computer program for implementing the multi-system gateway upgrade method.
[0178] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation plans of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, and is not a limitation on the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.
Claims
1. A multi-system gateway upgrade method, characterized in that: The steps include: Step S1: The gateway system periodically queries the server for gateway system and module system version information; Step S2: If only a new version of the gateway system is detected, the gateway system is upgraded to the new version, completing the multi-system gateway upgrade and going to step S1; Step S3: If only a new version of the module system is detected, the module system that needs to be upgraded is upgraded, and after the module system upgrade is completed, the process goes to step S8; Step S4: If new versions of the gateway system and the module system are detected at the same time, the gateway system sends a version update notification to the corresponding module system. The module system checks the urgency of its own running task and sends an update notification reply message to the gateway system; Step S5: Based on the update notification reply message, the gateway system determines whether the corresponding module system needs the gateway system as an intermediary for upgrading; Step S6: If the corresponding module system requires the gateway system as an intermediary for upgrading, the corresponding module system is upgraded first, and then the gateway system is upgraded, and then the process goes to step S8; Step S7: If the corresponding module system does not require the gateway system as an intermediary for upgrading, the corresponding module system is upgraded immediately and the gateway system is upgraded at the same time; Step S8: After the module system upgrade is completed, an upgrade completion notification is sent to the gateway system. The gateway system saves the upgrade information. For module systems that have not completed the upgrade, repeated attempts will be made until the set number of times threshold is reached. If the upgrade fails after reaching the number of times threshold, the error result and reason will be marked and saved. Step S9: After the gateway system confirms that the status of all systems to be upgraded is upgraded or not upgraded, it goes to step S1.
2. The multi-system gateway upgrade method according to claim 1, characterized in that: The gateway system periodically queries the server for gateway system and module system version information, including the following steps: Step S1.1: The gateway system periodically queries the server for gateway system and module system version information and records the information in the flash memory; Step S1.2: The gateway system background upgrade program parses the version information; Step S1.3: If it is confirmed that a version that needs to be upgraded is detected, the gateway system is disabled from periodically querying the server for gateway system and module system version information, and a version update notification is sent to the module system that needs to be upgraded.
3. The multi-system gateway upgrade method according to claim 1, characterized in that: The update notification reply message includes information on whether the upgrade is allowed and the check result information; if no update is required, the update notification reply message indicates no, and the corresponding module system is not upgraded, and the gateway system is upgraded autonomously, and the process goes to step S9; If an update is required, it is marked as yes in the update notification reply message, and the update notification reply message includes an upgrade method message, and the corresponding module system enters the upgrade state; The module system checks the urgency of its own running task and sends an update notification reply message to the gateway system, including the following steps: Step S4.1: Checking whether the module system is running an emergency task; Step S4.2: If the module system has an urgent task, the upgrade information in the update notification reply message is set to no, and the check result information is set to try later or an accurate time point; Step S4.3: The gateway system monitors and parses the update notification reply message; Step S4.4: If the upgrade information in the update notification reply message is "No" and the check result information is "Try Later", the gateway system will start a timer, then notify the module system to upgrade again, and record its status as "Try Later" in the flash memory; Step S4.5: If there is no urgent task, set the upgrade information in the update notification reply message to yes; Step S4.6: The module system checks whether it has the function of independently obtaining the new version of firmware from the server; Step S4.7: If there is no function to independently obtain the new version of firmware from the server, the message of the upgrade method is that the gateway system needs to be used as an intermediary for the upgrade; Step S4.8: If there is a function of independently obtaining a new version of firmware from a server, the message of the upgrade mode is that the corresponding module system directly obtains the upgrade information from the server.
4. The multi-system gateway upgrade method according to claim 1, characterized in that: The corresponding module system in step S6 is upgraded first, including the following steps: Step S6.1.1: The gateway system downloads the module firmware file from the server; Step S6.1.2: After the file is downloaded and verified, the gateway system sends a file ready message to the module system; Step S6.1.3: After receiving the Ready message, the module system returns an identification message of waiting for file download to the gateway system; Step S6.1.4: After receiving the file, the module system sends an upgrade identification message to the gateway system and performs the upgrade; Step S6.1.5: After receiving the message with the upgrade identification, the gateway system records the status of the corresponding module system as being upgraded in the flash memory.
5. The multi-system gateway upgrade method according to claim 1, characterized in that: The gateway system in step S6 is then upgraded, including the following steps: Step S6.2.1: Detect the system upgrade status of the non-independent upgrade module; Step S6.2.2: If the status of the dependent upgrade module is not yet upgraded, wait for it to enter the upgrade state; Step S6.2.3: If the system status of the non-independently upgraded module is "Upgrading" or "Upgrade Completed", check whether there are other independently upgraded modules with the system status of "Notify Later"; Step S6.2.4: If the system status of the independently upgraded module is "notified later", the timer is deleted and the timer is restarted after the gateway system upgrade is completed; Step S6.2.5: If the system status of none of the independently upgraded modules is to be notified later, the gateway system is upgraded immediately.
6. The multi-system gateway upgrade method according to claim 1, characterized in that: The corresponding module system in step S7 is immediately upgraded, including the following steps: Step S7.1: The gateway system sends the module system a download address for the new module firmware and records the status of the corresponding module system as being upgraded in the flash memory; Step S7.2: The module system directly requests firmware from the server; Step S7.3: Module system verification and upgrade.
7. The multi-system gateway upgrade method according to claim 1, characterized in that The step S8 comprises the following steps: Step S8.1: The gateway system queries the module system for the upgrade result; Step S8.2: The module system returns the query result to the gateway system; Step S8.3: If the module system is successfully upgraded, the upgrade result is immediately recorded in the flash memory; if the module system is not successfully upgraded within the specified time, the upgrade failure result and reason are recorded in the flash memory.
8. A multi-system gateway device, characterized in that: The gateway device has one or more modules, the gateway device has a built-in gateway system, the modules have a built-in module system, and the gateway device is upgraded using the upgrade method of any one of claims 1 to 7; Data communication can be performed between the gateway system and the module system; The module system is a non-independently upgraded module system or an independently upgraded module system or a combination of the two; The gateway system is used to regularly query the server for version information of the gateway system and the module system. If only a new version of the gateway system is detected, the gateway system is upgraded to the new version; if only a new version of the module system is detected, the module system that needs to be upgraded is upgraded; if new versions of both the gateway system and the module system are detected, a version update notification is sent to the corresponding module system; The dependent upgrade module system is defined as a module system that requires the gateway system as an intermediary for upgrading. It is used to receive version update notifications sent by the gateway system and return update notification reply information. If both the dependent upgrade module system and the gateway system need to be upgraded, the dependent upgrade module system will be upgraded first, and then the gateway system will be upgraded. The independently upgradeable module system is defined as a module system that does not require a gateway system as an intermediary for upgrading and can be upgraded independently. It is used to receive version update notifications sent by the gateway system and return update notification reply information. If both the independently upgradeable module system and the gateway system need to be upgraded, the independently upgradeable module system will be upgraded immediately and the gateway system will be upgraded at the same time.
9. The multi-system gateway device according to claim 8, characterized in that: The module system also includes the following functions: after the upgrade is completed, sending an upgrade completion notification to the gateway system; The gateway system also includes the following functions: the gateway system saves upgrade information, and for module systems that have not completed the upgrade, it will try repeatedly until the set number threshold is reached. If the upgrade fails after reaching the number threshold, the error result and reason will be marked and saved.
10. A computer-readable storage medium, characterized in that A computer program for implementing the upgrading method according to any one of claims 1 to 7 is stored thereon.
Citation Information
Patent Citations
Home gateway for realizing modular upgrade debugging development function and upgrade debugging processing method thereof
CN110166293A
Network management system and method
CN113037573A