A data recovery method, device, electronic device and storage medium

By introducing a blockchain system into audio and video applications, using its traceability, distributed consistency and anti-tampering technology, the problem that users cannot retrieve deleted audio and video behavior data is solved, and data recovery and user portrait analysis are improved.

CN114185952BActive Publication Date: 2025-07-11TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110110543.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-15
Publication Date
2025-07-11
Estimated Expiration
2040-09-15

AI Technical Summary

Technical Problem

In the prior art, users cannot retrieve historical audio and video behavior data that has been completely deleted from the audio and video server database.

Method used

The blockchain system is introduced to store the operation data of audio and video applications. Through the traceability, distributed consistency and anti-tampering technology of the blockchain, it realizes the storage and retrieval of audio and video behavior data, including storing the data in the blockchain system and searching and restoring it to the database.

Benefits of technology

It realizes the retrieval of the audio and video behavior data that has been deleted, improves the convenience of user data retrieval and the reliability of data query, and enhances the accuracy of user image analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114185952B_ABST
    Figure CN114185952B_ABST
Patent Text Reader

Abstract

The present application provides a data recovery method, apparatus, electronic device, and storage medium. The target data type to which the target audio-visual behavior data of the audio-visual application requested to be recovered by the target user belongs is obtained (the target audio-visual behavior data is historical audio-visual behavior data that is not currently stored in the database and has been deleted from the database). According to the target data type, the target audio-visual behavior data can be searched from a blockchain system for storing operation data of the audio-visual application (the operation data includes first operation data representing the audio-visual behavior data of the audio-visual application). Based on this, not only can the queried target audio-visual behavior data be stored in the database, but also the queried target audio-visual behavior data can be returned to the audio-visual application for the target user to view, realizing the recovery of the audio-visual behavior data that has been deleted from the database.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the application with the application date of September 15, 2020, application number: 202010967446.7, and invention title: A Data Recovery Method, Device, Electronic Device and Storage Medium. Technical Field

[0002] The present invention relates to the field of computer application technologies, and more particularly, to a data recovery method, device, electronic device and storage medium. Background Art

[0003] With the rapid development of communication technologies, people's functional requirements for terminals such as mobile phones and computers are constantly increasing, and various terminal-based applications are also increasing. In particular, audio and video applications have gradually become an essential tool in people's daily work and life. The user's operation behaviors on the audio and video in the audio and video applications will generate the user's audio and video behavior data.

[0004] In the prior art, generally, an audio and video server stores the user's audio and video behavior data in a database. When the user requests the audio and video application to query historical audio and video behavior data, the audio and video server directly queries the data from the database and returns the data to the audio and video application, so that the user can perform subsequent operations on the queried historical audio and video behavior data.

[0005] Moreover, when the user requests the audio and video application to delete historical audio and video behavior data, the audio and video server directly deletes the historical audio and video behavior data from the database completely. In this case, the user cannot request the audio and video application to retrieve the historical audio and video behavior data that has been deleted. Summary of the Invention

[0006] In view of this, the present application provides a data recovery method, device, electronic device and storage medium to realize the recovery of historical audio and video behavior data that has been deleted. The technical solutions are as follows:

[0007] A data recovery method includes:

[0008] Responding to the triggering operation of the target user on the data recovery button of the target data type in the first user interface; various data type buttons of each data type are displayed in the first user interface;

[0009] Receiving a data recovery request sent by the target user based on the data recovery interface; the data recovery request indicates to retrieve the target audio and video behavior data of the audio and video application, and the target audio and video behavior data is historical audio and video behavior data that is not currently stored in the database and has been deleted from the database;

[0010] Obtain the data retrieval condition carried in the data retrieval request, where the data retrieval condition indicates the target data type and the data retrieval range, and the data retrieval range is related to the target data deletion operation or the data retrieval time range;

[0011] Search in the blockchain system for storing the operation data of the audio - video application for the target audio - video behavior data that is within the data retrieval range and belongs to the target data type;

[0012] Store the target audio - video behavior data in the database;

[0013] Return the target audio - video behavior data to the target user.

[0014] A data retrieval device, comprising:

[0015] A data retrieval request receiving unit, configured to respond to the triggering operation of the target user on the data retrieval button of the target data type in the first user interface; display the data retrieval interface of the target data type; the first user interface displays data retrieval buttons for each of multiple data types; receive the data retrieval request sent by the target user based on the data retrieval interface; the data retrieval request indicates retrieving the target audio - video behavior data of the audio - video application, and the target audio - video behavior data is historical audio - video behavior data that is not currently stored in the database and has been deleted from the database;

[0016] A data type obtaining subunit, configured to obtain the data retrieval condition carried in the data retrieval request, where the data retrieval condition indicates the target data type and the data retrieval range, and the data retrieval range is related to the target data deletion operation or the data retrieval time range;

[0017] A data retrieval unit, configured to search in the blockchain system for storing the operation data of the audio - video application for the target audio - video behavior data that is within the data retrieval range and belongs to the target data type;

[0018] A data storage unit, configured to store the target audio - video behavior data in the database;

[0019] A data returning unit, configured to return the target audio - video behavior data to the target user.

[0020] An electronic device, comprising: a processor and a memory, the processor and the memory are connected through a communication bus; wherein, the processor is configured to call and execute a program stored in the memory; the memory is configured to store a program, and the program is used to implement the data retrieval method.

[0021] A computer-readable storage medium stores a computer program thereon, and the computer program is loaded and executed by a processor to implement the steps of the data recovery method.

[0022] This application provides a data recovery method, apparatus, electronic device, and storage medium. The target data type to which the target audio-video behavior data requested by the target user to recover belongs is obtained (the target audio-video behavior data is historical audio-video behavior data that is not currently stored in the database and has been deleted from the database). According to the target data type, the target audio-video behavior data can be found in the blockchain system for storing operation data of the audio-video application (the operation data includes first operation data representing the audio-video behavior data of the audio-video application). Based on this, not only can the queried target audio-video behavior data be stored in the database, but also the queried target audio-video behavior data can be returned to the audio-video application for the target user to view, realizing the recovery of the audio-video behavior data that has been deleted from the database. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings according to the provided drawings without creative efforts.

[0024] Figure 1 It is a schematic structural diagram of an existing audio-video system provided by an embodiment of this application;

[0025] Figure 2 It is a schematic structural diagram of a blockchain provided by an embodiment of this application;

[0026] Figure 3 It is a schematic diagram of the process of generating a new block provided by an embodiment of this application;

[0027] Figure 4 It is a schematic diagram of a Merkle tree structure provided by an embodiment of this application;

[0028] Figure 5 It is a schematic structural diagram of a data recovery system provided by an embodiment of this application;

[0029] Figure 6 It is another schematic structural diagram of a data recovery system provided by an embodiment of this application;

[0030] Figure 7 It is a flowchart of a data recovery method provided by an embodiment of this application;

[0031] Figure 8A flowchart of a method for finding target audio - video behavior data from a blockchain system for storing operation data of an audio - video application according to a target data type provided by an embodiment of the present application;

[0032] Figure 9 A flowchart of a method for obtaining a data retrieval range indicated by a data retrieval condition provided by an embodiment of the present application;

[0033] Figure 10a - Figure 10b A schematic diagram of the interaction between a database and a cache provided by an embodiment of the present application;

[0034] Figure 11a - Figure 11d A schematic diagram of a data retrieval method provided by an embodiment of the present application;

[0035] Figure 12 A schematic diagram of the structure of a data retrieval device provided by an embodiment of the present application;

[0036] Figure 13 A hardware structure block diagram of an electronic device to which a data retrieval method provided by an embodiment of the present application is applicable. Detailed implementation manners

[0037] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0038] Embodiment:

[0039] Figure 1 A schematic diagram of the structure of an existing - technology audio - video system provided by an embodiment of the present application. As Figure 1 shown, the existing - technology audio - video system usually consists of a terminal, an audio - video server, and a database. Users can install a client (audio - video application) on the terminal, and the audio - video server is used to provide technical support for the audio - video application.

[0040] A database (Database), in short, can be regarded as an electronic filing cabinet - a place for storing electronic files. Users can perform operations such as adding, querying, updating, and deleting data in the files. The so - called "database" is a data set stored together in a certain way, shared by multiple users, having the smallest possible redundancy, and independent of application programs.

[0041] In the audio - video system provided by the existing technology, the operation behavior of the audio - video in the audio - video application on the terminal will generate corresponding audio - video behavior data, and the audio - video server stores the audio - video behavior data in the database.

[0042] A user can send a data query request to an audio - video application. The audio - video server receives the data query request sent by the audio - video application, queries the request result of the data query request from the database, and returns the request result to the audio - video application.

[0043] Furthermore, the user can also send a data deletion request to the audio - video application. The audio - video server receives the data deletion request sent by the audio - video application and completely deletes the data indicated to be deleted by the data deletion request from the database. In this case, if the user sends a data query request to the audio - video application to query the data that has been completely deleted from the database, the audio - video server receives the data query request and cannot query the request result of the data request from the database. Also, based on the existing audio - video behavior system, the user cannot retrieve the audio - video behavior data that has been completely deleted from the database.

[0044] The embodiment of the present application provides a new audio - video system, which can be called a data retrieval system. This data retrieval system can not only retrieve the audio - video behavior data that was once deleted from the database, but also store the retrieved audio - video behavior data in the database. In this way, after subsequently receiving a data query request sent by the user, the audio - video behavior data that was once deleted from the database can be queried from the database.

[0045] In order to implement the data retrieval function, the data retrieval system provided by the embodiment of the present application introduces a blockchain system. Now, the blockchain system will be described in detail first.

[0046] Blockchain is a new application mode of computer technologies such as distributed data storage, peer - to - peer transmission, consensus mechanism, and encryption algorithms. Blockchain, in essence, is a decentralized database, a series of data blocks generated by using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity (anti - forgery) of the information and generate the next block. A blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.

