TW202113587A - Program upgrade method and apparatus for internet of things device, and internet of things device - Google Patents

Program upgrade method and apparatus for internet of things device, and internet of things device Download PDF

Info

Publication number
TW202113587A
TW202113587A TW109118082A TW109118082A TW202113587A TW 202113587 A TW202113587 A TW 202113587A TW 109118082 A TW109118082 A TW 109118082A TW 109118082 A TW109118082 A TW 109118082A TW 202113587 A TW202113587 A TW 202113587A
Authority
TW
Taiwan
Prior art keywords
upgrade
program
internet
application
upgraded
Prior art date
Application number
TW109118082A
Other languages
Chinese (zh)
Inventor
李燕瓊
Original Assignee
香港商阿里巴巴集團服務有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Publication of TW202113587A publication Critical patent/TW202113587A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

Disclosed are a program upgrade method and apparatus for an Internet of Things device, and an Internet of Things device. The method comprises: during the operation of at least one application program, detecting an upgrade trigger message sent by a device management service end; in response to the upgrade trigger message, closing at least some application programs on the basis of the resource occupation of the at least one application program; downloading a program to be upgraded from an upgrade service end; operating the program to be upgraded to complete an upgrade task of an Internet of Things device; and re-operating the at least one application program. By means of the method, conflicts between operating application programs and upgrade tasks are reduced to improve upgrade efficiency and system stability.

Description

物聯網設備的程式升級方法、裝置及物聯網設備Program upgrade method and device for internet of things equipment and internet of things equipment

本發明涉及電腦技術領域,尤其涉及一種物聯網設備的程式升級方法、裝置以及物聯網設備。The present invention relates to the field of computer technology, in particular to a program upgrade method and device for Internet of Things equipment, and Internet of Things equipment.

物聯網是一個基於網際網路、無線網路、傳統電信網路等網路的資訊載體,透過各種物聯網設備可以實現智慧化感知、識別、資料採集和設備管理等智慧處理過程。物聯網設備可以包括資訊感測器、射頻識別技術、全球定位系統、紅外線感測器、雷射掃描器、車載設備、智慧音箱等,利用物聯網設備可以即時採集聲音、光、電、熱、影像、位置等各種需要的資訊,從而實現智慧化感知、識別和管理。物聯網設備需要應用程式、操作系統、韌體等程式的支撐才得以運行,而隨著時間的推移,物聯網設備中的程式存在解決漏洞、兼容性問題、增加互動方式或者提供更多功能支援等需求,需要將物聯網設備程式升級。 現有技術中,在對物聯網設備進行升級時,為了使設備正常運行,物聯網設備通常是在物聯網設備運行期間升級,此時,物聯網設備中的主應用程式處於正常運行狀態,升級任務也處於運行狀態,主應用程式與升級任務同時啓動,以在設備的正常運行時,完成設備程式的升級。 但是,多數物聯網設備的記憶體資源較小,例如,感測器的記憶體資源可能只有100K,如果仍然根據記憶體資源的使用狀態同時處理主程式運行以及升級任務,容易出現下載速度下降或者主程式運行不穩定的問題,目前並沒有一種有效方式可以解決該技術問題。The Internet of Things is an information carrier based on the Internet, wireless networks, and traditional telecommunications networks. Through various Internet of Things devices, intelligent processing such as intelligent perception, identification, data collection and equipment management can be realized. IoT devices can include information sensors, radio frequency identification technology, global positioning systems, infrared sensors, laser scanners, in-vehicle devices, smart speakers, etc. The use of IoT devices can instantly collect sound, light, electricity, heat, Various required information such as image and location can realize intelligent perception, recognition and management. Internet of Things devices need the support of applications, operating systems, firmware and other programs to run. As time goes by, programs in Internet of Things devices have solutions to vulnerabilities, compatibility issues, increase interaction methods, or provide more functional support And other requirements, it is necessary to upgrade the IoT device program. In the prior art, when upgrading the Internet of Things device, in order to make the device operate normally, the Internet of Things device is usually upgraded during the operation of the Internet of Things device. At this time, the main application in the Internet of Things device is in a normal running state, and the upgrade task Also in the running state, the main application and the upgrade task are started at the same time to complete the upgrade of the device program during the normal operation of the device. However, the memory resources of most IoT devices are relatively small. For example, the memory resources of a sensor may be only 100K. If the main program operation and upgrade tasks are still processed at the same time according to the usage status of the memory resources, the download speed is likely to decrease or There is currently no effective way to solve the problem of unstable operation of the main program.

有鑒於此,本發明實施例提供一種物聯網設備的程式升級方法、裝置以及物聯網設備設備,用以解決現有技術中物聯網設備同時處理主應用程式運行以及升級任務時出現的系統不穩定的技術問題。 第一方面,本案實施例提供一種物聯網設備的程式升級方法,包括: 在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息; 回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式; 從升級伺服端下載待升級程式; 運行所述待升級程式,完成所述物聯網設備的升級任務; 重新運行所述至少一個應用程式。 第二方面,本案實施例提供一種物聯網設備的程式升級方法,包括: 在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息; 判斷當前運行的應用程式的資源佔用是否滿足升級條件; 如果滿足,從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務; 如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。 第三方面,本案實施例提供一種物聯網設備的程式升級裝置,包括: 訊息檢測模組,用於在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息; 訊息回應模組,用於回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式; 程式下載模組,用於從升級伺服端下載待升級程式; 程式升級模組,用於運行所述待升級程式,完成所述物聯網設備的升級任務; 程式運行模組,用於重新運行所述至少一個應用程式。 第四方面,本案實施例提供一種物聯網設備的程式升級裝置,包括: 訊息檢測模組,用於在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息; 條件判斷模組,用於判斷當前運行的應用程式的資源佔用是否滿足升級條件; 第一處理模組,用於如果滿足,從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務; 第二處理模組,用於如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。 第五方面,本案實施例提供一種物聯網設備,包括:儲存組件與處理組件;所述儲存組件用於儲存一條或多條電腦指令;所述一條或多條電腦指令被所述處理組件調用; 所述處理組件用於: 在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息;回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式;從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務;重新運行所述至少一個應用程式。 第六方面,本案實施例提供一種物聯網設備,包括:儲存組件與處理組件;所述儲存組件用於儲存一條或多條電腦指令;所述一條或多條電腦指令被所述處理組件調用; 所述處理組件用於: 在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息;判斷當前運行的應用程式的資源佔用是否滿足升級條件;如果滿足,從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務;如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。 本發明實施例,針對資源較少的物聯網設備,可以在物聯網設備的至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息,之後,可以回應於所述升級觸發訊息,基於至少一個應用程式的資源佔用,關閉至少部分應用程式,從而可以使得物聯網設備的系統環境能夠滿足升級需求,進而可以從升級伺服端下載待升級程式。下載結束時,可以運行下載完畢的待升級程式,從而完成物聯網設備的升級任務。在升級完畢之後,可以重新運行至少一個應用程式,以使物聯網設備重新正常運行。透過關閉至少部分應用程式以使物聯網設備的系統能夠正常下載待升級程式並完成升級任務,從而可以解決升級任務與主應用程式同時運行時導致的系統不穩定的技術問題。In view of this, the embodiments of the present invention provide a program upgrade method and device for an Internet of Things device, and an Internet of Things device to solve the problem of system instability that occurs when the Internet of Things device in the prior art processes the running of the main application program and the upgrade task at the same time. technical problem. In the first aspect, an embodiment of the present case provides a program upgrade method for an Internet of Things device, including: During the operation of at least one application, detect the upgrade trigger message sent by the device management server; In response to the upgrade trigger message, close at least part of the application based on the resource occupation of the at least one application; Download the program to be upgraded from the upgrade server; Run the program to be upgraded to complete the upgrade task of the Internet of Things device; Re-run the at least one application program. In the second aspect, the embodiment of this case provides a program upgrade method for an Internet of Things device, including: During the operation of at least one application, detect the upgrade trigger message sent by the device management server; Determine whether the resource occupancy of the currently running application meets the upgrade conditions; If it is satisfied, download the program to be upgraded from the upgrade server; run the program to be upgraded to complete the upgrade task of the Internet of Things device; If it is not satisfied, return to the step of judging whether the resource occupation of the currently running application meets the upgrade condition and continue to execute. In the third aspect, an embodiment of the present case provides a program upgrade device for Internet of Things equipment, including: The message detection module is used to detect the upgrade trigger message sent by the device management server during the running process of at least one application; The message response module is used to respond to the upgrade trigger message and close at least part of the application based on the resource occupation of the at least one application; Program download module, used to download the program to be upgraded from the upgrade server; The program upgrade module is used to run the program to be upgraded and complete the upgrade task of the Internet of Things device; The program running module is used to re-run the at least one application program. In a fourth aspect, an embodiment of the present case provides a program upgrade device for Internet of Things equipment, including: The message detection module is used to detect the upgrade trigger message sent by the device management server during the running process of at least one application; The condition judgment module is used to judge whether the resource occupation of the currently running application meets the upgrade conditions; The first processing module is used to download the program to be upgraded from the upgrade server if it is satisfied; run the program to be upgraded to complete the upgrade task of the Internet of Things device; The second processing module is used to return to the step of judging whether the resource occupation of the currently running application meets the upgrade condition if it is not met and continue execution. In a fifth aspect, an embodiment of the present case provides an Internet of Things device, including: a storage component and a processing component; the storage component is used to store one or more computer instructions; the one or more computer instructions are called by the processing component; The processing component is used for: During the operation of at least one application, detecting an upgrade trigger message sent by the device management server; responding to the upgrade trigger message, closing at least part of the application based on the resource occupation of the at least one application; from the upgrade server Download the program to be upgraded; run the program to be upgraded to complete the upgrade task of the Internet of Things device; re-run the at least one application program. In a sixth aspect, an embodiment of the present case provides an Internet of Things device, including: a storage component and a processing component; the storage component is used to store one or more computer instructions; the one or more computer instructions are called by the processing component; The processing component is used for: During the running of at least one application, detect the upgrade trigger message sent by the device management server; determine whether the resource occupation of the currently running application meets the upgrade conditions; if so, download the program to be upgraded from the upgrade server; run the For the program to be upgraded, complete the upgrade task of the Internet of Things device; if it is not satisfied, return to the step of judging whether the resource occupation of the currently running application program meets the upgrade condition and continue execution. In the embodiment of the present invention, for IoT devices with less resources, the upgrade trigger message sent by the device management server can be detected during the running process of at least one application of the IoT device, and then the upgrade trigger message can be responded to Based on the resource occupation of at least one application, at least part of the application is closed, so that the system environment of the IoT device can meet the upgrade requirements, and the program to be upgraded can be downloaded from the upgrade server. At the end of the download, you can run the downloaded program to be upgraded to complete the upgrade task of the IoT device. After the upgrade is complete, you can re-run at least one application to make the IoT device run normally again. By closing at least part of the application, the system of the IoT device can normally download the program to be upgraded and complete the upgrade task, so as to solve the technical problem of system instability caused by the simultaneous operation of the upgrade task and the main application.

