Rapid configuration and remote upgrading method and system for intelligent equipment

By generating a unique wireless network and internal web server, the configuration process of LoRa gateway devices is simplified, and multi-layer heterogeneous network resource allocation and deep reinforcement learning are used to optimize network connections. This solves the problems of complex configuration and difficult upgrades of existing LoRa gateway devices, and realizes efficient and secure remote upgrades.

CN120675877AInactive Publication Date: 2025-09-19SHENZHEN ELECROW LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510862601.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-09-19
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The configuration process of existing LoRa gateway devices is cumbersome and complex, requiring high levels of professional technical personnel to operate. Once the devices are deployed, software updates and maintenance are difficult, and there is a lack of automated and intelligent remote upgrade mechanisms, resulting in high equipment maintenance costs.

Method used

This method provides a fast configuration and remote upgrade method for smart devices. By monitoring the device's configuration button to enter configuration mode, a unique wireless network is generated, an internal web server is launched, and configuration is performed via a mobile terminal connected to the wireless network. Furthermore, it utilizes multi-layer heterogeneous network resource allocation and deep reinforcement learning to optimize network connectivity, while enabling version query and firmware upgrades via an OTA server.

Benefits of technology

It significantly reduces the threshold and time cost of equipment configuration and maintenance, improves the safety and success rate of equipment upgrades, realizes efficient and reliable remote upgrades, and reduces the complexity and cost of equipment maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120675877A_ABST
    Figure CN120675877A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent equipment, and discloses a rapid configuration and remote upgrading method and system for intelligent equipment, and the method comprises the steps: monitoring an equipment configuration key, enabling the equipment to enter a configuration mode, generating a wireless network with a unique identifier, and starting an internal Web server and a receiving timeout timer; connecting the wireless network through a mobile terminal, accessing the internal Web server configuration interface and acquiring configuration information; executing a network connection test based on the configuration information to obtain a verification result; performing multi-layer heterogeneous network resource allocation and deep reinforcement learning on a service function chain based on the verification result to obtain target network connection; and sending a version query request to an OTA server through the target network connection to obtain firmware data passing verification, and writing the firmware data passing verification into a target flash memory area to obtain an upgraded system. According to the invention, the security and success rate of equipment upgrading are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart devices, and in particular to a method and system for rapid configuration and remote upgrading of smart devices. Background Art

[0002] With the rapid development of IoT technology, smart devices such as LoRa gateways, serving as key hubs connecting a large number of low-power devices to the cloud, are increasingly being used in smart cities, smart industry, and smart agriculture. However, the configuration process for existing LoRa gateways is often cumbersome and complex, requiring specialized technicians to operate through command lines or complex user interfaces. This not only increases deployment costs but also limits widespread adoption. On-site configuration is particularly challenging for devices located in remote areas or complex environments.

[0003] At the same time, once smart devices are deployed, software updates and maintenance present significant challenges. Traditional upgrade methods often require manual intervention and lack automated and intelligent remote upgrade mechanisms. This leads to high device maintenance costs, delayed firmware security vulnerability fixes, and slow feature iteration. Especially in scenarios with a large number of widely distributed devices, achieving efficient and reliable remote upgrades becomes a key challenge in IoT device management. Summary of the Invention

[0004] The present invention provides a method and system for rapid configuration and remote upgrading of intelligent devices, which improves the security and success rate of device upgrading.

[0005] In a first aspect, the present invention provides a method for rapid configuration and remote upgrade of a smart device, the method comprising: The monitoring device configuration button puts the device into configuration mode, generates a wireless network with a unique identifier, and starts the internal web server and the receive timeout timer; Connecting to the wireless network via a mobile terminal, accessing the internal Web server configuration interface and obtaining configuration information; Performing a network connection test based on the configuration information to obtain a verification result; Based on the verification results, multi-layer heterogeneous network resource allocation and deep reinforcement learning are performed on the service function chain to obtain the target network connection; A version query request is sent to the OTA server through the target network connection to obtain the verified firmware data, and the verified firmware data is written into the target flash memory area to obtain the upgraded system.

[0006] In a second aspect, the present invention provides a system for rapid configuration and remote upgrade of smart devices, the system comprising: A monitoring module is used to monitor the device configuration button to enable the device to enter the configuration mode, generate a wireless network with a unique identifier, and start the internal web server and the receiving timeout timer; An access module, configured to connect to the wireless network via a mobile terminal, access the internal Web server configuration interface, and obtain configuration information; A testing module, configured to perform a network connection test based on the configuration information to obtain a verification result; A reinforcement learning module, configured to perform multi-layer heterogeneous network resource allocation and deep reinforcement learning on the service function chain based on the verification results to obtain a target network connection; The writing module is used to send a version query request to the OTA server through the target network connection, obtain the verified firmware data, and write the verified firmware data into the target flash memory area to obtain the upgraded system.

[0007] In the technical solution provided by this invention, a long press of a physical button on the device triggers configuration mode, automatically creating a uniquely identified wireless network and launching a web server, achieving a simple "one-click configuration" experience. Users can complete gateway configuration using common mobile devices without specialized knowledge, significantly reducing the configuration threshold and time cost, making device deployment simple and intuitive. This invention innovatively introduces an integrated network architecture, constructing a reconfigurable time-expansion graph to dynamically monitor the status of network resources at each layer. This multi-dimensional resource modeling approach enables the system to select the optimal communication path based on real-time network conditions, effectively addressing network fluctuations and resource imbalances, and improving data transmission reliability and network resource utilization. A deep reinforcement learning algorithm is used to dynamically schedule the service function chain, automatically learning the mapping between network environment characteristics and resource allocation strategies through a feedforward neural network model. A two-tier decision-making mechanism, combining a Markov decision process and a linear programming algorithm, enables task priority assessment and intelligent resource allocation, ensuring that high-priority tasks (such as critical firmware upgrades) receive priority resources while maximizing the overall system task completion rate. This invention designs a complete OTA remote upgrade process, including automatic version checking, block-by-block firmware downloading, multi-layered security verification, and a reliable firmware installation mechanism. Especially in the firmware security verification link, through multiple security measures such as MD5 hash value verification, hardware compatibility check, digital signature verification, etc., it effectively prevents data corruption during malicious firmware installation or upgrade, and significantly improves the security and success rate of device upgrades. By creating a system recovery point before the upgrade, implementing firmware write page-by-page verification and overall integrity check mechanisms, even if a power failure or data error occurs during the upgrade process, the system can quickly roll back to a stable state, avoiding the risk of the device not being able to work normally due to upgrade failure, and improving the fault tolerance of device maintenance and system stability. The resource allocation scheme of the present invention can dynamically adjust resource allocation according to network load changes and task priorities. Resource competition evaluation is achieved through technologies such as Bayesian optimization. While ensuring that key tasks are completed first, the load between edge nodes and core nodes is reasonably distributed to avoid resource waste and congestion, thereby achieving global optimization of system resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0009] Figure 1 A schematic diagram of the steps of a method for rapid configuration and remote upgrade of a smart device according to an embodiment of the present invention; Figure 2Schematic diagram of the structure of the rapid configuration and remote upgrade system of the intelligent device in an embodiment of the present invention. DETAILED DESCRIPTION