[0047] The underlying blockchain platform may include processing modules such as user management, basic services, smart contracts, and operation management. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and the maintenance of the correspondence between the real identity of users and blockchain addresses (permission management). And under authorized circumstances, it supervises and audits the transaction situations of certain real identities, and provides the rule configuration for risk control (risk control and auditing); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and after reaching a consensus on valid requests, records them on the storage. For a new business request, the basic service first performs interface adaptation parsing and authentication processing (interface adaptation), then encrypts the business information through a consensus algorithm (consensus management), transmits it intact and consistently to the shared ledger after encryption (network communication), and performs record storage; the smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define contract logic through a certain programming language, publish it to the blockchain (contract registration), trigger the execution according to the logic of the contract terms by calling keys or other events, complete the contract logic, and at the same time provide functions for contract upgrade and cancellation; the operation management module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation during the product release process, and the visual output of the real-time status during product operation, such as: alarming, managing network conditions, managing the health status of node devices, etc.

[0048] The platform product service layer provides the basic capabilities and implementation frameworks of typical applications. Developers can build on these basic capabilities and overlay the characteristics of the business to complete the blockchain implementation of the business logic. The application service layer provides application services based on the blockchain solution for business participants to use.

[0049] Taking the distributed system as an example of the blockchain system, the blockchain system consists of multiple nodes. When any node in the blockchain system receives input information, other nodes in the blockchain system obtain this input information according to the consensus algorithm and store this input information, so that the data stored on all nodes in the blockchain system is consistent.

[0050] For each node in the blockchain system, there is a corresponding node identifier, and each node in the blockchain system can store the node identifiers of other nodes in the blockchain system, so as to broadcast the generated block to other nodes in the blockchain system according to the node identifiers of other nodes in the future. A node identifier list as shown in the following table can be maintained in each node, and the node name and node identifier are stored correspondingly in this node identifier list. Among them, the node identifier can be an IP (Internet Protocol) address and any other information that can be used to identify this node. Only the IP address is used as an example in Table 1 for illustration.

[0051] Table 1

[0052] Node Name Node Identifier Node 1 117.114.151.174 Node 2 117.116.189.145 ... ... Node N 119.123.789.258

[0053] Each node in the blockchain system stores an identical blockchain. The blockchain consists of multiple blocks, see Figure 2 , the blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information eigenvalue, version number, timestamp, and difficulty value. The block body stores the input information; the next block of the genesis block uses the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information eigenvalue of the current block, the block header eigenvalue of the parent block, version number, timestamp, and difficulty value, and so on. This ensures that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, guaranteeing the security of the input information in the block.

[0054] When generating each block in the blockchain, see Figure 3 , when the node where the blockchain is located receives the input information, it verifies the input information. After verification, it stores the input information in the memory pool and updates the hash tree used to record the input information; then, it updates the timestamp to the time when the input information is received and tries different random numbers, performing eigenvalue calculations multiple times so that the calculated eigenvalue can satisfy the following formula:

[0055] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET

[0056] where SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time of the updated timestamp; nbits is the current difficulty, which is a fixed value within a certain period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, and this eigenvalue threshold can be determined according to nbits.

[0057] In this way, when a random number that satisfies the above formula is calculated, the information can be stored correspondingly, generating a block header and a block body to obtain the current block. Subsequently, the node where the blockchain is located sends the newly generated block to other nodes in its blockchain system according to the node identifiers of other nodes in the blockchain system. Other nodes verify the newly generated block and add the newly generated block to the blockchain they store after verification.

[0058] Based on the above detailed description of the blockchain system introduced in the data recovery system provided in the embodiments of the present application, the data recovery system provided in the embodiments of the present application will be further introduced. The data recovery system provided in the embodiments of the present application at least includes a terminal, an audio-video server, a database, and a blockchain system. The functions of the terminal, the audio-video server, the database, and the blockchain system will be described below respectively.

[0059] The terminal is used to install a client (audio-video application), and the client can be an application client or a web version client.

[0060] The terminal can be any electronic product that can perform human-computer interaction with the user in one or more ways such as a keyboard, a touchpad, a touch screen, a remote control, voice interaction, or a handwriting device. Exemplarily, the terminal can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a personal computer, a smart speaker, a wearable device, a smart TV, a smart watch, etc., but is not limited thereto.

[0061] The audio-video server is used to provide technical support for the audio-video application. The audio-video server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal and the audio-video server can be directly or indirectly connected through wired or wireless communication methods, and the present application does not limit this here.

[0062] The database is used to store the audio-video behavior data of the audio-video application. Exemplarily, the database can be an SQL database, a NoSQL database, etc., and is not limited here. In the embodiments of the present application, the operation behavior of the user on the audio-video application on the terminal will generate audio-video behavior data, and the data recovery system can store the audio-video behavior data in the database. Preferably, the audio-video server in the data recovery system can store the audio-video behavior data in the database.

[0063] The blockchain in the blockchain node of the blockchain system is used to store the operation data of the audio-video application. That is, the operation data of the audio-video application is stored as input information in the block body of the block in the blockchain.

[0064] Exemplarily, the operation data includes first operation data and second operation data. The first operation data represents the audio-video behavior data of the audio-video application. The second operation data represents the operation information of the audio-video behavior data stored in the database.

[0065] The blockchain system can utilize the technical features of the blockchain, namely traceability (block chain structure), distributed consistency (consensus algorithm), and anti-tampering (cryptography), to store the operation data of audio and video applications. The following introduces the technical implementation of the above three points in combination with the operation data of audio and video applications.

[0066] Traceability: By using the chain structure of the block, if a user deletes audio and video behavior data in the database and then wants to view the deleted data again, the user can trace back to the audio and video behavior data according to the chain structure.

[0067] Distributed consistency: In fact, if all nodes in a distributed system can operate without failure with extremely powerful performance (instant response, high throughput), then the consensus process is not complex and can be simply achieved through a multicast voting process. Unfortunately, such a "perfect" system does not exist in reality. For example, there are often delays in responding to requests, the network may be interrupted, nodes may fail, and there may even be malicious nodes deliberately trying to disrupt the system. For the operation data of audio and video applications, it is considered that there is no malicious response. Therefore, to ensure the consistency of the system, the Raft algorithm is used as the consensus mechanism. Under this mechanism, the network organizational structure is master-slave and allows less than 1 / 2 of the nodes to fail.

[0068] Anti-tampering: Anti-tampering mainly uses technologies such as encryption, Merkle trees, and distributed storage.

[0069] Regarding encryption, the hash value of the user's account information in the audio and video application is used as the encryption key. Therefore, for the operation data of the user in the audio and video application, when the user's account information is unknown, the content before encryption cannot be obtained.

[0070] Users can register in the audio and video application to obtain account information (account information includes account and password); if a user successfully logs in to the audio and video application using the account information, this user can be considered a logged-in user, and the account information used by this user to log in to the audio and video application can be considered the user's account information in the audio and video application; if a user fails to successfully log in to the audio and video application using the account information, this user can be considered an unlogged user (visitor). In this case, the account information used by this user to log in to the audio and video application can be considered the device information of the terminal where the audio and video application is used. The device information includes the hardware device information of the terminal and the password assigned by the audio and video application for this hardware device information.

[0071] Exemplarily, the hardware device information of the terminal can be considered the hardware device identifier of the terminal, and the hardware device identifier of the terminal can be regarded as an account.

[0072] In the embodiment of the present application, the password of the account information can be first subjected to a hash calculation to obtain a first hash value, and then the first hash value and the account number of the account information are subjected to a hash calculation to obtain a second hash value. The second hash value is used to encrypt the operation data of the user, and the encrypted operation data is stored in the blockchain system.

[0073] For a Merkle tree, the Merkle tree is used to ensure that the data blocks received by other nodes are not damaged and not replaced. The structure of the Merkle tree (hash tree) is as Figure 4 shown. The Merkle tree is a binary tree structure, consisting of a root node, a group of intermediate nodes, and a group of leaf nodes. As Figure 4 shown, the leaf nodes in the Merkle tree contain the stored data or its hash value, and the non-leaf nodes (including the intermediate nodes and the root node) are the hash values of the contents of its two child nodes. Any change in the underlying data in the Merkle tree will be passed to its parent node, which means that the value of the root of the Merkle tree actually represents the "digital digest" of all the underlying data. The difference chain system based on encryption, Merkle tree, and distributed storage can effectively achieve the purpose of preventing the operation data of the audio and video applications stored in the blockchain system from being tampered with.

[0074] Based on the above description of the functions of the terminal, audio and video server, database, and blockchain system provided in the embodiment of the present application for constructing a data recovery system, the detailed structures of the two data recovery systems provided in the embodiment of the present application will be described in detail in combination with Figure 4 - 5 this.

[0075] Figure 5 FIG. is a schematic structural diagram of a data recovery system provided in an embodiment of the present application.

[0076] As Figure 5 shown, the data recovery system consists of a terminal, an audio and video server, a database, and a blockchain system. For the functions of the terminal, audio and video server, database, and blockchain system, refer to the above description and will not be elaborated here.

[0077] Exemplarily, a data recovery method provided in an embodiment of the present application can be applied to the terminal in the data recovery system as Figure 5 shown, or can also be applied to the audio and video server in the data recovery system as Figure 5 shown.

[0078] Figure 6 FIG. is a schematic structural diagram of another data recovery system provided in an embodiment of the present application.

[0079] As Figure 6The data recovery system shown is composed of a terminal, an audio-video server, a target server, a database, and a blockchain system. For the functions of the terminal, audio-video server, database, and blockchain system, please refer to the above description and will not be elaborated here.

[0080] The target server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0081] Exemplarily, a data recovery method provided by an embodiment of the present application can be applied to the target server in the data recovery system as Figure 6 shown.

