Network set-top box data recovery method, device and equipment

By reading and copying data in the network set-top box and using a hash algorithm to verify consistency, it solves the problem of reconfiguring parameters after restoring factory settings, realizes automated data recovery, and improves efficiency and accuracy.

CN118503017BActive Publication Date: 2024-09-10SICHUAN TIANYI COMHEART TELECOM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410956700.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-09-10
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

After the network set-top box is restored to factory settings, users or installation and maintenance personnel need to reconfigure network, Bluetooth, hotspot and other parameters, resulting in low efficiency and high maintenance costs.

Method used

By responding to the data initialization request, read the data to be backed up from the original storage area, copy it to the preset storage partition, identify and copy the target data to the original storage area, use the hash algorithm to verify the data consistency, achieve data recovery, and restore the data based on the data. Configure the appropriate program.

Benefits of technology

It realizes the automatic restoration of important configuration data of network set-top boxes after restoring factory settings, improves the intelligence of data recovery, saves human resources, and improves configuration efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118503017B
    Figure CN118503017B
Patent Text Reader

Abstract

The present application discloses a network set-top box data recovery method, device and equipment, which reads the data to be backed up from the original storage area and lists it in a first set; copies the data to be backed up from the first set to a preset storage partition; performs data initialization on the original storage area; identifies the target data from the data to be backed up in the storage partition and lists it in a second set; copies the target data from the second set to the target storage path of the original storage area to obtain the recovery data; calculates the hash values ​​of the recovery data and the target data respectively according to the preset hash algorithm; verifies whether the hash values ​​are consistent, if they are consistent, the data recovery is completed; if they are inconsistent, returns to the steps of identifying and copying the target data, loops until the hash values ​​are consistent, and completes the data recovery. The data copying and recovery mechanism provided by the present application can realize the automatic restoration of important configuration data after the network set-top box is restored to factory settings, and improves the intelligence and accuracy of data recovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of set-top box data processing, and in particular to a method, device and equipment for recovering network set-top box data. Background Art

[0002] The Network Set-Top Box (STB) is a crucial technical device in information appliances, used to watch online video resources and so on by connecting to the Internet. During the use of the network set-top box, due to user misoperation, frequent input / output (I / O) operations of third-party programs (Application, APP), etc., the network set-top box may run slowly. Users or maintenance personnel often use the method of restoring factory settings to improve the operation speed of the network set-top box. Restoring factory settings can clear the cache files generated by the APP, delete the APP installed by the user from the application market and the files downloaded from the system, so that the network set-top box is restored to the initial version when it was shipped from the factory.

[0003] However, after restoring the factory settings of the network set-top box, the user or installation and maintenance personnel still need to reconfigure the network, Bluetooth, hotspot and other parameters, which is a huge workload and takes up a lot of user time, and has problems of low efficiency and high maintenance costs. Summary of the invention

[0004] The main purpose of the present application is to provide a network set-top box data recovery method, device and equipment, aiming to solve the technical problems of low efficiency and high maintenance cost of manual reconfiguration of parameters.

[0005] To achieve the above-mentioned purpose, in a first aspect, the present application provides a network set-top box data recovery method, the method comprising the following steps: in response to a data initialization request, reading the data to be backed up from the original storage area, and listing the data to be backed up in a first set; copying the data to be backed up from the first set to a preset storage partition; performing data initialization on the original storage area; identifying target data from the data to be backed up in the storage partition, and listing the target data in a second set; copying the target data from the second set to the target storage path of the original storage area to obtain recovery data; calculating a first hash value of the recovery data and a second hash value of the target data according to a preset hash algorithm; verifying whether the first hash value and the second hash value are consistent, if they are consistent, data recovery is completed; if the hash values ​​are inconsistent, returning to execute the step of identifying the target data from the data to be backed up in the storage partition, looping until the first hash value is consistent with the second hash value, and completing data recovery.

[0006] Optionally, the preset hash algorithm includes an MD5 algorithm and / or a SHA-256 algorithm.

[0007] Optionally, after the data recovery is completed, the method further includes: configuring a corresponding target program according to the recovered data.