[0010] Embodiments of the present invention provide a method and system for rapid configuration and remote upgrading of smart devices. The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way are interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or are inherent to these processes, methods, products or devices.

[0011] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 An embodiment of a method for rapid configuration and remote upgrade of a smart device in an embodiment of the present invention includes: Step S1: Press the configuration button of the monitoring device to put the device into configuration mode, generate a wireless network with a unique identifier, and start the internal web server and the receiving timeout timer at the same time; It is understandable that the execution subject of the present invention can be a rapid configuration and remote upgrade system for smart devices, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking the server as the execution subject as an example.

[0012] Specifically, the device configuration button is pressed continuously. By detecting the physical buttons of the device, once it is recognized that the user performs a continuous pressing operation, that is, a long press for a certain period of time, the embedded control program of the device triggers the configuration mode switching command and sends a specific configuration mode activation signal to the system to indicate that the device enters the configuration mode state. During this process, the device uses hardware logic to determine the stability of the button to ensure that the signal is not mistakenly triggered due to false touch or short-term fluctuations, thereby avoiding unexpected mode switching. When the configuration mode activation signal is successfully generated, the device executes a series of status visualization feedback measures, such as controlling the device's LED indicator light so that the user can intuitively confirm that the device has successfully entered the configuration mode. At the same time, the device generates a wireless network with a unique identifier so that the user can connect through the mobile terminal and perform subsequent parameter configuration. To ensure wireless network uniqueness, the device extracts a unique identifier from its hardware—for example, the device's MAC address, factory serial number, or unique device ID stored in EEPROM. This unique identifier is combined with a pre-set network name template to create a unique wireless network name. This effectively prevents wireless network name conflicts when similar devices in the same environment simultaneously enter configuration mode, ensuring that users can accurately identify and connect to the target device. The wireless communication module's access point (AP) mode is activated. The device's wireless module operates in client mode (STA mode) by default. After entering configuration mode, it dynamically switches to AP mode, broadcasting its signal as an independent wireless hotspot. This allows users to directly connect to the wireless network via mobile devices such as mobile phones, tablets, or PCs. The device's embedded control program invokes the underlying wireless driver to enable AP mode and configure the appropriate SSID (wireless network name) and default wireless security protocol to ensure a stable and secure wireless connection. During this process, the device also launches an internal web server, which provides a web-based configuration interface for users. Users access this interface through a browser and enter configuration information such as the WiFi name, password, and network mode. The web server is implemented using a lightweight HTTP server, such as uHTTPd on an embedded Linux system or a lightweight web server on an RTOS, to ensure efficient device operation despite limited resources. To enhance system stability, a timeout timer is initiated when the device enters configuration mode. This timer prevents the device from being left unattended for extended periods in configuration mode, which could lead to resource usage or security risks. The timer begins counting after the device enters configuration mode. If no valid user interaction is detected within the preset timeout period, such as failure to access the web server for configuration or complete the network connection test, the device automatically exits configuration mode and returns to its default operating mode.

[0013] Step S2: Connect to the wireless network through the mobile terminal, access the internal Web server configuration interface and obtain configuration information; Specifically, the user uses the mobile terminal's wireless network scanning function to search for available Wi-Fi signals nearby. The search results identify wireless networks with unique identifiers. This unique identifier is generated by the device's hardware identification code, such as a MAC address or serial number. This ensures accurate identification and selection of the target device's wireless network when multiple devices simultaneously enter configuration mode. Once the mobile terminal identifies the target network, the user selects it for connection and completes the connection using the device's wireless access point mode, establishing a basic wireless communication link between the device and the mobile terminal. After establishing the wireless network connection, the mobile terminal requests an IP address from the device. The device's internal DHCP (Dynamic Host Configuration Protocol) service assigns the mobile terminal an available IP address and provides default gateway information, enabling communication between the mobile terminal and the device through this gateway. After obtaining the IP address, a TCP / IP communication link is formally established between the mobile terminal and the device, establishing a data transmission channel and ensuring smooth subsequent configuration information exchange. The device's internal web server is now in a listening state, awaiting access requests from the mobile terminal. When the user enters the device's default gateway address in the mobile terminal's web browser, or the device's internal web server enables the automatic redirect function, the mobile terminal's browser automatically redirects to the device's web configuration interface. The user can then see the web interface for configuring network parameters and set the device's parameters accordingly. After entering the web configuration page, the user selects the target communication method in the global parameter area. The device supports communication methods including WiFi, Ethernet, LoRa, and cellular networks (4G / 5G). Therefore, the user selects the appropriate communication mode based on the actual application scenario and makes the corresponding settings on the interface. After the target communication method is determined, the user configures the target area parameters, such as setting country or region parameters for the device that are suitable for the current environment to meet the wireless communication regulations in different regions. At the same time, a specific network mode, such as DHCP mode or static IP mode, is set to accommodate different network access requirements. After configuring global parameters, the user enters the corresponding connection parameters in the gateway parameter area. For example, if WiFi mode is selected, enter the SSID (wireless network name) and password; if cellular network mode is selected, enter the APN (access point name) and related authentication information; and if LoRa mode is selected, set key communication parameters such as the LoRa frequency band and spreading factor. In this way, the corresponding parameters for different communication modes are correctly entered to ensure that the device can successfully connect to the target network. The global network parameters and the target interface parameters are integrated to form the network configuration data. The global parameters and the target interface parameters are checked for compatibility to ensure that the selected communication mode and the entered network parameters match and are usable.The device's embedded control program performs logical checks on the configuration data. For example, if the user selects Wi-Fi mode but leaves the SSID or password blank, an error message will appear, prompting the user to complete the parameters to prevent configuration failures caused by incomplete parameters. Once all parameters meet the requirements, the complete configuration information is stored in internal memory, such as Flash memory or EEPROM. This ensures that the device retains the configured network parameters even after a reboot and can connect to the target network according to the user-configured parameters.