[0082] It should be noted that Figure 5 - 6 is only an example diagram, and there can be various types of terminals, not limited to Figure 5 - 6 the smart phones and laptop computers in. And Figure 5 - 6 only two terminals are shown in, and in actual applications, the number of terminals can be determined according to actual situations, and is not limited to Figure 5 - 6 the number shown.

[0083] Now, in combination with Figure 5 - 6 a data recovery method provided by an embodiment of the present application will be described in detail.

[0084] A data recovery method provided by an embodiment of the present application can store the audio-video behavior data generated by the user's operation behavior on the audio-video in the audio-video application on the terminal into the blockchain system. That is, the first operation data stored in the blockchain system includes the audio-video behavior data.

[0085] A data recovery method provided by an embodiment of the present application can also perform a traceability operation on the audio-video behavior data in the blockchain system to obtain traceability data, and store the traceability data into the blockchain system. That is, the first operation data stored in the blockchain system also includes the traceability data.

[0086] Further, in a data recovery method provided by an embodiment of the present application, the operation behavior of the user on the audio-video behavior data in the audio-video application involves the operation on the audio-video behavior data stored in the database. Correspondingly, in a data recovery method provided by an embodiment of the present application, the operation behavior of the user on the audio-video behavior data stored in the database will generate corresponding second operation data, and the second operation data represents the operation information (i.e., operation behavior) of the user on the audio-video behavior data of the audio-video application in the database. Further, in a data recovery method provided by an embodiment of the present application, the second operation data can be stored in the blockchain system.

[0087] In a data recovery method provided by an embodiment of the present application, by storing the operation data of the audio-video application (the operation data includes the first operation data and the second operation data) in the blockchain system, after the audio-video behavior data stored in the database is deleted, the purpose of retrieving the audio-video behavior data that has been deleted from the database from the blockchain system can be achieved.

[0088] For ease of understanding, taking a data recovery method provided by an embodiment of the present application applied to an audio-video server in a data recovery system as shown in Figure 5 as an example, the data recovery function implemented by the data recovery system as shown in Figure 5 will be described in detail.

[0089] The operation behavior of the user on the audio-video of the audio-video application on the terminal will generate audio-video behavior data related to the operation behavior, and the audio-video server stores the audio-video behavior data in the database and the blockchain system respectively.

[0090] In an embodiment of the present application, the user's behaviors such as watching, paying, giving away movies, and exchanging in the audio-video application can all be considered as the operation behaviors of the user on the audio-video in the audio-video application. The operation behavior of the user on the audio-video in the audio-video application will generate audio-video behavior data, and the data types of the audio-video behavior data generated by different operation types of operation behaviors are different.

[0091] For example, when the operation behavior is the behavior of watching an audio-video, the operation behavior belongs to the operation type of watching an audio-video, and the audio-video behavior data generated by the behavior of watching an audio-video can be called audio-video viewing data, and the audio-video viewing data belongs to the audio-video viewing data type.

[0092] For example, when the operation behavior is the behavior of paying for an audio-video, the operation behavior belongs to the operation type of audio-video payment, and the audio-video behavior data generated by the audio-video payment behavior can be called audio-video purchase data, and the audio-video purchase data belongs to the audio-video purchase data type.

[0093] For example, when the operation behavior is a payment behavior for the membership privilege of an audio-video application (i.e., purchasing the membership of an audio-video application), the operation behavior belongs to the operation type of membership privilege payment behavior. The audio-video behavior data generated by the payment behavior for the membership privilege of the audio-video application can be called membership privilege purchase data, and the membership privilege purchase data belongs to the membership privilege purchase data category.

[0094] For example, when the operation behavior is an exchange behavior for an audio-video, the operation behavior belongs to the operation type of audio-video exchange. The audio-video behavior data generated by the exchange behavior for the audio-video can be called audio-video exchange data, and the audio-video exchange data belongs to the audio-video exchange data category.

[0095] For example, when the operation behavior is a film donation behavior for an audio-video, the operation behavior data belongs to the operation type of audio-video film donation. The audio-video behavior data generated by the film donation behavior for the audio-video can be called audio-video film donation data, and the audio-video film donation data belongs to the audio-video film donation data category.

[0096] The above is the preferred content of the audio-video behavior data provided by the embodiments of the present application. Regarding the specific content of the audio-video behavior data, the inventor can set it according to his own needs and is not limited herein.

[0097] It should be noted that each piece of audio-video behavior data carries a unique data identifier. That is, different audio-video behavior data carry different data identifiers.

[0098] The audio-video behavior data can also carry the data generation time of the audio-video behavior data. For example, the user watched Video 1 on the audio-video application from 10:00 on March 3, 2020 to 11:00 on March 3, 2020. For this operation behavior of the user on Video 1, the corresponding audio-video behavior data is generated, and the data generation time carried by the generated audio-video behavior data is from 10:00 on March 3, 2020 to 11:00 on March 3, 2020.

[0099] The audio-video server can not only store the audio-video behavior data of the audio-video application into the blockchain system, but also perform a traceability operation on the audio-video behavior data in the blockchain system to obtain traceability data, and store the traceability data into the blockchain system. Correspondingly, both the audio-video behavior data and the traceability data of the audio-video application in the blockchain system can be regarded as the first operation data of the blockchain system.

[0100] It should be noted that since the audio-video behavior data is the data generated by the operation behavior of the audio-video in the audio-video application, the audio-video behavior data can also be regarded as operation data.

[0101] A user can send a data query request to an audio-video application on a terminal. The audio-video server receives the data query request sent by the audio-video application, queries the request result of the data query request in a database (i.e., obtains the audio-video behavior data indicated by the data query request from the database), returns the request result to the audio-video application, and the audio-video application displays the request result on a display interface.

[0102] The user views the request result displayed by the audio-video application on the display interface. If the user does not need some of the audio-video behavior data in the request result, the user can further send a data deletion request to the audio-video application. The audio-video server receives the data deletion request sent by the audio-video application and completely deletes the audio-video behavior data indicated by the data deletion request from the database.

[0103] It should be noted that when the user does not need some audio-video behavior data, the user can send a data deletion request to the audio-video application. In this case, only the audio-video behavior data indicated by the data deletion request in the database is deleted, and the audio-video behavior data in the blockchain system does not need to be deleted.

[0104] Furthermore, the audio-video server can also generate second operation data related to the data deletion request. The second operation data represents the operation information of the audio-video behavior data of the audio-video application stored in the database. Specifically, the second operation data related to the data deletion request represents the data deletion operation of the audio-video behavior data indicated by the data deletion request in the database, and the second operation data is stored in the blockchain system.

[0105] Exemplarily, the second operation data related to the data deletion request indicates the audio-video behavior data indicated by the data deletion request. That is, the second operation data related to the data deletion request indicates the audio-video behavior data indicated by the data deletion operation corresponding to the data deletion request.

[0106] Specifically, the second operation data representing the data deletion operation may include the data identifier of each audio-video behavior data indicated by the data deletion operation.

[0107] For example, the data deletion request indicates to delete two pieces of audio-video behavior data, which are audio-video behavior data 1 and audio-video behavior data 2 respectively. The data identifier of audio-video behavior data 1 is data identifier 1, and the data identifier of audio-video behavior data 2 is data identifier 2; correspondingly, the second operation data related to this data deletion request includes data identifier 1 and data identifier 2.

[0108] Furthermore, if a user wants to retrieve audio and video behavior data that has been deleted from the database, the user can send a data retrieval request to the audio and video application. The audio and video server receives the data retrieval request sent by the audio and video application, queries the request result of the data retrieval request from the blockchain system (i.e., searches for the audio and video behavior data that has been deleted from the database in the blockchain system according to the data retrieval request), stores the retrieved audio and video behavior data in the database, so as to achieve the purpose of restoring the audio and video behavior data that has been deleted from the database to the database. In this way, the user can directly query the restored audio and video behavior data from the database next time. Moreover, the audio and video server can not only store the retrieved audio and video behavior data in the database, but also return the retrieved audio and video behavior data to the audio and video application, so that the audio and video application can display the received audio and video behavior data on the display interface for the user to view.

[0109] Further, the audio and video server can also generate second operation data related to the data retrieval request. The second operation data represents the operation information of the audio and video behavior data of the audio and video application stored in the database. Specifically, the second operation data related to the data retrieval request represents the operation of retrieving the audio and video behavior data indicated by the data retrieval request back to the database, and stores the second operation data in the blockchain system.

[0110] Exemplarily, the second operation data related to the data retrieval request indicates the audio and video behavior data indicated by the data retrieval request. That is, the second operation data related to the data retrieval request indicates the audio and video behavior data retrieved by the data retrieval operation corresponding to the data retrieval request.

[0111] Specifically, the second operation data representing the data retrieval operation may include the data identifiers of each piece of audio and video behavior data retrieved by the data retrieval operation.

[0112] For example, the data retrieval request indicates retrieving two pieces of audio and video behavior data, which are audio and video behavior data 3 and audio and video behavior data 4 respectively. The data identifier of audio and video behavior data 3 is data identifier 3, and the data identifier of audio and video behavior data 4 is data identifier 4. Correspondingly, the second operation data related to the data retrieval request includes data identifier 3 and data identifier 4.

[0113] The user's operation behavior on the audio and video in the audio and video application generates audio and video behavior data. Both the data deletion operation and the data retrieval operation can be regarded as operations on the audio and video behavior data in the database. Performing a data deletion operation on the audio and video behavior data in the database can obtain second operation data representing the data deletion operation, and performing a data retrieval operation on the audio and video behavior data in the database can obtain second operation data representing the data retrieval operation.