為使本發明實施例的目的、技術方案和優點更加清楚,下面將結合本發明實施例中的圖式,對本發明實施例中的技術方案進行清楚、完整地描述,顯然,所描述的實施例是本發明一部分實施例,而不是全部的實施例。基於本發明中的實施例,本領域普通技術人員在沒有作出創造性勞動前提下所獲得的所有其他實施例,都屬於本發明保護的範圍。 在本發明實施例中使用的術語是僅僅出於描述特定實施例的目的,而非旨在限制本發明。在本發明實施例和所附申請專利範圍中所使用的單數形式的“一種”、“所述”和“該”也旨在包括多數形式,除非上下文清楚地表示其他含義,“多種”一般包含至少兩種,但是不排除包含至少一種的情況。 應當理解,本文中使用的術語“和/或”僅僅是一種描述關聯對象的關聯關係,表示可以存在三種關係,例如,A和/或B,可以表示:單獨存在A,同時存在A和B,單獨存在B這三種情況。另外,本文中字符“/”,一般表示前後關聯對象是一種“或”的關係。 取決於語境,如在此所使用的詞語“如果”、“若”可以被解釋成為“在……時”或“當……時”或“回應於確定”或“回應於識別”。類似地,取決於語境,短語“如果確定”或“如果識別(陳述的條件或事件)”可以被解釋成為“當確定時”或“回應於確定”或“當識別(陳述的條件或事件)時”或“回應於識別(陳述的條件或事件)”。 還需要說明的是,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的商品或者系統不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種商品或者系統所固有的要素。在沒有更多限制的情況下,由語句“包括一個……”限定的要素,並不排除在包括所述要素的商品或者系統中還存在另外的相同要素。 本案實施例可以應用於物聯網設備中,透過對物聯網設備中系統資源的佔用情況進行分析,以提供能夠正常升級的條件,使得升級能夠及時完成,並及時恢復主應用程式的運行,從而避免出現下載升級導致的運行系統不穩定問題。 現有技術中,物聯網設備的硬體資源、記憶體資源可能是一定的,且不夠大。在物聯網設備至少一個應用程式運行的過程中,可以針對物聯網設備中的程式進行升級,例如,應用程式的普通升級、版本的升級或者韌體升級等等。在升級過程中,為了確保物聯網設備與升級父親端之間的網路連接的安全性以及可靠性,通常需要物聯網設備與升級伺服端透過安全的HTTPS(Hypertext transfer protocol Secure,超文件傳輸安全協定)下載待升級程式,也即是安裝包。但是,由於HTTPS的下載升級過程中,需要增加證書交換以及交換處理(hand shaking)驗證的過程,對系統記憶體資源的消耗更大。因此,資源受限的物聯網設備往往無法使用HTTPS進行下載升級。並且,在一些資源受限的物聯網設備中如果同時進行應用程式的運行以及升級任務的下載時,由於資源受限,還容易出現物聯網設備的操作系統不穩定的技術問題。為了解決上述技術問題,發明人提出了本案的技術方案。 本案實施例中,針對資源受限的物聯網設備,可以在至少一個應用程式運行的過程中,檢測設備管理伺服端發送的升級觸發訊息,回應於該升級觸發訊息,可以基於至少一個應用程式的資源佔用,關閉至少部分應用程式,以使得物聯網設備系統中的資源能夠執行升級任務。從升級伺服端下載待升級程式之後,可以運行該待升級程式,完成物聯網設備的升級任務,之後,可以重新運行至少一個應用程式。此時,物聯網設備完成升級任務,且在升級結束之後重新運行至少一個應用程式,以使物聯網設備的系統恢復到穩定狀態,從而可以解決升級任務與主應用程式同時運行時導致的系統不穩定的技術問題。 下面將結合圖式對本案實施例進行詳細描述。 如圖1所示,為本案實施例提供的一種物聯網設備的程式升級方法的一個實施例的流程圖,所述方法可以包括以下幾個步驟: 101:在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息。 本案實施例可以應用於物聯網設備中,所述物聯網設備可以指資源受限的電子設備,具體可以指記憶體資源小於設定的記憶體臨限值的電子設備。 物聯網設備在正常運行時,需要多個程式的支援,例如可以包括:引導程式(Bootloader)、OS(operating system、操作系統)、定時程式以及網路連接程式等,對於某些特定功能的物聯網設備,例如,影像感測器、聲音感測器等,還可以包括具有針對使用者提供某些特定功能的應用程式,例如,展示影像的應用程式、為使用者輸出聲音的應用程式等。 設備管理伺服端可以用於提供計算服務的設備,例如可以是個人電腦、超級電腦、筆記型電腦等設備構成,還可以是雲端伺服器構成,本案實施例對所述設備管理伺服端的具體類型不作出過多限定。 設備管理伺服端是指用於對物聯網設備進行管理的伺服端,通常可以對物聯網設備的服務請求進行回應,並進行處理,還可以對物聯網設備中的應用程式進行管理控制。在一些實施例中,當物聯網設備中的使用者應用程式進行版本更新或者升級時,設備管理伺服端可以由第三方伺服器構成,該第三方伺服器具體可以指開發該使用者應用程式的開發者為這個使用者應用程式設定的存取伺服器。 設備管理伺服端判斷物聯網設備存在升級需求時,可以發送升級觸發訊息至物聯網設備。所述升級觸發訊息中可以包括待升級程式的程式名稱以及下載位址等資訊,透過升級觸發訊息可以確定下載位址,從而從升級伺服端下載待升級程式。 所述至少一個應用程式可以指所述物聯網設備中的主應用(MAIN APP Task)模組,主應用模組是指針對使用者制定的具有特定應用目的的軟體模組,透過主應用模組主要為使用者可以在物聯網設備上使用的程式,不包括物聯網設備的操作系統、網路模組等。 102:回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式。 物聯網設備中的至少一個應用程式在運行過程中會消耗該物聯網設備的資源,其中,可以包括硬體資源或記憶體資源。由於物聯網設備的資源較小,如果至少一個應用程式的資源佔用較大,導致物聯網設備的剩餘資源較少,不能夠及時進行升級,或者升級程式與至少一個應用程式的運行存在資源爭奪現象。例如,假設物聯網設備的記憶體資源為100K,而至少一個應用程式佔用的資源為60K,剩餘資源為40K,但是若升級任務需要60K的記憶體資源,由於剩餘資源不夠,不能完成升級,若升級任務需要38K的記憶體資源,在至少一個應用程式以及升級任務同時進行升級時需要使用98K的記憶體資源,可以進行任務升級,但是由於記憶體資源消耗過多,容易出現資源使用衝突,資源爭搶等現象,導致物聯網設備出現不穩定現象。 在回應升級觸發訊息之後,可以開始啓動升級。此時可以基於至少一個應用程式的資源佔用,關閉至少部分應用程式,透過至少部分應用程式的關閉,可以使得物聯網設備中的部分資源被解除佔用,提高了可應用資源的供應量,物聯網設備即可以在關閉了至少部分應用程式的基礎上進行升級。 103:從升級伺服端下載待升級程式。 可選地,所述回應升級觸發訊息中可以包括待升級程式的下載位址,可以基於待升級程式的下載位址,從伺服端下載待升級程式。 可選地,所述回應升級觸發訊息中可以包括待升級程式的下載提示資訊,物聯網設備可以根據回應升級觸發訊息中的下載提示資訊,確定待升級程式的下載位址,從而基於下載位址,從升級伺服端下載待升級程式。 在一些實施例中,所述從升級伺服端下載待升級程式具體可以是:基於下載位址,向所述下載位址對應的升級伺服端發送下載請求,基於所述下載請求建立與所述升級伺服端的交換處理連接,連接完成,根據已建立的交換處理連接,與所述升級伺服端交換證書之後,可以從升級伺服端下載待升級程式。 104:運行所述待升級程式,完成所述物聯網設備的升級任務。 物聯網設備在下載待升級程式之後,可以啓動該待升級程式,以完成所述物聯網設備的升級任務。 105:重新運行所述至少一個應用程式。 所述重新運行所述至少一個應用程式可以包括重新啓動被關閉的至少部分應用程式,以重新運行至少一個應用程式。 本案實施例中,透過針對資源受限的物聯網設備,可以在至少一個應用程式運行的過程中,檢測設備管理伺服端發送的升級觸發訊息,回應於該升級觸發訊息,可以基於至少一個應用程式的資源佔用,關閉至少部分應用程式,以使得物聯網設備系統中的資源能夠執行升級任務。從升級伺服端下載待升級程式之後,可以運行該待升級程式,完成物聯網設備的升級任務,之後,可以重新運行至少一個應用程式。此時,物聯網設備完成升級任務,且在升級結束之後重新運行至少一個應用程式,以使物聯網設備的系統恢復到穩定狀態,從而可以解決升級任務與主應用程式同時運行時導致的系統不穩定的技術問題。 為了解決下載任務與至少一個應用程式同時運行產生的資源衝突問題,可以關閉所有應用程式,增加系統中的可利用資源,從而確保程式升級能夠正常完成。作為一個實施例,所述回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式可以包括: 回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉所有應用程式。 為了確保下載的安全性,所述從升級伺服端下載待升級程式可以包括: 基於超文件傳輸安全協定,從升級伺服端下載待升級程式。 所述超文件傳輸安全協定由於需要資源較多,在未關閉至少部分應用程式時,不可以使用或者受資源限制影響而使用效果不佳,本案中透過關閉至少部分應用程式可以使得超文件傳輸安全協定得以使用,以提高下載的安全性,從而提高升級任務的安全性。 如圖2所示,為本案實施例提供的一種物聯網設備的程式升級方法的又一個實施例的流程圖,所述方法可以包括以下幾個步驟: 201:在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息。 本案實施例中的部分步驟的處理過程與圖1所示的實施例中的部分內容相同,在此不再贅述。 202:回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉所有應用程式。 203:切換所述物聯網設備至下載模式,以從升級伺服端下載待升級程式。 作為一種可能的實現方式,可以透過執行模式指令,以切換物聯網設備至下載模式,從升級伺服端下載待升級程式。 切換物聯網設備至下載模式時,需要物聯網設備不處於升級模式。因此,所述切換所述物聯網設備至下載模式時,還可以包括:設定升級標誌位為第一標誌,重啓所述物聯網設備,檢測所述升級標誌位為第一標誌時,確定物聯網設備切換至下載模式,以從升級伺服端下載待升級程式。 204:檢測所述待升級程式下載完成時,切換所述物聯網設備至升級模式。 檢測所述待升級程式完成具體可以是檢測所述待升級程式接收到所述升級伺服端發送的結束指令,即可以確定所述待升級程式下載完成。 切換所述物聯網設備至升級模式具體可以包括:檢測所述待升級程式下載完成時,設定升級標誌位為第二標誌,重啓物聯網設備,並檢測所述升級標誌位為第二標誌時,確定物聯網設備切換至升級模式。 在檢測所述待升級程式下載完成時,切換所述物聯網設備至升級模式具體可以包括在檢測所述待升級程式下載完成時,清除所述下載模式,並切換所述物聯網設備至升級模式。 205:檢測所述物聯網設備處於升級模式時,運行所述待升級程式,完成所述物聯網設備的升級任務。 所述物聯網處理升級模式時,也即檢測到升級標誌位為第二標誌時,可以運行待升級程式,完成所述物聯網設備的升級任務。 升級標誌位可以指用於標識升級模式的變量,透過升級標誌位的設定可以判斷當前是否可以對物聯網設備的程式進行升級。例如,所述升級標誌位可以透過表示為整型變量flag(標誌),為flag設定的第一標誌具體可以指flag等於0;為flag設定的第二標誌具體可以指flag等於1。在升級標誌位為第一標誌時,未處於升級狀態,不執行物聯網設備的待升級程式。在升級標誌位為第二標誌時,執行對物聯網設備的升級程式,完成對物聯網設備的升級。 206:重新運行所述至少一個應用程式。 本案實施例中,透過設定下載模式,以使得物聯網設備可以明確當前運行環境,從而根據當前運行環境,下載待升級程式,下載成功之後可以切換所述物聯網設備至升級模式,檢測所述物聯網設備處於升級模式時,可以運行待升級程式,完成所述物聯網設備的升級任務。在這一過程中,透過模式的作用可以明確執行的內容,以提高升級效率。 作為一個實施例,所述切換所述物聯網設備至下載模式,以從升級伺服端下載待升級程式可以包括: 設定所述物聯網設備為下載模式並重啓所述物聯網設備,以切換所述物聯網設備至下載模式。 檢測升級標誌位為第一標誌時,從升級伺服端下載待升級程式。 物聯網設備中下載模式的開啓之後,可以透過重啓的方式,使物聯網設備由正常運行模式切換至下載模式,重啓之後,處於下載模式的物聯網設備即可以開始下載待升級程式。在下載模式下,升級標誌位為第一標誌時,可以從升級伺服端下載待升級程式。由於採用重啓的方式,物聯網設備中的應用程式關閉,將應用程式與下載過程進行了隔離,以確保下載效率。 由於物聯網設備的至少一個應用程式中按照啓動順序的先後順序排列,具體可以包括:啓動程式、操作系統、網路模組、使用者應用程式等。不同的應用程式具備不同的功能。而啓動程式是為了將至少一個應用程式與升級任務完全隔離以執行,可以啓動階段將升級任務與至少一個應用程式在物聯網設備進行隔離。 作為一種可能的實現方式,所述檢測升級標誌位為第一標誌時,從升級伺服端下載待升級程式可以包括: 在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,從升級伺服端下載待升級程式。 本案實施例中,在物聯網設備啓動引導程式之後,即可以開始進行待升級程式的下載,以使得物聯網設備能夠在引導程式啓動其他程式不啓動的情況下即可以開始進行待升級程式的下載,以實現升級任務與使用者應用、操作系統等程式的隔離,在升級結束之後,再啓動物聯網設備的至少一個應用程式即可,從而確保應用程式的正常運行,以避免出現因下載任務以及使用者應用同時執行產生資源爭奪而導致系統運行不穩定、升級任務不穩定的問題。 進一步,可選地,所述在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,從升級伺服端下載待升級程式可以包括: 在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,運行所述物聯網設備的操作系統單元。 檢測與所述升級伺服端的網路連接已完成時,檢測所述物聯網設備為下載模式時,從所述升級伺服端下載待升級程式。 在檢測升級標誌位為第一標誌時,可以啓動待升級服務的下載任務,此時即可以進入操作系統的啓動、網路連接成功時,即可以開始進行程式下載。 作為一種可能的實現方式,所述檢測所述待升級程式下載完成時,切換所述物聯網設備至升級模式可以包括: 檢測所述待升級程式下載完成時,清除所述下載模式並設定升級標誌位為第二標誌; 重啓所述物聯網設備; 檢測所述升級標誌位為第二標誌時,確認切換至升級模式。 在物聯網設備進入升級模式之後,可以運行所述待升級程式,完成所述物聯網設備的升級任務。 進一步,可選地,所述檢測所述升級標誌位為第二標誌時,確認切換至升級模式包括: 在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第二標誌時,確認切換至升級模式。 在某些實施例中,所述檢測所述物聯網設備處於升級模式時,運行所述待升級程式,完成所述物聯網設備的升級任務之後,所述方法還可以包括: 設定所述升級標誌位為第一標誌。 作為一個實施例,所述重新運行所述至少一個應用程式可以包括: 重啓所述物聯網設備,以重新運行所述至少一個應用程式。 在某些實施例中,所述重啓所述物聯網設備,以重新運行所述至少一個應用程式可以包括: 運行重啓指令,啓動引導程式; 檢測升級標誌位為第一標誌時,啓動操作系統並建立網路連接; 檢測未處於下載模式時,啓動所述至少一個應用程式。 本案中所述的重啓物聯網設備具體可以指運行重啓(Reboot)指令,以重啓所述物聯網設備。 如圖3所示,為本案實施例提供的一種物聯網設備的程式升級方法的又一個實施例的流程圖,所述方法可以包括以下幾個步驟: 301:在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息。 302:回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉所有應用程式。 303:設定所述物聯網設備為下載模式並重啓,以切換所述物聯網設備至下載模式; 304:在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,運行所述物聯網設備的操作系統單元。 305:檢測與所述升級伺服端的網路連接已完成時,檢測所述物聯網設備為下載模式時,啓動監控任務,從所述升級伺服端下載待升級程式並利用所述監控任務監控所述待升級程式的下載過程。 在從升級伺服端下載待升級程式時可以基於超文件傳輸安全協定,從升級伺服端下載待升級程式,以確保下載的安全性。 306:檢測所述待升級程式下載完成時,清除所述下載模式並設定升級標誌位為第二標誌; 307:重啓所述物聯網設備。 308:在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第二標誌時,確認切換至升級模式。 309:檢測所述物聯網設備處於升級模式時,運行所述待升級程式,完成所述物聯網設備的升級任務。 310:設定所述升級標誌位為第一標誌。 311:重啓所述物聯網設備,以重新運行所述至少一個應用程式。 所述重啓所述物聯網設備,以重啓運行所述至少一個應用程式可以包括: 重啓所述物聯網設備,啓動引導程式;檢測所述升級標誌位為第一標誌時,啓動操作系統並建立網路連接;檢測未處於下載模式時,啓動所述至少一個應用程式。 本案實施例中的部分步驟的處理過程與圖1~圖2中所示的實施例中的部分內容相同,在此不再贅述。 本案實施例中,物聯網設備的升級整體分為了三個階段,第一階段,在物聯網設備至少一個應用程式正常運行的過程中,可以檢測到設備管理伺服端發送的升級觸發訊息,此時物聯網設備可以回應於該升級觸發訊息,基於至少一個應用程式的資源佔用,關閉所有應用程式,進而可以將物聯網設備設定為下載模式,並重新啓動,此時,即可以切換物聯網設備至下載模式,進行待升級程式的下載。在物聯網設備重啓之後,引導程式先啓動,啓動結束時,物聯網設備即可以開始進入啓動階段,透過對升級標誌位的檢測可以在確定升級標誌位為第一標誌時,啓動物聯網設備的操作系統單元,並在操作系統啓動完畢時,建立物聯網設備與升級伺服端的連接,從而完成下載環境的搭建。在下載過程中,可以啓動監控任務,在從升級伺服端下載待升級程式時,利用監控任務監控待升級程式的下載過程,從而可以在檢測待升級程式下載完成時,清除下載模式,並設定升級標誌位為第二標誌。此時待升級程式經過模式切換、重啓設備、搭載下載環境之後完成待升級程式的下載工作。第二階段,在將升級標誌位設定為第二標誌之後,即完成待升級程式的下載工作,可以開始執行待升級程式的安裝工作,此時,可以重啓物聯網設備,並在所述物聯網設備的引導程式啓動之後,檢測升級標誌位。當檢測到升級標誌位為第二標誌時,說明此時物聯網設備已切換至升級模式,在升級模式下,即可以開始運行待升級程式,完成物聯網設備的升級任務,此時即完成待升級程式的安裝工作。第三階段,物聯網設備在安裝待升級程式之後,可以設定升級標誌位為第一標誌,將其切換為正常的工作模式,此時,重啓所述物聯網設備,即可以重新運行至少一個應用程式,完成整個物聯網設備的升級。在這一升級過程中,由於物聯網設備的下載過程以及安裝過程均未有應用程式參與運行,可以使得物聯網設備能夠單獨處理待升級程式的下載以及安裝,之後再正常運行至少一個應用程式,避免出現應用程式的運行與下載以及安裝過程出現資源衝突,提高了系統的穩定性。 為了便於理解,以所述物聯網設備為智慧音箱為例對本案實施例進行詳細說明。圖4中的智慧音箱M1可以與設備管理伺服端M2建立通信連接,還可以與升級伺服端M3建立通信連接。所述智慧音箱M1可以在正常工作過程中可以正常運行至少一個應用程式。設備管理伺服端M2可以發送401升級觸發訊息至智慧音箱M1。在至少一個應用程式的運行過程中,智慧音箱M1可以檢測402設備管理伺服端M2發送的升級觸發訊息。 智慧音箱M1可以回應於該升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉所有應用程式403。之後,智慧音箱可以設定所述物聯網設備為下載模式404,之後可以運行405重啓指令(Reboot)。重啓指令運行之後,引導程式(Bootloader)即開始啓動406。智慧音箱判斷407升級標誌位(Upgrade Flag)是第一標誌時,啓動408操作系統單元,建立409網路連接。網路連接成功(Network Ready)之後,檢測410處於下載模式時,啓動411監控任務(Monitor Task),從所述升級伺服端M3下載412待升級程式並利用所述監控任務監控所述待升級程式的下載過程。檢測所述待升級程式下載完成時,清除所述下載模式並設定升級標誌位為第二標誌413。 之後,智慧音箱M1可以運行重啓指令405,在執行引導程式啓動406後,檢測407所述升級標誌位為第二標誌時,確認切換至升級模式,從而在升級模式下,運行414所述待升級程式,完成所述物聯網設備的升級任務。升級成功之後,可以清除升級標誌位,也即將升級標誌位設定為第一標誌415。 之後,智慧音箱M1可以重啓所述物聯網設備405,執行406啓動引導程式;執行407檢測所述升級標誌位為第一標誌時,以及執行步驟408啓動操作系統並409建立網路連接;410檢測未處於下載模式時,啓動所述至少一個應用程式417。 如圖5所示,為本案實施例提供的一種物聯網設備的程式升級方法的又一個實施例的流程圖,所述方法可以包括以下幾個步驟: 501:在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息。 502:回應於所述升級觸發訊息,如果所述至少一個應用程式的資源佔用大於相對應的佔用臨限值,關閉至少部分應用程式。 作為一種可能的實現方式,所述佔用臨限值可以透過以下方式確定: 基於所述升級觸發訊息,確定所述升級觸發訊息運行時所需的目標資源; 利用所述目標資源以及所述物聯網設備的總資源,確定所述佔用臨限值。 可選地,所述利用所述目標資源以及所述物聯網設備的總資源,確定所述佔用臨限值可以包括:計算所述目標資源與所述物聯網設備的總資源的比值,獲得升級任務的佔用比例,計算整數1與升級任務的佔用比例的差,獲得所述佔用臨限值。所述回應於所述升級觸發訊息,如果所述至少一個應用程式的資源佔用大於相對應佔用臨限值,關閉至少部分應用程式包括:回應於所述升級觸發訊息,如果所述至少一個應用程式的資源佔用與物聯網設備的總資源的比例大於相對應的佔用臨限值,關閉至少部分應用程式。 在某些實施例中,所述回應於所述升級觸發訊息,如果所述至少一個應用程式的資源佔用大於相對應的佔用臨限值,關閉至少部分應用程式可以包括:回應於所述升級觸發訊息,如果所述至少一個應用程式的資源佔用大於相對應的佔用臨限值,基於所述佔用臨限值,重新確定所述至少一個應用程式的可佔用資源;關閉至少部分應用程式,以使得至少一個應用程式中的剩餘應用程式佔用的資源小於所述可佔用資源。 503:從升級伺服端下載待升級程式。 504:運行所述待升級程式,完成所述物聯網設備的升級任務。 505:重新運行所述至少一個應用程式。 本案實施例中的部分步驟的處理過程與圖1~圖3所示的實施例中的部分內容相同,在此不再贅述。 本案實施例中,在至少一個應用程式運行過程中,可以檢測設備管理伺服端發送的升級觸發訊息。之後,可以回應於所述升級觸發訊息,如果所述至少一個應用程式的資源佔用大於佔用臨限值,可以關閉至少部分應用程式。透過關閉至少部分應用程式可以將物聯網設備中的部分被佔用的資源解除佔用,從而可以使物聯網設備的資源可以完成待升級程式且不影響剩餘部分的應用程式的穩定運行。 如圖6所示,為本案實施例提供的一種物聯網設備的程式升級方法的又一個實施例的流程圖,所述方法可以包括以下幾個步驟: 601:在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息。 602:確定與所述升級觸發訊息對應升級任務的升級類型。 其中,所述升級類型包括全量升級或增量升級。 603:如果所述升級類型為全量升級,解除所述至少一個應用程式的資源佔用,以關閉所述至少一個應用程式。之後,執行步驟606。 604:如果所述升級類型為增量升級,確定與所述增量升級相匹配的目標資源。 605:根據所述至少一個應用程式的資源佔用以及所述目標資源,解除至少部分應用程式的資源佔用,以使所述物聯網設備中剩餘資源滿足所述目標資源的需求。之後,執行步驟606。 可選地,所述根據所述至少一個應用程式的資源佔用以及所述目標資源,解除至少部分應用程式的資源佔用,以使所述物聯網設備中剩餘資源滿足所述目標資源的需求可以包括:根據所述物聯網設備的總資源,以及所述目標資源,計算所述物聯網設備中應用程式的可佔用資源;解除所述至少一個應用程式中至少部分應用程式佔用的資源,以使所述至少一個應用程式中的剩餘存在的資源佔用小於所述可佔用資源。 在某些實施例中,可以對至少一個應用程式分別設定各自的運行級別,在關閉至少部分應用程式時,可以按照每個應用程式的運行級別,按照從低到高的順序關閉對應的應用程式,直至物聯網設備的剩餘資源滿足升級任務的資源需求。例如,第一應用程式的運行級別為一級,第二應用程式的運行級別為二級,一級應用程式的運行級別大於二級應用程式,可以按照二級應用程式運行級別低於一級應用程式運行級別的關閉規則,先關閉第二應用程式,如果物聯網設備中的剩餘資源滿足升級任務的資源需求不再關閉第一應用程式,即可以開始執行下載任務;如果物聯網設備中的剩餘資源不滿足升級任務的資源需求,需要關閉第一應用程式,直至物聯網設備中的剩餘資源滿足升級任務的資源需求。 606:從升級伺服端下載待升級程式。 607:運行所述待升級程式,完成所述物聯網設備的升級任務。 608:重新運行所述至少一個應用程式。 本案實施例中的部分步驟的處理過程與圖1~圖3所示的實施例中的部分內容相同,在此不再贅述。 本案實施例中,在物聯網設備的至少一個應用程式的運行過程中,可以檢測設備管理伺服器發送的升級觸發訊息,透過升級觸發訊息可以確定其對應升級任務的升級類型,所述升級類型可以包括全量升級以及增量升級。對於全量升級可能對物聯網設備的資源要求較高,因此,可以採用關閉所有應用程式的方式以執行升級任務,而對於增量升級而言,對物聯網設備的資源要求較低,因此,可以採用關閉部分升級資源的方式以執行升級任務。對於不同類型的升級任務採用不同的關閉方式,升級過程較為靈活可以減少關閉所有應用程式的次數,以保持物聯網設備的可運行狀態,使得其能夠維持較高的工作效率。 如圖7所示,為本案實施例提供的一種物聯網設備的程式升級方法的又一個實施例的流程圖,所述方法可以包括以下幾個步驟: 701:在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息; 702:判斷當前運行的應用程式的資源佔用是否滿足升級條件。 可選地,所述判斷當前運行的應用程式的資源佔用是否滿足升級條件可以包括判斷當前運行的應用程式的資源佔用是否小於對應的佔用臨限值。 其中,所述佔用臨限值為基於所述升級觸發訊息對應的升級任務所需的資源而確定。所述佔用臨限值具體可以透過:基於所述升級觸發訊息,確定所述升級觸發訊息運行時所需的目標資源;利用所述目標資源以及所述物聯網設備的總資源,確定所述佔用臨限值。 可選地,所述利用所述目標資源以及所述物聯網設備的總資源,確定所述佔用臨限值可以包括:計算所述目標資源與所述物聯網設備的總資源的比值,獲得升級任務的佔用比例,計算整數1與升級任務的佔用比例的差,獲得所述佔用臨限值。 703:如果滿足,從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務。 704:如果不滿足,返回步驟702。 本案實施例中的部分步驟的處理過程與圖1~圖3所示的實施例中的部分內容相同,在此不再贅述。 本案實施例中,在物聯網設備的至少一個應用程式的運行過程中,可以檢測設備管理伺服器發送的升級觸發訊息。之後,可以判斷當前運行的應用程式是否滿足升級條件,如果滿足,可以從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務,如果不滿足可以返回至判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行,直至當前運行的應用程式的資源佔用滿足升級條件。對當前運行的應用程式的資源佔用是否滿足升級條件的角度出發,對物聯網設備的資源環境進行了監控,從而在達到升級條件時,執行升級任務。避免了在物聯網設備資源環境較差時的升級而引發系統不穩定的現象,提高了升級的穩定性以及有效性。 為了提高監控的準確性以及有效性,可以按照一定的監控頻率對物聯網設備的資源佔用情況進行監控,作為一個實施例,所述判斷當前運行的應用程式的資源佔用是否滿足升級條件可以包括: 基於預設監控頻率,判斷當前運行的應用程式的資源佔用是否滿足升級條件。 可選地,所述基於預設監控頻率,判斷當前運行的應用程式的資源佔用是否滿足升級條件可以包括:基於預設監控頻率,確定每次監控對應的監控時間;在達到任一監控時間時,判斷當前運行的應用程式的資源佔用是否滿足升級條件。 在一些實施例中,在當前運行的應用程式的資源佔用不滿足升級條件時,可以關閉至少部分應用程式,以使得當前運行的應用程式的資源佔用滿足升級條件,從而實現升級。所述如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行可以包括: 如果不滿足,基於當前運行的應用程式的資源佔用,關閉至少部分應用程式;返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。 透過關閉當前運行至少部分應用程式以使關閉後剩餘應用程式的資源展示滿足升級條件,從而可以實現升級。 進一步,可選地,所述基於當前運行的應用程式的資源佔用,關閉至少部分應用程式具體可以是: 解除當前運行的應用程式中至少部分應用程式佔用的資源。 作為一種可能的實現方式,具體還可以是:確定升級任務所需的目標資源;根據所述物聯網設備的總資源,以及所述目標資源,計算所述物聯網設備中應用程式的可佔用資源;解除當前運行應用程式中至少部分應用程式的資源佔用,以使剩餘應用程式的資源佔用小於所述可佔用資源。 如圖8所示,為本案實施例提供的一種物聯網設備的程式升級裝置的一個實施例的結構示意圖,所述裝置可以包括: 訊息檢測模組801,用於在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息。 訊息回應模組802,用於回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式。 程式下載模組803,用於從升級伺服端下載待升級程式。 程式升級模組804,用於運行所述待升級程式,完成所述物聯網設備的升級任務。 程式運行模組805,用於重新運行所述至少一個應用程式。 本案實施例中,透過針對資源受限的物聯網設備,可以在至少一個應用程式運行的過程中,檢測設備管理伺服端發送的升級觸發訊息,回應於該升級觸發訊息,可以基於至少一個應用程式的資源佔用,關閉至少部分應用程式,以使得物聯網設備系統中的資源能夠執行升級任務。從升級伺服端下載待升級程式之後,可以運行該待升級程式,完成物聯網設備的升級任務,之後,可以重新運行至少一個應用程式。此時,物聯網設備完成升級任務,且在升級結束之後重新運行至少一個應用程式,以使物聯網設備的系統恢復到穩定狀態,從而可以解決升級任務與主應用程式同時運行時導致的系統不穩定的技術問題。 作為一個實施例,所述訊息回應模組可以包括: 第一回應單元,用於回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉所有應用程式。 在某些實施例中,所述程式下載模組可以包括: 模式切換單元,用於切換所述物聯網設備至下載模式,以從升級伺服端下載待升級程式; 所述裝置還包括: 升級切換模組,用於檢測所述待升級程式下載完成時,切換所述物聯網設備至升級模式; 所述程式升級模組可以包括: 第一升級單元,用於檢測所述物聯網設備處於升級模式時,運行所述待升級程式,完成所述物聯網設備的升級任務。 作為一種可能的實現方式,所述模式切換單元包括: 第一處理子單元,用於設定所述物聯網設備為下載模式並重啓所述物聯網設備,以切換所述物聯網設備至下載模式; 第二處理子單元,用於檢測升級標誌位為第一標誌時,從升級伺服端下載待升級程式。 在某些實施例中,所第二處理子單元可以包括: 第一下載模組,用於在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,從升級伺服端下載待升級程式。 進一步,可選地,所述第一下載模組可以包括: 在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,運行所述物聯網設備的操作系統單元; 檢測與所述升級伺服端的網路連接已完成時,檢測所述物聯網設備為下載模式時,從所述升級伺服端下載待升級程式。 作為又一種可能的實現方式,所述升級切換模組包括: 標誌清除單元,用於檢測所述待升級程式下載完成時,清除所述下載模式並設定升級標誌位為第二標誌; 第一重啓單元,用於重啓所述物聯網設備; 第一切換單元,用於檢測所述升級標誌位為第二標誌時,確認切換至升級模式。 在某些實施例中,所述第一切換單元可以包括: 第三處理子單元,用於在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第二標誌時,確認切換至升級模式。 在某些實施例中,所述裝置還可以包括: 標誌設定模組,用於設定所述升級標誌位為第一標誌。 作為一種可能的實現方式,所述程式運行模組包括: 第二重啓單元,用於重啓所述物聯網設備,以重新運行所述至少一個應用程式。 進一步,可選地,所述第二重啓單元可以包括: 第二重啓子單元,用於運行重啓指令,啓動引導程式; 第四處理子單元,用於檢測升級標誌位為第一標誌時,啓動操作系統並建立網路連接; 程式啓動子單元,用於檢測未處於下載模式時,啓動所述至少一個應用程式。 作為一個實施例,所述訊息回應模組可以包括: 第二回應單元,用於回應於所述升級觸發訊息,如果所述至少一個應用程式的資源佔用大於相對應的佔用臨限值,關閉至少部分應用程式。 作為又一個實施例,所述訊息回應模組包括: 類型確定單元,用於確定與所述升級觸發訊息對應升級任務的升級類型;其中,所述升級類型包括全量升級或增量升級; 第二升級單元,用於如果所述升級類型為全量升級,解除所述至少一個應用程式的資源佔用,以關閉所述至少一個應用程式; 第三升級單元,用於如果所述升級類型為增量升級,確定與所述增量升級相匹配的目標資源;根據所述至少一個應用程式的資源佔用以及所述目標資源,解除至少部分應用程式的資源佔用,以使所述物聯網設備中剩餘資源滿足所述目標資源的需求。 作為一個實施例,所述程式下載模組可以包括: 協定傳輸單元,用於基於超文件傳輸安全協定,從升級伺服端下載待升級程式。 作為又一個實施例,所述裝置還包括: 任務監控模組,用於啓動下載監控任務,利用所述下載監控任務監控所述待升級程式的下載過程。 圖8所述的物聯網設備的程式升級裝置可以執行圖1~圖6所示實施例所述的物聯網設備的程式升級方法,其實現原理和技術效果不再贅述。對於上述實施例中的程式升級裝置其中的各個模組、單元、子單元所執行操作的具體方式已經在有關該方法的實施例中進行了詳細描述,此處將不做詳細闡述說明。 此外,本案實施例還提供一種電腦可讀儲存媒體,所述電腦可讀儲存媒體儲存有電腦指令儲存有電腦指令,當所述電腦指令被一個或多個處理器執行時,致使所述一個或多個處理器上述實施例中執行的任一個實施例中圖1~圖6所述的物聯網設備的程式升級方法。 在實際應用中,圖8所示的裝置可以配置為一物聯網設備,如圖9所示,為本案實施例提供的一種物聯網設備的結構示意圖,所述設備可以包括: 儲存組件901與處理組件902;所述儲存組件901用於儲存一條或多條電腦指令;所述一條或多條電腦指令被所述處理組件902調用; 所述處理組件902用於: 在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息;回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式;從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務;重新運行所述至少一個應用程式。 本案實施例中,透過針對資源受限的物聯網設備,可以在至少一個應用程式運行的過程中,檢測設備管理伺服端發送的升級觸發訊息,回應於該升級觸發訊息,可以基於至少一個應用程式的資源佔用,關閉至少部分應用程式,以使得物聯網設備系統中的資源能夠執行升級任務。從升級伺服端下載待升級程式之後,可以運行該待升級程式,完成物聯網設備的升級任務,之後,可以重新運行至少一個應用程式。此時,物聯網設備完成升級任務,且在升級結束之後重新運行至少一個應用程式,以使物聯網設備的系統恢復到穩定狀態,從而可以解決升級任務與主應用程式同時運行時導致的系統不穩定的技術問題。 作為一個實施例,所述處理組件回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式具體可以是: 回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉所有應用程式。 在某些實施例中,所述處理組件從升級伺服端下載待升級程式具體可以是: 切換所述物聯網設備至下載模式,以從升級伺服端下載待升級程式; 所述處理組件運行所述待升級程式,完成所述物聯網設備的升級任務之前,還具體可以是: 檢測所述待升級程式下載完成時,切換所述物聯網設備至升級模式; 所述處理組件運行所述待升級程式,完成所述物聯網設備的升級任務具體可以是: 檢測所述物聯網設備處於升級模式時,運行所述待升級程式,完成所述物聯網設備的升級任務。 作為一種可能的實現方式,所述處理組件切換所述物聯網設備至下載模式,以從升級伺服端下載待升級程式具體可以是: 設定所述物聯網設備為下載模式並重啓所述物聯網設備,以切換所述物聯網設備至下載模式; 檢測升級標誌位為第一標誌時,從升級伺服端下載待升級程式。 在一種可能的設計中,所述處理組件檢測升級標誌位為第一標誌時,從升級伺服端下載待升級程式具體可以是: 在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,從升級伺服端下載待升級程式。 進一步,可選地,所述處理組件在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,從升級伺服端下載待升級程式具體可以是: 在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,運行所述物聯網設備的操作系統單元; 檢測與所述升級伺服端的網路連接已完成時,檢測所述物聯網設備為下載模式時,從所述升級伺服端下載待升級程式。 作為又一種可能的實現方式,所述處理組件檢測所述待升級程式下載完成時,切換所述物聯網設備至升級模式具體可以是: 檢測所述待升級程式下載完成時,清除所述下載模式並設定升級標誌位為第二標誌; 重啓所述物聯網設備; 檢測所述升級標誌位為第二標誌時,確認切換至升級模式。 在一種可能的設計中,所述處理組件檢測所述升級標誌位為第二標誌時,確認切換至升級模式具體可以是: 在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第二標誌時,確認切換至升級模式。 進一步,可選地,所述處理組件檢測所述物聯網設備處於升級模式時,運行所述待升級程式,完成所述物聯網設備的升級任務之後,還具體可以是: 設定所述升級標誌位為第一標誌。 在某些實施例中,所述處理組件重新運行所述至少一個應用程式具體可以是: 重啓所述物聯網設備,以重新運行所述至少一個應用程式。 在一種可能的設計中,所述處理組件重啓所述物聯網設備,以重新運行所述至少一個應用程式具體可以是: 運行重啓指令,啓動引導程式; 檢測升級標誌位為第一標誌時,啓動操作系統並建立網路連接; 檢測未處於下載模式時,啓動所述至少一個應用程式。 作為又一個實施例,所述處理組件回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式具體可以是: 回應於所述升級觸發訊息,如果所述至少一個應用程式的資源佔用大於相對應的佔用臨限值,關閉至少部分應用程式。 作為又一個實施例,所述處理組件回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式具體可以是: 確定與所述升級觸發訊息對應升級任務的升級類型;其中,所述升級類型包括全量升級或增量升級; 如果所述升級類型為全量升級,解除所述至少一個應用程式的資源佔用,以關閉所述至少一個應用程式; 如果所述升級類型為增量升級,確定與所述增量升級相匹配的目標資源;根據所述至少一個應用程式的資源佔用以及所述目標資源,解除至少部分應用程式的資源佔用,以使所述物聯網設備中剩餘資源滿足所述目標資源的需求。 作為又一個實施例,所述從升級伺服端下載待升級程式具體可以是: 基於超文件傳輸安全協定,從升級伺服端下載待升級程式。 作為又一個實施例,所述處理組件從升級伺服端下載待升級程式之前,具體可以是: 啓動下載監控任務,利用所述下載監控任務監控所述待升級程式的下載過程。 圖9所述的物聯網設備可以執行圖1~圖6所示實施例所述的物聯網設備的程式升級方法,其實現原理和技術效果不再贅述。對於上述實施例中的物聯網設備其中的處理組件所執行操作的具體方式已經在有關該方法的實施例中進行了詳細描述,此處將不做詳細闡述說明。 如圖10所示,為本案實施例提供的一種物聯網設備的程式升級裝置的一個實施例的結構示意圖,所述裝置可以包括: 訊息檢測模組1001,用於在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息; 條件判斷模組1002,用於判斷當前運行的應用程式的資源佔用是否滿足升級條件; 第一處理模組1003,用於如果滿足,從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務; 第二處理模組1004,用於如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。 作為一個實施例,所述條件判斷模組可以包括: 條件判斷單元,用於基於預設監控頻率,判斷當前運行的應用程式的資源佔用是否滿足升級條件。 作為又一個實施例,在當前運行的應用程式的資源佔用不滿足升級條件時,可以關閉至少部分應用程式,以使得當前運行的應用程式的資源佔用滿足升級條件,從而實現升級。所述第二處理模組可以包括: 資源處理單元,用於如果不滿足,基於當前運行的應用程式的資源佔用,關閉至少部分應用程式;返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。 透過關閉當前運行至少部分應用程式以使關閉後剩餘應用程式的資源展示滿足升級條件,從而可以實現升級。 圖10所述的物聯網設備的程式升級裝置可以執行圖7所示實施例所述的物聯網設備的程式升級方法,其實現原理和技術效果不再贅述。對於上述實施例中的程式升級裝置其中的各個模組、單元、子單元所執行操作的具體方式已經在有關該方法的實施例中進行了詳細描述,此處將不做詳細闡述說明。 此外,本案實施例還提供一種電腦可讀儲存媒體,所述電腦可讀儲存媒體儲存有電腦指令儲存有電腦指令,當所述電腦指令被一個或多個處理器執行時,致使所述一個或多個處理器上述實施例中執行的任一個實施例中圖7所述的物聯網設備的程式升級方法。 在實際應用中,圖10所示的裝置可以配置為一物聯網設備,如圖11所示,為本案實施例提供的一種物聯網設備的結構示意圖,所述設備可以包括:儲存組件1101與處理組件1102;所述儲存組件1101用於儲存一條或多條電腦指令;所述一條或多條電腦指令被所述處理組件1102調用; 所述處理組件1102用於: 在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息;判斷當前運行的應用程式的資源佔用是否滿足升級條件;如果滿足,從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務;如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。 作為一個實施例,所述處理組件判斷當前運行的應用程式的資源佔用是否滿足升級條件具體可以是: 基於預設監控頻率,判斷當前運行的應用程式的資源佔用是否滿足升級條件。 作為一個實施例,所述處理組件處理如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行具體可以是: 如果不滿足,基於當前運行的應用程式的資源佔用,關閉至少部分應用程式;返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。 圖11所述的物聯網設備可以執行圖7所示實施例所述的物聯網設備的程式升級方法,其實現原理和技術效果不再贅述。對於上述實施例中的物聯網設備其中的處理組件所執行操作的具體方式已經在有關該方法的實施例中進行了詳細描述,此處將不做詳細闡述說明。 實施例未詳細描述的部分,可參考對圖1~圖7所示實施例的相關說明。該技術方案的執行過程和技術效果參見圖1~圖7所示實施例中的描述,在此不再贅述。 以上所描述的裝置實施例僅僅是示意性的,其中所述作為分離部件說明的單元可以是或者也可以不是物理上分開的,作為單元顯示的部件可以是或者也可以不是物理單元,即可以位於一個地方,或者也可以分布到多個網路單元上。可以根據實際的需要選擇其中的部分或者全部模組來實現本實施例方案的目的。本領域普通技術人員在不付出創造性的勞動的情況下,即可以理解並實施。 透過以上的實施方式的描述,本領域的技術人員可以清楚地瞭解到各實施方式可借助加必需的通用硬體平臺的方式來實現,當然也可以透過硬體和程式結合的方式來實現。基於這樣的理解,上述技術方案本質上或者說對現有技術做出貢獻的部分可以以電腦產品的形式體現出來,本發明可採用在一個或多個其中包含有電腦可用程式碼的電腦可用儲存媒體(包括但不限於磁碟記憶體、CD-ROM、光學記憶體等)上實施的電腦程式產品的形式。 本發明是參照根據本發明實施例的方法、設備(系統)、和電腦程式產品的流程圖和/或方塊圖來描述的。應理解可由電腦程式指令實現流程圖和/或方塊圖中的每一流程和/或方塊、以及流程圖和/或方塊圖中的流程和/或方塊的結合。可提供這些電腦程式指令到通用電腦、專用電腦、嵌入式處理機或其他可程式化資料處理設備的處理器以產生一個機器,使得透過電腦或其他可程式化資料處理設備的處理器執行的指令產生用於實現在流程圖一個流程或多個流程和/或方塊圖一個方塊或多個方塊中指定的功能的裝置。 這些電腦程式指令也可儲存在能引導電腦或其他可程式化資料處理設備以特定方式工作的電腦可讀記憶體中,使得儲存在該電腦可讀記憶體中的指令產生包括指令裝置的製造品,該指令裝置實現在流程圖一個流程或多個流程和/或方塊圖一個方塊或多個方塊中指定的功能。 這些電腦程式指令也可裝載到電腦或其他可程式化資料處理設備上,使得在電腦或其他可程式化設備上執行一系列操作步驟以產生電腦實現的處理,從而在電腦或其他可程式化設備上執行的指令提供用於實現在流程圖一個流程或多個流程和/或方塊圖一個方塊或多個方塊中指定的功能的步驟。 在一個典型的配置中,計算設備包括一個或多個處理器 (CPU)、輸入/輸出介面、網路介面和記憶體。 記憶體可能包括電腦可讀媒體中的非永久性記憶體,隨機存取記憶體 (RAM) 和/或非揮發性記憶體等形式,如唯讀記憶體 (ROM) 或快閃記憶體(flash RAM)。記憶體是電腦可讀媒體的示例。 電腦可讀媒體包括永久性和非永久性、可移除和非可移除媒體可以由任何方法或技術來實現資訊儲存。資訊可以是電腦可讀指令、資料結構、程式的模組或其他資料。電腦的儲存媒體的例子包括,但不限於相變記憶體 (PRAM)、靜態隨機存取記憶體 (SRAM)、動態隨機存取記憶體 (DRAM)、其他類型的隨機存取記憶體 (RAM)、唯讀記憶體 (ROM)、電可抹除可程式化唯讀記憶體 (EEPROM)、快閃記憶體或其他記憶體技術、唯讀光碟唯讀記憶體 (CD-ROM)、數位多功能光碟 (DVD) 或其他光學儲存、磁盒式磁帶,磁帶磁碟儲存或其他磁性儲存設備或任何其他非傳輸媒體,可用於儲存可以被計算設備存取的資訊。按照本文中的界定,電腦可讀媒體不包括暫存電腦可讀媒體 (transitory media),如調變的資料信號和載波。 最後應說明的是:以上實施例僅用以說明本發明的技術方案,而非對其限制;儘管參照前述實施例對本發明進行了詳細的說明,本領域的普通技術人員應當理解:其依然可以對前述各實施例所記載的技術方案進行修改,或者對其中部分技術特徵進行等同替換;而這些修改或者替換,並不使相應技術方案的本質脫離本發明各實施例技術方案的精神和範圍。In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments These are a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention. The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms of "a", "the" and "the" used in the embodiments of the present invention and the scope of the appended patent application are also intended to include plural forms, unless the context clearly indicates other meanings, the "plurality" generally includes There are at least two, but it does not exclude the case where at least one is included. It should be understood that the term "and/or" used herein is only an association relationship describing associated objects, indicating that there can be three relationships, for example, A and/or B can mean: A alone exists, and A and B exist at the same time. There are three cases of B alone. In addition, the character "/" in this text generally indicates that the associated objects before and after are in an "or" relationship. Depending on the context, the words "if" and "if" as used herein can be interpreted as "when" or "when" or "in response to certainty" or "in response to recognition". Similarly, depending on the context, the phrase "if determined" or "if recognized (statement or event)" can be interpreted as "when determined" or "in response to determination" or "when recognized (statement or event)" Event)" or "response to identification (statement or event)". It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a commodity or system that includes a series of elements not only includes those elements, but also includes those elements that are not explicitly listed. Other elements of, or also include elements inherent to this kind of commodity or system. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the commodity or system that includes the element. The embodiments of this case can be applied to IoT devices. By analyzing the occupancy of system resources in the IoT devices, the conditions for normal upgrades can be provided, so that the upgrade can be completed in time, and the operation of the main application can be restored in time, thereby avoiding The running system is unstable due to download and upgrade. In the prior art, the hardware resources and memory resources of the Internet of Things device may be fixed and not large enough. During the running of at least one application of the IoT device, the program in the IoT device can be upgraded, for example, a general upgrade of an application, a version upgrade or a firmware upgrade, etc. During the upgrade process, in order to ensure the security and reliability of the network connection between the IoT device and the upgraded father, it is usually necessary for the IoT device and the upgrade server to pass the secure HTTPS (Hypertext transfer protocol Secure). Protocol) Download the program to be upgraded, that is, the installation package. However, since the HTTPS download and upgrade process needs to increase the process of certificate exchange and hand shaking (hand shaking) verification, the consumption of system memory resources is greater. Therefore, resource-constrained IoT devices are often unable to download and upgrade using HTTPS. Moreover, in some resource-constrained IoT devices, if the application program is run and the upgrade task is downloaded at the same time, due to the limited resources, the technical problem of the instability of the operating system of the IoT device is prone to occur. In order to solve the above technical problems, the inventor proposed the technical solution of this case. In the embodiment of this case, for the resource-constrained IoT device, the upgrade trigger message sent by the device management server can be detected during the running of at least one application, and the response to the upgrade trigger message can be based on the at least one application. Resource occupation, close at least part of the application, so that the resources in the IoT device system can perform the upgrade task. After downloading the program to be upgraded from the upgrade server, the program to be upgraded can be run to complete the upgrade task of the IoT device, and then at least one application can be re-run. At this point, the IoT device completes the upgrade task, and reruns at least one application after the upgrade is completed to restore the system of the IoT device to a stable state, which can solve the system failure caused by the upgrade task and the main application running at the same time. Stable technical issues. The embodiments of this case will be described in detail below in conjunction with the drawings. As shown in FIG. 1, a flowchart of an embodiment of a program upgrade method for an Internet of Things device provided in this embodiment of the present application, the method may include the following steps: 101: During the running of at least one application, detect the upgrade trigger message sent by the device management server. The embodiments of this case can be applied to Internet of Things devices. The Internet of Things devices can refer to electronic devices with limited resources, and specifically can refer to electronic devices with memory resources less than a set memory threshold. When the Internet of Things devices are running normally, they need the support of multiple programs, such as bootloader, OS (operating system, operating system), timing program, and network connection program, etc., for some specific functions of the object Networked devices, for example, image sensors, sound sensors, etc., may also include applications that provide certain functions for users, for example, applications that display images, applications that output sounds to users, and so on. The device management server can be used to provide computing services. For example, it can be composed of devices such as personal computers, supercomputers, and notebook computers, or it can be composed of cloud servers. Make too many restrictions. The device management server refers to the server used to manage the Internet of Things devices. It can usually respond to and process service requests from the Internet of Things devices, and can also manage and control the applications in the Internet of Things devices. In some embodiments, when the user application in the Internet of Things device is version updated or upgraded, the device management server may be constituted by a third-party server, and the third-party server may specifically refer to the developer of the user application. The access server set by the developer for this user application. When the device management server determines that there is an upgrade requirement for the IoT device, it can send an upgrade trigger message to the IoT device. The upgrade trigger message may include information such as the program name and download address of the program to be upgraded, and the download address can be determined through the upgrade trigger message, so that the program to be upgraded can be downloaded from the upgrade server. The at least one application program may refer to a main application (MAIN APP Task) module in the Internet of Things device. The main application module refers to a software module with a specific application purpose formulated by the user, through the main application module Mainly programs that users can use on IoT devices, excluding the operating systems and network modules of IoT devices. 102: In response to the upgrade trigger message, close at least part of the application based on the resource occupation of the at least one application. At least one application in the Internet of Things device consumes resources of the Internet of Things device during the running process, which may include hardware resources or memory resources. Due to the small resources of the IoT device, if at least one application has a large resource occupancy, the remaining resources of the IoT device are small, and the upgrade cannot be performed in time, or there is a resource contention between the upgrade program and the operation of at least one application. . For example, suppose that the memory resource of the IoT device is 100K, and the resource occupied by at least one application is 60K, and the remaining resource is 40K. However, if the upgrade task requires 60K memory resources, the upgrade cannot be completed because the remaining resources are insufficient. The upgrade task requires 38K of memory resources. When at least one application and the upgrade task are upgraded at the same time, 98K of memory resources are required. Task upgrades can be performed. However, due to excessive memory resource consumption, resource conflicts and resource contention are prone to occur. Phenomena such as grabbing have led to instability of IoT devices. After responding to the upgrade trigger message, you can start the upgrade. At this time, based on the resource occupation of at least one application, at least part of the application can be closed. By closing at least part of the application, part of the resources in the IoT device can be unoccupied, and the supply of applicable resources can be increased. The device can be upgraded after closing at least part of the application. 103: Download the program to be upgraded from the upgrade server. Optionally, the response to the upgrade trigger message may include the download address of the program to be upgraded, and the program to be upgraded may be downloaded from the server based on the download address of the program to be upgraded. Optionally, the response to the upgrade trigger message may include download prompt information of the program to be upgraded, and the IoT device may determine the download address of the program to be upgraded based on the download prompt information in the response to the upgrade trigger message. , Download the program to be upgraded from the upgrade server. In some embodiments, the downloading of the program to be upgraded from the upgrade server may specifically be: based on the download address, sending a download request to the upgrade server corresponding to the download address, and establishing and updating the program based on the download request. After the exchange processing connection on the server side, the connection is completed, according to the established exchange processing connection, after the certificate is exchanged with the upgrade server side, the program to be upgraded can be downloaded from the upgrade server side. 104: Run the program to be upgraded to complete the upgrade task of the Internet of Things device. After downloading the program to be upgraded, the Internet of Things device can start the program to be upgraded to complete the upgrade task of the Internet of Things device. 105: Re-run the at least one application. The re-running the at least one application program may include restarting at least part of the closed application program to re-run the at least one application program. In this embodiment of the case, by targeting resource-constrained IoT devices, it is possible to detect the upgrade trigger message sent by the device management server during the operation of at least one application program, and respond to the upgrade trigger message based on at least one application program. Occupies resources, close at least part of the application, so that the resources in the IoT device system can perform the upgrade task. After downloading the program to be upgraded from the upgrade server, the program to be upgraded can be run to complete the upgrade task of the IoT device, and then at least one application can be re-run. At this point, the IoT device completes the upgrade task, and reruns at least one application after the upgrade is completed to restore the system of the IoT device to a stable state, which can solve the system failure caused by the upgrade task and the main application running at the same time. Stable technical issues. In order to solve the resource conflict problem caused by the download task and at least one application running at the same time, all applications can be closed to increase the available resources in the system, so as to ensure that the program upgrade can be completed normally. As an embodiment, in response to the upgrade trigger message, shutting down at least part of the application based on the resource occupation of the at least one application may include: In response to the upgrade trigger message, all applications are closed based on the resource occupation of the at least one application. In order to ensure the security of the download, the downloading of the program to be upgraded from the upgrade server may include: Based on the hyper-file transfer security protocol, download the program to be upgraded from the upgrade server. The hyper-file transfer security protocol requires more resources, and cannot be used when at least part of the application is not closed or is affected by resource restrictions and has poor use effect. In this case, closing at least part of the application can make hyper-file transfer secure The agreement can be used to improve the security of the download, thereby improving the security of the upgrade task. As shown in FIG. 2, a flowchart of another embodiment of a program upgrade method for an Internet of Things device provided in this embodiment of the present application, the method may include the following steps: 201: During the running of at least one application, detect an upgrade trigger message sent by the device management server. The processing process of some steps in the embodiment of this case is the same as part of the content in the embodiment shown in FIG. 1, and will not be repeated here. 202: In response to the upgrade trigger message, close all applications based on the resource occupation of the at least one application. 203: Switch the Internet of Things device to the download mode to download the program to be upgraded from the upgrade server. As a possible implementation, you can switch the IoT device to the download mode by executing the mode command, and download the program to be upgraded from the upgrade server. When switching the IoT device to the download mode, the IoT device needs to be not in the upgrade mode. Therefore, when switching the Internet of Things device to the download mode, it may also include: setting the upgrade flag bit as the first flag, restarting the Internet of Things device, and when detecting that the upgrade flag bit is the first flag, determining the object The networked device switches to the download mode to download the program to be upgraded from the upgrade server. 204: When detecting that the download of the program to be upgraded is completed, switch the Internet of Things device to an upgrade mode. Detecting the completion of the program to be upgraded may specifically be detecting that the program to be upgraded receives an end instruction sent by the upgrade server to determine that the download of the program to be upgraded is completed. Switching the Internet of Things device to the upgrade mode may specifically include: when detecting that the download of the program to be upgraded is completed, setting the upgrade flag to the second flag, restarting the Internet of Things device, and detecting when the upgrade flag is the second flag , Make sure the IoT device is switched to the upgrade mode. When it is detected that the download of the program to be upgraded is completed, switching the Internet of Things device to the upgrade mode may specifically include clearing the download mode when it is detected that the download of the program to be upgraded is completed, and switching the Internet of Things device to the upgrade mode . 205: When detecting that the Internet of Things device is in the upgrade mode, run the program to be upgraded to complete the upgrade task of the Internet of Things device. When the Internet of Things processes the upgrade mode, that is, when it is detected that the upgrade flag is the second flag, the program to be upgraded can be run to complete the upgrade task of the Internet of Things device. The upgrade flag can refer to a variable used to identify the upgrade mode. Through the setting of the upgrade flag, it can be judged whether the program of the Internet of Things device can be upgraded. For example, the upgrade flag bit may be expressed as an integer variable flag (flag), the first flag set for flag may specifically mean that flag is equal to 0; the second flag set for flag may specifically mean that flag is equal to 1. When the upgrade flag is the first flag, it is not in the upgrade state, and the program to be upgraded for the Internet of Things device is not executed. When the upgrade flag is the second flag, the upgrade program for the Internet of Things device is executed to complete the upgrade of the Internet of Things device. 206: Re-run the at least one application program. In the embodiment of this case, the download mode is set so that the current operating environment of the Internet of Things device can be determined, so that the program to be upgraded can be downloaded according to the current operating environment. After the download is successful, the Internet of Things device can be switched to the upgrade mode to detect the object. When the networked device is in the upgrade mode, the program to be upgraded can be run to complete the upgrade task of the IoT device. In this process, the content of execution can be clarified through the role of the model to improve the efficiency of the upgrade. As an embodiment, the switching the Internet of Things device to the download mode to download the program to be upgraded from the upgrade server may include: Set the Internet of Things device to the download mode and restart the Internet of Things device to switch the Internet of Things device to the download mode. When it is detected that the upgrade flag is the first flag, the program to be upgraded is downloaded from the upgrade server. After the download mode in the IoT device is turned on, the IoT device can be switched from the normal operation mode to the download mode by restarting. After the restart, the IoT device in the download mode can start to download the program to be upgraded. In download mode, when the upgrade flag is the first flag, the program to be upgraded can be downloaded from the upgrade server. Due to the restart method, the application in the IoT device is closed, and the application is isolated from the download process to ensure download efficiency. Since at least one application program of the Internet of Things device is arranged in the order of the startup sequence, it may specifically include: startup program, operating system, network module, user application, etc. Different applications have different functions. The startup program is to completely isolate at least one application from the upgrade task for execution, and the upgrade task and at least one application can be isolated on the IoT device during the startup phase. As a possible implementation, when the detecting that the upgrade flag is the first flag, downloading the program to be upgraded from the upgrade server may include: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag is the first flag, the program to be upgraded is downloaded from the upgrade server. In the embodiment of this case, after the IoT device starts the boot program, the download of the program to be upgraded can be started, so that the IoT device can start downloading the program to be upgraded when the boot program starts other programs but does not start , In order to realize the isolation of upgrade tasks from user applications, operating systems and other programs. After the upgrade is completed, at least one application of the IoT device can be started to ensure the normal operation of the application to avoid downloading tasks and Simultaneous execution of user applications results in resource contention, resulting in unstable system operation and unstable upgrade tasks. Further, optionally, when the boot program of the Internet of Things device is started, when detecting that the upgrade flag bit is the first flag, downloading the program to be upgraded from the upgrade server may include: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag is the first flag, the operating system unit of the Internet of Things device is run. When it is detected that the network connection with the upgrade server is completed, and when it is detected that the Internet of Things device is in the download mode, the program to be upgraded is downloaded from the upgrade server. When it is detected that the upgrade flag is the first flag, the download task of the service to be upgraded can be started, and the operating system can be started at this time, and the program download can be started when the network connection is successful. As a possible implementation manner, when detecting that the download of the program to be upgraded is completed, switching the Internet of Things device to the upgrade mode may include: When detecting that the download of the program to be upgraded is completed, clear the download mode and set the upgrade flag bit as the second flag; Restart the Internet of Things device; When detecting that the upgrade flag bit is the second flag, confirm switching to the upgrade mode. After the Internet of Things device enters the upgrade mode, the program to be upgraded can be run to complete the upgrade task of the Internet of Things device. Further, optionally, when detecting that the upgrade flag bit is the second flag, confirming the switch to the upgrade mode includes: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag is the second flag, it is confirmed to switch to the upgrade mode. In some embodiments, when detecting that the IoT device is in the upgrade mode, running the program to be upgraded, and after completing the upgrade task of the IoT device, the method may further include: Set the upgrade flag bit as the first flag. As an embodiment, the re-running the at least one application program may include: Restart the Internet of Things device to re-run the at least one application. In some embodiments, the restarting the Internet of Things device to re-run the at least one application may include: Run the restart command to start the boot program; When the detection upgrade flag is the first flag, start the operating system and establish a network connection; When it is detected that it is not in the download mode, the at least one application is started. The restarting of the Internet of Things device in this case may specifically refer to running a restart (Reboot) instruction to restart the Internet of Things device. As shown in FIG. 3, a flowchart of another embodiment of a program upgrade method for an Internet of Things device provided in this embodiment of the present application, the method may include the following steps: 301: During the operation of at least one application, detect an upgrade trigger message sent by the device management server. 302: In response to the upgrade trigger message, close all applications based on the resource occupation of the at least one application. 303: Set the Internet of Things device to the download mode and restart to switch the Internet of Things device to the download mode; 304: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag is the first flag, run the operating system unit of the Internet of Things device. 305: When detecting that the network connection with the upgrade server is completed, and when detecting that the Internet of Things device is in the download mode, start a monitoring task, download the program to be upgraded from the upgrade server, and use the monitoring task to monitor the The download process of the program to be upgraded. When downloading the program to be upgraded from the upgrade server, it is possible to download the program to be upgraded from the upgrade server based on the hyper-file transfer security protocol to ensure the security of the download. 306: When detecting that the download of the program to be upgraded is completed, clear the download mode and set the upgrade flag bit as the second flag; 307: Restart the Internet of Things device. 308: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag bit is the second flag, confirm to switch to the upgrade mode. 309: When detecting that the Internet of Things device is in the upgrade mode, run the program to be upgraded to complete the upgrade task of the Internet of Things device. 310: Set the upgrade flag bit as the first flag. 311: Restart the Internet of Things device to re-run the at least one application. The restarting the Internet of Things device to restart running the at least one application program may include: Restart the Internet of Things device and start the boot program; when it is detected that the upgrade flag is the first flag, start the operating system and establish a network connection; when it is detected that it is not in the download mode, start the at least one application. The processing process of part of the steps in the embodiment of this case is the same as part of the content in the embodiment shown in FIG. 1 to FIG. 2, and will not be repeated here. In the embodiment of this case, the upgrade of the IoT device is divided into three stages as a whole. In the first stage, during the normal operation of at least one application of the IoT device, the upgrade trigger message sent by the device management server can be detected. The IoT device can respond to the upgrade trigger message, based on the resource usage of at least one application, close all applications, and then set the IoT device to download mode and restart it. At this time, you can switch the IoT device to Download mode, download the program to be upgraded. After the IoT device restarts, the boot program starts first. When the startup is over, the IoT device can start to enter the startup phase. Through the detection of the upgrade flag bit, the IoT device can be started when it is determined that the upgrade flag bit is the first flag. When the operating system is started, the connection between the Internet of Things device and the upgrade server is established to complete the establishment of the download environment. During the download process, you can start the monitoring task. When downloading the program to be upgraded from the upgrade server, use the monitoring task to monitor the download process of the program to be upgraded, so that the download mode can be cleared and the upgrade can be set when the download of the program to be upgraded is detected. The flag bit is the second flag. At this time, the program to be upgraded will complete the download of the program to be upgraded after the mode switch, restart the device, and load the download environment. In the second stage, after the upgrade flag is set to the second flag, the download of the program to be upgraded is completed, and the installation of the program to be upgraded can be started. At this time, the Internet of Things device can be restarted, and the After the boot program of the networked device is started, check the upgrade flag. When the upgrade flag is detected as the second flag, it means that the IoT device has switched to the upgrade mode at this time. In the upgrade mode, you can start to run the program to be upgraded and complete the upgrade task of the IoT device. Installation work of the upgrade program. In the third stage, after the IoT device installs the program to be upgraded, the upgrade flag can be set as the first flag and switched to the normal working mode. At this time, restart the IoT device to re-run at least one App, complete the upgrade of the entire Internet of Things equipment. In this upgrade process, since no application is involved in the download process and installation process of the IoT device, the IoT device can separately handle the download and installation of the program to be upgraded, and then run at least one application normally. Avoid resource conflicts in the running and downloading and installation of applications, and improve the stability of the system. For ease of understanding, the embodiment of this case is described in detail by taking the IoT device as a smart speaker as an example. The smart speaker M1 in Figure 4 can establish a communication connection with the device management server M2, and can also establish a communication connection with the upgrade server M3. The smart speaker M1 can run at least one application program normally during normal operation. The device management server M2 can send a 401 upgrade trigger message to the smart speaker M1. During the running of at least one application, the smart speaker M1 can detect the upgrade trigger message sent by the 402 device management server M2. The smart speaker M1 can respond to the upgrade trigger message and close all the applications 403 based on the resource occupation of the at least one application. After that, the smart speaker can set the IoT device to a download mode 404, and then can run 405 a restart command (Reboot). After the restart command runs, the bootloader starts to start 406. When the smart speaker judges that the Upgrade Flag 407 is the first flag, it starts the 408 operating system unit and establishes a 409 network connection. After the network connection is successful (Network Ready), when it is detected that 410 is in the download mode, the 411 monitor task (Monitor Task) is started, 412 the program to be upgraded is downloaded from the upgrade server M3, and the program to be upgraded is monitored by the monitoring task Download process. When it is detected that the download of the program to be upgraded is completed, the download mode is cleared and the upgrade flag bit is set to the second flag 413. After that, the smart speaker M1 can run the restart instruction 405. After the boot program is started 406, the upgrade flag bit 407 is detected as the second flag, and then it is confirmed to switch to the upgrade mode, so that in the upgrade mode, run the standby mode described in 414. The upgrade program completes the upgrade task of the Internet of Things device. After the upgrade is successful, the upgrade flag bit can be cleared, that is, the upgrade flag bit is set to the first flag 415. After that, the smart speaker M1 can restart the Internet of Things device 405, execute 406 to start the boot program; execute 407 to detect that the upgrade flag is the first flag, and execute step 408 to start the operating system and 409 to establish a network connection; 410 When it is detected that it is not in the download mode, the at least one application program 417 is activated. As shown in FIG. 5, a flowchart of another embodiment of a program upgrade method of an Internet of Things device provided in this embodiment of the present application, the method may include the following steps: 501: During the running of at least one application, detect the upgrade trigger message sent by the device management server. 502: In response to the upgrade trigger message, if the resource occupancy of the at least one application is greater than the corresponding occupancy threshold, close at least part of the application. As a possible implementation, the occupancy threshold can be determined in the following ways: Based on the upgrade trigger message, determine the target resource required when the upgrade trigger message runs; Use the target resource and the total resource of the Internet of Things device to determine the occupation threshold. Optionally, the determining the threshold of occupation by using the target resource and the total resource of the Internet of Things device may include: calculating the ratio of the target resource to the total resource of the Internet of Things device to obtain an upgrade The occupation ratio of the task is calculated by calculating the difference between the integer 1 and the occupation ratio of the upgrade task to obtain the occupation threshold. The response to the upgrade trigger message, if the resource occupation of the at least one application program is greater than the corresponding occupancy threshold, shutting down at least part of the application program includes: responding to the upgrade trigger message, if the at least one application program The ratio of the resource occupation of the Internet of Things to the total resource of the IoT device is greater than the corresponding threshold of occupation, and at least some applications are closed. In some embodiments, in response to the upgrade trigger message, if the resource occupancy of the at least one application is greater than a corresponding occupancy threshold, shutting down at least part of the application may include: responding to the upgrade trigger Message, if the resource occupancy of the at least one application is greater than the corresponding occupancy threshold, based on the occupancy threshold, re-determine the available resources of the at least one application; close at least part of the application so that The resources occupied by the remaining application programs in at least one application program are less than the occupable resources. 503: Download the program to be upgraded from the upgrade server. 504: Run the program to be upgraded to complete the upgrade task of the Internet of Things device. 505: Re-run the at least one application. The processing process of part of the steps in the embodiment of this case is the same as part of the content in the embodiment shown in FIG. 1 to FIG. 3, and will not be repeated here. In the embodiment of this case, during the running of at least one application program, the upgrade trigger message sent by the device management server can be detected. Afterwards, in response to the upgrade trigger message, if the resource occupation of the at least one application program is greater than the occupation threshold, at least part of the application program may be closed. By closing at least part of the application, part of the occupied resources in the IoT device can be released, so that the resources of the IoT device can complete the program to be upgraded without affecting the stable operation of the remaining part of the application. As shown in FIG. 6, a flowchart of another embodiment of a program upgrade method of an Internet of Things device provided in this embodiment of the present application, the method may include the following steps: 601: Detect the upgrade trigger message sent by the device management server during the running of at least one application. 602: Determine the upgrade type of the upgrade task corresponding to the upgrade trigger message. Wherein, the upgrade type includes full upgrade or incremental upgrade. 603: If the upgrade type is a full upgrade, release the resource occupation of the at least one application to close the at least one application. After that, step 606 is executed. 604: If the upgrade type is an incremental upgrade, determine a target resource that matches the incremental upgrade. 605: According to the resource occupation of the at least one application program and the target resource, release the resource occupation of at least part of the application program, so that the remaining resources in the Internet of Things device meet the demand of the target resource. After that, step 606 is executed. Optionally, the releasing the resource occupation of at least part of the application program according to the resource occupation of the at least one application program and the target resource, so that the remaining resources in the Internet of Things device meet the demand of the target resource may include : According to the total resources of the Internet of Things device and the target resources, calculate the occupable resources of the application in the Internet of Things device; release the resources occupied by at least part of the application in the at least one application, so that all The remaining resource occupancy in the at least one application program is less than the occupable resource. In some embodiments, at least one application can be individually set to run levels. When at least some applications are closed, the corresponding applications can be closed in descending order according to the run level of each application. , Until the remaining resources of the Internet of Things devices meet the resource requirements of the upgrade task. For example, the run level of the first application is level one, and the run level of the second application is level two. The run level of the first level application is greater than that of the second level application, and the run level of the first level application can be lower than that of the first level application If the remaining resources in the IoT device meet the resource requirements of the upgrade task, the first application can not be closed, and the download task can be started; if the remaining resources in the IoT device are not satisfied The resource requirements of the upgrade task need to close the first application until the remaining resources in the IoT device meet the resource requirements of the upgrade task. 606: Download the program to be upgraded from the upgrade server. 607: Run the program to be upgraded to complete the upgrade task of the Internet of Things device. 608: Re-run the at least one application. The processing process of part of the steps in the embodiment of this case is the same as part of the content in the embodiment shown in FIG. 1 to FIG. 3, and will not be repeated here. In the embodiment of the present case, during the operation of at least one application of the Internet of Things device, the upgrade trigger message sent by the device management server can be detected, and the upgrade type of the corresponding upgrade task can be determined through the upgrade trigger message. The upgrade type can be Including full upgrades and incremental upgrades. For full upgrades, the resource requirements for IoT devices may be high. Therefore, all applications can be closed to perform the upgrade task. For incremental upgrades, the resource requirements for IoT devices are low. Therefore, you can Use the method of shutting down part of the upgrade resources to perform the upgrade task. For different types of upgrade tasks, different closing methods are used. The upgrade process is more flexible and can reduce the number of times to close all applications, so as to maintain the operational status of the Internet of Things devices, so that they can maintain high work efficiency. As shown in FIG. 7, a flowchart of another embodiment of a program upgrade method for an Internet of Things device provided in this embodiment of the present application, the method may include the following steps: 701: Detect the upgrade trigger message sent by the device management server during the running of at least one application; 702: Determine whether the resource occupation of the currently running application program meets the upgrade conditions. Optionally, the determining whether the resource occupation of the currently running application program satisfies the upgrade condition may include determining whether the resource occupation of the currently running application program is less than a corresponding occupancy threshold. Wherein, the occupation threshold is determined based on the resources required by the upgrade task corresponding to the upgrade trigger message. The occupancy threshold can be specifically determined by: determining the target resource required by the upgrade trigger message during operation based on the upgrade trigger message; determining the occupancy by using the target resource and the total resources of the Internet of Things device Threshold value. Optionally, the determining the threshold of occupation by using the target resource and the total resource of the Internet of Things device may include: calculating the ratio of the target resource to the total resource of the Internet of Things device to obtain an upgrade The occupation ratio of the task is calculated by calculating the difference between the integer 1 and the occupation ratio of the upgrade task to obtain the occupation threshold. 703: If it is satisfied, download the program to be upgraded from the upgrade server; run the program to be upgraded to complete the upgrade task of the Internet of Things device. 704: If not satisfied, go back to step 702. The processing process of part of the steps in the embodiment of this case is the same as part of the content in the embodiment shown in FIG. 1 to FIG. 3, and will not be repeated here. In this embodiment of the case, during the running of at least one application of the Internet of Things device, the upgrade trigger message sent by the device management server can be detected. After that, it can be judged whether the currently running application program meets the upgrade conditions. If it is satisfied, the program to be upgraded can be downloaded from the upgrade server; run the program to be upgraded to complete the upgrade task of the Internet of Things device, if not satisfied, you can return to The step of judging whether the resource occupation of the currently running application meets the upgrade condition is continued until the resource occupation of the currently running application meets the upgrade condition. From the perspective of whether the resource occupancy of the currently running application meets the upgrade conditions, the resource environment of the IoT device is monitored, so that the upgrade task is executed when the upgrade conditions are met. It avoids the phenomenon of system instability caused by the upgrade when the resource environment of the Internet of things equipment is poor, and the stability and effectiveness of the upgrade are improved. In order to improve the accuracy and effectiveness of the monitoring, the resource occupancy of the IoT device can be monitored according to a certain monitoring frequency. As an embodiment, the judging whether the resource occupancy of the currently running application meets the upgrade conditions may include: Based on the preset monitoring frequency, it is determined whether the resource occupation of the currently running application meets the upgrade conditions. Optionally, the determining whether the resource occupation of the currently running application meets the upgrade condition based on the preset monitoring frequency may include: determining the monitoring time corresponding to each monitoring based on the preset monitoring frequency; when any monitoring time is reached , To determine whether the resource occupation of the currently running application meets the upgrade conditions. In some embodiments, when the resource occupancy of the currently running application program does not meet the upgrade condition, at least part of the application program may be closed, so that the resource occupancy of the currently running application program meets the upgrade condition, thereby realizing the upgrade. If it is not met, returning to the step of judging whether the resource occupation of the currently running application meets the upgrade condition and continuing to execute may include: If it is not satisfied, based on the resource occupation of the currently running application, close at least part of the application; return to the step of judging whether the resource occupation of the currently running application meets the upgrade condition and continue execution. The upgrade can be achieved by closing at least part of the currently running applications so that the resource display of the remaining applications after closing meets the upgrade conditions. Further, optionally, based on the resource occupation of the currently running application, closing at least part of the application may specifically be: Release the resources occupied by at least part of the currently running applications. As a possible implementation method, it can also be specifically: determining the target resource required for the upgrade task; calculating the occupable resources of the application in the Internet of Things device according to the total resources of the Internet of Things device and the target resource ;Release the resource occupation of at least part of the currently running applications, so that the resource occupation of the remaining applications is less than the occupable resources. As shown in FIG. 8, a schematic structural diagram of an embodiment of a program upgrade apparatus for an Internet of Things device provided in this embodiment of the present application, the apparatus may include: The message detection module 801 is used to detect the upgrade trigger message sent by the device management server during the running process of at least one application. The message response module 802 is used to respond to the upgrade trigger message and close at least part of the application based on the resource occupation of the at least one application. The program download module 803 is used to download the program to be upgraded from the upgrade server. The program upgrade module 804 is used to run the program to be upgraded and complete the upgrade task of the Internet of Things device. The program running module 805 is used to re-run the at least one application program. In this embodiment of the case, by targeting resource-constrained IoT devices, it is possible to detect the upgrade trigger message sent by the device management server during the operation of at least one application program, and respond to the upgrade trigger message based on at least one application program. Occupies resources, close at least part of the application, so that the resources in the IoT device system can perform the upgrade task. After downloading the program to be upgraded from the upgrade server, the program to be upgraded can be run to complete the upgrade task of the IoT device, and then at least one application can be re-run. At this point, the IoT device completes the upgrade task, and reruns at least one application after the upgrade is completed to restore the system of the IoT device to a stable state, which can solve the system failure caused by the upgrade task and the main application running at the same time. Stable technical issues. As an embodiment, the message response module may include: The first response unit is configured to respond to the upgrade trigger message and close all applications based on the resource occupation of the at least one application. In some embodiments, the program download module may include: The mode switching unit is used to switch the Internet of Things device to a download mode to download the program to be upgraded from the upgrade server; The device also includes: The upgrade switching module is used to switch the Internet of Things device to the upgrade mode when detecting that the download of the program to be upgraded is completed; The program upgrade module may include: The first upgrade unit is used to detect that the Internet of Things device is in an upgrade mode, run the program to be upgraded, and complete the upgrade task of the Internet of Things device. As a possible implementation manner, the mode switching unit includes: The first processing subunit is configured to set the Internet of Things device to download mode and restart the Internet of Things device to switch the Internet of Things device to the download mode; The second processing subunit is used to download the program to be upgraded from the upgrade server when detecting that the upgrade flag bit is the first flag. In some embodiments, the second processing subunit may include: The first download module is used for downloading the program to be upgraded from the upgrade server when detecting that the upgrade flag bit is the first flag when the boot program of the Internet of Things device is started. Further, optionally, the first download module may include: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag bit is the first flag, run the operating system unit of the Internet of Things device; When it is detected that the network connection with the upgrade server is completed, and when it is detected that the Internet of Things device is in the download mode, the program to be upgraded is downloaded from the upgrade server. As yet another possible implementation manner, the upgrade switching module includes: The flag clearing unit is used for detecting that the downloading of the program to be upgraded is completed, clearing the download mode and setting the upgrade flag bit as the second flag; The first restart unit is configured to restart the Internet of Things device; The first switching unit is used for confirming switching to the upgrade mode when detecting that the upgrade flag bit is the second flag. In some embodiments, the first switching unit may include: The third processing subunit is used for confirming switching to the upgrade mode when detecting that the upgrade flag bit is the second flag when the boot program of the Internet of Things device is started. In some embodiments, the device may further include: The flag setting module is used to set the upgrade flag bit as the first flag. As a possible implementation, the program running module includes: The second restart unit is used to restart the Internet of Things device to re-run the at least one application. Further, optionally, the second restart unit may include: The second restart subunit is used to run restart instructions and start the boot program; The fourth processing subunit is used to detect that the upgrade flag is the first flag, start the operating system and establish a network connection; The program activation subunit is used for detecting that the at least one application program is not in the download mode. As an embodiment, the message response module may include: The second response unit is used to respond to the upgrade trigger message, and if the resource occupation of the at least one application is greater than the corresponding occupancy threshold, close at least part of the application. As another embodiment, the message response module includes: The type determining unit is configured to determine the upgrade type of the upgrade task corresponding to the upgrade trigger message; wherein, the upgrade type includes a full upgrade or an incremental upgrade; The second upgrade unit is configured to release the resource occupation of the at least one application program to close the at least one application program if the upgrade type is a full upgrade; The third upgrade unit is configured to determine a target resource matching the incremental upgrade if the upgrade type is an incremental upgrade; release at least part of the application according to the resource occupation of the at least one application and the target resource The resource occupation of the program, so that the remaining resources in the Internet of Things device meet the demand of the target resource. As an embodiment, the program download module may include: The protocol transmission unit is used to download the program to be upgraded from the upgrade server based on the hyper-file transfer security protocol. As yet another embodiment, the device further includes: The task monitoring module is used to start a download monitoring task, and use the download monitoring task to monitor the download process of the program to be upgraded. The program upgrade apparatus of the Internet of Things device described in FIG. 8 can execute the program upgrade method of the Internet of Things device described in the embodiments shown in FIGS. 1 to 6, and its implementation principles and technical effects will not be repeated. The specific operations performed by the modules, units, and sub-units of the program upgrading apparatus in the foregoing embodiment have been described in detail in the embodiments of the method, and detailed descriptions will not be given here. In addition, the embodiment of the present case also provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions stored thereon, and when the computer instructions are executed by one or more processors, cause the one or The program upgrade method of the Internet of Things device described in FIG. 1 to FIG. 6 in any one of the embodiments executed by the multiple processors in the above embodiments. In practical applications, the device shown in FIG. 8 may be configured as an Internet of Things device. As shown in FIG. 9, a schematic structural diagram of an Internet of Things device provided in this embodiment of the present application. The device may include: A storage component 901 and a processing component 902; the storage component 901 is used to store one or more computer instructions; the one or more computer instructions are called by the processing component 902; The processing component 902 is used to: During the operation of at least one application, detecting an upgrade trigger message sent by the device management server; responding to the upgrade trigger message, closing at least part of the application based on the resource occupation of the at least one application; from the upgrade server Download the program to be upgraded; run the program to be upgraded to complete the upgrade task of the Internet of Things device; re-run the at least one application program. In this embodiment of the case, by targeting resource-constrained IoT devices, it is possible to detect the upgrade trigger message sent by the device management server during the operation of at least one application program, and respond to the upgrade trigger message based on at least one application program. Occupies resources, close at least part of the application, so that the resources in the IoT device system can perform the upgrade task. After downloading the program to be upgraded from the upgrade server, the program to be upgraded can be run to complete the upgrade task of the IoT device, and then at least one application can be re-run. At this point, the IoT device completes the upgrade task, and reruns at least one application after the upgrade is completed to restore the system of the IoT device to a stable state, which can solve the system failure caused by the upgrade task and the main application running at the same time. Stable technical issues. As an embodiment, the processing component responds to the upgrade trigger message, and based on the resource occupation of the at least one application, shutting down at least part of the application may specifically be: In response to the upgrade trigger message, all applications are closed based on the resource occupation of the at least one application. In some embodiments, the processing component downloading the program to be upgraded from the upgrade server may specifically be: Switch the Internet of Things device to the download mode to download the program to be upgraded from the upgrade server; The processing component runs the program to be upgraded, and before completing the upgrade task of the Internet of Things device, it may also specifically be: When detecting that the download of the program to be upgraded is completed, switch the Internet of Things device to an upgrade mode; The processing component runs the program to be upgraded, and completing the upgrade task of the Internet of Things device may specifically be: When detecting that the Internet of Things device is in the upgrade mode, run the program to be upgraded to complete the upgrade task of the Internet of Things device. As a possible implementation manner, the processing component switches the Internet of Things device to a download mode to download the program to be upgraded from the upgrade server, which may specifically be: Setting the Internet of Things device to download mode and restarting the Internet of Things device to switch the Internet of Things device to the download mode; When it is detected that the upgrade flag is the first flag, the program to be upgraded is downloaded from the upgrade server. In a possible design, when the processing component detects that the upgrade flag is the first flag, downloading the program to be upgraded from the upgrade server may specifically be: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag is the first flag, the program to be upgraded is downloaded from the upgrade server. Further, optionally, when the processing component detects that the upgrade flag is the first flag when the boot program of the Internet of Things device is started, downloading the program to be upgraded from the upgrade server may specifically be: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag bit is the first flag, run the operating system unit of the Internet of Things device; When it is detected that the network connection with the upgrade server is completed, and when it is detected that the Internet of Things device is in the download mode, the program to be upgraded is downloaded from the upgrade server. As yet another possible implementation manner, when the processing component detects that the download of the program to be upgraded is completed, switching the Internet of Things device to the upgrade mode may specifically be: When detecting that the download of the program to be upgraded is completed, clear the download mode and set the upgrade flag bit as the second flag; Restart the Internet of Things device; When detecting that the upgrade flag bit is the second flag, confirm switching to the upgrade mode. In a possible design, when the processing component detects that the upgrade flag bit is the second flag, confirming to switch to the upgrade mode may specifically be: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag is the second flag, it is confirmed to switch to the upgrade mode. Further, optionally, when the processing component detects that the Internet of Things device is in the upgrade mode, it runs the program to be upgraded, and after completing the upgrade task of the Internet of Things device, it may also specifically be: Set the upgrade flag bit as the first flag. In some embodiments, re-running the at least one application by the processing component may specifically be: Restart the Internet of Things device to re-run the at least one application. In a possible design, the processing component restarts the Internet of Things device to re-run the at least one application program may specifically be: Run the restart command to start the boot program; When the detection upgrade flag is the first flag, start the operating system and establish a network connection; When it is detected that it is not in the download mode, the at least one application is started. As another embodiment, the processing component responds to the upgrade trigger message, and based on the resource occupation of the at least one application, shutting down at least part of the application may specifically be: In response to the upgrade trigger message, if the resource occupancy of the at least one application is greater than the corresponding occupancy threshold, close at least part of the application. As another embodiment, the processing component responds to the upgrade trigger message, and based on the resource occupation of the at least one application, shutting down at least part of the application may specifically be: Determine the upgrade type of the upgrade task corresponding to the upgrade trigger message; wherein, the upgrade type includes full upgrade or incremental upgrade; If the upgrade type is a full upgrade, release the resource occupation of the at least one application to close the at least one application; If the upgrade type is an incremental upgrade, determine the target resource that matches the incremental upgrade; according to the resource occupation of the at least one application and the target resource, release at least part of the application's resource occupation, so that The remaining resources in the Internet of Things device meet the requirements of the target resources. As another embodiment, the download of the program to be upgraded from the upgrade server may specifically be: Based on the hyper-file transfer security protocol, download the program to be upgraded from the upgrade server. As another embodiment, before the processing component downloads the program to be upgraded from the upgrade server, it may specifically be: Start the download monitoring task, and use the download monitoring task to monitor the download process of the program to be upgraded. The Internet of Things device described in FIG. 9 can execute the program upgrade method of the Internet of Things device described in the embodiments shown in FIG. 1 to FIG. 6, and its implementation principles and technical effects will not be repeated. The specific manner of operations performed by the processing components of the Internet of Things device in the foregoing embodiment has been described in detail in the embodiment of the method, and will not be elaborated here. As shown in FIG. 10, a schematic structural diagram of an embodiment of a program upgrade apparatus for an Internet of Things device provided in this embodiment of the present application, the apparatus may include: The message detection module 1001 is used to detect the upgrade trigger message sent by the device management server during the running process of at least one application; The condition judgment module 1002 is used to judge whether the resource occupation of the currently running application program meets the upgrade condition; The first processing module 1003 is used to download the program to be upgraded from the upgrade server if it is satisfied; run the program to be upgraded to complete the upgrade task of the Internet of Things device; The second processing module 1004 is configured to return to the step of judging whether the resource occupation of the currently running application program meets the upgrade condition if it is not satisfied, and continue execution. As an embodiment, the condition judgment module may include: The condition judgment unit is used to judge whether the resource occupation of the currently running application meets the upgrade condition based on the preset monitoring frequency. As another embodiment, when the resource occupancy of the currently running application program does not meet the upgrade condition, at least part of the application program may be closed, so that the resource occupancy of the currently running application program meets the upgrade condition, thereby realizing the upgrade. The second processing module may include: The resource processing unit is configured to shut down at least part of the application based on the resource occupation of the currently running application if it is not met; return to the step of judging whether the resource occupation of the currently running application meets the upgrade condition and continue execution. The upgrade can be achieved by closing at least part of the currently running applications so that the resource display of the remaining applications after closing meets the upgrade conditions. The program upgrade apparatus of the Internet of Things device described in FIG. 10 can execute the program upgrade method of the Internet of Things device described in the embodiment shown in FIG. 7, and its implementation principles and technical effects will not be repeated. The specific operations performed by the modules, units, and sub-units of the program upgrading apparatus in the foregoing embodiment have been described in detail in the embodiments of the method, and detailed descriptions will not be given here. In addition, the embodiment of the present case also provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions stored thereon, and when the computer instructions are executed by one or more processors, cause the one or The program upgrade method of the Internet of Things device described in FIG. 7 in any one of the embodiments executed by the multiple processors in the above embodiments. In practical applications, the device shown in FIG. 10 may be configured as an Internet of Things device. As shown in FIG. 11, it is a schematic structural diagram of an Internet of Things device provided in this embodiment of the present application. The device may include: a storage component 1101 and a processing device. Component 1102; the storage component 1101 is used to store one or more computer instructions; the one or more computer instructions are called by the processing component 1102; The processing component 1102 is used to: During the running of at least one application, detect the upgrade trigger message sent by the device management server; determine whether the resource occupation of the currently running application meets the upgrade conditions; if so, download the program to be upgraded from the upgrade server; run the For the program to be upgraded, complete the upgrade task of the Internet of Things device; if it is not satisfied, return to the step of judging whether the resource occupation of the currently running application program meets the upgrade condition and continue execution. As an embodiment, the processing component judging whether the resource occupation of the currently running application program meets the upgrade condition may specifically be: Based on the preset monitoring frequency, it is determined whether the resource occupation of the currently running application meets the upgrade conditions. As an embodiment, if the processing of the processing component is not satisfied, returning to the step of judging whether the resource occupation of the currently running application meets the upgrade condition and continuing to execute may specifically be: If it is not satisfied, based on the resource occupation of the currently running application, close at least part of the application; return to the step of judging whether the resource occupation of the currently running application meets the upgrade condition and continue execution. The Internet of Things device described in FIG. 11 can execute the program upgrade method of the Internet of Things device described in the embodiment shown in FIG. 7, and its implementation principles and technical effects will not be repeated. The specific operation performed by the processing component of the IoT device in the foregoing embodiment has been described in detail in the embodiment of the method, and detailed description will not be given here. For parts that are not described in detail in the embodiment, reference may be made to the related description of the embodiment shown in FIG. For the implementation process and technical effects of this technical solution, please refer to the description in the embodiment shown in FIG. 1 to FIG. 7, and will not be repeated here. The device embodiments described above are merely illustrative, where the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments. Those of ordinary skill in the art can understand and implement without creative work. Through the description of the above implementation manners, those skilled in the art can clearly understand that each implementation manner can be implemented by adding a necessary universal hardware platform, and of course, it can also be implemented through a combination of hardware and programs. Based on this understanding, the above technical solution essentially or the part that contributes to the existing technology can be embodied in the form of a computer product, and the present invention can be used in one or more computer-usable storage media containing computer-usable program codes. (Including but not limited to disk memory, CD-ROM, optical memory, etc.) in the form of computer program products implemented. The present invention is described with reference to flowcharts and/or block diagrams of methods, equipment (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, and the combination of processes and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, dedicated computers, embedded processors, or other programmable data processing equipment to generate a machine that can be executed by the processors of the computer or other programmable data processing equipment A device for realizing the functions specified in one flow or multiple flows in the flowchart and/or one block or multiple blocks in the block diagram is generated. These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured product including the instruction device , The instruction device realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram. These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so that the computer or other programmable equipment The instructions executed above provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram. In a typical configuration, the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. Memory may include non-permanent memory in computer-readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash). RAM). Memory is an example of computer-readable media. Computer-readable media includes permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. 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), and other types of random access memory (RAM) , Read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital multi-function Optical discs (DVD) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves. Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the foregoing embodiments are modified, or some of the technical features thereof are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

