Matter equipment network distribution method and device, storage medium and product
By dividing multiple partitions in the Matter device and using specific flag bits, data recovery after the Matter device's network allocation failed or timed out is achieved, solving the problem that the device cannot automatically restore the last network allocation data, and improving the user experience.
Patent Information
- Application Number
- CN202411704970.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-14
AI Technical Summary
After the existing Matter device fails or timeouts, it cannot automatically restore the data from the last distribution network, causing the device to be offline and affecting the user experience.
By dividing multiple partitions in the flash Flash of the Matter device, including the Matter data area, the Matter backup area and the normal data area, the Matter pairing success flag bit and the start distribution flag bit are used to achieve data backup and recovery.
When the Matter device redistributes the network, the data from the last distribution network can be automatically restored, quickly connected, and improved the user experience.
Smart Images

Figure CN119621426A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the technical field of Matter protocol, and in particular to a Matter device network configuration method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] The Matter protocol is a standard IoT connection solution jointly promoted by the CSA Alliance, Google, Amazon, and Apple. It aims to achieve compatibility among all IoT devices and control all devices with one set of protocols.
[0003] In the existing technology, Matter distribution network is based on the local network, using the properties of the basic network layer to achieve local connection and stable and fast response between devices, which is not affected by Internet connection. Of course, devices can also be easily connected to cloud services through these IP network protocols.
[0004] Matter device configuration is the process of adding a device to Fabric. The Matter protocol has a Fabric function. Fabric is a collection of Matter devices that form a virtual network. Matter devices obtain a node operation certificate when joining the virtual network. This certificate is based on the same root certificate. The matter protocol has a fabric function (corresponding to "fabric" in Chinese), which is explained as follows: a group of devices under the same network share the same security domain, allowing secure communication between nodes. This group of devices is called fabric. Fabric can be compared to a network. Each matter device is a node on this network. Each node has a unique node identifier nodeid under fabric, so if you want to use matter devices, you first need to create a fabric.
[0005] The maximum time for Matter network configuration is only 15 minutes. When Matter network configuration times out or you manually exit the network configuration, the device is in a state where it can only be controlled by hardware. If you want to re-configure the device, you can only let the device re-enter the Matter network configuration and configure it successfully.
[0006] Currently, the Matter standard specifies the steps that devices should take before joining a new network, including clearing data. Compliance with these standards ensures interoperability of devices across different vendors and ecosystems. Therefore, when Matter reconfigures the network, it is necessary to clear Matter's data and restart the device before allowing the device to enter the Matter configuration state. This means that when Matter reconfigures the network, the data from the last configuration cannot be restored after the configuration fails and the device remains offline. Summary of the invention
[0007] The purpose of the embodiments of the present disclosure is to provide a Matter device network configuration method, apparatus, electronic device, computer-readable storage medium, and computer program product, so as to solve the aforementioned problems existing in the prior art.
[0008] In order to achieve the above objectives, the technical solutions adopted by the embodiments of the present disclosure are as follows:
[0009] A first aspect of an embodiment of the present disclosure provides a Matter device network configuration method, which is applied to repeated network configuration of a matter device. The method includes:
[0010] Divide the flash memory of the Matter device into multiple partitions, including: Matter data area, Matter backup area and general data area; wherein the general data area includes: Matter pairing success flag and Matter start network configuration flag;
[0011] In response to the network configuration request, the Matter pairing success flag is read from the flash memory;
[0012] Whether the network configuration has been successful is determined according to the Matter pairing success flag. If the Matter pairing success flag is 1, the data in the Matter data area is copied to the Matter backup area, and the device Matter network configuration start flag is set to 2 and written into the flash memory Flash; wherein the Matter data area stores network configuration data, the Matter pairing success flag is 1, indicating that the Matter pairing has been successful, and the data needs to be backed up to enter the network configuration in order to restore the data after failure, and the Matter network configuration start flag is 2, indicating that the Matter network configuration is actively entered;
[0013] Clear all Matter data areas, and restart the Matter device to enter the network configuration;
[0014] If pairing is unsuccessful, determine whether Matter pairing has been successful. If Matter pairing has been successful, restore the last network configuration data from the Matter backup area and restart the device Matter.
[0015] Exemplarily, the unsuccessful pairing includes: pairing timeout or network configuration failure or network configuration exit;
[0016] The method further includes: if the device is restarted, determining whether the Matter pairing has been successful, and if the Matter pairing success flag is 1, restoring the data in the Matter backup area to the Matter data area, and going back online.
[0017] Exemplarily, judging whether the network configuration has been successful according to the Matter pairing success flag bit further includes:
[0018] If the Matter pairing success flag is 0, the device Matter network configuration start flag is directly written to the flash memory as 2, wherein the Matter pairing success flag is 0, indicating that Matter has never been paired successfully, and no data copying is required to enter the network configuration;
[0019] Clear all Matter data areas, and restart the Matter device to enter the network configuration;
[0020] If the network pairing is unsuccessful, determine whether the Matter pairing has been successful. If not, connect to the production test wifi;
[0021] If the device restarts, determine whether the Matter pairing was successful. If not, reopen the Bluetooth pairing.
[0022] Exemplarily, restarting a Matter device to enter a distribution network includes:
[0023] Determine the Matter network configuration start flag. If the Matter network configuration start flag is 1, determine whether the network configuration has been successful. If successful, copy the Matter backup area data into the data area and set the Matter network configuration start flag to 0.
[0024] If the Matter start network configuration flag is 2, set the flag to 1 and enter the Matter Bluetooth network configuration state.
[0025] Exemplarily, restoring data from the Matter backup area includes:
[0026] Copy the Matter backup area to the Matter data area, and clear the Matter backup area after the copy is successful;
[0027] After restoring the data in the Matter data area, set the Matter network configuration start flag to 0 to ensure that the next startup will not trigger data recovery. The Matter network configuration start flag is 0, which means that the network configuration will not be entered and the startup will be normal.
[0028] Exemplarily, if Matter pairing is successful, after Matter pairing is completed, the method further includes: clearing the Matter backup area, and setting the Matter pairing success flag position to 1 and the Matter start network configuration flag position to 0.
[0029] A second aspect of the embodiments of the present disclosure provides a Matter device network configuration device, which is applied to repeated network configuration of a Matter device, and the device includes:
[0030] A partition module is used to divide the Matter device flash memory into multiple partitions, including: Matter data area, Matter backup area and general data area; wherein the general data area includes: Matter pairing success flag and Matter start network configuration flag;
[0031] A reading module, used for reading a Matter pairing success flag from the flash memory in response to a network configuration request;
[0032] The judgment module is used to judge whether the network configuration has been successful according to the Matter pairing success flag. If the Matter pairing success flag is 1, the data in the Matter data area is copied to the Matter backup area, and the device Matter network configuration start flag is set to 2 and written into the flash memory Flash; wherein the Matter data area stores network configuration data, the Matter pairing success flag is 1, indicating that the Matter pairing has been successful, and the network configuration needs to be backed up for data recovery after failure, and the Matter network configuration start flag is 2, indicating active entry into the Matter network configuration
[0033] The network configuration module is used to clear all Matter data areas and restart the Matter device to enter the network configuration;
[0034] The recovery module is used to determine whether the Matter pairing has been successful if the pairing is unsuccessful. If the Matter pairing has been successful, the last network configuration data is restored from the Matter backup area and the device Matter is restarted.
[0035] A third aspect of an embodiment of the present disclosure provides an electronic device, including: a processor; and a memory storing computer instructions, which, when executed by the processor, causes the processor to execute the method steps described above.
[0036] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method described above when executed by a processor.
[0037] A fifth aspect of an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the steps of the method described above when executed by a processor.
[0038] The beneficial effects of the embodiments of the present disclosure are:
[0039] The Matter network configuration method proposed in the embodiment of the present disclosure is simple. By setting multiple Matter data areas, Matter backup areas, and Matter data areas, the Matter pairing success flag and the Matter network configuration start flag can be used to restore the data of the last network configuration when the pairing times out or the network configuration fails and the network configuration is re-established, so as to quickly connect and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a schematic diagram of a Matter device network configuration method process proposed in an embodiment of the present disclosure;
[0041] Figure 2 It is a flowchart of whether the network configuration of a Matter device is successful in the embodiment of the present disclosure;
[0042] Figure 3 It is a schematic diagram of the structure of a Matter device network distribution device proposed in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the embodiment of the present disclosure more clear, the embodiment of the present disclosure is further described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation methods described here are only used to explain the embodiment of the present disclosure and are not used to limit the embodiment of the present disclosure.
[0044] When Matter repeats network configuration, it is necessary to clear the data in the Matter data area and then restart the device. Restart the device to enter the network configuration. If the network configuration is unsuccessful, it will remain offline. Conventional Matter devices do not back up data and cannot automatically restore the last ecological data, making the network configuration not smooth. It may also be necessary to manually enter complex network credentials, affecting the user experience.
[0045] Embodiment 1:
[0046] like Figure 1 As shown, the first aspect of the embodiment of the present disclosure proposes a Matter device network configuration method, which is applied to repeated network configuration of matter devices, and the method includes:
[0047] Step S100, dividing the Matter device flash memory Flash into multiple partitions, the partitions include: Matter data area, Matter backup area and general data area; wherein the general data area includes: Matter pairing success flag and Matter start network configuration flag.
[0048] It should be noted that the traditional Matter device flash memory is divided into multiple areas, including a bootloader area, an application area, a configuration area, and a log area. In the embodiment of the present disclosure, the Matter device FLASH partition is divided into three additional areas in addition to the traditional partition, namely, the Matter data area, the Matter backup area, and the normal data area.
[0049] The Matter data area stores configuration and status data related to the Matter protocol, such as important data such as device configuration information, Fabric information, node ID, security key, etc. The two flags used in the configuration process are Matter pairing success and Matter configuration start flag, both of which are stored in the general data area.
[0050] The Matter backup area is mainly used to back up the data in the Matter data area. It is used to restore the data in the Matter data area after the device is restarted, the network configuration times out, or the network configuration fails and thus exits the network configuration, etc., to ensure that the device can be restored to its previous working state.
[0051] Step S200: In response to the network configuration request, a Matter pairing success flag is read from the flash memory.
[0052] In step S200, you can enter the network configuration by long pressing the corresponding button of the Matter device, and the device reads the Matter pairing success flag from the Flash. The Matter pairing success flag is represented by 0 and 1 respectively, where the Matter pairing success flag is 0, which means that Matter has never been paired successfully, and no data needs to be copied when entering the network configuration. The Matter pairing success flag is 1, which means that Matter has been paired successfully, and data needs to be copied when entering the network configuration, and recovery is required when exiting the network configuration.
[0053] Step S300, judging whether the network configuration has been successful according to the Matter pairing success flag, if the Matter pairing success flag is 1, copying the data in the Matter data area to the Matter backup area, and writing the device Matter start network configuration flag as 2 into the flash memory Flash; wherein, the Matter data area stores network configuration data, the Matter pairing success flag is 1 indicating that the Matter pairing has been successful, and data backup is required to enter the network configuration in order to restore the data after failure, and the Matter start network configuration flag is 2 indicating active entry into the Matter network configuration.
[0054] After the Matter device reads the Matter pairing success flag from the flash memory, it determines whether the network configuration is successful based on the value of the Matter pairing success flag. That is, it determines whether the value is 1. If it is 1, the data in the Matter data area is copied to the Matter backup area, and the device Matter start network configuration flag is written to 2 in the FLash.
[0055] If the value is 0, the device Matter start network configuration flag position is directly written to 2 in the flash memory Flash, the Matter data area is completely cleared, the Matter device is restarted, and enters the Matter Bluetooth network configuration state.
[0056] The Matter network configuration flag is represented by 0, 1, and 2. The Matter network configuration flag is 0, which means that the network configuration is not entered and the device starts normally. This usually occurs when the device is manually restarted. The Matter network configuration flag is 1, which means that the device was restarted for some unknown reason during the last Matter network configuration process. It is necessary to determine whether the Matter network configuration was successful. If it was successful, it needs to be restored, and then the Matter network configuration flag is set to 0. The Matter network configuration flag is 2, which means that the Matter network configuration is actively entered. The flag position is stored in the flash to prevent the device from restarting during the network configuration process.
[0057] Step S400: Clear all Matter data areas, and the Matter device restarts to enter the network configuration.
[0058] When the device restarts, it will read data from the Matter data area and load it into the Matter variable. When the number of Fabrics in it is not 0, the device will not enter the Matter network configuration state. When the device wants to enter the Matter network configuration again, the Matter data area and Matter variables must be cleared again. At this stage, the SDK does not provide this interface, so the device can only be soft-restarted to enter the Matter Bluetooth network configuration state if it wants to re-configure the network. If you need to restore data, you also need to restart the device and load the Matter variable during the initialization phase.
[0059] That is to say, the device Matter startup process includes: judging the device Matter network configuration flag: 0 means normal startup without entering network configuration; 1 means the device restarts during network configuration, judging whether the Matter pairing has been successful, and restoring the partition if successful; 2 means actively entering the Matter network configuration, setting the Matter network configuration flag to 1, to prevent the device from being unable to restore data due to restart during the network configuration process. The details are as follows:
[0060] The Matter device restarts to enter the distribution network including:
[0061] Step S410, determine the Matter start network configuration flag. If the Matter start network configuration flag is 1, determine whether the network configuration has been successful. If successful, copy the Matter backup area data into the data area. Regardless of whether it is copied, the start network configuration flag needs to be set to 0; then enter the Matter Bluetooth network configuration state.
[0062] If the Matter network configuration start flag is 1, it means that the device was restarted during manual network configuration and the Matter data needs to be restored.
[0063] Step S420: If the Matter network configuration start flag is 2, the flag is set to 1 to enter the Matter Bluetooth network configuration state.
[0064] In step S420 , it is determined that the Matter network configuration start flag is 2, that is, the network configuration is actively entered to restart the device, and only the Matter network configuration start flag is changed from 2 to 1.
[0065] Generally speaking, manually restart the Matter device and determine the Matter start network configuration flag. If the Matter start network configuration flag is 0, it will start normally without doing any operation. It will internally determine whether to enter the network configuration.
[0066] That is to say, the Matter network configuration flag should be 0, and the device Matter can be started normally; when Matter is re-configured, the device is always offline after the network configuration fails and exits. Each time the device Matter restarts, it determines whether the device Matter network configuration flag is 1 or 2. If it is 2, the flag is set to 1. If it is 1, it means that the device was restarted during manual network configuration, and the Matter data needs to be restored. When the device Matter restarts, the data is read from the Matter data area and loaded into the Matter variable. When the number of Fabrics in it is not 0, the device does not enter the Matter network configuration state.
[0067] Step S500: If pairing is unsuccessful, determine whether Matter pairing has been successful. If the Matter pairing success flag is 1, restore the last network configuration data from the Matter backup area and restart the device Matter.
[0068] like Figure 2As shown, in step S300, if the Matter pairing is successful, the network configuration process is to initialize the data in the Matter data area to the default value, and then restart to enter the network configuration. If successful, the network configuration is completed, and the Matter backup area is cleared after the network configuration is successful; if the network configuration is not successful, it may be a network configuration timeout, or a network configuration failure or exit from the network configuration, then restore the data: restore the data in the Matter data area from the Matter backup area, that is, restore the last network configuration data from the Matter backup area. If the device restarts, it can be a manual restart to determine whether the Matter pairing is successful. If the Matter pairing success flag is 1, restore the data in the Matter data area from the Matter backup area and go online again.
[0069] In step S300, it is determined whether the network configuration has been successful based on the Matter pairing success flag. If the Matter pairing has not been successful, that is, the Matter pairing success flag is 0: Continue network configuration: No need to restore data, write the device Matter network configuration start flag position to 2 in the flash memory Flash, clear the Matter data area, and restart the Matter device to enter the Matter Bluetooth network configuration state. Similarly, the network configuration process is to initialize the data in the Matter data area to the default value, perform network configuration, and if successful, complete the network configuration; if the network configuration is unsuccessful, it may be due to network configuration timeout, network configuration failure, or exit from network configuration. It is also necessary to determine whether the Matter pairing has been successful. If it has not been successful, connect to the production test wifi , Connecting to the production test wifi is the initial state. If the device is restarted, it can be restarted manually to determine whether the Matter pairing is successful. If not, re-enable Bluetooth pairing.
[0070] The Matter backup area restores data including:
[0071] Copy the Matter backup area to the Matter data area, and clear the Matter backup area after the copy is successful;
[0072] After restoring the data in the Matter data area, set the Matter network configuration start flag to 0 to ensure that the next startup will not trigger data recovery.
[0073] In the disclosed embodiment, after restarting the device, it is determined whether the Matter pairing was successful based on the Matter pairing success flag. If it was successful, the data in the Matter data area is restored to avoid the situation where the device cannot restore data due to restart during the network configuration process.
[0074] Step S600: If the Matter pairing is successful, after the Matter pairing is completed, the Matter backup area is cleared, and the Matter pairing success flag is set to 1 and the Matter network configuration start flag is set to 0.
[0075] That is to say, after the device Matter pairing is completed, the Matter backup area is cleared and the Matter start network configuration flag is set to 0.
[0076] When the pairing times out, determine whether the Matter pairing has been successful. If the Matter pairing success flag is 1, restore the last network configuration data and restart the device Matter.
[0077] Matter pairing success or timeout process: If Matter pairing is successful, the Matter pairing success flag will be set to 1, and the Matter network configuration start flag will be set to 0. If the timeout occurs, it will determine whether Matter has been successful. If successful, the Matter data will be restored.
[0078] like Figure 3 As shown, in a first aspect, an embodiment of the present disclosure proposes a Matter device network configuration device, which is applied to repeated network configuration of a matter device, and the device includes:
[0079] The partition module 100 is used to divide the Matter device flash memory Flash into multiple partitions, the partitions include: Matter data area, Matter backup area and common data area; wherein the common data area includes: Matter pairing success flag and Matter start network configuration flag.
[0080] The reading module 200 is used to read the Matter pairing success flag from the flash memory Flash in response to the network configuration request.
[0081] The judgment module 300 is used to judge whether the network configuration has been successful according to the Matter pairing success flag. If the Matter pairing success flag is 1, the data in the Matter data area is copied to the Matter backup area, and the device Matter start network configuration flag is written as 2 into the flash memory Flash; wherein, the Matter data area stores network configuration data, the Matter pairing success flag is 1, indicating that the Matter pairing has been successful, and entering the network configuration requires backing up data for data recovery after failure, and the Matter start network configuration flag is 2, indicating active entry into the Matter network configuration.
[0082] The network configuration module 400 is used to clear all Matter data areas, and the Matter device restarts to enter the network configuration.
[0083] The recovery module 500 is used to determine whether the Matter pairing has been successful if the pairing is unsuccessful. If the Matter pairing has been successful, the last network configuration data is restored from the Matter backup area and the device Matter is restarted.
[0084] Embodiment 2:
[0085] Before the Matter device of Example 1 is networked, the master device obtains the broadcast packet of the Matter device. The master device can communicate with the Matter device through wired, WiFi and / or Bluetooth to obtain the broadcast packet. The broadcast packet includes a storage identifier. The master device can obtain the network configuration data of the Matter device through the broadcast packet. The storage identifier indicates whether the network configuration data of the Matter device needs to be backed up to the master device. Whether the Matter device needs to back up the network configuration data to the master device is pre-set. The storage identifier can be divided into 1 and 0, 1 indicates that the network configuration data of the Matter device needs to be backed up to the master device, and 0 indicates that the network configuration data of the Matter device does not need to be backed up to the master device. The master device can determine whether the network configuration data of the Matter device needs to be backed up to the backup area of the master device based on the storage identifier.
[0086] When the Matter device is configuring the network, when backing up the data in the data area, it is determined whether the network configuration data needs to be backed up to the main control device. It can be determined whether the network configuration data needs to be backed up to the main control device based on the storage identifier. If necessary, when backing up the network configuration data, the backed up network configuration data is uploaded to the backup area of the main control device. The backup area of the Matter device only stores the recovery data control symbol corresponding to the network configuration data. If not required, the network configuration data is backed up to the backup area of the Matter device; when restoring data from the backup area, if the network configuration data is backed up in the main control device, the Matter device sends the recovery data control symbol to the main control device, and the main control device sends the backed up network configuration data directly to the Matter data area according to the recovery data control symbol.
[0087] Embodiment three:
[0088] On the basis of Example 2, for Matter devices that need to back up network configuration data to the main control device, when backing up network configuration data, the network configuration data can be divided into important and non-important data, which are stored in the Matter device and the main control device respectively. Specifically, non-important data is backed up in the backup area of the Matter device, and important data is backed up in the backup area of the main control device. Important data may include: network credentials (Wi-Fi SSID and password), device identification (device ID and type), and security information (encryption keys and certificates). Non-important data may include: configuration parameters, device name, room location, initial setting parameters; configuration parameters such as IP address, subnet mask, gateway address, DNS server address. The backup area of the Matter device also stores recovery data control symbols.
[0089] When restoring data from the backup area, the backup area data of the master device is sent to the data area of the Matter device according to the data restoration control character, and the backup area data of the Matter device is restored to the data area at the same time.
[0090] A third aspect of an embodiment of the present disclosure provides an electronic device, including: a processor; and a memory storing computer instructions, which, when executed by the processor, causes the processor to execute the method steps described above.
[0091] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method described above when executed by a processor.
[0092] A fifth aspect of an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the steps of the method described above when executed by a processor.
[0093] The above is only a preferred implementation of the embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiment of the present disclosure. These improvements and modifications should also be considered as the protection scope of the embodiment of the present disclosure.
Claims
1. A Matter device network configuration method, applied to repeated network configuration of matter devices, characterized in that: The method comprises: Divide the flash memory of the Matter device into multiple partitions, including: Matter data area, Matter backup area and general data area; wherein the general data area includes: Matter pairing success flag and Matter start network configuration flag; In response to the network configuration request, the Matter pairing success flag is read from the flash memory; Whether the network configuration has been successful is determined according to the Matter pairing success flag. If the Matter pairing success flag is 1, the data in the Matter data area is copied to the Matter backup area, and the device Matter network configuration start flag is set to 2 and written into the flash memory Flash; wherein the Matter data area stores network configuration data, the Matter pairing success flag is 1, indicating that the Matter pairing has been successful, and the data needs to be backed up to enter the network configuration in order to restore the data after failure, and the Matter network configuration start flag is 2, indicating that the Matter network configuration is actively entered; Clear all Matter data areas, and restart the Matter device to enter the network configuration; If pairing is unsuccessful, determine whether Matter pairing has been successful. If Matter pairing has been successful, restore the last network configuration data from the Matter backup area and restart the device Matter.
2. The method according to claim 1, characterized in that The unsuccessful pairing includes: pairing timeout or network configuration failure or network configuration exit; The method further includes: if the device is restarted, determining whether the Matter pairing has been successful, and if the Matter pairing success flag is 1, restoring the data in the Matter backup area to the Matter data area, and going back online.
3. The method according to claim 1, characterized in that The step of judging whether the network configuration has been successful according to the Matter pairing success flag bit also includes: If the Matter pairing success flag is 0, the device Matter network configuration start flag is directly written to the flash memory as 2, wherein the Matter pairing success flag is 0, indicating that Matter has never been paired successfully, and no data copying is required to enter the network configuration; Clear all Matter data areas, and restart the Matter device to enter the network configuration; If the network pairing fails, determine whether the Matter pairing has been successful. If not, connect to the production test wifi. If the device restarts, determine whether the Matter pairing was successful. If not, reopen the Bluetooth pairing.
4. The method according to any one of claims 1 to 3, characterized in that: Matter device restart to enter the network configuration includes: Determine the Matter network configuration start flag. If the Matter network configuration start flag is 1, determine whether the network configuration has been successful. If successful, copy the Matter backup area data into the data area and set the Matter network configuration start flag to 0. If the Matter start network configuration flag is 2, set the flag to 1 and enter the Matter Bluetooth network configuration state.
5. The method according to claim 1 or 2, characterized in that: Matter backup area restores data, including: Copy the Matter backup area to the Matter data area, and clear the Matter backup area after the copy is successful; After restoring the data in the Matter data area, set the Matter network configuration start flag to 0 to ensure that the next startup will not trigger data recovery. The Matter network configuration start flag bit being 0 indicates that the network configuration will not be entered and the startup will be normal.
6. The method according to any one of claims 1 to 3, characterized in that: If the Matter pairing is successful, after the Matter pairing is completed, the method further includes: clearing the Matter backup area, and setting the Matter pairing success flag position to 1 and the Matter network configuration start flag position to 0.
7. A Matter device network configuration device, applied to repeated network configuration of matter devices, characterized in that: The device comprises: The partition module is used to divide the Matter device flash memory into multiple partitions, including: Matter data area, Matter backup area and general data area; the general data area includes: Matter pairing success flag and Matter start network configuration flag; A reading module, used for reading a Matter pairing success flag from the flash memory in response to a network configuration request; A judgment module is used to judge whether the network configuration has been successful according to the Matter pairing success flag. If the Matter pairing success flag is 1, the data in the Matter data area is copied to the Matter backup area, and the device Matter network configuration start flag is written as 2 into the flash memory Flash; wherein the Matter data area stores network configuration data, the Matter pairing success flag is 1, indicating that the Matter pairing has been successful, and data needs to be copied to enter the network configuration, and the Matter network configuration start flag is 2, indicating active entry into the Matter network configuration; The network configuration module is used to clear all Matter data areas and restart the Matter device to enter the network configuration; The recovery module is used to determine whether the Matter pairing has been successful if the pairing is unsuccessful. If the Matter pairing has been successful, the last network configuration data is restored from the Matter backup area and the device Matter is restarted.
8. An electronic device, characterized in that: include: processor; and a memory storing computer instructions, which, when executed by the processor, causes the processor to perform the method steps described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.