[0114] The data recovery function provided by this application is applied to a data recovery system. In the data recovery system, the database is used to store the audio-video behavior data deposited by the audio-video server. The blockchain system in the data recovery system is not only used to store the audio-video behavior data deposited by the audio-video server, but also used to store the traceability data and the second operation data deposited by the audio-video server (the audio-video behavior data, the traceability data, and the second operation data of the audio-video application constitute the operation data of the audio-video application). By storing the operation data of the audio-video application in the blockchain system, not only can it be retrieved from the blockchain system after the audio-video behavior data in the database is deleted, but also, the user portrait analysis can be performed on the user based on the operation data of the user in the audio-video application stored in the blockchain system to generate the user portrait of the user, improving the accuracy of the user portrait analysis result.

[0115] Combined with the above data recovery system, the data recovery method provided by the embodiments of this application will be described below. Specifically, Figure 7 It is a flowchart of a data recovery method provided by an embodiment of this application. As Figure 7 shown, the data recovery method is applied to an electronic device, and the electronic device can be a terminal as Figure 5 shown, or an audio-video server as Figure 5 shown, or a target server as Figure 6 shown.

[0116] S701. Obtain the target data type to which the target audio-video behavior data of the audio-video application requested by the target user to recover belongs. The target audio-video behavior data is historical audio-video behavior data that is not currently stored in the database and has been deleted from the database.

[0117] The user can use the audio-video application on the account information terminal. If the user successfully logs in to the audio-video application through the account information, the user can be considered as a logged-in user, and the account (vuid) of the user's account information can be used as the user identifier of the user; if the user fails to successfully log in to the audio-video application through the account information, the user can be considered as an unlogged user. An unlogged user can be considered as a visitor. At this time, the hardware device identifier (guid) of the terminal where the audio-video application used by the user to log in can be used as the user identifier of the user.

[0118] A user sends a data retrieval request to an audio-video application on a terminal. The data retrieval request carries data retrieval conditions, which indicate the target data type to which the target audio-video behavior data of the audio-video application that the user requests to retrieve belongs among multiple data types. For the sake of easy distinction, the user who sends the data retrieval request can be called the target user. Correspondingly, the data retrieval conditions carried by the data retrieval request indicate the target data type to which the target audio-video behavior data of the audio-video application that the target user requests to retrieve belongs among multiple data types. Further, the data retrieval conditions can also carry the user identification of the target user.

[0119] If the target user has successfully logged in to the audio-video application through account information when sending the data retrieval request, the user identification in the data retrieval conditions of the data retrieval request is the account in the account information; if the target user has not successfully logged in to the audio-video application when sending the data retrieval request, the user identification in the data retrieval conditions carried by the data retrieval request is the hardware device identification of the terminal used to send the data retrieval request.

[0120] In the embodiments of the present application, the audio-video behavior data indicated to be retrieved by the data retrieval request is the audio-video behavior data to be retrieved, which can also be called the target audio-video behavior data. The data type to which the target audio-video behavior data belongs is called the target data type. The target data type can be an audio-video viewing data type, an audio-video purchase data type, a membership privilege purchase data type, an audio-video exchange data type, an audio-video gift film data type, etc.

[0121] It should be noted that the user's operation behavior on the audio-video in the audio-video application generates audio-video behavior data. The audio-video server can store the audio-video behavior data in a database; at the same time, the electronic device can store the audio-video behavior data in a blockchain system.

[0122] Exemplarily, if the electronic device is a terminal, when the audio-video application generates audio-video behavior data, the audio-video server stores the audio-video behavior data in a database, and the terminal stores the audio-video behavior data in a blockchain system.

[0123] Exemplarily, if the electronic device is an audio-video server, when the audio-video application generates audio-video behavior data, the audio-video server stores the audio-video behavior data in a database, and the audio-video server stores the audio-video behavior data in a blockchain system.

[0124] Exemplarily, if the electronic device is a target server, when the audio-video application generates audio-video behavior data, the audio-video server stores the audio-video behavior data in a database, and the audio-video server transmits the audio-video behavior data to the target server, and the target server stores the audio-video behavior data in a blockchain system.

[0125] The above are only several preferred implementation manners provided by the embodiments of the present application. Regarding the specific implementation manner of storing audio-visual behavior data in the blockchain system, the inventor can set it according to his own needs and is not limited herein.

[0126] The audio-visual behavior data generated in the audio-visual application needs to be stored in both the database and the blockchain system. If it involves the user's data deletion operation on the audio-visual behavior data that has been generated in the audio-visual application, it is necessary to delete the audio-visual behavior data indicated to be deleted by the data deletion operation in the database, and no deletion operation is performed on the audio-visual behavior data in the blockchain system.

[0127] Because, after the audio-visual server receives the data query request sent by the user, it directly queries the request result of the data query request from the database. In this way, if the audio-visual behavior data indicated to be queried by the data query request is the audio-visual behavior data that has been deleted from the database, the audio-visual server cannot query the request result of the data request.

[0128] Furthermore, if the user needs to query the audio-visual behavior data that has been deleted from the database, a data retrieval request needs to be sent. After the electronic device receives the data retrieval request, it queries the target audio-visual behavior data indicated to be retrieved by the data retrieval request (i.e., the request result of the data retrieval request) from the blockchain system. After the electronic device finds the request result of the data retrieval request from the blockchain system, it can not only return the request result to the audio-visual application for the audio-visual application to display the request result, but also store the request result in the database so that when a subsequent data query request is received, the retrieved audio-visual behavior data can be queried from the database.

[0129] S702. Search for the target audio-visual behavior data from the blockchain system for storing the operation data of the audio-visual application according to the target data type, where the operation data includes the first operation data representing the audio-visual behavior data;

[0130] After the electronic device receives the data retrieval request sent by the target user, it obtains the user identifier carried in the data retrieval request and determines the target data type to which the target audio-visual behavior data indicated to be retrieved by the data retrieval request belongs; the target audio-visual behavior data can be queried from the blockchain system according to the target data type.

[0131] It should be noted that the operation data of each user using the audio-visual application is stored in the blockchain system. Among them, the operation data of the user includes the first operation data and the second operation data of the user.

[0132] Exemplarily, the first operation data of the user includes the audio-visual behavior data of the user on the audio-visual application. Further, the electronic device can also perform a traceability operation on the audio-visual behavior data of the user stored in the blockchain system to obtain the traceability data of the user, and store the traceability data of the user in the blockchain system. Correspondingly, the first operation data of the user can be considered to include two parts of data. One part of the data is the audio-visual behavior data generated by the user's operation behavior on the audio-visual application, and the other part of the data is the traceability data of the user obtained by performing a traceability operation on the audio-visual behavior data of the user.

[0133] Exemplarily, if it involves a data deletion operation / data recovery operation on the audio-visual behavior data of the user, the electronic device will generate second operation data representing the operation information on the audio-visual behavior data, and store the second operation data in the blockchain system.

[0134] It should be noted that whether it is a data deletion operation on the audio-visual behavior data of the user or a data recovery operation on the audio-visual behavior data of the user, it involves the operation on the audio-visual behavior data in the database. For example, the data deletion operation on the audio-visual behavior data of the user involves the data deletion operation of the user on the audio-visual behavior data in the database; the data recovery operation on the audio-visual behavior data of the user will ultimately store the retrieved audio-visual behavior data in the database, which can also be considered as the operation of the user on the audio-visual behavior data in the database.

[0135] Therefore, the second operation data can represent the operation information of the user on the audio-visual behavior data in the database. That is, it represents the operation behavior of the user on the audio-visual behavior data in the database.

[0136] In the embodiments of the present application, the audio-visual behavior data of all users using the audio-visual application can be considered as the audio-visual behavior data of the audio-visual application.

[0137] The operation data of the user corresponding to the user identifier carried in the data recovery request can be queried from the blockchain system first; and the target audio-visual behavior data of the user can be queried from the operation data of the user according to the target data type. For the specific process of finding the target audio-visual behavior data from the blockchain system according to the target data type, please refer to Figure 8 the detailed description, which will not be elaborated here.

[0138] S703. Store the target audio-visual behavior data in the database;

[0139] S704. Return the target audio-visual behavior data to the target user.

[0140] Exemplarily, if the electronic device is a terminal, after querying the target audio-visual behavior data from the blockchain system, the electronic device may return the target audio-visual behavior data to the audio-visual application; and store the target audio-visual behavior data in a database. In one implementation, the terminal may first send the target audio-visual behavior data to the audio-visual server, and then the audio-visual server stores the target audio-visual behavior data in the database. In another implementation, the terminal directly stores the target audio-visual behavior data in the database.

[0141] Exemplarily, if the electronic device is an audio-visual server, after querying the target audio-visual behavior data from the blockchain system, the audio-visual server may return the target audio-visual behavior data to the audio-visual application through the terminal, and the audio-visual server may also store the target audio-visual behavior data in the database.

[0142] Exemplarily, if the electronic device is a target server, after querying the target audio-visual behavior data from the blockchain system, the target server may send the target audio-visual behavior data to the audio-visual server, and then the audio-visual server returns the target audio-visual behavior data to the audio-visual application through the terminal, and the audio-visual server stores the target audio-visual data in the database.

[0143] In the embodiments of the present application, after the electronic device finds the target audio-visual behavior data from the blockchain system, it may return the found target audio-visual behavior data to the audio-visual application, so as to display the target audio-visual behavior data on the display interface of the audio-visual application, which is convenient for users to view. Moreover, after the electronic device finds the target audio-visual behavior data from the blockchain system, it may also store the target audio-visual behavior data in the database. In this way, when the user needs to query the target audio-visual behavior data again, the user may send a data query request to the audio-visual application, and the audio-visual server may directly query the target video behavior data from the database in response to the data query request, without retrieving the data from the blockchain system again.

[0144] The following combines Figure 8 to elaborate in detail on the method for the electronic device to find the target audio-visual behavior data from the blockchain system for storing the operation data of the audio-visual application according to the target data type. As Figure 8 shown, the method includes:

[0145] S801. Query at least one traceability data of the target user from the first operation data of the audio-visual application stored in the blockchain system, where the traceability data is generated by tracing the audio-visual behavior data of the target user in the audio-visual application;

[0146] The operation data of users in the blockchain system for audio and video applications at least includes the audio and video behavior data of users in the audio and video applications. The electronic device performs a tracing operation every preset time interval (standard duration), and this tracing operation involves the tracing operation for each user respectively. Taking one user as an example, the tracing operation for this user can be understood as: performing a tracing operation on the audio and video behavior data of this user in the audio and video application in the blockchain system to generate a tracing data for this user.

[0147] Taking one user as an example, there are two ways to generate a tracing data for this user by performing a tracing operation on the audio and video behavior data of this user in the blockchain system for the audio and video application.

[0148] The first tracing method: Determine the time period between the current (current time) and the most recent previous tracing operation for this user (the time of the most recent previous tracing operation for this user); for the convenience of understanding, this time period can be called the actual time period; perform a tracing operation on the audio and video behavior data of this user generated by the audio and video application in the blockchain system during this actual time period to obtain the tracing data of this user during this actual time period. That is, count the audio and video behavior data of the user generated by the audio and video application stored in the blockchain system during the actual time period to obtain the tracing data of this user during this actual time period.

[0149] It should be noted that the method to determine the audio and video behavior data of the user generated by the audio and video application stored in the blockchain system during the actual time period can be: determine the audio and video behavior data of the audio and video application of the user whose data generation time stored in the blockchain system is within the actual time period.

[0150] For example, if the enabling time of a data recovery method provided in an embodiment of the present application is 10:00 on February 3, 2020; if the standard duration is 1 day, taking user 1 as an example, then the first tracing for user 1 is performed at 10:00 on February 4, 2020, and all the audio and video behavior data of user 1 in the audio and video application from 10:00 on February 3, 2020 to 10:00 on February 4, 2020 is counted based on the blockchain system; the second tracing for user 1 is performed at 10:00 on February 5, 2020, and all the audio and video behavior data of user 1 in the audio and video application from 10:00 on February 4, 2020 to 10:00 on February 5, 2020 is counted based on the blockchain system; the third tracing for user 1 is performed at 10:00 on February 6, 2020, and all the audio and video behavior data of user 1 in the audio and video application from 10:00 on February 5, 2020 to 10:00 on February 6, 2020 is counted based on the blockchain system...

[0151] The second traceability method: Perform historical traceability operations on the audio and video behavior data of this user in the audio and video application stored in the blockchain system to generate traceability data. That is, count all the audio and video behavior data of this user in the audio and video application stored in the blockchain system from history to the present to obtain a traceability data of this user. That is, count all the historical audio and video behavior data of this user in the audio and video application stored in the blockchain system to obtain a traceability data of this user.

[0152] For example, if the enabling time of a data recovery method provided in an embodiment of this application is 10:00 on February 3, 2020; if the standard duration is 1 day, taking User 1 as an example, then the first traceability of User 1 is performed at 10:00 on February 4, 2020, and based on the blockchain system, count all the audio and video behavior data of User 1 in the audio and video application until 10:00 on February 4, 2020; the second traceability of User 1 is performed at 10:00 on February 5, 2020, and based on the blockchain system, count all the audio and video behavior data of User 1 in the audio and video application until 10:00 on February 5, 2020; the third traceability of User 1 is performed at 10:00 on February 6, 2020, and based on the blockchain system, count all the audio and video behavior data of User 1 in the audio and video application until 10:00 on February 6, 2020...

[0153] It should be noted that the enabling time of a data recovery method provided in an embodiment of this application can be regarded as the time when the first traceability operation is performed. The enabling time of the data recovery method can be regarded as the time when the data recovery method is first applied.

[0154] In an embodiment of this application, the server performs a traceability operation at every preset time interval (standard duration). For each traceability operation, after the execution of this traceability operation is completed, a traceability data can be obtained for each user who has used the audio and video application historically before the execution of this traceability operation, and all the traceability data of the obtained users are regarded as the traceability data generated by this traceability operation.

[0155] S802. Obtain the data recovery range indicated by the data recovery condition;

[0156] In an embodiment of this application, the data recovery condition indicates a data recovery range. For the method of obtaining the data recovery range indicated by the data recovery condition, please refer to Figure 9 for the detailed introduction and will not be elaborated here.

[0157] S803. Query, from at least one piece of traceability data, the data that is within the data recovery range and belongs to the target data type.

[0158] Query at least one traceability data of the target user from the first operation data of the audio-video application stored in the blockchain system, and obtain the data recovery range indicated by the data recovery condition; the audio-video behavior data located within the data recovery range and belonging to the target data type can be queried from at least one traceability data.

[0159] In the embodiments of the present application, each traceability data of the target user queried from the first operation data of the audio-video application stored in the blockchain system can be regarded as at least one traceability data of the target user.

[0160] For the first traceability method, query at least one traceability data of the target user from the first operation data of the audio-video application stored in the blockchain system. Each traceability data in the at least one traceability data corresponds to a different actual time period, and there is no time overlap between the actual time periods corresponding to different traceability data in the at least one traceability data. Correspondingly, the method of querying the audio-video behavior data located within the data recovery range and belonging to the target data type from at least one traceability data can be: obtain the data generation time of the audio-video behavior data indicated to be retrieved by the data recovery range (that is, determine the data generation time of the target audio-video behavior data), determine the traceability data in the at least one traceability data that matches the obtained data generation time (for the sake of distinction, the traceability data determined here is called the first traceability data), and query the audio-video behavior data located within the data recovery range and belonging to the target data type from the first traceability data.

[0161] Among them, the method of determining the traceability data in the at least one traceability data that matches the data generation time can be: determine the actual time period corresponding to each traceability data in the at least one traceability data, obtain the actual time periods in which the data generation time is located from the determined actual time periods, and determine the traceability data of each obtained actual time period as a traceability data that matches the data generation time.

[0162] In the embodiments of the present application, the method of obtaining the actual time periods in which the data generation time is located from the determined actual time periods can be: if there is a time overlap between the determined actual time period and the data generation time, then consider the determined actual time period as the actual time period in which the data generation time is located.

[0163] For example, if at least one traceability data includes traceability data with an actual time period of 10:00 - 11:00, traceability data with an actual time period of 11:00 - 12:00, and traceability data with an actual time period of 12:00 - 13:00, and if the data generation time is 10:30 - 11:30, then the traceability data in at least one traceability data that matches the data generation time includes traceability data with an actual time period of 10:00 - 11:00 and traceability data with an actual time period of 11:00 - 12:00. It should be noted that there is no time overlap between 10:00 - 11:00 and 11:00 - 12:00, and there is no time overlap between 11:00 - 12:00 and 12:00 - 13:00. For example, 10:00 - 11:00 may not include 11:00; 11:00 - 12:00 may not include 12:00.

[0164] For the second traceability method, the method of querying the audio - video behavior data within the data recovery range and belonging to the target data type from at least one traceability data can be: determining the traceability data that was most recently generated among at least one traceability data (for the sake of distinction, the traceability data that was most recently generated among at least one traceability data is called the second traceability data); querying the data within the data recovery range and belonging to the target data type from the second traceability data.

[0165] In the second traceability method, the execution time of the traceability operation is proportional to the generation time of the traceability data generated by the traceability operation. That is, the later the traceability operation is executed, the later the generation time of the traceability data generated by the traceability operation. In this way, by searching for the traceability data that was most recently generated from at least one traceability data of the target user, this traceability data that was most recently generated is the traceability data with the latest generation time among at least one traceability data of the target user.

[0166] The later the traceability operation is executed, the more audio - video behavior data is included in the generated traceability data. For example, on February 3, 2020, at 10:00, user 1 is traced. Based on the blockchain system, until 10:00 on February 3, 2020, all the audio - video behavior data of user 1 in the audio - video application is obtained as traceability data 1; on March 3, 2020, at 10:00, user 1 is traced. Based on the blockchain system, until 10:00 on March 3, 2020, all the audio - video behavior data of user 1 in the audio - video application is obtained as traceability data 2, and traceability data 2 includes traceability data 1.

[0167] In the embodiments of the present application, data belonging to the target data type is queried from the first traceability data / the second traceability data, and further data located within the data recovery range is queried from the queried data. At this time, the data located within the data recovery range found can be regarded as the target audio-visual behavior data indicated to be recovered by the data recovery request. The embodiments of the present application implement data recovery based on the traceability data, and do not need to perform data traceability on the audio-visual behavior data stored in the blockchain system during the data recovery process, which can effectively improve the data recovery efficiency.

[0168] In the embodiments of the present application, for the method by which the electronic device obtains the data recovery range indicated by the data recovery condition, please refer to Figure 9 . Specifically, Figure 9 is a flowchart of a method for obtaining the data recovery range indicated by the data recovery condition provided by the embodiments of the present application.

[0169] As Figure 9 shown, the method includes:

[0170] S901. Detect whether the data recovery condition indicates a target data deletion operation; if the data recovery condition indicates a target data deletion operation, then perform step S902; if the data recovery condition does not indicate a target data deletion operation, then perform step S903;

[0171] When the target user sends a data recovery request to the audio-visual application, the data recovery request can be sent based on the selected data deletion operation. In this way, the data recovery condition carried by the data recovery request is related to the selected data deletion operation. For the sake of distinction, the data deletion operation selected by the target user is referred to as the target data deletion operation.

[0172] The target data deletion operation is a historical data deletion operation that the target user requests the audio-visual application to perform on the audio-visual behavior data in the database.

[0173] For example, the target data deletion operation selected by the target user can be the data deletion operation performed by the target user most recently in history, the data deletion operation performed by the target user for the third time from the bottom in history, the data deletion operations performed by the target user for the most recent 10 times in history, and so on. The target user can set the specific content of the target data deletion operation according to their own needs, and no limitation is made here.