101,102,103,104,105:步驟 201,202,203,204,205,206:步驟 301,302,303,304,305,306,307,308,309,310,311:步驟 M1:智慧音箱 M2:設備管理伺服端 M3:伺服端 401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,417:步驟 501,502,503,504,505:步驟 601,602,603,604,605,606,607,608:步驟 701,702,703,704:步驟 801:訊息檢測模組 802:訊息回應模組 803:程式下載模組 804:程式升級模組 805:程式運行模組 901:儲存組件 902:處理組件 1001:訊息檢測模組 1002:條件判斷模組 1003:第一處理模組 1004:第二處理模組 1101:儲存組件 1102:處理組件101, 102, 103, 104, 105: steps 201, 202, 203, 204, 205, 206: steps 301,302,303,304,305,306,307,308,309,310,311: steps M1: Smart speaker M2: Device management server M3: server 401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,417: steps 501,502,503,504,505: steps 601,602,603,604,605,606,607,608: steps 701,702,703,704: steps 801: Message Detection Module 802: Message response module 803: Program download module 804: Program Upgrade Module 805: program running module 901: storage components 902: processing component 1001: Message detection module 1002: Condition judgment module 1003: The first processing module 1004: The second processing module 1101: storage components 1102: processing components

為了更清楚地說明本發明實施例或現有技術中的技術方案,下面將對實施例或現有技術描述中所需要使用的圖式作一簡單地介紹,顯而易見地,下面描述中的圖式是本發明的一些實施例,對於本領域普通技術人員來講,在不付出創造性勞動的前提下,還可以根據這些圖式獲得其他的圖式。 [圖1]為本發明實施例提供的一種物聯網設備的程式升級方法的一個實施例的流程圖; [圖2]為本發明實施例提供的一種物聯網設備的程式升級方法的又一個實施例的流程圖; [圖3]為本發明實施例提供的一種物聯網設備的程式升級方法的又一個實施例的流程圖; [圖4]為本發明實施例提供的一個物聯網設備的升級示例圖; [圖5]為本發明實施例提供的一種物聯網設備的程式升級方法的又一個實施例的流程圖; [圖6]為本發明實施例提供的一種物聯網設備的程式升級方法的又一個實施例的流程圖; [圖7]            為本發明實施例提供的一種物聯網設備的程式升級方法的又一個實施例的流程圖; [圖8]為本發明實施例提供的一種物聯網設備的程式升級裝置的一個實施例的結構示意圖; [圖9]為本發明實施例提供的一種物聯網設備的一個實施例的結構示意圖; [圖10]為本發明實施例提供的一種物聯網設備的程式升級裝置的一個實施例的結構示意圖; [圖11]為本發明實施例提供的一種物聯網設備的一個實施例的結構示意圖。In order to more clearly explain the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are the present For some of the embodiments of the invention, for those of ordinary skill in the art, other schemes can be obtained based on these schemes without creative work. [Fig. 1] is a flowchart of an embodiment of a program upgrade method for an Internet of Things device provided by an embodiment of the present invention; [Figure 2] is a flowchart of another embodiment of a program upgrade method for an Internet of Things device provided by an embodiment of the present invention; [Figure 3] is a flowchart of another embodiment of a program upgrade method for an Internet of Things device provided by an embodiment of the present invention; [Figure 4] is an example diagram of an upgrade of an Internet of Things device provided by an embodiment of the present invention; [Figure 5] is a flowchart of another embodiment of a program upgrade method for an Internet of Things device provided by an embodiment of the present invention; [FIG. 6] is a flowchart of another embodiment of a program upgrade method for an Internet of Things device provided by an embodiment of the present invention; [Figure 7] is a flowchart of another embodiment of a program upgrade method for an Internet of Things device provided by an embodiment of the present invention; [Figure 8] is a schematic structural diagram of an embodiment of a program upgrade apparatus for an Internet of Things device provided by an embodiment of the present invention; [Figure 9] is a schematic structural diagram of an embodiment of an Internet of Things device provided by an embodiment of the present invention; [FIG. 10] is a schematic structural diagram of an embodiment of a program upgrade apparatus for an Internet of Things device provided by an embodiment of the present invention; [Fig. 11] is a schematic structural diagram of an embodiment of an Internet of Things device provided by an embodiment of the present invention.