[0008] Optionally, the data to be backed up also includes non-target data, and the method also includes: in response to a non-target program request, reading the non-target data corresponding to the non-target program request from the storage partition; if the non-target data is empty, displaying a page to be configured on the user interface; if the non-target data is not empty, displaying configuration information corresponding to the non-target data on the user interface, and displaying an option for asking whether to restore the configuration information; in response to a request to confirm restoration, copying the non-target data from the storage partition to a corresponding non-target storage path of the original storage area, and configuring a corresponding non-target program according to the non-target data; in response to a request to cancel restoration, displaying a page to be configured on the user interface, and deleting the non-target data from the storage partition.

[0009] Optionally, reading the data to be backed up from the original storage area includes: reading the set-top box system preset attributes and / or platform issued attributes to obtain the storage path and name of the data to be backed up; obtaining the data to be backed up according to the storage path and name; and / or,

[0010] The target data is copied from the second set to the target storage path of the original storage area to obtain the recovery data, including: obtaining the target storage path of the target data from FileSave.cpp; and copying the target data from the second set to the target storage path to obtain the recovery data.

[0011] Optionally, read the set-top box system preset properties and / or platform-issued properties to obtain the storage path and name of the data to be backed up, including: calling the SystemProperties.get(key,defvalue) program to obtain the storage path and name of the data to be backed up from the set-top box system preset properties and / or platform-issued properties.

[0012] Optionally, the target data includes at least one of a connected WiFi account password, an Ethernet account password, a hotspot account password, and a Bluetooth PIN code.

[0013] In a second aspect, the present application provides a network set-top box data recovery device, the device comprising:

[0014] A reading module is used to respond to a data initialization request, read the data to be backed up from the original storage area, and list the data to be backed up in a first set; a first backup module is used to copy the data to be backed up from the first set to a preset storage partition; an initialization module is used to perform data initialization on the original storage area; an identification module is used to identify target data from the data to be backed up in the storage partition, and list the target data in a second set; a second backup module is used to copy the target data from the second set to the target storage path of the original storage area to obtain recovery data; a calculation module is used to calculate a first hash value of the recovery data and a second hash value of the target data according to a preset hash algorithm; a verification module is used to verify whether the first hash value and the second hash value are consistent, if they are consistent, data recovery is completed; if the hash values ​​are inconsistent, return to execute the step of identifying the target data from the data to be backed up in the storage partition, loop until the first hash value is consistent with the second hash value, and complete data recovery.

[0015] Optionally, the preset hash algorithm includes an MD5 algorithm and / or a SHA-256 algorithm.

[0016] Optionally, the network set-top box data recovery device further includes a configuration module, and the configuration module is used to configure a corresponding target program according to the recovery data after the data recovery is completed.

[0017] Optionally, the data to be backed up also includes non-target data, and the configuration module can also be used to respond to a non-target program request and read the non-target data corresponding to the non-target program request from the storage partition; if the non-target data is empty, the page to be configured is displayed on the user interface; if the non-target data is not empty, the configuration information corresponding to the non-target data is displayed on the user interface, and an option for asking whether to restore the configuration information is displayed; in response to a request to confirm restoration, the non-target data is copied from the storage partition to a corresponding non-target storage path of the original storage area, and a corresponding non-target program is configured according to the non-target data; in response to a request to cancel restoration, the page to be configured is displayed on the user interface, and the non-target data is deleted from the storage partition.

[0018] Optionally, the reading module can also be used to read the set-top box system preset attributes and / or platform-issued attributes to obtain the storage path and name of the data to be backed up; and obtain the data to be backed up according to the storage path and name.

[0019] Optionally, the second backup module may also be used to obtain a target storage path of the target data from FileSave.cpp; copy the target data from the second set to the target storage path to obtain restored data.

[0020] Optionally, the reading module can also be used to call the SystemProperties.get(key,defvalue) program to obtain the storage path and name of the data to be backed up from the set-top box system preset properties and / or platform-delivered properties.

[0021] Optionally, the target data includes at least one of a connected WiFi account password, an Ethernet account password, a hotspot account password, and a Bluetooth PIN code.

[0022] In a third aspect, the present application provides an electronic device comprising: a memory and a processor; the memory is used to store program instructions; the processor is used to call the program instructions to execute any network set-top box data recovery method provided in the first aspect above.

[0023] In a fourth aspect, the present application provides a network set-top box, comprising: the electronic device provided in the third aspect above.

[0024] In a fifth aspect, the present application provides a computer program product, including a computer program; when the computer program is executed, it implements any network set-top box data recovery method provided in the first aspect above.