[0014] Step S3: Perform a network connection test based on the configuration information to obtain a verification result; Specifically, each field in the configuration information is checked and analyzed to ensure its integrity and validity. The device's embedded control program checks that all required fields in the configuration information are correctly filled, including key information such as the IP address, subnet mask, and WiFi password. This analysis ensures the structural integrity of the configuration information. For example, it checks to see if all required network parameters are provided. If any are missing, a prompt is automatically generated, prompting the user to provide the relevant information. Regular expression matching is performed on fields such as the IP address, subnet mask, and WiFi password length based on preset formatting rules to ensure that these fields conform to standard formats. For example, the IP address must conform to IPv4 format, the subnet mask must use standard network mask format, and the WiFi password length must fall within the system's set minimum and maximum values ​​to ensure password security. These format verifications effectively eliminate incorrectly formatted or invalid characters, preventing subsequent connection issues caused by incorrect formatting. After completing the integrity and validity checks, the device performs a logical AND operation based on the results of these checks to comprehensively determine whether the configuration information meets the requirements. If the configuration information passes the integrity check and all fields are formatted correctly, the device marks it as passed and prepares for the next network connection. If the check fails, the device displays an error message through the user interface and asks the user to correct the problem and resubmit the configuration information. At this point, the verification flag is marked as passed, and the device initiates the next network connection process. Based on the verification flag being passed, the device activates the corresponding hardware interface based on the user's selected network access method and maintains AP mode, ensuring that the device maintains wireless access point functionality after the connection test completes. This allows the device to simultaneously support mobile terminal connections while performing network testing, allowing users to readily review configuration and test results. Once the hardware interface is successfully activated and maintains AP mode, the device executes the target network connection process using the connection parameters in the configuration information. Based on the WiFi, Ethernet, or other communication method settings in the configuration information, the device activates the corresponding network interface and attempts to establish a connection to the target network. The device connects wirelessly or wired based on the network parameters entered, including sending a connection request to the specified WiFi network or router, or connecting to the target carrier's base station via a cellular network. The device continuously checks the stability of the target network link based on its established connection. Once a stable connection is established, the device proceeds to the next phase of network testing. Once the connection is established, the device sends data packets to a pre-set test server via the target network link to verify actual network performance. These packets are used to test key performance indicators such as network latency, packet loss rate, and throughput. Network latency reflects the time delay in data transmission from the device to the server, while packet loss rate indicates the number of packets lost during data transmission.Meanwhile, throughput indicates the amount of data successfully transmitted per unit time. Higher throughput indicates a stronger network's transmission capacity. To prevent inaccurate test results due to network fluctuations or occasional errors, the device implements a three-retry mechanism during testing. Whenever packet loss or timeouts occur, the device automatically retries up to three times to ensure accurate and reliable network performance data. After several rounds of verification and retries, the device generates a verification result, including specific values ​​for latency, packet loss rate, and throughput, and records these results.

[0015] Step S4: Based on the verification results, perform multi-layer heterogeneous network resource allocation and deep reinforcement learning on the service function chain to obtain the target network connection; Specifically, a hierarchical network environment is mapped to construct an initial network environment model, reflecting the relationships between different network resource layers, such as wireless access networks (such as WiFi and LoRa), core networks, and transport networks. Based on this initial network environment model, a reconfigurable time-scaled graph is constructed, in which periodic sampling points are set for the network resource status at each layer. By regularly monitoring and recording these sampling points, a dynamic resource mapping table is generated, reflecting the network resource usage status in real time, enabling devices to assess resource load and status changes at different network layers in real time. Based on the current network environment and configuration requirements, the device decomposes tasks into several specific task items. Each task item represents a functional requirement of the device, such as bandwidth or latency requirements for network connections. A priority score is assigned to each task item. After priority quantification, a task request set is generated, containing all pending task items. Based on this, each task item in the task request set is decomposed into a specific service function chain structure. Each service function chain structure represents the network resource path required by the task, including its associated resource requirements and processing nodes, thereby constructing a specific service structure tailored to the network environment. A deep reinforcement learning model is constructed based on a feedforward neural network. This model makes optimization decisions based on the current state of network resources and allocates appropriate network resources to each task. In this deep reinforcement learning model, the input layer maps the current state of network resources, such as bandwidth, latency, network topology, etc., and the output layer represents the resource allocation strategy that the device should adopt, determining which tasks receive resource allocation at which network levels. In order to train the neural network model, the device uses a gradient descent algorithm to continuously adjust the parameters of the network so that it learns the optimal resource allocation strategy and forms a trained decision model. The trained decision model is applied to the two-layer decision mechanism. The first layer uses a Markov decision process to select the optimal communication path, ensuring data transmission within the network with the lowest latency and highest throughput. This Markov decision process selects the optimal path based on the current network environment, thereby reducing network congestion and improving overall communication efficiency. The second layer utilizes a linear programming algorithm to allocate processing resources to each functional node, ensuring that each node in the network can handle the corresponding task within the available resources. This two-tiered decision mechanism comprehensively considers network resource usage and task requirements to provide the optimal resource allocation plan for each task. Based on this comprehensive resource allocation plan, an end-to-end virtual service channel is established on the selected optimal network layer. This service channel provides a secure, stable, and efficient transmission path for data flows between each functional node, ensuring that tasks are completed as expected. To optimize network performance, the device configures network protocol conversion parameters to ensure smooth data conversion between different network layers and sets data flow priority tags, ensuring that high-priority packets are transmitted first within the network, thereby effectively utilizing network resources and maximizing system performance. Through these steps, an efficient and stable target network connection is ultimately achieved.

[0016] Step S5: Send a version query request to the OTA server through the target network connection to obtain the verified firmware data, and write the verified firmware data into the target flash memory area to obtain the upgraded system.