Claims (22)

一種物聯網設備的程式升級方法,其特徵在於,包括: 在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息; 回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式; 從升級伺服端下載待升級程式; 運行所述待升級程式,完成所述物聯網設備的升級任務; 重新運行所述至少一個應用程式。A program upgrade method for Internet of Things equipment, which is characterized in that it includes: During the operation of at least one application, detect the upgrade trigger message sent by the device management server; In response to the upgrade trigger message, close at least part of the application based on the resource occupation of the at least one application; Download the program to be upgraded from the upgrade server; Run the program to be upgraded to complete the upgrade task of the Internet of Things device; Re-run the at least one application program. 根據請求項1所述的方法,其中,所述回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式包括: 回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉所有應用程式。The method according to claim 1, wherein, in response to the upgrade trigger message, shutting down at least part of the application based on the resource occupation of the at least one application includes: In response to the upgrade trigger message, all applications are closed based on the resource occupation of the at least one application. 根據請求項2所述的方法,其中,所述從升級伺服端下載待升級程式包括: 切換所述物聯網設備至下載模式,以從升級伺服端下載待升級程式; 所述運行所述待升級程式,完成所述物聯網設備的升級任務之前,還包括: 檢測所述待升級程式下載完成時,切換所述物聯網設備至升級模式; 所述運行所述待升級程式,完成所述物聯網設備的升級任務包括: 檢測所述物聯網設備處於升級模式時,運行所述待升級程式,完成所述物聯網設備的升級任務。The method according to claim 2, wherein the downloading the program to be upgraded from the upgrade server includes: Switch the Internet of Things device to the download mode to download the program to be upgraded from the upgrade server; Before the running the program to be upgraded and completing the upgrade task of the Internet of Things device, it further includes: When detecting that the download of the program to be upgraded is completed, switch the Internet of Things device to an upgrade mode; The running the program to be upgraded and completing the upgrade task of the Internet of Things device includes: When detecting that the Internet of Things device is in the upgrade mode, run the program to be upgraded to complete the upgrade task of the Internet of Things device. 根據請求項3所述的方法,其中,所述切換所述物聯網設備至下載模式,以從升級伺服端下載待升級程式包括: 設定所述物聯網設備為下載模式並重啓所述物聯網設備,以切換所述物聯網設備至下載模式; 檢測升級標誌位為第一標誌時,從升級伺服端下載待升級程式。The method according to claim 3, wherein the switching the Internet of Things device to a download mode to download the program to be upgraded from an upgrade server includes: Setting the Internet of Things device to download mode and restarting the Internet of Things device to switch the Internet of Things device to the download mode; When it is detected that the upgrade flag is the first flag, the program to be upgraded is downloaded from the upgrade server. 根據請求項4所述的方法,其中,所述檢測升級標誌位為第一標誌時,從升級伺服端下載待升級程式包括: 在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,從升級伺服端下載待升級程式。The method according to claim 4, wherein, when the detecting that the upgrade flag is the first flag, downloading the program to be upgraded from the upgrade server includes: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag is the first flag, the program to be upgraded is downloaded from the upgrade server. 根據請求項5所述的方法,其中,所述在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,從升級伺服端下載待升級程式包括: 在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第一標誌時,運行所述物聯網設備的操作系統單元; 檢測與所述升級伺服端的網路連接已完成時,檢測所述物聯網設備為下載模式時,從所述升級伺服端下載待升級程式。The method according to claim 5, wherein the detecting that the upgrade flag is the first flag when the boot program of the Internet of Things device is started, downloading the program to be upgraded from the upgrade server includes: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag bit is the first flag, run the operating system unit of the Internet of Things device; When it is detected that the network connection with the upgrade server is completed, and when it is detected that the Internet of Things device is in the download mode, the program to be upgraded is downloaded from the upgrade server. 根據請求項3所述的方法,其中,所述檢測所述待升級程式下載完成時,切換所述物聯網設備至升級模式包括: 檢測所述待升級程式下載完成時,清除所述下載模式並設定升級標誌位為第二標誌; 重啓所述物聯網設備; 檢測所述升級標誌位為第二標誌時,確認切換至升級模式。The method according to claim 3, wherein when detecting that the download of the program to be upgraded is completed, switching the Internet of Things device to an upgrade mode includes: When detecting that the download of the program to be upgraded is completed, clear the download mode and set the upgrade flag bit as the second flag; Restart the Internet of Things device; When detecting that the upgrade flag bit is the second flag, confirm switching to the upgrade mode. 根據請求項7所述的方法,其中,所述檢測所述升級標誌位為第二標誌時,確認切換至升級模式包括: 在所述物聯網設備的引導程式啓動時,檢測所述升級標誌位為第二標誌時,確認切換至升級模式。The method according to claim 7, wherein when the detecting that the upgrade flag bit is the second flag, confirming to switch to the upgrade mode includes: When the boot program of the Internet of Things device is started, when it is detected that the upgrade flag is the second flag, it is confirmed to switch to the upgrade mode. 根據請求項7所述的方法,其中,所述檢測所述物聯網設備處於升級模式時,運行所述待升級程式,完成所述物聯網設備的升級任務之後,還包括: 設定所述升級標誌位為第一標誌。The method according to claim 7, wherein when detecting that the Internet of Things device is in an upgrade mode, running the program to be upgraded, and after completing the upgrade task of the Internet of Things device, the method further includes: Set the upgrade flag bit as the first flag. 根據請求項4所述的方法,其中,所述重新運行所述至少一個應用程式包括: 重啓所述物聯網設備,以重新運行所述至少一個應用程式。The method according to claim 4, wherein the re-running the at least one application includes: Restart the Internet of Things device to re-run the at least one application. 根據請求項10所述的方法,其中,所述重啓所述物聯網設備,以重新運行所述至少一個應用程式包括: 運行重啓指令,啓動引導程式; 檢測升級標誌位為第一標誌時,啓動操作系統並建立網路連接; 檢測未處於下載模式時,啓動所述至少一個應用程式。The method according to claim 10, wherein the restarting the Internet of Things device to re-run the at least one application includes: Run the restart command to start the boot program; When the detection upgrade flag is the first flag, start the operating system and establish a network connection; When it is detected that it is not in the download mode, the at least one application is started. 根據請求項1所述的方法,其中,所述回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式包括: 回應於所述升級觸發訊息,如果所述至少一個應用程式的資源佔用大於相對應的佔用臨限值,關閉至少部分應用程式。The method according to claim 1, wherein, in response to the upgrade trigger message, shutting down at least part of the application based on the resource occupation of the at least one application includes: In response to the upgrade trigger message, if the resource occupancy of the at least one application is greater than the corresponding occupancy threshold, close at least part of the application. 根據請求項1所述的方法,其中,所述回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式包括: 確定與所述升級觸發訊息對應升級任務的升級類型;其中,所述升級類型包括全量升級或增量升級; 如果所述升級類型為全量升級,解除所述至少一個應用程式的資源佔用,以關閉所述至少一個應用程式; 如果所述升級類型為增量升級,確定與所述增量升級相匹配的目標資源;根據所述至少一個應用程式的資源佔用以及所述目標資源,解除至少部分應用程式的資源佔用,以使所述物聯網設備中剩餘資源滿足所述目標資源的需求。The method according to claim 1, wherein, in response to the upgrade trigger message, shutting down at least part of the application based on the resource occupation of the at least one application includes: Determine the upgrade type of the upgrade task corresponding to the upgrade trigger message; wherein, the upgrade type includes full upgrade or incremental upgrade; If the upgrade type is a full upgrade, release the resource occupation of the at least one application to close the at least one application; If the upgrade type is an incremental upgrade, determine the target resource that matches the incremental upgrade; according to the resource occupation of the at least one application and the target resource, release at least part of the application's resource occupation, so that The remaining resources in the Internet of Things device meet the requirements of the target resources. 根據請求項1所述的方法,其中,所述從升級伺服端下載待升級程式包括: 基於超文件傳輸安全協定,從升級伺服端下載待升級程式。The method according to claim 1, wherein the downloading the program to be upgraded from the upgrade server includes: Based on the hyper-file transfer security protocol, download the program to be upgraded from the upgrade server. 根據請求項1所述的方法,其中,所述從升級伺服端下載待升級程式之前,還包括: 啓動下載監控任務,利用所述下載監控任務監控所述待升級程式的下載過程。The method according to claim 1, wherein, before downloading the program to be upgraded from the upgrade server, the method further includes: Start the download monitoring task, and use the download monitoring task to monitor the download process of the program to be upgraded. 一種物聯網設備的程式升級方法,其特徵在於,包括: 在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息; 判斷當前運行的應用程式的資源佔用是否滿足升級條件; 如果滿足,從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務; 如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。A program upgrade method for Internet of Things equipment, which is characterized in that it includes: During the operation of at least one application, detect the upgrade trigger message sent by the device management server; Determine whether the resource occupancy of the currently running application meets the upgrade conditions; If it is satisfied, download the program to be upgraded from the upgrade server; run the program to be upgraded to complete the upgrade task of the Internet of Things device; If it is not satisfied, return to the step of judging whether the resource occupation of the currently running application meets the upgrade condition and continue to execute. 根據請求項16所述的方法,其中,所述判斷當前運行的應用程式的資源佔用是否滿足升級條件包括: 基於預設監控頻率,判斷當前運行的應用程式的資源佔用是否滿足升級條件。The method according to claim 16, wherein the determining whether the resource occupation of the currently running application program satisfies the upgrade condition includes: Based on the preset monitoring frequency, it is determined whether the resource occupation of the currently running application meets the upgrade conditions. 根據請求項16所述的方法,其中,所述如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行包括: 如果不滿足,基於當前運行的應用程式的資源佔用,關閉至少部分應用程式;返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。The method according to claim 16, wherein, if it is not met, returning to the step of judging whether the resource occupation of the currently running application meets the upgrade condition and continuing to execute includes: If it is not satisfied, based on the resource occupation of the currently running application, close at least part of the application; return to the step of judging whether the resource occupation of the currently running application meets the upgrade condition and continue execution. 一種物聯網設備的程式升級裝置,其特徵在於,包括: 訊息檢測模組,用於在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息; 訊息回應模組,用於回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式; 程式下載模組,用於從升級伺服端下載待升級程式; 程式升級模組,用於運行所述待升級程式,完成所述物聯網設備的升級任務; 程式運行模組,用於重新運行所述至少一個應用程式。A program upgrade device for Internet of Things equipment, which is characterized in that it includes: The message detection module is used to detect the upgrade trigger message sent by the device management server during the running process of at least one application; The message response module is used to respond to the upgrade trigger message and close at least part of the application based on the resource occupation of the at least one application; Program download module, used to download the program to be upgraded from the upgrade server; The program upgrade module is used to run the program to be upgraded and complete the upgrade task of the Internet of Things device; The program running module is used to re-run the at least one application program. 一種物聯網設備的程式升級裝置,其特徵在於,包括: 訊息檢測模組,用於在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息; 條件判斷模組,用於判斷當前運行的應用程式的資源佔用是否滿足升級條件; 第一處理模組,用於如果滿足,從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務; 第二處理模組,用於如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。A program upgrade device for Internet of Things equipment, which is characterized in that it includes: The message detection module is used to detect the upgrade trigger message sent by the device management server during the running process of at least one application; The condition judgment module is used to judge whether the resource occupation of the currently running application meets the upgrade conditions; The first processing module is used to download the program to be upgraded from the upgrade server if it is satisfied; run the program to be upgraded to complete the upgrade task of the Internet of Things device; The second processing module is used to return to the step of judging whether the resource occupation of the currently running application meets the upgrade condition if it is not met and continue execution. 一種物聯網設備,其特徵在於,包括:儲存組件與處理組件;所述儲存組件用於儲存一條或多條電腦指令;所述一條或多條電腦指令被所述處理組件調用; 所述處理組件用於: 在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息;回應於所述升級觸發訊息,基於所述至少一個應用程式的資源佔用,關閉至少部分應用程式;從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務;重新運行所述至少一個應用程式。An Internet of Things device, characterized by comprising: a storage component and a processing component; the storage component is used to store one or more computer instructions; the one or more computer instructions are called by the processing component; The processing component is used for: During the operation of at least one application, detecting an upgrade trigger message sent by the device management server; responding to the upgrade trigger message, closing at least part of the application based on the resource occupation of the at least one application; from the upgrade server Download the program to be upgraded; run the program to be upgraded to complete the upgrade task of the Internet of Things device; re-run the at least one application program. 一種物聯網設備,其特徵在於,包括:儲存組件與處理組件;所述儲存組件用於儲存一條或多條電腦指令;所述一條或多條電腦指令被所述處理組件調用; 所述處理組件用於: 在至少一個應用程式的運行過程中,檢測設備管理伺服端發送的升級觸發訊息;判斷當前運行的應用程式的資源佔用是否滿足升級條件;如果滿足,從升級伺服端下載待升級程式;運行所述待升級程式,完成所述物聯網設備的升級任務;如果不滿足,返回至所述判斷當前運行的應用程式的資源佔用是否滿足升級條件的步驟繼續執行。An Internet of Things device, characterized by comprising: a storage component and a processing component; the storage component is used to store one or more computer instructions; the one or more computer instructions are called by the processing component; The processing component is used for: During the running of at least one application, detect the upgrade trigger message sent by the device management server; determine whether the resource occupation of the currently running application meets the upgrade conditions; if so, download the program to be upgraded from the upgrade server; run the For the program to be upgraded, complete the upgrade task of the Internet of Things device; if it is not satisfied, return to the step of judging whether the resource occupation of the currently running application program meets the upgrade condition and continue execution.
TW109118082A 2019-09-27 2020-05-29 Program upgrade method and apparatus for internet of things device, and internet of things device TW202113587A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910926491.5 2019-09-27
CN201910926491.5A CN112579114A (en) 2019-09-27 2019-09-27 Program upgrading method and device for Internet of things equipment and Internet of things equipment