[0025] The beneficial effects that can be achieved by the present application are as follows: the data copying and recovery mechanism provided can realize the automatic restoration of important configuration data after the network set-top box is restored to factory settings, thereby improving the intelligence level of data recovery, saving human resources, and improving configuration efficiency; utilizing a collection to realize a one-time copy of data, thereby further improving the efficiency and accuracy of data copying; using a hash algorithm to calculate and verify the data before and after the copy, thereby avoiding recognition errors that may be caused by different data formats, thereby further improving the accuracy of data restoration.

[0026] The network set-top box data recovery method, device and equipment proposed in the embodiment of the present application, by responding to the data initialization request, reads the data to be backed up from the original storage area, and lists the data to be backed up in the first set; copies the data to be backed up from the first set to the preset storage partition; performs data initialization on the original storage area; identifies the target data from the data to be backed up in the storage partition, and lists the target data in the second set; copies the target data from the second set to the target storage path of the original storage area to obtain the recovery data; calculates the first hash value of the recovery data and the second hash value of the target data according to the preset hash algorithm; verifies whether the first hash value and the second hash value are consistent, if they are consistent, the data recovery is completed; if the hash values ​​are inconsistent, returns to the step of identifying the target data from the data to be backed up in the storage partition, loops until the first hash value is consistent with the second hash value, and completes the data recovery. The problem of manual time consumption in network set-top box data recovery is solved, and the intelligent and efficient data restoration is realized. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0028] Figure 2 Schematic diagram of the process of the network set-top box data recovery method provided in the embodiment of the present application Figure 1 ;

[0029] Figure 3 Schematic diagram of the process of the network set-top box data recovery method provided in the embodiment of the present application Figure 2 ;

[0030] Figure 4 A schematic diagram of the functional modules of the network set-top box data recovery device provided in an embodiment of the present application;

[0031] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0032] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0033] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0034] The main solution of the embodiment of the present application is: when the user restores the factory settings of the network set-top box, the stored files / data are backed up, and some files / data are restored by default or selectively as needed to achieve an automatic configuration restoration function after data formatting.

[0035] Because the existing technology clears all stored data after restoring the factory settings of the network set-top box, including not only cache files but also important configuration files generated during user use. These configuration files need to be re-entered by the installation and maintenance personnel or the user, such as network, Bluetooth, hotspot and other accounts and passwords, etc. The manual operation process is cumbersome, time-consuming and has a poor user experience.

[0036] The present application provides a solution that enables a network set-top box to automatically restore some important configuration data after restoring factory settings, without the need for manual operation, thereby ensuring that the cache of the network set-top box is cleared without the user's awareness, saving configuration time and improving user experience.

[0037] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, the application scenario includes a configuration personnel 101 , a network set-top box 102 and a server 103 .

[0038] Configuration personnel 101 refers to personnel who can perform configuration operations on the network set-top box 102, including users, installation and maintenance personnel, etc. Configuration personnel 101 can input configuration instructions to the network set-top box 102, and can also read feedback information from the network set-top box 102. Configuration personnel 101 restores the network set-top box 102 to factory settings and performs possible configuration operations on the network set-top box 102 according to the actual needs of the user.

[0039] The network set-top box 102 is a device that connects a TV and the Internet via a network. It can convert TV signals into digital signals and transmit various media contents such as movies, TV programs, music, games, etc. via the network. The network set-top box usually has functions such as video on demand, online live broadcast, applications and games, Internet browsing, multimedia playback and remote control.

[0040] During the use of the network set-top box 102, it may become stuck due to user misoperation, frequent IO operations of third-party programs, excessive cache, etc., and the problem cannot be solved by simply cleaning the cache. By restoring the factory settings, the network set-top box can be restored to the version when it was shipped from the factory. Various cache files and program files can be deeply cleaned, thereby improving system operation efficiency.

[0041] The network set-top box 102 may include a button that can be used to start the factory reset program, and may also include a display screen that can be used to display feedback information, such as configuration-related options, to the configuration personnel 101. Exemplarily, the button and the display screen may also be externally connected to the network set-top box 102, such as through a wired or wireless connection.

[0042] The network set top box 102 comprises an original storage area and a preset storage partition. The above-mentioned various cache files and program files etc. are all stored in the original storage area, and the files related to different programs are stored under the different storage paths of the original storage area. The storage partition is added outside the original storage area and can store the above-mentioned various cache files and program files etc.