[0174] S902. Query the target second operation data representing the target data deletion operation from the second operation data of the audio-visual application stored in the blockchain system;

[0175] In the embodiments of the present application, if the data recovery condition indicates a target data deletion operation, the operation data of the target user stored in the blockchain system may be determined first, the second operation data of the target user may be determined from the operation data of the target user, and then the second operation data representing the target data deletion operation may be queried from the second operation data of the target user. For the convenience of distinction, the second operation data representing the target data deletion operation queried may be referred to as the target second operation data.

[0176] S903. Obtain the target data identifier of the audio-visual behavior data requested to be deleted by the target data deletion operation from the target second operation data;

[0177] In the embodiments of the present application, the second operation data includes the data identifier of the audio-visual behavior data indicated to be deleted by the data deletion operation represented by the second operation data. Based on this, the data identifier included in the target second operation data may be obtained (for the convenience of distinction, the data identifier obtained from the target second operation data may be referred to as the target data identifier), and the target data identifier may be determined as the data recovery range indicated by the data recovery condition.

[0178] Correspondingly, when the data recovery range is the target data identifier, the method of querying the data belonging to the target data type from the first traceability data / second traceability data and further querying the data located within the data recovery range from the queried data may be: query the data belonging to the target data type from the first traceability data / second traceability data, and obtain the data carrying the target data identifier from the queried data.

[0179] S904. Obtain the data recovery time range indicated by the data recovery condition, and the data recovery time range is related to the data generation time of the target audio-visual behavior data.

[0180] Furthermore, if the data recovery condition does not indicate a target data deletion operation, it is determined whether the data recovery condition carries time information representing the data recovery time range. If the data recovery condition carries time information representing the data recovery time range, the time information carried by the data recovery condition is obtained (the time information carried by the data recovery condition may be considered as the data recovery time range indicated by the data recovery condition); if the data recovery condition does not carry time information representing the data recovery time range, the time range from history to now is determined as the data recovery time range indicated by the data recovery condition.

[0181] Correspondingly, when the data recovery range is the data recovery time range, the method of querying the data belonging to the target data type from the first traceability data / second traceability data and further querying the data located within the data recovery range from the queried data can be: querying the data belonging to the target data type from the first traceability data / second traceability data and further querying the data located within the data recovery time range from the queried data. That is, querying the data whose generation time is within the data recovery time range.

[0182] In an implementation, if there is a time overlap between the data generation time of the audio-visual data and the data recovery time range, the audio-visual data is considered to be the data within the data recovery time range.

[0183] In another implementation, if the data generation time of the audio-visual data is completely covered by the data recovery time range, the audio-visual data is considered to be the data within the data recovery time range. If there is a time overlap between the data generation time of the audio-visual data and the data recovery time range, but the data generation time of the audio-visual data is not completely covered by the data recovery time, the audio-visual data is considered not to be the data within the data recovery time range.

[0184] It should be noted that as long as there is the same time between two time periods, it can be considered that there is a time overlap between the two time periods; if the time range represented by one time period (the first time period) covers the time range represented by another time period (the second time period), it can be considered that the first time period covers the second time period.

[0185] The above are only two preferred implementation manners provided by the embodiments of the present application for determining whether the audio-visual data is within the data recovery time range. Regarding the specific manner of determining whether the audio-visual data is within the data recovery time range, the inventor can set it according to his own needs and is not limited herein.

[0186] In the embodiments of the present application, when the target user sends a data recovery request to the audio-visual application, if the data recovery request is sent based on the selected data deletion operation, the data recovery condition carried in the data recovery request is related to the selected data deletion operation; if the data recovery request is sent based on the selected data recovery time range, the data recovery condition carried in the data recovery request is related to the selected data recovery time range.

[0187] Further, if the target user neither selects a data deletion operation nor selects a data retrieval time range when sending a data retrieval request, the data retrieval request sent by the target user carries a data retrieval condition indicating the default data retrieval time range, which is from the past to the present. That is, taking the time when the target user first uses the audio-video application as the starting time point and the time when the data retrieval request sent by the target user is currently received as the ending time point, the time period composed of the starting time point and the ending time point can be considered as from the past to the present.

[0188] Based on different setting methods for the data retrieval range, the embodiments of the present application can implement different data retrieval scenarios. Correspondingly, more data retrieval methods are provided for users on the audio-video application side, improving the convenience of user data retrieval.

[0189] Based on the above detailed description of a data retrieval method and system provided by the embodiments of the present application, the database in the data retrieval system will be further described. The database is used to store audio-video behavior data; for example, the audio-video behavior data of users is stored using mysql. In terms of storage design, for logged-in users, the user account vuid is used as the identifier, and for unlogged users, the device guid is used as the identifier. In the mysql table, taking the audio-video viewing data as an example, the table structure of the audio-video viewing data of logged-in users can be shown in Table 2:

[0190] Table 2. Table Structure of Audio-Video Viewing Data of Logged-in Users

[0191] Field Type Description vuid int64 User ID cid string Album vid string List watch_time date Viewing Time duration int64 Viewing Duration platfrom int Platform Number guid string Device ID location string Viewing Geographic Location scene int Viewing Scene

[0192] In addition, the database provided by the embodiments of the present application has the following designs based on the user scale and the request volume:

[0193] 1. Since the number of users or devices is in the hundreds of millions, the tables are divided in the storage design. According to the dimension of vuid, the table is divided into 512 tables.

[0194] 2. In the database design, read-write separation is implemented. For the online query interface, the read database is requested (for users to view historical data), and for the online write requests (when users play videos and delete historical data), the write database is requested.

[0195] 3. Data redundancy. To prevent data loss, the historical data of users is backed up in multiple databases.

[0196] 4. Multi-site active-active. To reduce the request latency of users in different regions across the country, the data redundancy is distributed in five central cities across the country.

[0197] Moreover, since the read and write volume of audio-visual viewing data is extremely large (when users watch videos and when presenting the TV home page, for example, the historical viewing data will be pulled), if all requests read and write the database, the database will not be able to withstand the peak requests. Therefore, in order to reduce the burden on the database, a cache layer is added during read and write requests. The processing process of read and write requests and the consistency design between the cache and the database are as follows Figure 10a - Figure 10b as shown.

[0198] See Figure 10a . When requesting data, if the data is in the cache, it will be directly returned; otherwise, the database will be requested. When the data is found in the database, the cache will be updated simultaneously. See Figure 10b . When updating data, the database will be updated first, and the cache data will be set to invalid simultaneously.

[0199] In addition to audio-visual viewing data, users' video behavior data also includes audio-visual purchase data, gift video data, redemption data, and data of liking and supporting stars. In the design of the storage solution, except for the table structure and some design differences (for example: the online request volume of other audio-visual behavior data except audio-visual viewing data has not reached the level of audio-visual viewing data, so when requesting, the database storage is directly read without the need for caching), it is basically similar to the storage design of audio-visual viewing data.

[0200] The database provided in the embodiments of the present application adopts a multi-database backup mechanism, effectively improving the stability of the database and enhancing its anti-risk ability; moreover, the database not only adopts the strategy of multi-site active-active, but also combines the cache layer to implement data query, effectively reducing the burden on the database and improving the data query efficiency.

[0201] Furthermore, the embodiments of the present application provide a data retrieval scenario to elaborate on a data retrieval method provided in the embodiments of the present application.

[0202] For the user named "Zhang San", the first user interface is opened on the audio-visual application as Figure 11a . There is an item "Viewing History" displayed in this first user interface. Taking the example that the audio-visual behavior data of the user named "Zhang San" has never been deleted, after the user opens the first user interface, the item "Viewing History" in the first user interface displays the recent audio-visual behavior data of "Zhang San". The user can click "More" on this "Viewing History" item to jump to the second user interface as Figure 11b shown.

[0203] As Figure 11b shown, the detailed viewing history of "Zhang San" is displayed in the second user interface. See Figure 11b, the user can perform a data deletion operation on the audio - video behavior data in the detailed viewing history of "Zhang San" displayed in the second user interface through the "Edit" button on the second user interface.

[0204] For example, by using the "Edit" button as Figure 11b above to clear the audio - video behavior data in the detailed viewing history of "Zhang San", after clearing the detailed viewing history of "Zhang San" (correspondingly, the detailed viewing history of "Zhang San" stored in the database is deleted), if the user returns to the first user interface, the display content of the first user interface is as Figure 11c shown.

[0205] As Figure 11c can be seen, after clearing the audio - video behavior data in the detailed viewing history of "Zhang San", if returning to the first user interface, the first user interface cannot query any audio - video behavior data of "Zhang San" from the database. Therefore, as Figure 11c shown, the content in the "Viewing History" item is empty.

[0206] Refer to Figure 11c When the "Viewing History" is empty, the first user interface also provides a "Retrieve Viewing History" button. When the user clicks the "Retrieve Viewing History" button, it can jump to the retrieve viewing history interface, and the retrieve viewing history interface is as Figure 11d shown.

[0207] The user can fill in the data to be retrieved for the last few data deletion operations in the retrieve viewing history interface as Figure 11d shown; or, fill in the data retrieval time range in the retrieve viewing history interface as Figure 11d shown; after the user fills in and clicks the "Confirm" button as Figure 11d shown, a data retrieval operation can be performed from the blockchain system.

[0208] This application takes the example that the user does not fill in any information in the interface as Figure 11d shown. That is, the user neither fills in the data deletion operation nor the data retrieval time range, but directly clicks the "Confirm" button. At this time, the server of the audio - video application retrieves all the historical audio - video behavior data of "Zhang San" from the blockchain and displays all the retrieved historical audio - video behavior data of "Zhang San". That is, it jumps to and displays the interface as Figure 11b shown.