[0017] Specifically, the working state of the LED indicator light is controlled on the device side, so that it switches from the normal working state to the yellow flashing mode to provide a clear visual status prompt, so that the user can judge that the device is currently in the process of firmware upgrade. This operation is achieved by controlling the LED drive circuit through GPIO. After entering the upgrade mode, the system immediately calls the relevant control logic to change the flashing state of the LED and maintains this state until the upgrade process is completed. After completing the status indication switch, the device sends a version query request to the OTA server to obtain the latest firmware version information. In order to ensure that the server can correctly identify the firmware status of the current device, the version query request contains multiple key information fields, including device type identification, current firmware version number, hardware version information and device unique identification code. When the version query request is sent to the server, the server returns a version response data packet, which is encapsulated in JSON format to ensure data readability and parsing efficiency. After receiving the server's response, the device parses the JSON format data to extract the firmware version information and compares it with the current firmware version to obtain the version difference judgment result. If the version difference check indicates that the device's firmware is already the latest version, the upgrade process is terminated and the device returns to normal operation, with the LED indicator switching back to normal operation. If the check indicates that the device's firmware version is behind the latest version provided by the server, the firmware download process begins to obtain the new version. To improve download efficiency and ensure transmission stability, the device uses a block-by-block download method to obtain firmware data. Block-by-block downloading effectively prevents download failures caused by network fluctuations and improves data transmission reliability. To optimize device storage utilization, the block size is dynamically adjusted based on the device's available memory, ensuring smooth download completion even with limited memory resources. The device also implements breakpoint-resume downloading. If the download is interrupted due to a network anomaly or a device reboot, the system records the current download progress and resumes downloading the remaining blocks from the interrupted point when the network connection is restored. This avoids re-downloading completed blocks, improves download efficiency, and reduces network traffic consumption. Once all blocks are downloaded and successfully reassembled, the device receives a complete firmware data package. During the security verification phase, the device performs multi-level security verification on the complete firmware data packet to ensure data integrity and security. Integrity verification uses a hash check method, such as calculating the SHA-256 hash value of the firmware data packet and comparing it with the hash value provided by the server. If the calculation results are consistent, it means that the data has not been tampered with and the integrity verification passes. Security verification includes digital signature verification to ensure that the source of the firmware is trustworthy. The device uses a preset public key to verify the firmware signature. If the signature verification is successful, it means that the source of the firmware data is trustworthy. Otherwise, the device will refuse to upgrade to prevent potential malicious attacks.After completing integrity and security verification, the device performs a logical judgment based on the verification results. If the verification passes, the firmware data is marked as valid and prepared to be written to the target flash memory area. Otherwise, the device discards the data packet and requests the firmware download again to ensure the security of the upgrade process. After all verifications pass, the device initiates the firmware write process and writes the verified firmware data to the target flash memory area. The device uses an A / B partition upgrade mechanism to ensure that if a failure occurs during the upgrade process, it can still roll back to the old version, preventing the device from being unavailable due to upgrade failure. After the write is complete, the device performs a firmware check to confirm that the data was written successfully, and loads the new firmware when the system restarts to complete the entire upgrade process. A complete backup of the current system's key components and user configuration data is performed. During the upgrade process, the device needs to prevent system data loss due to upgrade failures. Therefore, a system restore point is created, which packages all key system parameters, network configurations, user data, and other information and writes them to the device's secure partition. This secure partition will not be affected by the firmware upgrade. Even if the device upgrade fails or an exception occurs, the restore point data can be used to restore the device to its pre-upgrade stable state. After the backup is complete, the device enters the upgrade preparation phase and controls the LED indicator light based on the upgrade status information, causing it to enter a red rapid flashing mode to provide the user with an intuitive upgrade status indication. At the same time, the device proactively stops all services related to data interaction, including data collection services and network forwarding services. This operation aims to reduce unnecessary resource usage during the system upgrade process and ensure that the device is in a stable state during the firmware write operation, thereby avoiding resource conflicts or write failures caused by multiple tasks running in parallel. After the system resource optimization is completed, the device performs an erase operation on the target flash memory area, using a standard erase command to completely clear the contents of the target partition to ensure that the new firmware data is correctly written in an undisturbed environment. Flash erase is a standard instruction executed by the underlying storage controller, such as performing a block-level erase operation on NOR or NANDFlash memory to ensure that the data is not affected by residual data. After the erase operation is completed, a blank partition to be written is obtained, ensuring that the firmware write can proceed smoothly. The device writes the verified firmware data to the blank partition in sequence according to the page programming method, writing one storage page at a time, and immediately performs a read operation after each page of data is written, comparing it with the original data to verify whether the data is written accurately. This page-by-page verification mechanism effectively detects and prevents potential errors in the data writing process, such as write failures, data corruption, etc., ensuring the reliability of the entire firmware writing process. After all firmware data is written to the target flash memory area, the device performs a CRC32 checksum calculation on the entire firmware to verify data integrity. CRC32 is an efficient checksum algorithm that quickly detects errors during data transmission or storage. Therefore, the device calculates the CRC32 value of the new firmware data and compares it with the original firmware checksum. If the two match, the firmware data is intact and uncorrupted. Otherwise, the device retrys the write or rolls back to the original system to prevent boot failure due to firmware corruption. If the overall firmware integrity verification passes, the device enters the bootloader modification phase, modifying the boot parameters in the bootloader configuration file to point to the partition containing the new firmware to ensure that the new firmware is correctly loaded on the next boot. The device then performs an orderly shutdown of system components and saves the current operating state to ensure normal system functionality upon reboot. After all critical states have been saved, the device triggers an automatic reboot, loads the new firmware, and enters the upgraded system.After the device successfully completes the upgrade and starts successfully, it sends an upgrade status report to the OTA server. The report will contain the device's unique ID, the version number of the new firmware, and information on whether the upgrade is successful. After receiving this information, the OTA server records the list of devices that have successfully upgraded and avoids repeatedly pushing the same version of firmware in future upgrade management. At the same time, the device upgrade results are used for diagnosis and maintenance. If the upgrade fails, the server provides remote diagnostic support based on the information fed back by the device.

[0018] In a specific embodiment, the process of executing step S1 may specifically include the following steps: Continuously press the device configuration button to trigger the configuration mode switching command and obtain the configuration mode activation signal; According to the configuration mode activation signal, the LED indicator light is controlled to flash blue to obtain a visual indication of the device status, and a unique identification code is extracted from the device hardware identifier to obtain a unique network name; The access point function of the wireless communication module is activated to obtain a wireless network with a unique identifier, and the internal Web server and the receiving timeout timer are started at the same time.

[0019] Specifically, implement the key detection logic in the firmware of the embedded system. Set a timer At fixed time intervals Scan the button status, assuming the current moment is If the device detects a button press signal Keep going for a while , that is, the following conditions are met: in, is the button state function, Indicates that the key is pressed. Indicates that the key is not pressed. When it is detected that the key is pressed continuously for a certain period of time After that, the device triggers the configuration mode switching command and sets the system variable Mark the device to enter configuration mode: The device generates a configuration mode activation signal. After the configuration mode is activated, the device provides a visual indication to the user so that the user can intuitively perceive the device status. The device controls the LED indicator to enter a blue flashing mode and set the LED flashing cycle. , where the LED lighting time is , the extinguishing time is , satisfying the following relationship: The device controls the LED output voltage through PWM : in, The device flashes blue at a set frequency to provide visual feedback to the user. When the device enters configuration mode, it generates a unique wireless network name so that users can identify the device and connect to it. To ensure the uniqueness of the network name, a unique identification code is extracted from the hardware information. , which is identified by the device's MAC address or serial number generate: Among them, Hash is a hash function, Represents the splicing operation. The wireless network name finally generated by the device for: in, is a fixed prefix, such as "ThinkNode-G1-". Each device has a unique wireless network name. Identify the device. After generating a unique network name, the device starts the access point (AP) function of the wireless communication module, enabling it to broadcast externally. The device initializes the AP mode of the wireless chip and sets the parameters of the AP mode, including the channel. , transmit power and safe mode : in, is the default channel, is the maximum transmit power supported by the device, When AP mode is started, the device automatically broadcasts , so that users can find the network in the WiFi list. At the same time, the device starts the internal web server so that users can access the device configuration page through the browser. The web server runs on a fixed IP address After connecting to the device AP, the user enters the Access the device's configuration interface. To prevent the device from being in configuration mode for a long time and affecting normal use, the system will start a timeout timer. , set the timeout If the device is If the user configuration is not completed within 1 second, the system will automatically exit the configuration mode, resume normal operation, and shut down the AP mode and Web server.

[0020] In a specific embodiment, the process of executing step S2 may specifically include the following steps: Performing a wireless network scanning operation on the mobile terminal, identifying and selecting a wireless network with a unique identifier, and obtaining a network connection; Obtain IP address allocation from the device DHCP service through network connection, establish TCP / IP communication link, and obtain data transmission channel; Use the web browser of the mobile terminal to access the default gateway address, or wait for it to automatically jump to the web server configuration interface to obtain the configuration page; Select the target communication method in the Global Parameters area of ​​the configuration page, set the target area parameters, obtain the global network parameters, and fill in the corresponding connection parameters in the Gateway Parameters area according to the target communication method to obtain the target interface parameters; The global network parameters and target interface parameters are integrated to obtain configuration information.