[0043] The server 103 is used to receive and process information output from the network set-top box 102, for example, calling underlying programs, calculating specified data, etc. The server 103 can be a remote data center or a microprocessor built into the network set-top box 102. The server 103 can be a physical server or a virtual server.

[0044] The network set-top box 102 sends a request to the server 103 according to the configuration request of the configuration personnel 101 , and the server 103 performs corresponding processing according to the request and returns the result to the network set-top box 102 .

[0045] Figure 2Schematic diagram of the process of the network set-top box data recovery method provided in the embodiment of the present application Figure 1 .like Figure 2 As shown, the data recovery method includes:

[0046] S201: In response to a data initialization request, read the data to be backed up from the original storage area, and list the data to be backed up in a first set.

[0047] The data initialization request can be input to the network set-top box through a button, an option on the display interface, or a key on the OS setting page. The data to be backed up can be all or part of the stored data / files in the original storage area, and needs to include the following target data.

[0048] After receiving the initialization request, the network set-top box reads the storage data in the original storage area to determine whether the factory settings can be restored. If it is confirmed that the factory settings can be restored, the data to be backed up is included in the first set and waits for copying.

[0049] S202: Copy the data to be backed up from the first set to a preset storage partition.

[0050] The preset storage partition corresponds to the storage path of the original storage area one by one. Exemplarily, the preset storage partition can be established in the same hard disk or storage device as the original storage area, divided into different logical parts and used independently, or can be established in an independently set hardware device, which can be read and written by the OS system of the network set-top box.

[0051] Copying data from a collection can complete the copying of all data at one time without copying them one by one, which improves the accuracy and timeliness of copying the data to be backed up to a certain extent.

[0052] S203: Perform data initialization on the original storage area.

[0053] After completing the copying of the required data, the data in the original storage area is cleared to restore the original storage area to the factory state.

[0054] S204: Identify target data from the data to be backed up in the storage partition, and include the target data in the second set.

[0055] The target data refers to the configuration data / file that the user wants to restore. For example, the target data includes at least one of the connected wifi account password, Ethernet account password, hotspot account password and Bluetooth PIN code. In some embodiments, the data to be backed up is the target data, and S204 obtains the target data by reading the data to be backed up; in other embodiments, the data to be backed up includes the target data and all or part of the non-target data. The target data is first listed in the second set and waits for copying.

[0056] S205: Copy the target data from the second set to the target storage path of the original storage area to obtain restored data.

[0057] The target storage path of the original storage area is the location where the target data is stored when the original storage area is not formatted. The access program can obtain the corresponding target data from the target storage path and restore the target data back to the original target storage path, which is called recovering data.

[0058] Restoring the target data copy from the second set to the target storage path of the original storage area can complete the copying of all data at one time without copying them one by one, further improving the accuracy and timeliness of the target data copy.

[0059] S206: Calculate a first hash value of the restored data and a second hash value of the target data according to a preset hash algorithm.

[0060] The preset hash algorithm can be called to the bottom layer through the network set-top box OS system, for example, a request is sent to the server, the hash algorithm program is called to calculate the recovery data and the target data respectively, and the calculation results are fed back to the network set-top box.

[0061] Since the storage format or storage length of the restored data and the target data may be different, and each piece of data may have multiple formats or special operators, conventional recognition methods may not be able to accurately identify the data, resulting in large errors in the recognition results. However, using a hash algorithm to calculate data can identify and calculate data in different formats. For the same data in different formats, a consistent hash value can still be calculated, thereby avoiding calculation errors caused by differences in data formats.

[0062] Optionally, the preset hash algorithm includes an MD5 algorithm and / or a SHA-256 algorithm. MD5 (Message Digest Algorithm 5) is a commonly used hash algorithm used to convert data of any length into a hash value of a fixed length; the SHA-256 (Secure Hash Algorithm 256-bit) algorithm is a cryptographic hash function used to convert data into a hash value of a fixed length. The advantages of the MD5 algorithm and the SHA-256 algorithm are that for the same input data, no matter how many times the calculation is performed, the hash value obtained is the same, while for different input data, even if there is only one byte difference, the hash value obtained will be very different, thereby ensuring the accuracy of the calculation result.

[0063] The two hash values ​​calculated using the above hash algorithm for the restored data and the target data have the same data length, which is convenient for identification and comparison. Optionally, the above hash value calculation can be performed for each piece of data one by one to verify whether each corresponding piece of data is consistent.