[0209] Moreover, the embodiment of this application can also store all the retrieved historical audio - video behavior data of "Zhang San" in the database, so that when the user opens the first user interface next time, the audio - video application can directly query the audio - video behavior data of "Zhang San" from the database, making the displayed first user interface as Figure 11aas shown

[0210] The viewing history can be regarded as audio - video viewing data. The data recovery schematic diagram provided in the embodiments of the present application, as shown Figure 11a - Figure 11d in, involves the recovery of data of the data type of "audio - video viewing data". If a user wants to recover data of other data types, they can enter from other positions in the interface. For example, the order shown Figure 11a can be regarded as audio - video purchase data. When the user clicks the "Order" button shown Figure 11a in, they can query all the audio - video purchase data of "Zhang San" in the database, and then perform operations such as deleting and recovering the audio - video purchase data of "Zhang San". The method of recovering data of the data type of "audio - video purchase data" will not be described in detail here.

[0211] A data recovery method provided in the embodiments of the present application adds a new function for users in terms of product experience, enabling the recovery of previously deleted records; compared with the current traditional storage solutions based on NoSQL or SQL, it enhances security, reducing the risk of accidental deletion of user data by operators; existing storage solutions only store users' audio - video behavior data, such as viewing history, purchase records, etc., while the data recovery method provided in the embodiments of the present application not only stores users' audio - video behavior data but also stores the operation data of users on the audio - video behavior data, such as the second operation data representing data deletion operations, the second operation data representing data recovery operations, etc. These data can be better used for user profiling and analysis, improving the accuracy of user profiling and providing a better data basis for user profiling analysis.

[0212] Figure 12 is a schematic structural diagram of a data recovery device provided in the embodiments of the present application.

[0213] As shown Figure 12 in, the device includes:

[0214] A data type acquisition unit 1201, configured to acquire the target data type to which the target audio - video behavior data of the audio - video application requested by the target user to recover belongs, where the target audio - video behavior data is historical audio - video behavior data that is not currently stored in the database and has been deleted from the database;

[0215] A data recovery unit 1202, configured to search for the target audio - video behavior data from the blockchain system for storing the operation data of the audio - video application according to the target data type, where the operation data includes the first operation data representing the audio - video behavior data;

[0216] A data storage unit 1203, configured to store the target audio - video behavior data in the database;

[0217] A data return unit 1204, configured to return target audio-video behavior data to a target user.

[0218] In an embodiment of the present application, preferably, the data type acquisition unit includes:

[0219] A data retrieval request receiving unit, configured to receive a data retrieval request sent by a target user;

[0220] A data type acquisition subunit, configured to acquire a data retrieval condition carried in the data retrieval request, where the data retrieval condition indicates a target data type to which the target audio-video behavior data of the audio-video application requested by the target user to retrieve belongs, and the audio-video behavior data generated by operation behaviors of different operation types belongs to different data types.

[0221] In an embodiment of the present application, preferably, the data retrieval unit includes:

[0222] A traceability data determination unit, configured to query at least one piece of traceability data of the target user from the first operation data of the audio-video application stored in the blockchain system, where the traceability data is generated by tracing the audio-video behavior data of the target user in the audio-video application;

[0223] A data retrieval range acquisition unit, configured to acquire a data retrieval range indicated by the data retrieval condition;

[0224] A data retrieval subunit, configured to query, from at least one piece of traceability data, the audio-video behavior data that is within the data retrieval range and belongs to the target data type.

[0225] In an embodiment of the present application, preferably, the operation data further includes second operation data representing operation information on the audio-video behavior data of the audio-video application stored in the database. Correspondingly, the data retrieval range acquisition unit includes:

[0226] An operation detection unit, configured to detect whether the data retrieval condition indicates a target data deletion operation, where the target data deletion operation is a historical data deletion operation that the target user requests the audio-video application to perform on the audio-video behavior data in the database;

[0227] A query unit, configured to, if the data retrieval condition indicates a target data deletion operation, query target second operation data representing the target data deletion operation from the second operation data of the audio-video application stored in the blockchain system;

[0228] A data identifier acquisition unit, configured to acquire a target data identifier of the audio-video behavior data requested to be deleted by the target data deletion operation from the target second operation data.

[0229] Further, the obtaining unit provided in the embodiment of the present application further includes:

[0230] A data retrieval time range obtaining unit, configured to obtain a data retrieval time range indicated by a data retrieval condition, where the data retrieval time range is related to the data generation time of the target audio-visual behavior data.

[0231] In the embodiment of the present application, preferably, the data retrieval time range obtaining unit includes:

[0232] A time information detection unit, configured to detect whether the data retrieval condition carries time information characterizing the data retrieval time range;

[0233] A time information obtaining unit, configured to obtain the time information if the data retrieval condition carries time information characterizing the data retrieval time range;

[0234] A time range determination unit, configured to determine that the data retrieval time range indicated by the data retrieval condition is from history to the present if the data retrieval condition does not carry time information characterizing the data retrieval time range.

[0235] A data retrieval device provided in the embodiment of the present application further includes a traceability data generation unit.

[0236] As an implementation manner of the embodiment of the present application, the traceability data generation unit includes:

[0237] A first detection unit, configured to detect whether the duration represented by the actual time period formed by the current time and the time of the most recent previous traceability operation in history reaches a preset standard duration;

[0238] A first generation unit, configured to perform a traceability operation on the audio-visual behavior data generated by the audio-visual application stored in the blockchain system during the actual time period and generate traceability data for the actual time period if the duration represented by the actual time period reaches the standard duration.

[0239] Correspondingly, the data retrieval sub-unit includes:

[0240] A data generation time obtaining unit, configured to obtain the data generation time of the audio-visual behavior data indicated to be retrieved by the data retrieval range;

[0241] A first traceability data determination unit, configured to determine first traceability data that matches the data generation time in at least one piece of traceability data;

[0242] A first retrieval unit, configured to query, from the first traceability data, data that is within the data retrieval range and belongs to the target data type.

[0243] As an implementation manner of the embodiment of the present application, the traceability data generation unit includes:

[0244] A second detection unit, configured to detect whether the duration represented by the actual time period formed by the current time and the time of the most recent historical traceability operation reaches a preset standard duration;

[0245] A second generation unit, configured to, if the duration represented by the actual time period reaches the standard duration, perform a historical traceability operation on the audio-video behavior data of the audio-video application stored in the blockchain system to generate traceability data.

[0246] Correspondingly, the data retrieval subunit includes:

[0247] A second traceability data determination unit, configured to determine the second traceability data that was most recently generated among at least one piece of traceability data;

[0248] A second retrieval unit, configured to query, from the second traceability data, data that is within the data retrieval range and belongs to the target data type.

[0249] Furthermore, a data retrieval device provided in an embodiment of the present application further includes a data storage unit, and the data storage unit includes:

[0250] A second operation data generation unit, configured to generate second operation data related to the data retrieval request according to the target audio-video behavior data;

[0251] A second operation data storage subunit, configured to store the second operation data in the blockchain system.

[0252] Furthermore, a data retrieval device provided in an embodiment of the present application further includes a user portrait unit, and the user portrait unit is configured to analyze the operation data of the target user in the audio-video application to generate a user portrait of the target user.

[0253] The present application provides a data retrieval device, which can obtain the target data type to which the target audio-video behavior data of the audio-video application requested to be retrieved by the target user belongs (the target audio-video behavior data is historical audio-video behavior data that is not currently stored in the database and has been deleted from the database), and can search for the target audio-video behavior data from the blockchain system for storing the operation data of the audio-video application (the operation data includes first operation data representing the audio-video behavior data of the audio-video application) according to the target data type. Based on this, the data retrieval device can not only store the queried target audio-video behavior data in the database, but also return the queried target audio-video behavior data to the audio-video application for the target user to view, so as to retrieve the audio-video behavior data that has been deleted from the database.

[0254] As Figure 13 shown, it is a structural diagram of an implementation manner of an electronic device provided in an embodiment of the present application, and the electronic device includes:

[0255] A memory 1301 for storing programs;

[0256] A processor 1302 for executing the program, and the program is specifically used for:

[0257] Obtain the target data type to which the target audio - video behavior data of the audio - video application that the target user requests to retrieve belongs. The target audio - video behavior data is historical audio - video behavior data that is not currently stored in the database and has been deleted from the database;

[0258] Search for the target audio - video behavior data from the blockchain system for storing operation data of the audio - video application. The operation data includes the first operation data representing the audio - video behavior data;

[0259] Store the target audio - video behavior data in the database;

[0260] Return the target audio - video behavior data to the target user.

[0261] The processor 1302 may be a central processing unit CPU or a specific integrated circuit ASIC (Application Specific Integrated Circuit).

[0262] The control device may further include a communication interface 1303 and a communication bus 1304. Among them, the memory 1301, the processor 1302, and the communication interface 1303 complete mutual communication through the communication bus 1304.

[0263] An embodiment of the present application also provides a readable storage medium, on which a computer program is stored. The computer program is loaded and executed by the processor to implement the steps of the above - mentioned data recovery method. The specific implementation process can refer to the description of the corresponding part of the above - mentioned embodiment, and this embodiment will not be elaborated.

[0264] The present application also proposes a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer - readable storage medium. The processor of the computer device reads the computer instructions from the computer - readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementation manners in terms of the above - mentioned data recovery method or data recovery device. The specific implementation process can refer to the description of the corresponding embodiment above and will not be elaborated.

[0265] The present application provides a data recovery method, apparatus, electronic device, and storage medium. The type of target data to which the target audio-visual behavior data requested by the target user to be recovered belongs is obtained (the target audio-visual behavior data is historical audio-visual behavior data that is not currently stored in the database and has been deleted from the database). According to the type of target data, the target audio-visual behavior data can be searched from the blockchain system for storing the operation data of the audio-visual application (the operation data includes the first operation data representing the audio-visual behavior data of the audio-visual application). Based on this, not only can the queried target audio-visual behavior data be stored in the database, but also the queried target audio-visual behavior data can be returned to the audio-visual application for the target user to view, realizing the recovery of the audio-visual behavior data that has been deleted from the database.