Publications (1)

Publication Number Publication Date
TW202113587A true TW202113587A (en) 2021-04-01

Family

ID=75110054

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109118082A TW202113587A (en) 2019-09-27 2020-05-29 Program upgrade method and apparatus for internet of things device, and internet of things device

Country Status (3)

Country Link
CN (1) CN112579114A (en)
TW (1) TW202113587A (en)
WO (1) WO2021057880A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113242288B (en) * 2021-05-06 2022-03-08 国家计算机网络与信息安全管理中心 Internet of things equipment firmware upgrading method, system and device and storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100589078C (en) * 2007-08-21 2010-02-10 中兴通讯股份有限公司 Multi-core terminal firmware upgrading method
CN103530146B (en) * 2013-09-16 2016-09-07 成都交大光芒科技股份有限公司 Low-power-consumption embedded equipment remote radio upgrade method
CN104239111B (en) * 2014-09-30 2017-11-07 北京金山安全软件有限公司 Application program upgrading method and device and terminal
CN105721941B (en) * 2016-01-18 2019-08-13 贵阳海信电子有限公司 The aerial downloading upgrade control method and device of cloud TV
CN106101835A (en) * 2016-07-05 2016-11-09 青岛海信电器股份有限公司 Intelligent television upgrade control method and device
CN106325929B (en) * 2016-08-22 2020-02-07 合肥美的智能科技有限公司 Firmware upgrading method, firmware upgrading device, refrigerator and server
CN107992318A (en) * 2017-12-07 2018-05-04 北京趣拿软件科技有限公司 Application program updating method, apparatus, storage medium and processor
CN109445809A (en) * 2018-08-29 2019-03-08 交控科技股份有限公司 Train automatic monitoring ATS subsystem software automatically updating method and system
CN109766109B (en) * 2018-12-17 2022-04-15 浙江创意声光电科技有限公司 Client updating method, device and system of lighting controller
CN110086885A (en) * 2019-05-10 2019-08-02 上海擎感智能科技有限公司 The upgrade package method for down loading and device of space download technology, storage medium and terminal
CN110221856B (en) * 2019-06-25 2024-03-19 努比亚技术有限公司 Wearable device upgrading method, wearable device and storage medium