[0064] Optionally, the second hash value of the target data is calculated in advance by a remote end. The remote end may be a remote computer or server, such as an operator's server. Before performing data initialization on the original storage area, the remote end reads the data to be backed up from the original storage area, identifies the target data, and uses a preset hash algorithm to calculate the second hash value of the target data, which is stored in the remote end, waiting to be compared with the first hash value for verification. By calculating the second hash value by the remote end in advance, the accuracy of the target data can be further ensured, and the situation that the data to be backed up already has copy errors and cannot be verified can be effectively prevented. S207: Verify whether the first hash value and the second hash value are consistent. If they are consistent, data recovery is completed; if the hash values ​​are inconsistent, return to the step of identifying the target data from the data to be backed up in the storage partition, loop until the first hash value is consistent with the second hash value, and complete data recovery.

[0065] By comparing the first hash value and the second hash value to see if they are consistent, it is determined whether the copied recovery data is accurate. If the two are consistent, it proves that the recovery data and the target data are the same; if the two are different, it proves that the recovery data and the target data are different, and the copy may be incomplete or incorrect. At this time, return to S204 and re-execute the copying work of the target data until accurate recovery data is obtained.

[0066] The embodiment of the present application responds to a data initialization request, reads the data to be backed up from the original storage area, and lists the data to be backed up in a first set; copies the data to be backed up from the first set to a preset storage partition; performs data initialization on the original storage area; identifies the target data from the data to be backed up in the storage partition, and lists the target data in a second set; copies the target data from the second set to the target storage path of the original storage area to obtain the recovery data; calculates a first hash value of the recovery data and a second hash value of the target data according to a preset hash algorithm; verifies whether the first hash value and the second hash value are consistent, and if so, the data recovery is completed; if the hash values ​​are inconsistent, returns to the step of identifying the target data from the data to be backed up in the storage partition, loops until the first hash value is consistent with the second hash value, and completes the data recovery. The data copying and recovery mechanism provided in the embodiment of the present application can realize automatic restoration of important configuration data of the network set-top box after restoring the factory settings, improve the intelligence level of data recovery, save human resources, and improve configuration efficiency; use a collection to realize a one-time copy of data, further improve the efficiency and accuracy of data copying; use a hash algorithm to calculate and verify the data before and after the copy, avoid recognition errors that may be caused by different data formats, and further improve the accuracy of data restoration.

[0067] On the basis of the above embodiment, optionally, after S202, it may also include: using a preset hash algorithm, calculating the data to be backed up in the original storage area to obtain a third hash value, calculating the data to be backed up in the storage partition to obtain a fourth hash value; verifying whether the third hash value is consistent with the fourth hash value, if consistent, executing S203; if inconsistent, returning to execute S202, looping until the third hash value is consistent with the fourth hash value, and completing the copying of the data to be backed up. On the basis of the above embodiment, adding the steps of calculating and verifying the data hash values ​​before and after the copying of the data to be backed up can ensure that the copying process of the data to be backed up is accurate, and further improve the accuracy of the target data and non-target data.

[0068] On the basis of the above embodiment, optionally, after the data recovery is completed, it also includes: configuring the corresponding target program according to the recovery data. In some embodiments, the configuration of the target program is performed by default after the data recovery is completed; in other embodiments, the configuration of the target program is triggered in response to the configuration personnel inputting a target program request to the network set-top box. The recovery data is consistent with the target data, and the target program is automatically configured using the recovery data, so that the target program automatically restores the configuration state before formatting, without manual operation one by one, and the degree of intelligence is improved, so that non-sensing data cleaning and restoration can be achieved, and the user experience is improved.

[0069] Figure 3 Schematic diagram of the process of the network set-top box data recovery method provided in the embodiment of the present application Figure 2 In this embodiment, after the data recovery is completed, the network set-top box executes S301 for the input target program request: matching the corresponding target program according to the recovery data. For the input non-target program request, the data recovery method includes:

[0070] S302: In response to a non-target program request, read non-target data corresponding to the non-target program request from a storage partition;

[0071] S303: If the non-target data is empty, displaying the page to be configured on the user interface;

[0072] S304: If the non-target data is not empty, displaying configuration information corresponding to the non-target data on the user interface, and displaying an option for asking whether to restore the configuration information;

[0073] S305: In response to determining the request for restoration, copy the non-target data from the storage partition to a corresponding non-target storage path of the original storage area, and configure a corresponding non-target program according to the non-target data;