[0266] The above has introduced in detail a data recovery method, apparatus, electronic device, and storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

[0267] It should be noted that the various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0268] It should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements inherent to the process, method, article or device, but also other elements inherent to these process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including the said element.

[0269] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data recovery method, characterized in that, Including: In response to a triggering operation of the target user on the data retrieval button of the target data type in the first user interface, display the data retrieval interface of the target data type; In the first user interface, a data retrieval button for each data type among multiple data types is displayed; Receive a data retrieval request sent by the target user based on the data retrieval interface; the data retrieval request indicates retrieving target audio-video behavior data of an audio-video application, and the target audio-video behavior data is historical audio-video behavior data that is not currently stored in the database and has been deleted from the database; Obtain a data retrieval condition carried by the data retrieval request, where the data retrieval condition indicates the target data type and a data retrieval range, and the data retrieval range is related to a target data deletion operation or a data retrieval time range; Search in a blockchain system for storing operation data of the audio-video application for the target audio-video behavior data that is within the data retrieval range and belongs to the target data type; Store the target audio-video behavior data in the database; Return the target audio-video behavior data to the target user; Wherein, the operation data includes second operation data representing operation information on the audio-video behavior data of the audio-video application stored in the database, and the method for obtaining the data retrieval range is: Detect whether the data retrieval condition indicates a target data deletion operation, where the target data deletion operation is a historical data deletion operation requested by the target user for the audio-video behavior data in the database by the audio-video application; If the data retrieval condition indicates the target data deletion operation, query in the second operation data of the audio-video application stored in the blockchain system for target second operation data representing the target data deletion operation; Obtain a target data identifier of the audio-video behavior data indicated to be deleted by the target data deletion operation from the target second operation data.

2. The method according to claim 1, characterized in that The method further includes: In response to a triggering operation of the target user on the detailed data button of the target data type in the first user interface, display a second user interface of the target data type; the second user interface displays detailed audio-video behavior data of the target user in the target data type; Receive a data deletion operation of the target user on the detailed audio-video behavior data in the second user interface, delete the audio-video behavior data indicated by the data deletion operation in the database, and generate second operation data representing the data deletion operation; Store the second operation data in the blockchain system.

3. The method according to claim 2, characterized in that, The operation data further includes first operation data representing audio-video behavior data, and the searching in the blockchain system for storing operation data of the audio-video application for the target audio-video behavior data that is within the data retrieval range and belongs to the target data type includes: Query at least one traceability data of the target user from the first operation data of the audio-video application stored in the blockchain system, where the traceability data is generated by tracing the audio-video behavior data of the target user in the audio-video application; Obtain the data retrieval range indicated by the data retrieval condition; Query the audio-video behavior data that is within the data retrieval range and belongs to the target data type from the at least one traceability data.

4. The method according to claim 1, characterized in that, If the data retrieval condition does not indicate the target data deletion operation, the method further includes: Obtain the data retrieval time range indicated by the data retrieval condition, where the data retrieval time range is related to the data generation time of the target audio-video behavior data.

5. The method according to claim 4, characterized in that The obtaining of the data retrieval time range indicated by the data retrieval condition includes: Detect whether the data retrieval condition carries time information representing the data retrieval time range; If the data retrieval condition carries time information representing the data retrieval time range, obtain the time information; If the data retrieval condition does not carry time information representing the data retrieval time range, determine that the data retrieval time range indicated by the data retrieval condition is from history to the present.

6. The method according to claim 3, wherein The generation method of the at least one traceability data includes: Detect whether the duration represented by the actual time period formed by the current time and the time of the most recent historical traceability operation reaches a preset standard duration; If the duration represented by the actual time period reaches the standard duration, perform a traceability operation on the audio-video behavior data generated by the audio-video application stored in the blockchain system during the actual time period to generate the traceability data for the actual time period.

7. The method according to claim 6, wherein The querying of the audio-video behavior data that is within the data retrieval range and belongs to the target data type from the at least one traceability data includes: Obtain the data generation time of the audio-video behavior data retrieved according to the data retrieval range; Determine the first traceability data in the at least one traceability data that matches the data generation time; Query the data that is within the data retrieval range and belongs to the target data type from the first traceability data.

8. The method according to claim 3, characterized in that, The generation method of the at least one traceability data includes: Detect whether the duration represented by the actual time period formed by the current time and the time of the most recent historical traceability operation reaches a preset standard duration; If the duration represented by the actual time period reaches the standard duration, perform a historical traceability operation on the audio-video behavior data of the audio-video application stored in the blockchain system to generate traceability data.

9. The method according to claim 8, wherein The querying of the audio-video behavior data that is within the data retrieval range and belongs to the target data type from the at least one traceability data includes: Determine the second traceability data that was most recently generated in the at least one traceability data; Query the data that is within the data retrieval range and belongs to the target data type from the second traceability data.

10. The method according to claim 2, wherein It further includes: Generate second operation data related to the data retrieval request according to the target audio-video behavior data; Store the generated second operation data into the blockchain system.

11. The method according to claim 1, characterized in that, It further includes: Analyze the operation data of the target user in the audio-video application to generate a user profile of the target user.

12. A data recovery device, characterized in that, It includes: A data retrieval request receiving unit, which is configured to respond to a triggering operation of a target user on a data retrieval button of a target data type in a first user interface, and display a data retrieval interface for the target data type; multiple data retrieval buttons for each data type among multiple data types are displayed in the first user interface; receive a data retrieval request sent by the target user based on the data retrieval interface; the data retrieval request indicates retrieving target audio-visual behavior data of an audio-visual application, and the target audio-visual behavior data is historical audio-visual behavior data that is not currently stored in a database and has been deleted from the database. A data type obtaining subunit, which is configured to obtain a data retrieval condition carried in the data retrieval request, the data retrieval condition indicating the target data type and a data retrieval range, and the data retrieval range being related to a target data deletion operation or a data retrieval time range. A data retrieval unit, which is configured to search for the target audio-visual behavior data that is within the data retrieval range and belongs to the target data type from a blockchain system for storing operation data of the audio-visual application. A data storage unit, which is configured to store the target audio-visual behavior data into the database. A data return unit, which is configured to return the target audio-visual behavior data to the target user. Wherein, the operation data includes second operation data representing operation information on the audio-visual behavior data of the audio-visual application stored in the database, and the obtaining method of the data retrieval range is as follows: Detect whether the data retrieval condition indicates a target data deletion operation, and the target data deletion operation is a historical data deletion operation requested by the target user for the audio-visual behavior data in the database. If the data retrieval condition indicates the target data deletion operation, query target second operation data representing the target data deletion operation from the second operation data of the audio-visual application stored in the blockchain system. Obtain a target data identifier of the audio-visual behavior data indicated to be deleted by the target data deletion operation from the target second operation data.

13. The device according to claim 12, wherein The operation data further includes first operation data representing audio-visual behavior data, and the data retrieval unit includes: A traceability data determination unit, which is configured to query at least one traceability data of the target user from the first operation data of the audio-visual application stored in the blockchain system, and the traceability data is generated by tracing the audio-visual behavior data of the target user in the audio-visual application. A data retrieval range obtaining unit, which is configured to obtain the data retrieval range indicated by the data retrieval condition. A data retrieval subunit, which is configured to query the audio-visual behavior data that is within the data retrieval range and belongs to the target data type from the at least one traceability data.

14. The device according to claim 12, characterized in that, The obtaining unit further includes: A data retrieval time range obtaining unit, which is configured to obtain the data retrieval time range indicated by the data retrieval condition, and the data retrieval time range is related to the data generation time of the target audio-visual behavior data.

15. The device according to claim 14, wherein The data retrieval time range obtaining unit includes: A time information detection unit, configured to detect whether the data recovery condition carries time information representing a data recovery time range; A time information acquisition unit, configured to acquire the time information if the data recovery condition carries time information representing a data recovery time range; A time range determination unit, configured to determine that the data recovery time range indicated by the data recovery condition is from history to the present if the data recovery condition does not carry time information representing a data recovery time range.

16. The device according to claim 13, characterized in that, The device further includes a traceability data generation unit, and the traceability data generation unit includes: A first detection unit, configured to detect whether the duration represented by the actual time period formed by the current time and the time of the most recent traceability operation in history reaches a preset standard duration; A first generation unit, configured to perform a traceability operation on the audio-video behavior data generated by the audio-video application in the blockchain system during the actual time period and generate traceability data for the actual time period if the duration represented by the actual time period reaches the standard duration.

17. The device according to claim 16, characterized in that, The data recovery subunit includes: A data generation time acquisition unit, configured to acquire the data generation time of the audio-video behavior data indicated to be recovered by the data recovery range; A first traceability data determination unit, configured to determine first traceability data that matches the data generation time among the at least one piece of traceability data; A first recovery unit, configured to query, from the first traceability data, data that is within the data recovery range and belongs to the target data type.

18. An electronic device, characterized in that, including: A processor and a memory, the processor and the memory are connected through a communication bus; wherein, the processor is configured to call and execute a program stored in the memory; The memory is configured to store a program, and the program is used to implement the data recovery method according to any one of claims 1-11.

19. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and the computer program is loaded and executed by a processor to implement the steps of the data recovery method according to any one of claims 1-11.

20. A computer program product, characterized in that, The computer program product includes computer instructions, and when the processor of the computer device executes the computer instructions, the computer device executes the data recovery method according to any one of claims 1-11.

Citation Information

Patent Citations

  • Operation data tamper-proofing method based on block chain

    CN111125776A