[0021] Specifically, the mobile terminal enables the wireless network card module and executes the network scanning command. Set the scanning time interval of the mobile terminal to , the scanning cycle is , then at time In the mobile terminal's wireless scanning function Expressed as: in, is the number of scans, Represents a list of network names obtained during each scan. Devices matching a specific prefix in the scan results Combined unique identifier Network name ,Right now: in, By the device's MAC address and serial number Calculated by hash function: If the match is successful, the mobile terminal selects the network to connect, performs the network authentication process, and attempts to obtain an IP address. After successfully connecting to the wireless network, the mobile terminal obtains an IP address from the device's DHCP server to establish a TCP / IP communication link. Set the mobile terminal's DHCP request packet size to , the response time of the DHCP server is , then the time to establish a network connection is expressed as: in, The DHCP server is based on the MAC address of the mobile terminal. Assign an IP address to it , subnet mask , default gateway , the TCP / IP configuration of the device is expressed as: After the IP address is assigned, the mobile terminal accesses the device's Web server through the TCP / IP protocol. The user accesses the device's default gateway address through the mobile terminal's Web browser , the device's Web server will listen to HTTP requests and automatically jump to the configuration page. Set the Web server port number to , the HTTP request format is , the response delay of the Web server Expressed as: in, The calculation time for the server to process the HTTP request. After the browser receives the response, it loads the configuration interface and the user sets the device parameters. In the global parameter area of ​​the configuration page, the user selects the target communication method, such as WiFi, Ethernet, or cellular network. Set the communication method selection variable to , the target area parameters are , then the global network parameters Depend on: in, Represents the communication protocol selected by the user, Represents regional settings, such as WiFi channels or cellular network frequency bands. Depending on the selected communication method, the user fills in specific connection parameters in the gateway parameter area. For example, in WiFi mode, you need to enter the SSID and password , you need to enter the IP address in wired mode and Gateway , you need to enter APN in cellular mode and certification information . Set the target interface parameters to ,but: The specific parameters depend on the communication method selected by the user. and target interface parameters Integrate to generate complete configuration information : The device will Perform format verification and store it in the system configuration file to complete the network setup process.

[0022] In a specific embodiment, the process of executing step S3 may specifically include the following steps: Check and analyze the required fields in the configuration information to obtain integrity verification results, and perform regular expression matching on the IP address format, mask format, and WiFi password length based on preset format rules to obtain legitimacy verification results; Based on the logical AND operation of the integrity check result and the legality check result, it is determined whether the configuration information has passed the verification and the verification flag is obtained; Based on the verification flag being in the passed state, the corresponding hardware interface is started according to the network access method and the AP mode is kept running synchronously to obtain the coexistence state of the dual network interfaces; Using the connection parameters in the configuration information, execute the target network connection process to obtain the target network link; Send data packets to the preset test server through the target network link, record the network delay, packet loss rate and throughput, implement a three-time retry mechanism to prevent occasional errors, and obtain verification results.

[0023] Specifically, define the configuration information structure and perform integrity check on each field. Set the configuration information to , which contains the IP address , subnet mask , Gateway Address 、WiFi SSID and WiFi password , then the integrity check function Expressed as: in, Represents a logical AND operation. If all required fields are not empty, the integrity check result is 1, otherwise it is 0. After the integrity check is completed, the device verifies the legitimacy of the IP address, subnet mask, and WiFi password format. Set the legitimacy verification function The IP address must conform to the standard IPv4 format. , the subnet mask needs to conform to the standard network mask format MASK , the WiFi password length must meet ,but: If the IP address, subnet mask and WiFi password format all meet the preset rules, the validity check result is 1, otherwise it is 0. The device is based on the integrity check result and validity verification results Perform logical AND operation to determine whether the configuration information has passed the verification and obtain the verification flag bit : when , it indicates that the configuration information verification has passed and the device enters the next step of the network access process. Otherwise, it returns an error message and requires the user to re-enter the configuration information. If the connection is successful, the device starts the corresponding hardware interface according to the network access method and keeps the AP mode running synchronously to achieve the coexistence of dual network interfaces. , wireless interface status If the device selects Ethernet connection: If the device selects WiFi connection, then: At the same time, set the AP mode to keep running and set the AP mode status ,but: The device enters the dual network interface coexistence state, where: Indicates that at least one network interface is in working state and AP mode is always on. After the network interface is successfully started, the device uses the connection parameters in the configuration information to perform the target network connection process to establish the target network link. Set the target network connection function , when the device is connected successfully: otherwise: Equipment detection If the connection fails, try again up to three times, otherwise proceed to the next test process. After successfully establishing the target network link, the device sends data packets to the preset test server and records the network delay, packet loss rate and throughput. Set the data packet size to , the data transmission time is , then the network delay Expressed as: Packet loss rate Expressed as: in, is the number of packets lost. Throughput The calculation is as follows: To prevent occasional errors, the device will perform a three-time retry mechanism, setting the number of retries. , each test result The record is as follows: The device calculates the average of the three tests to obtain the final verification result: Equipment according to The network quality is judged. If it meets the preset threshold, the network verification is passed. Otherwise, the network configuration process is re-executed.

[0024] In a specific embodiment, the process of executing step S4 may specifically include the following steps: Perform hierarchical structure mapping on the network environment to obtain an initial network environment model, and build a reconfigurable time expansion graph based on the initial network environment model. Periodically sample the network resource status of each layer to obtain a dynamic resource mapping table. Decompose equipment requirements into specific task items, quantify and score each task item's priority, obtain a task request set, and perform decomposition operations on each task item in the task request set to build a service function chain structure; A deep reinforcement learning model is constructed based on a feedforward neural network. The input layer maps the current network resource status, and the output layer represents the resource allocation strategy. The gradient descent algorithm is used to train the network parameters to obtain a trained decision model. The trained decision model is applied to a two-tier decision-making mechanism, which includes a Markov decision process to select the optimal communication path and a linear programming algorithm to allocate processing resources to each functional node to obtain a comprehensive resource allocation plan. According to the comprehensive resource allocation plan, an end-to-end virtual service channel is established on the selected optimal network layer, network protocol conversion parameters and data flow priority marking are configured, and the target network connection is obtained.