[0074] S306: In response to the request to cancel the restoration, a page to be configured is displayed on the user interface, and non-target data is deleted from the storage partition.

[0075] Non-target data is not necessary configuration data or storage data that users need to restore, so non-target data does not need to be used as recovery data. The method of distinguishing target data from non-target data can be based on empirical values ​​obtained from user big data analysis. For example, the parameters that most users will restore after restoring the factory settings of the network set-top box are identified as target data.

[0076] In order to further improve the user experience, this embodiment provides an optional recovery mechanism for this part of non-target data. When the non-target program is required to start, it is first confirmed whether the corresponding non-target data exists in the historical data (i.e., the storage data / files before the network set-top box performs the factory reset). If so, the user is asked whether to restore, and the historical data is restored or cleared according to the user's choice. This optional recovery mechanism restores the corresponding data to the original storage area only when the user confirms the restoration, while ensuring the data / file cleaning effect of the network set-top box restoring the factory settings and the intelligent experience of data recovery.

[0077] On the basis of the above embodiment, optionally, reading the data to be backed up from the original storage area includes: reading the set-top box system preset properties and / or platform-issued properties to obtain the storage path and name of the data to be backed up; obtaining the data to be backed up according to the storage path and name. Exemplarily, the target data includes a wifi account password, an Ethernet account password, a hotspot account password, a Bluetooth PIN code, etc. When the network set-top box presets the properties, the system obtains the storage path and name of the data to be backed up from the set-top box system preset properties and / or platform-issued properties by calling the SystemProperties.get(key,defvalue) program. Specifically, calling the SystemProperties.get(key,defvalue) program identifies the file name and path to be restored, and inquires whether the file to be backed up exists and is damaged. The developer of the preset properties can increase or decrease the files to be backed up according to the actual situation. In addition, considering the platform-issued properties, the corresponding parameter value can be modified by SystemProperties.set(key,value).

[0078] Optionally, the target data is copied from the second set to the target storage path of the original storage area to obtain the recovery data, including: obtaining the target storage path of the target data from FileSave.cpp; copying the target data from the second set to the target storage path to obtain the recovery data. In one embodiment, in the first step, the system reads the path of the file to be backed up and the target file path in FileSave.cpp, and puts them into the source set and the target set respectively; in the second step, the system compares the lengths of the two arrays, and if the array lengths are consistent, the execution continues; in the third step, the system determines whether the file to be copied exists, and if the file exists, the execution continues; in the fourth step, the system takes out the path of the target data and performs the copy action.

[0079] The above embodiments explain in detail the network set-top box data recovery method provided by the present application. The network set-top box data recovery device, electronic device, storage medium and program product provided by the embodiments of the present application will be specifically described below.

[0080] Figure 4 This is a functional module diagram of a network set-top box data recovery device provided in an embodiment of the present application. Figure 4 As shown, the network set-top box data recovery device 400 includes:

[0081] The reading module 401 is used to read the data to be backed up from the original storage area in response to the data initialization request, and list the data to be backed up in the first set;

[0082] A first backup module 402, used to copy the data to be backed up from the first set to a preset storage partition;

[0083] Initialization module 403, used to perform data initialization on the original storage area;

[0084] An identification module 404, configured to identify target data from the data to be backed up in the storage partition, and list the target data in the second set;

[0085] The second backup module 405 is used to copy the target data from the second set to the target storage path of the original storage area to obtain the restored data;

[0086] A calculation module 406, configured to calculate a first hash value of the restored data and a second hash value of the target data according to a preset hash algorithm;

[0087] Verification module 407 is used to verify whether the first hash value and the second hash value are consistent. If they are consistent, data recovery is completed; if the hash values ​​are inconsistent, return to the step of identifying the target data from the data to be backed up in the storage partition, loop until the first hash value is consistent with the second hash value, and complete data recovery.

[0088] Optionally, the preset hash algorithm includes an MD5 algorithm and / or a SHA-256 algorithm.

[0089] Optionally, the network set-top box data recovery device 400 further includes a configuration module, and the configuration module is used to configure a corresponding target program according to the recovery data after the data recovery is completed.