Also Published As

Publication number Publication date
WO2021057880A1 (en) 2021-04-01
CN112579114A (en) 2021-03-30

Similar Documents

Publication Publication Date Title
US11146620B2 (en) Systems and methods for instantiating services on top of services
US8997090B2 (en) Installing an operating system in a host system
US10474451B2 (en) Containerized upgrade in operating system level virtualization
US10891122B2 (en) Rolling upgrade of a distributed application
WO2016177260A1 (en) Libvirt software hot upgrading method and device
TWI587219B (en) Persistent and resilient worker processes
WO2015196967A1 (en) Method and apparatus for application to permanently reside in background of operating system
WO2021129733A1 (en) Cloud operating system management method and apparatus, server, management system, and medium
KR20170022028A (en) Method and apparatus for security checking of image for container
US11176244B2 (en) Cloud application detection method and cloud application detection apparatus
US10212034B1 (en) Automated network change management
CN111552489B (en) User mode file system hot upgrading method, device, server and medium
US10404568B2 (en) Agent manager for distributed transaction monitoring system
US8893114B1 (en) Systems and methods for executing a software package from within random access memory
CN104636159B (en) The method and apparatus that software in virtual machine is upgraded
WO2021057880A1 (en) Program upgrade method and apparatus for internet of things device, and internet of things device
US11520648B2 (en) Firmware emulated watchdog timer controlled using native CPU operations
US10394619B2 (en) Signature-based service manager with dependency checking
JP7422705B2 (en) METHODS, SYSTEMS AND COMPUTER-READABLE MEDIA
JP2010170285A (en) Service provider node, program for providing service, and software updating method
US20240004687A1 (en) Systems, methods, and apparatus for state convergence associated with high availability application migration in a virtualized environment
CN113687915B (en) Container running method, device, equipment and storage medium
TW201327139A (en) Method for processing node replacement and server system using the same
WO2021003729A1 (en) Configuration method, physical device, server and computer readable storage medium
US20240134671A1 (en) Cluster management plugin with support for multiple clusters and cluster managers