[0025] Specifically, define the hierarchical structure of the network environment. Set the network environment to include Different layers, each layer represents a different communication protocol or data transmission method, such as WiFi, cellular network and Ethernet. Set the resource status of each layer to , each Bandwidth included , delay and packet loss rate , then the network environment status Expressed as: To construct a time-expansion graph, define time slices , where the length of each time slice is , and in The resource status is sampled on each time slice to form a time expansion graph : in, Representative The network status within a time slice. Through periodic sampling, a dynamic resource mapping table is constructed. , record the network resource situation that changes over time. Decompose the equipment requirements into specific task items and quantify the priority of each task item to form a task request set. Set the equipment to have tasks, each task Requires specific bandwidth , computing power and latency requirements , then the task demand vector Defined as: The priority of each task By the importance of the task and timeliness Decide: in, and is the weight factor. Task request set Contains all tasks: Decompose each task and transform it into a service function chain structure , where each task Decomposed into multiple sub-functions : in, For the task To optimize resource allocation, a deep reinforcement learning model is constructed based on a feedforward neural network, where the input layer maps the current state of network resources. , the output layer represents the resource allocation strategy , then the mapping relationship of the neural network is expressed as: in, is the network parameter, and the training goal is to optimize it through the gradient descent algorithm , so that the decision model can maximize the utilization of network resources. Set the loss function : Update the parameters using the gradient descent algorithm: in, is the learning rate. After training is completed, the decision model is obtained , used for actual resource allocation. The trained decision model is applied to a two-layer decision mechanism, where the first layer selects the optimal communication path based on the Markov decision process and defines the state transition probability : Select the best path: The second level of decision making is based on linear programming, which allocates processing resources to each functional node and defines the optimization goal: in, Represents the task allocation variable, subject to resource constraints: Solve the linear programming equation to obtain a comprehensive resource allocation plan .according to , establish an end-to-end virtual service channel on the selected optimal network layer , and configure network protocol conversion parameters and data flow priority marking , get the final target network connection.

[0026] Among them, a deep reinforcement learning model is constructed based on a feedforward neural network, the input layer maps the current network resource status, the output layer represents the resource allocation strategy, and the gradient descent algorithm is used to train the network parameters to obtain a trained decision model, including: optimizing the deep reinforcement learning model with a memristor neuromorphic architecture, integrating a memristor with an internal multi-segment state function into the model, setting the initial number of segments to 8, and obtaining a memristor-enhanced neural network structure; constructing a discrete-time memristor dual-neuron Hopfield neural network (DMT-HNN) layer based on the memristor-enhanced neural network structure, setting the memristor scaling factor α=0.05, and obtaining a network resource status feature extraction module; inputting the dynamic resource mapping table data into the network resource status feature extraction module, generating a multi-band hyperchaotic attractor through multi-stage memristor synaptic weight adjustment, and obtaining a high-dimensional feature map of the network environment; discretely sampling the high-dimensional feature map of the network environment, setting the sampling interval to 50ms, and sampling The data was constructed into a three-dimensional feature tensor of 64×32×16 to obtain a compressed state representation; data normalization was performed based on the compressed state representation, the normalization interval was set to [-1,1], and the Min-Max scaling algorithm was used to convert the numerical range to obtain standardized input features; the standardized input features were input into a value function evaluator consisting of a 4-layer fully connected network, with 256, 128, 64 and 32 nodes in each layer, and the LeakyReLU activation function was used to obtain action value predictions; the action value predictions were exploratory perturbations using pseudo-random noise generated by DMT-HNN, and the exploration rate ε was set to an initial value of 0.3 and gradually decreased at a decay rate of 0.995 to obtain a decision sequence that balanced exploration and utilization; the decision sequence was paired with the actual network performance feedback data to construct an experience replay buffer, and a data subset with a batch size of 64 was randomly sampled. The network parameters were updated through temporal difference learning with a learning rate set to 0.001 to obtain a trained decision model.

[0027] In this embodiment, the trained decision model is applied to a two-tier decision mechanism. The two-tier decision mechanism includes a Markov decision process to select the optimal communication path, and a linear programming algorithm to allocate processing resources to each functional node to obtain a comprehensive resource allocation plan, including: constructing a state space for the dynamic resource mapping table, defining a state set, an action set and a transition probability matrix P, establishing a state transfer function, and obtaining a state representation of the Markov decision process; constructing an immediate reward function, assigning a first weight to the communication delay indicator, a second weight to the bandwidth capacity, and a third weight to the connection reliability, and comprehensively calculating the reward value of each state-action pair to obtain a reward matrix; based on the reward matrix and the state transfer function, a value iteration algorithm is used to calculate the Bellman equation to obtain a state value function; performing a strategy extraction operation according to the state value function to obtain the optimal Communication path selection strategy; quantify the resource requirements of each functional node in the service function chain structure, establish a three-dimensional resource vector, and estimate the load change trend through a neural network prediction model to obtain a dynamic resource demand matrix; based on the dynamic resource demand matrix, construct a linear programming model to obtain a mathematical expression of the resource optimization problem; use the improved two-stage simplex method to solve the resource optimization problem, first execute the initial feasible solution construction phase, introduce artificial variables through the M method, and then execute the optimization phase, use the Bland rule to avoid loops, and obtain the optimal resource allocation vector for each functional node; integrate the optimal communication path selection strategy with the optimal resource allocation vector, construct a resource-path joint allocation table, adjust the resource ratio of edge nodes and core nodes, and set the resource preemption threshold to handle the priority of sudden tasks, and obtain a comprehensive resource allocation plan.

[0028] In a specific embodiment, the process of executing step S5 may specifically include the following steps: Switch the device LED indicator control parameters to change the working status indication mode to yellow flashing mode to obtain a visual status prompt of the upgrade process; Construct a version query request based on the device type identifier, current firmware version number, hardware version information, and device unique identification code, obtain a server version response, and parse the server version response in JSON format to obtain a version difference judgment result; When the version difference judgment result indicates that an upgrade is required, the firmware data is obtained by block downloading. The data block size is dynamically adjusted according to the available memory of the device and the breakpoint resume function is implemented to obtain a complete firmware data package. Perform multi-level security verification on the complete firmware data package to obtain integrity and security verification results; Perform logical judgment based on the integrity and security verification results, and output the verified firmware data if the verification passes; The verified firmware data is written into the target flash memory area to obtain the upgraded system.