[0090] Optionally, the data to be backed up also includes non-target data, and the configuration module can also be used to respond to a non-target program request and read the non-target data corresponding to the non-target program request from the storage partition; if the non-target data is empty, the page to be configured is displayed on the user interface; if the non-target data is not empty, the configuration information corresponding to the non-target data is displayed on the user interface, and an option for asking whether to restore the configuration information is displayed; in response to a request to confirm restoration, the non-target data is copied from the storage partition to a corresponding non-target storage path of the original storage area, and a corresponding non-target program is configured according to the non-target data; in response to a request to cancel restoration, the page to be configured is displayed on the user interface, and the non-target data is deleted from the storage partition.

[0091] Optionally, the reading module 401 may also be used to read the set-top box system preset attributes and / or platform-issued attributes to obtain the storage path and name of the data to be backed up; and obtain the data to be backed up according to the storage path and name.

[0092] Optionally, the second backup module 405 may also be used to obtain a target storage path of the target data from FileSave.cpp; copy the target data from the second set to the target storage path to obtain restored data.

[0093] Optionally, the reading module 401 may also be used to call the SystemProperties.get(key, defvalue) program to obtain the storage path and name of the data to be backed up from the set-top box system preset properties and / or platform-delivered properties.

[0094] Optionally, the target data includes at least one of a connected WiFi account password, an Ethernet account password, a hotspot account password, and a Bluetooth PIN code.

[0095] The device provided in the embodiment of the present application can be used to execute the above-mentioned network set-top box data recovery method, and its implementation method and technical effect are similar, which will not be repeated here.

[0096] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 500 includes:

[0097] Processor 501 , memory 502 , communication interface 503 and system bus 504 .

[0098] Among them, the memory 502 and the communication interface 503 are connected to the processor 501 through the system bus 504 and complete communication with each other. The memory 502 is used to store computer execution instructions, the communication interface 503 is used to communicate with other devices, and the processor 501 is used to execute computer execution instructions to execute the network set-top box data recovery method as described in the above method embodiment.

[0099] Specifically, the processor 501 may include one or more processing units, for example, the processor 501 may be a CPU, or a digital signal processing (DSP), an application specific integrated circuit (ASIC), etc. A general processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0100] The memory 502 can be used to store program instructions. The memory 502 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 500 (such as audio data, etc.), etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (Universal Flash Storage, referred to as UFS), etc. The processor 501 executes various functional applications and data processing of the electronic device 500 by running the program instructions stored in the memory 502.

[0101] The communication interface 503 can provide solutions for wireless communications including 2G / 3G / 4G / 15G, etc., applied to the electronic device 500. The communication interface 503 can receive electromagnetic waves through an antenna, filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The communication interface 503 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna. In some embodiments, at least some functional modules of the communication interface 503 can be set in the processor 501. In some embodiments, at least some functional modules of the communication interface 503 can be set in the same device as at least some modules of the processor 501.

[0102] The system bus 504 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus 504 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0103] It should be noted that the number of the memory 502 and the processor 501 is not limited in the embodiment of the present application, and they can be one or more. Figure 5 Take one as an example for illustration; the memory 502 and the processor 501 can be connected by wire or wirelessly in various ways, such as through a bus connection. In practical applications, the electronic device 500 can be various forms of computers or mobile terminals. Among them, the computer is, for example, a laptop computer, a desktop computer, a workbench, a server, a blade server, a mainframe computer, etc.; the mobile terminal is, for example, a personal digital assistant, a cellular phone, a smart phone, a wearable device, and other similar computing devices.

[0104] The electronic device of this embodiment can be used to execute the technical solution in the above method embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.

[0105] The embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the solution of the network set-top box data recovery method in the above method embodiment is implemented.

[0106] The embodiment of the present application also provides a computer program product, including a computer program; when the computer program is executed, the solution of the network set-top box data recovery method in the above method embodiment is implemented.

[0107] An embodiment of the present application further provides a network set-top box, including: the electronic device provided in the above embodiment.