[0029] Specifically, adjust the control parameters of the LED indicator so that its working state changes to yellow flashing mode. Set the LED flashing cycle to , where the lighting time is , the extinguishing time is , then: The device controls the LED voltage through PWM signal , its function form is: in, The rated driving voltage of the LED. At this time, the device LED enters the yellow flashing mode, and the user intuitively perceives that the device has entered the upgrade state. After entering the upgrade mode, the device sends a firmware version query request to the server to determine whether a firmware upgrade is required. Set the device type identifier , current firmware version number , hardware version information And the device's unique identification code , then construct a query request : The request is encapsulated in JSON format and sent to the server, and the server returns a version response in JSON format , which contains the latest firmware version of the server , the device parses the JSON response, extracts the version information, and calculates the version difference: if , indicating that the server has a new version of firmware and the device needs to perform an upgrade. Otherwise, it will directly exit the upgrade mode and resume normal operation. When the version difference calculation result indicates that an upgrade is required, the device enters the firmware download phase and uses a block download method to obtain the firmware data. Set the total firmware size to , the device's available memory is , then the size of each data block is Depend on: The device requests the server to send data in batches, and the amount of data downloaded each time is , and use the breakpoint resume function to set the download progress variable : in, The number of blocks. If the download is interrupted, the device records and continue from Position download to ensure data integrity and finally obtain complete firmware data package After the download is complete, the device performs multi-level security verification on the complete firmware data package, performs integrity verification, and calculates the hash value of the firmware data. : and the hash value provided by the server To compare: Otherwise, the device needs to re-download the firmware data. Then perform security verification, use the digital signature algorithm to verify the legitimacy of the firmware, and set the firmware signature and the device's built-in public key , verify that the signatures match: If the verification fails, it means that the firmware data is at risk of being tampered with and the device will refuse to upgrade. When both integrity and security verifications are passed, the device enters the firmware writing phase. Erase the target flash area and set the target flash partition. , then the erase operation is expressed as: Then use page programming to write the firmware data, writing one storage page at a time , read and compare data immediately after writing: If the comparison is consistent, continue writing to the next page, otherwise rewrite until all data is written. After writing is completed, the device performs the final firmware integrity verification and calculates the CRC32 check value of the written data. : and the checksum provided by the server To compare: Otherwise, the device needs to erase the flash memory and rewrite the firmware data. When the firmware write verification passes, the device modifies the boot program configuration file and sets the startup parameters. Point to the new firmware partition : And trigger the device to restart, so that the device enters the upgraded system. After the upgrade is completed, the device sends a result report to the server , which contains the device ID , new firmware version and upgrade status : The server receives and records the upgrade status. At this point, the entire firmware upgrade process is completed.

[0030] In a specific embodiment, the step of writing the verified firmware data into the target flash memory area to obtain the upgraded system may specifically include the following steps: Perform a complete backup of the current system's key parts and user configuration data, write the backup data to the device's secure partition, and obtain system recovery point data; According to the upgrade status information, the LED indicator is controlled to execute the red fast flashing mode, and the data collection service and network forwarding service are stopped at the same time to obtain the system resource optimization status; Perform an erase operation on the target flash memory area and use a standard erase command to clear the contents of the target partition to obtain a blank partition to be written; Write the verified firmware data into the blank partition to be written according to the page programming method. After each page is written, read it immediately and compare it with the original data to obtain the page-by-page verification result; Perform CRC32 checksum calculation on the written firmware to obtain the overall firmware integrity verification result; If the overall firmware integrity verification result is passed, the startup parameters in the bootloader configuration file are modified to point to the new firmware partition, an orderly shutdown of system components and state preservation are performed, the device is triggered to restart, the upgraded system is obtained, and a result report containing the device ID, new firmware version number, and upgrade status information is sent to the OTA server.

[0031] Specifically, perform a complete backup of the current system's key parts and user configuration data so that the system can be restored in the event of an upgrade failure. Set the system's key data sets as , the user configuration data set is , then the complete backup data Depend on: To ensure the security of backup data, the device stores it in a separate secure partition , and calculate the data integrity check value : Will Write to the secure partition: Write and then calculate Hash ,if , indicating that the backup is successful, otherwise it needs to be rewritten until the backup data is complete. After the backup is completed, the system enters the upgrade mode. In order to provide an intuitive status indication, the device controls the LED indicator to enter the red fast flashing mode. Set the LED flashing cycle to , where the lighting time is , the extinguishing time is ,satisfy: The device controls the LED voltage via PWM : in, The rated driving voltage of the LED. In order to optimize system resources, the device suspends data acquisition service and network forwarding services : Ensure that there is no additional data transmission interference during the upgrade process. After the resource optimization is completed, the device performs an erase operation on the target flash memory area to clear the original firmware data and provide a blank partition for the new firmware to write. Set the target flash memory partition to , Erase command The effects are as follows: At this point, all data in the partition is cleared, and the device gets a blank partition to be written. The device writes the verified firmware data to the target partition in accordance with the page programming method, and sets the firmware data , each write storage page size is , total number of pages is , the write operation is as follows: After writing, the device immediately reads and compares: Otherwise, rewrite it to ensure that the page-by-page verification passes. When all pages are written, the device performs integrity verification of the entire firmware and calculates the CRC32 check value of the new firmware data. : and the checksum provided by the server To compare: If the verification fails, the device will re-erase the flash memory and re-write the firmware data until the verification passes. After the firmware integrity verification passes, the device enters the boot program modification phase and sets the startup parameters. Point to the new firmware partition: The device performs an orderly shutdown of system components, ensuring that all processes exit safely and saving the current system state. Set system state variables : After completion, the device triggers a reboot, allowing the device to load the new firmware and enter the upgraded system. After the device successfully boots up, the device sends an upgrade result report to the server and sets the device ID , new firmware version and upgrade status : After receiving the report, the server records the device information of the successful upgrade. At this point, the entire firmware upgrade process is completed.

[0032] The above describes the method for rapid configuration and remote upgrade of smart devices in the embodiment of the present invention. The following describes the system for rapid configuration and remote upgrade of smart devices in the embodiment of the present invention. Figure 2 In one embodiment of the present invention, a system for rapid configuration and remote upgrade of smart devices includes: A monitoring module is used to monitor the device configuration button to enable the device to enter the configuration mode, generate a wireless network with a unique identifier, and start the internal web server and the receiving timeout timer; Access module, used to connect to the wireless network through a mobile terminal, access the internal Web server configuration interface and obtain configuration information; A test module is used to perform network connection tests based on configuration information and obtain verification results; The reinforcement learning module is used to perform multi-layer heterogeneous network resource allocation and deep reinforcement learning on the service function chain based on the verification results to obtain the target network connection; The write module is used to send a version query request to the OTA server through the target network connection, obtain the verified firmware data, and write the verified firmware data into the target flash memory area to obtain the upgraded system.

[0033] Through the collaborative efforts of the various components described above, a deep reinforcement learning algorithm is employed to dynamically schedule the service function chain, and a feedforward neural network model is used to automatically learn the mapping relationship between network environment characteristics and resource allocation strategies. A two-tier decision-making mechanism, combining a Markov decision process with a linear programming algorithm, enables task priority assessment and intelligent resource allocation, ensuring that high-priority tasks (such as critical firmware upgrades) receive priority resources while maximizing the system's overall task completion rate. The resource allocation scheme of the present invention is capable of dynamically adjusting resource allocation based on changes in network load and task priority. Resource competition assessment is achieved through techniques such as Bayesian optimization, ensuring that critical tasks are completed first while rationally allocating the load between edge nodes and core nodes, avoiding resource waste and congestion, and achieving global optimization of system resource utilization.

[0034] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0035] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0036] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for rapid configuration and remote upgrade of intelligent devices, characterized in that: The method comprises: The monitoring device configuration button puts the device into configuration mode, generates a wireless network with a unique identifier, and starts the internal web server and the receive timeout timer; Connecting to the wireless network via a mobile terminal, accessing the internal Web server configuration interface and obtaining configuration information; Performing a network connection test based on the configuration information to obtain a verification result; Based on the verification results, multi-layer heterogeneous network resource allocation and deep reinforcement learning are performed on the service function chain to obtain the target network connection; A version query request is sent to the OTA server through the target network connection to obtain the verified firmware data, and the verified firmware data is written into the target flash memory area to obtain the upgraded system.

2. The method for rapid configuration and remote upgrade of smart devices according to claim 1, characterized in that: The monitoring device configuration button causes the device to enter configuration mode, generate a wireless network with a unique identifier, and simultaneously start an internal web server and a receive timeout timer, including: Continuously press the device configuration button to trigger the configuration mode switching command and obtain the configuration mode activation signal; According to the configuration mode activation signal, the LED indicator light is controlled to flash blue to obtain a visual indication of the device status, and a unique identification code is extracted from the device hardware identifier to obtain a unique network name; The access point function of the wireless communication module is activated to obtain a wireless network with a unique identifier, and the internal Web server and the receiving timeout timer are started at the same time.

3. The method for rapid configuration and remote upgrade of smart devices according to claim 1, characterized in that: The step of connecting to the wireless network through a mobile terminal, accessing the internal Web server configuration interface and obtaining configuration information includes: Performing a wireless network scanning operation on the mobile terminal to identify and select the wireless network with the unique identifier to obtain a network connection; Obtaining an IP address from the device's DHCP service via the network connection, establishing a TCP / IP communication link, and obtaining a data transmission channel; Use the web browser of the mobile terminal to access the default gateway address, or wait for automatic jump to the web server configuration interface to obtain the configuration page; Select the target communication mode in the global parameter area of ​​the configuration page, set the target area parameters, obtain the global network parameters, and fill in the corresponding connection parameters in the gateway parameter area according to the target communication mode to obtain the target interface parameters; The global network parameters and the target interface parameters are integrated to obtain configuration information.

4. The method for rapid configuration and remote upgrade of smart devices according to claim 3, characterized in that: The performing of a network connection test based on the configuration information to obtain a verification result includes: Check and analyze the required fields in the configuration information to obtain an integrity check result, and perform regular expression matching on the IP address format, mask format, and WiFi password length based on preset format rules to obtain a legitimacy check result; Determine whether the configuration information passes verification based on a logical AND operation of the integrity check result and the legality check result, and obtain a verification flag; Based on the verification flag being in a passed state, starting the corresponding hardware interface according to the network access method and maintaining the AP mode synchronous operation to obtain a dual network interface coexistence state; Utilizing the connection parameters in the configuration information, executing a target network connection process to obtain a target network link; The data packet is sent to the preset test server through the target network link, the network delay, packet loss rate and throughput are recorded, and a three-time retry mechanism is executed to prevent occasional errors to obtain the verification result.

5. The method for rapid configuration and remote upgrade of smart devices according to claim 1, characterized in that: The performing multi-layer heterogeneous network resource allocation and deep reinforcement learning on the service function chain based on the verification result to obtain the target network connection includes: Performing hierarchical structure mapping on the network environment to obtain an initial network environment model, constructing a reconfigurable time extension graph based on the initial network environment model, periodically sampling the network resource status of each layer to obtain a dynamic resource mapping table; Decompose the equipment requirements into specific task items, perform quantitative priority scoring on each task item to obtain a task request set, and perform decomposition operations on each task item in the task request set to build a service function chain structure; A deep reinforcement learning model is constructed based on a feedforward neural network. The input layer maps the current network resource status, and the output layer represents the resource allocation strategy. The gradient descent algorithm is used to train the network parameters to obtain a trained decision model. Applying the trained decision model to a two-tier decision mechanism, wherein the two-tier decision mechanism includes selecting an optimal communication path using a Markov decision process and allocating processing resources to each functional node using a linear programming algorithm to obtain a comprehensive resource allocation plan; An end-to-end virtual service channel is established on the selected optimal network layer according to the comprehensive resource allocation scheme, network protocol conversion parameters and data flow priority markings are configured, and a target network connection is obtained.

6. The method for rapid configuration and remote upgrade of a smart device according to claim 1, characterized in that: The method includes sending a version query request to the OTA server through the target network connection, obtaining verified firmware data, and writing the verified firmware data into the target flash memory area to obtain an upgraded system, including: Switch the device LED indicator control parameters to change the working status indication mode to yellow flashing mode to obtain a visual status prompt of the upgrade process; Construct a version query request based on the device type identifier, current firmware version number, hardware version information, and device unique identification code, obtain a server version response, and parse the server version response in JSON format to obtain a version difference judgment result; When the version difference judgment result indicates that an upgrade is required, the firmware data is obtained by downloading in blocks, the data block size is dynamically adjusted according to the available memory of the device, and the breakpoint resume function is implemented to obtain a complete firmware data package; Performing multi-level security verification on the complete firmware data packet to obtain integrity and security verification results; Performing logical judgment based on the integrity and security verification results, and outputting the verified firmware data if the verification passes; The verified firmware data is written into the target flash memory area to obtain an upgraded system.

7. The method for rapid configuration and remote upgrade of a smart device according to claim 6, characterized in that: Writing the verified firmware data into a target flash memory area to obtain an upgraded system includes: Perform a complete backup of the current system's key parts and user configuration data, write the backup data to the device's secure partition, and obtain system recovery point data; According to the upgrade status information, the LED indicator is controlled to execute the red fast flashing mode, and the data collection service and network forwarding service are stopped at the same time to obtain the system resource optimization status; Perform an erase operation on the target flash memory area and use a standard erase command to clear the contents of the target partition to obtain a blank partition to be written; Writing the verified firmware data into the blank partition to be written in a page programming manner, and immediately reading and comparing each page after writing it with the original data to obtain a page-by-page verification result; Perform CRC32 checksum calculation on the written firmware to obtain the overall firmware integrity verification result; If the overall firmware integrity verification result is passed, the startup parameters in the boot loader configuration file are modified to point to the new firmware partition, the system components are shut down in an orderly manner and the status is saved, the device is triggered to restart, the upgraded system is obtained, and a result report containing the device ID, new firmware version number and upgrade status information is sent to the OTA server.

8. A rapid configuration and remote upgrade system for smart devices, characterized in that: A method for rapidly configuring and remotely upgrading an intelligent device according to any one of claims 1 to 7, wherein the system comprises: A monitoring module is used to monitor the device configuration button to enable the device to enter the configuration mode, generate a wireless network with a unique identifier, and start the internal web server and the receiving timeout timer; An access module, configured to connect to the wireless network via a mobile terminal, access the internal Web server configuration interface, and obtain configuration information; A testing module, configured to perform a network connection test based on the configuration information to obtain a verification result; A reinforcement learning module, configured to perform multi-layer heterogeneous network resource allocation and deep reinforcement learning on the service function chain based on the verification results to obtain a target network connection; The writing module is used to send a version query request to the OTA server through the target network connection, obtain the verified firmware data, and write the verified firmware data into the target flash memory area to obtain the upgraded system.

Citation Information

Cited By

  • Firmware upgrading method of substrate management controller and electronic equipment

    CN120950103A

  • Firmware upgrade method and electronic device for board management controller

    CN120950103B