[0108] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for recovering data from a network set-top box, characterized in that: The method comprises the following steps: In response to a data initialization request, reading the data to be backed up from the original storage area, and listing the data to be backed up in the first set; Copying the data to be backed up from the first set to a preset storage partition; Performing data initialization on the original storage area; Identify target data from the data to be backed up in the storage partition, and list the target data in the second set; Copying the target data from the second set to the target storage path of the original storage area to obtain restored data; Calculate a first hash value of the restored data according to a preset hash algorithm; Obtain a second hash value from a remote end, verify whether the first hash value and the second hash value are consistent, if they are consistent, data recovery is completed; if the hash values ​​are inconsistent, return to the step of identifying the target data from the data to be backed up in the storage partition, loop until the first hash value is consistent with the second hash value, and complete data recovery; The second hash value is obtained according to the following steps: before performing data initialization on the original storage area, the remote end reads the data to be backed up from the original storage area, identifies the target data, calculates the second hash value of the target data using a preset hash algorithm, and stores the second hash value at the remote end, waiting for verification; The data to be backed up also includes non-target data, and the method further includes: In response to a non-target program request, reading non-target data corresponding to the non-target program request from the storage partition; If the non-target data is empty, a page to be configured is displayed on the user interface; If the non-target data is not empty, displaying configuration information corresponding to the non-target data on the user interface, and displaying an option for asking whether to restore the configuration information; In response to determining a request for restoration, copying the non-target data from the storage partition to a corresponding non-target storage path of the original storage area, and configuring a corresponding non-target program according to the non-target data; In response to the request to cancel the restoration, a page to be configured is displayed on the user interface, and the non-target data is deleted from the storage partition.

2. The network set-top box data recovery method according to claim 1, characterized in that: The preset hash algorithm includes MD5 algorithm and / or SHA-256 algorithm.

3. The network set-top box data recovery method according to claim 2, characterized in that: After the data recovery is completed, the following steps are also included: The corresponding target program is configured according to the recovery data.

4. The network set-top box data recovery method according to claim 3, characterized in that: The step of reading the data to be backed up from the original storage area includes: Read the set-top box system preset attributes and / or platform-issued attributes to obtain the storage path and name of the data to be backed up; Acquire the data to be backed up according to the storage path and name; and / or, The step of copying the target data from the second set to the target storage path of the original storage area to obtain the restored data includes: Get the target storage path of the target data from FileSave.cpp; The target data is copied from the second set to the target storage path to obtain restored data.

5. The network set-top box data recovery method according to claim 4, characterized in that: The step of reading the set-top box system preset attributes and / or platform issued attributes to obtain the storage path and name of the data to be backed up includes: Call the SystemProperties.get(key,defvalue) program to obtain the storage path and name of the data to be backed up from the set-top box system preset properties and / or platform-issued properties.

6. The method for recovering data from a network set-top box according to any one of claims 1 to 5, characterized in that: The target data includes at least one of a connected WiFi account password, an Ethernet account password, a hotspot account password, and a Bluetooth PIN code.

7. A network set-top box data recovery device, characterized in that: The device comprises: A reading module, configured to read the data to be backed up from the original storage area in response to a data initialization request, and list the data to be backed up in the first set; A first backup module, used for copying the data to be backed up from the first set to a preset storage partition; An initialization module, used for performing data initialization on the original storage area; an identification module, configured to identify target data from the data to be backed up in the storage partition, and list the target data in the second set; A second backup module, used for copying the target data from the second set to a target storage path of the original storage area to obtain recovery data; A calculation module, used for calculating a first hash value of the restored data according to a preset hash algorithm; A verification module, used to obtain a second hash value from a remote end, verify whether the first hash value and the second hash value are consistent, if they are consistent, the data recovery is completed; if the hash values ​​are inconsistent, return to the step of identifying the target data from the data to be backed up in the storage partition, loop until the first hash value is consistent with the second hash value, and complete the data recovery; The second hash value is obtained according to the following steps: before performing data initialization on the original storage area, the remote end reads the data to be backed up from the original storage area, identifies the target data, calculates the second hash value of the target data using a preset hash algorithm, and stores the second hash value at the remote end, waiting for verification; The data to be backed up also includes non-target data, and the device also includes a response module, which is used to: In response to a non-target program request, reading non-target data corresponding to the non-target program request from the storage partition; If the non-target data is empty, a page to be configured is displayed on the user interface; If the non-target data is not empty, displaying configuration information corresponding to the non-target data on the user interface, and displaying an option for asking whether to restore the configuration information; In response to determining a request for restoration, copying the non-target data from the storage partition to a corresponding non-target storage path of the original storage area, and configuring a corresponding non-target program according to the non-target data; In response to the request to cancel the restoration, a page to be configured is displayed on the user interface, and the non-target data is deleted from the storage partition.

8. An electronic device, characterized in that: include: Memory and processor; The memory is used to store program instructions; The processor is used to call the program instructions to execute the network set-top box data recovery method according to any one of claims 1 to 6.

9. A network set-top box, characterized in that: include: The electronic device as claimed in claim 8.