Blockchain-based data processing method, apparatus, device, and readable storage medium
By using blockchain technology to generate private and public keys in social applications and recording account registration and transactions on the blockchain, the security issues caused by centralized data storage in social applications are solved, achieving decentralization and improved data security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-07-06
- Publication Date
- 2026-07-24
Smart Images

Figure CN117411858B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data processing method, apparatus, device, and readable storage medium based on blockchain. Background Technology
[0002] In recent years, various social applications have emerged one after another, and online social networking has gradually become an indispensable way of socializing in people's lives.
[0003] Currently, most social applications are server-side based, requiring each client to establish a connection with the server to function properly, as data such as social media accounts are stored on the server. Therefore, it's understandable that server-side social applications are centralized; all data and information are stored on the server, making them vulnerable to attack, which could easily lead to the loss of sensitive data. Summary of the Invention
[0004] This application provides a data processing method, apparatus, device, and readable storage medium that can improve data security in social applications.
[0005] One embodiment of this application provides a blockchain-based data processing method, including:
[0006] In response to the first object's account registration request for a social application, a private key is generated for the first object based on blockchain rules; the blockchain rules are stored in the terminal device corresponding to the first object.
[0007] Generate the public key corresponding to the first object and the account address corresponding to the first object based on the private key;
[0008] The account registration transaction for the first object is sent to the blockchain network based on the private key, public key and account address, so that the blockchain network can package the account registration transaction into the target block and perform consensus on the target block and put it on the chain;
[0009] If a registration success message is received from the backend server corresponding to the social application, the account address is identified as the social account; the private key, public key, and social account are used to provide the first object with the ability to perform social interactions in the social application; the registration success message is generated by the backend server when it successfully connects to the target block consensus.
[0010] One embodiment of this application provides a blockchain-based data processing device, including:
[0011] The first generation module is used to respond to the account registration request of the first object for the social application and generate a private key for the first object based on the blockchain rules; the blockchain rules are stored in the terminal device corresponding to the first object.
[0012] The second generation module is used to generate the public key corresponding to the first object and the account address corresponding to the first object based on the private key.
[0013] The transaction registration module is used to send an account registration transaction for a first object to the blockchain network based on the private key, public key, and account address, so that the blockchain network can package the account registration transaction into the target block and perform consensus on the target block and put it on the chain.
[0014] The account confirmation module is used to identify the account address as a social account if a registration success message is received from the backend server corresponding to the social application. The private key, public key, and social account are used to provide the first object with the ability to perform social interactions in the social application. The registration success message is generated by the backend server when the target block consensus is successfully uploaded to the chain.
[0015] The second generation module includes:
[0016] The first encryption unit is used to perform asymmetric encryption on the private key to obtain the public key corresponding to the first object;
[0017] The second encryption unit is used to perform one-way hash encryption on the public key to obtain the account address corresponding to the first object.
[0018] The transaction registration module includes:
[0019] The registration transaction generation unit is used to generate an account registration request; the account registration request carries the public key and the account address.
[0020] The registration transaction generation unit is also used to sign the account registration request using a private key to obtain signature data;
[0021] The registration transaction generation unit is also used to package the account registration request and signature data to obtain the account registration transaction for the first object;
[0022] The registration transaction sending unit is also used to send account registration transactions to the blockchain network so that the blockchain network can verify the signature data according to the public key and obtain the verification result. When the verification result is successful, the account registration transaction is packaged into the target block and consensus is achieved on the target block.
[0023] The aforementioned data processing device further includes:
[0024] The first password setting module is used to display the password setting page for social media accounts;
[0025] The first password setting module is also used to respond to the input operation of the first object on the password setting page, and to obtain the password entered by the first object as the first password;
[0026] The first password setting module is also used to perform reversible encryption processing on the private key according to the first password to obtain the first encrypted file;
[0027] The first password setting module is also used to store the first encrypted file. After the first encrypted file is successfully stored, a password setting success message is displayed on the password setting page.
[0028] The aforementioned data processing device further includes:
[0029] The second password setting module is used to display the password setting page for social media accounts; the password setting page includes a password setting text box and a random code setting text box;
[0030] The second password setting module is also used to respond to the setting operation of the first object on the password setting text box, and to obtain the password set by the first object as the second password;
[0031] The second password setting module is also used to respond to the setting operation of the first object for the random code setting text box, and to obtain the random code set by the first object as the target random code;
[0032] The second password setting module is also used to obtain an encryption method that matches the target random code from the encryption pool, and use it as the target encryption method;
[0033] The second password setting module is also used to perform reversible encryption processing on the private key according to the second password and the target encryption method to obtain the second encrypted file;
[0034] The second password setting module is also used to associate and store the second encrypted file, the target random code, and the social media account of the first object;
[0035] The second password setting module is also used to display a password setting success message on the password setting page after the second encrypted file, the target random code, and the social media account of the first object are successfully associated and stored.
[0036] The aforementioned data processing device further includes:
[0037] The social interaction on-chain module is used to respond to the first object's social interaction on-chain operation for social applications and generate a social interaction on-chain request;
[0038] The social interaction on-chain module is also used to display password input text boxes in social applications;
[0039] The social interaction on-chain module is also used to respond to the first object's input operation on the password input text box, obtain the password entered by the first object, and use it as the input password;
[0040] The social interaction on-chain module is also used to obtain the second encrypted file and the target random code stored in association with the social account of the first object if the entered password is the same as the second password;
[0041] The social interaction on-chain module is also used to obtain the target encryption method that matches the target random code from the encryption pool;
[0042] The social interaction on-chain module is also used to reversibly decrypt the second encrypted file based on the input password and the target encryption method to obtain the private key;
[0043] The social interaction on-chain module is also used to sign social interaction on-chain requests using a private key to obtain social interaction signature data.
[0044] The social interaction on-chain module is also used to package social interaction on-chain requests and social interaction signature data to obtain social interaction on-chain transactions;
[0045] The social interaction on-chain module is also used to send social interaction on-chain transactions to the blockchain network, so that the blockchain network can package the social interaction on-chain transactions into a new target block and perform consensus on the new target block.
[0046] The aforementioned data processing device further includes:
[0047] The account transfer module is used to respond to the account transfer operation of the first object on the transfer terminal device and generate the target transfer code;
[0048] The account transfer module is also used to establish a point-to-point connection with the transfer terminal device and receive the response transfer code sent by the transfer terminal device through the point-to-point connection;
[0049] The account transfer module is also used to send the second encrypted file, the target random code, and the social account to the transfer terminal device if the response transfer code is the same as the target transfer code, so that the transfer terminal device can obtain the verification password entered by the first object, perform reversible decryption processing on the second encrypted file according to the verification password and the target random code to obtain the decryption private key, and send the verification transaction to the blockchain network according to the decryption private key and the social account of the first object.
[0050] The account transfer module is also used to confirm that the account transfer was successful if a transfer success notification is received from the transfer terminal device. The transfer success notification is generated by the transfer terminal device when it confirms that the transaction has been successfully verified on the blockchain.
[0051] The aforementioned data processing device further includes:
[0052] The password cloud storage module is used to display the password cloud storage page for social media accounts;
[0053] The password cloud storage module is also used to respond to input operations on the password cloud storage page and obtain the available contact account of the first object;
[0054] The password cloud storage module is also used to reversibly encrypt the second password based on the available contact account and the target encryption method to obtain the third encrypted file;
[0055] The password cloud storage module is also used to send the third encrypted file and the available contact account to the backend server of the social application, so that the backend server can associate and store the third encrypted file and the available contact account.
[0056] The password cloud storage module is also used to display a storage success message if a storage success message is received from the backend server.
[0057] The aforementioned data processing device further includes:
[0058] The password cloud retrieval module is used to display the password cloud retrieval page for social media accounts;
[0059] The password cloud retrieval module is also used to respond to input operations on the password cloud retrieval page and obtain the retrieval account entered by the first object.
[0060] The password cloud retrieval module is also used to send the entered retrieval account to the backend server, so that when the backend server detects that the entered retrieval account is the same as the available contact account, it obtains the third encrypted file, generates a retrieval verification code for the third encrypted file, and sends the retrieval verification code to the entered retrieval account.
[0061] The password cloud retrieval module is also used to display a verification code input box on the password cloud retrieval page if a verification code has been sent and a notification message has been received from the backend server.
[0062] The password cloud retrieval module is also used to respond to input operations in the verification code input box and obtain the input verification code entered by the first object;
[0063] The password cloud retrieval module is also used to send the entered verification code to the backend server;
[0064] The password cloud retrieval module is also used to receive a third encrypted file returned by the backend server if the backend server verifies that the entered verification code and the retrieved verification code are the same.
[0065] The password cloud retrieval module is also used to reversibly decrypt the third encrypted file based on the input retrieval account and the target encryption method to obtain the second password, which is then displayed on the password cloud retrieval page.
[0066] Social interaction includes the posting of social information;
[0067] The aforementioned data processing device further includes:
[0068] The social information publishing module is used to respond to the social information publishing operation performed by the first object through a social account and generate a social information publishing request; the social information publishing request includes the information to be published.
[0069] The social information publishing module is also used to obtain the private key corresponding to the first object, and to sign the social information publishing request based on the private key to obtain social information publishing signature data;
[0070] The social information publishing module is also used to package social information publishing requests and social information publishing signature data to obtain social information publishing transactions;
[0071] The social information publishing module is also used to send social information publishing transactions to the blockchain network, so that the blockchain network can package the social information publishing transactions into social blocks and perform consensus on the social blocks and put them on the chain.
[0072] The social information publishing module is also used to display the information to be published and the block hash of the social block in the social application if it receives a social information publishing instruction from the backend server, which carries the information to be published and the block hash of the social block. The social information publishing instruction is generated by the backend server when the consensus on the social block is successfully uploaded to the chain. The block hash is used to query the block information of the social block.
[0073] Social interaction includes adding objects;
[0074] The aforementioned data processing device further includes:
[0075] The object addition module is used to respond to the object addition operation performed by the first object through its social media account and generate an object addition request; the object addition request includes the social media account of the second object.
[0076] The object addition module is also used to establish a point-to-point connection between the object and the terminal device bound to the second object;
[0077] The object adding module is also used to send an object adding request to the object terminal device through the object peer-to-peer connection if the object peer-to-peer connection is successfully established, so that the object terminal device responds to the object adding request to perform the object adding operation and obtain the object adding result;
[0078] The object addition module is also used to determine if the object addition fails if the result is "object refuses to be added".
[0079] The object addition module is also used to obtain the private key of the first object if the object addition result is an object addition allowed result, and to sign the object addition allowed result according to the private key to obtain the addition result signature data;
[0080] The object addition module is also used to package the object's allowed addition results and the addition result signature data to obtain the first object's allowed addition transaction;
[0081] The object addition module is also used to send the first object addition permission transaction to the blockchain network so that the blockchain network can reach a consensus on the first object addition permission transaction and put it on the chain;
[0082] The object addition module is also used to add the social media account of the second object to the object list of the first object if a successful object addition instruction is received from the backend server. The successful object addition instruction is generated by the backend server when it is determined that the consensus on the first object allowing the addition of transactions and the second object allowing the addition of transactions is successfully recorded on the blockchain. The second object allowing the addition of transactions is generated by the object terminal device based on the object allowing the addition result.
[0083] Social interaction includes real-time conversations with objects;
[0084] The aforementioned data processing device further includes:
[0085] The object instant conversation module is used to respond to the object instant conversation operation made by the first object through its social account and display the object list of the first object.
[0086] The object instant conversation module is also used to respond to triggered operations on the social media accounts of the second object in the object list and display the instant conversation interface with the second object;
[0087] The object instant conversation module is also used to respond to the first object's conversation message generation operation and generate an instant conversation message;
[0088] The object instant conversation module is also used to send instant conversation messages to the object terminal device via object peer-to-peer connection.
[0089] One embodiment of this application provides a computer device, including: a processor, a memory, and a network interface;
[0090] The processor is connected to the memory and the network interface. The network interface is used to provide a data communication network element, the memory is used to store a computer program, and the processor is used to call the computer program to execute the method in the embodiments of this application.
[0091] One aspect of this application provides a computer-readable storage medium storing a computer program adapted for loading by a processor and executing the methods described in this application.
[0092] One aspect of this application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in this application.
[0093] In this embodiment, when responding to a first object's account registration request for a social application, a private key is generated for the first object based on blockchain rules. Further, a public key and an account address corresponding to the first object are generated based on the private key. The blockchain rules are stored in the terminal device corresponding to the first object. Then, an account registration transaction for the first object is sent to the blockchain network based on the private key, public key, and account address. The blockchain network packages the account registration transaction into the target block and performs consensus on the target block. If a registration success notification is received from the backend server corresponding to the social application, the account address is identified as a social account. This private key, public key, and social account are used to provide the first object with the ability to perform social interactions within the social application. The registration success notification is generated by the backend server when it reaches the target block and successfully completes consensus on the blockchain. Using the method provided in this application embodiment, the object's account information will be stored in the blockchain. Even if the backend server is attacked, the object's account information will not be lost, thus realizing the decentralization of the object's social account. In addition, the data generated by the object through social interaction through social applications needs to be uploaded to the blockchain using public and private keys. Because public and private keys can only be generated and stored on terminal devices that have integrated and installed the application client, they are not easy to be leaked, reducing the possibility that the data of social applications will be tampered with before being uploaded to the blockchain, thereby improving the data security of social applications. Attached Figure Description
[0094] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0095] Figure 1This is a schematic diagram of a blockchain construction process provided in an embodiment of this application;
[0096] Figure 2 This is a schematic diagram of a network architecture provided in an embodiment of this application;
[0097] Figure 3a This is a schematic diagram illustrating a scenario where a decentralized social account registration request is uploaded to the blockchain, as provided in an embodiment of this application.
[0098] Figure 3b This is a schematic diagram illustrating a scenario of successful decentralized social media account registration provided in an embodiment of this application;
[0099] Figure 4 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application;
[0100] Figure 5 This is a schematic diagram illustrating the creation process of a social identity account system provided in an embodiment of this application;
[0101] Figure 6 This is an interactive diagram illustrating a post publishing implementation provided in an embodiment of this application;
[0102] Figure 7 This is a schematic diagram of an object addition implementation provided in an embodiment of this application;
[0103] Figure 8 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application;
[0104] Figure 9 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application;
[0105] Figure 10 This is an interactive schematic diagram of a private key transfer provided in an embodiment of this application;
[0106] Figure 11 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of this application;
[0107] Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0108] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0109] Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. It is primarily used to organize data chronologically and encrypt it into a ledger, making it tamper-proof and forgery-proof. It also allows for data verification, storage, and updating. Essentially, a blockchain is a decentralized database where each node stores an identical copy. The blockchain network can distinguish between consensus nodes and business nodes, with the consensus node responsible for achieving consensus across the entire network. The process of writing transaction data into the ledger in a blockchain network can be summarized as follows: a client sends transaction data to a business node, which then relays this data among the business nodes in the blockchain network until the consensus node receives it. The consensus node then packages the transaction data into a block and reaches a consensus with other consensus nodes. Once consensus is reached, the block containing the transaction data is written into the ledger.
[0110] In this context, it can be understood that a block is a data packet that carries transaction data (i.e., transaction business) on a blockchain network. It is a data structure that is marked with a timestamp and the hash value of the previous block. The transactions in the block are verified and confirmed by the network's consensus mechanism.
[0111] In this context, a hash value, also known as an information feature value or characteristic value, is generated by converting input data of arbitrary length into cryptographic data and producing a fixed output using a hash algorithm. The original input data cannot be retrieved by decrypting the hash value; it is a one-way cryptographic function. In a blockchain, each block (except the initial block) contains the hash value of its predecessor block, which is called the parent block of the current block. The hash value is a core and crucial aspect of blockchain technology, preserving the authenticity of recorded and viewed data, as well as the integrity of the blockchain as a whole.
[0112] It is understood that a blockchain system can include smart contracts. A smart contract can be understood and executed by all nodes in the blockchain (including consensus nodes), capable of executing arbitrary logic and producing results. Users can initiate a transaction request through a client, invoking a smart contract already deployed on the blockchain. Subsequently, the transaction nodes on the blockchain can send the request to the consensus nodes, which can then run the smart contract. It should be understood that a blockchain can include one or more smart contracts, distinguished by an identity document (ID) or name. The client's transaction request can also carry the smart contract's identity document or name, specifying the smart contract the blockchain needs to run. If the smart contract specified by the client requires data retrieval, each consensus node will access its local ledger to read the data. Finally, the consensus nodes will verify the consistency of the execution results (i.e., reach consensus). If they are consistent, the execution result can be stored in their respective local ledgers and returned to the client.
[0113] The method provided in this application requires blockchain implementation. Because social applications have high requirements for information iteration and updates, public blockchains are generally unsuitable. Therefore, this application requires selecting a blockchain engine that offers fast block generation and stability. The block engine is a low-level component that encapsulates logic code, enabling rapid blockchain deployment. Please refer to [link to previous section]. Figure 1 , Figure 1 This is a schematic diagram illustrating a blockchain construction process provided in an embodiment of this application. Figure 1 As shown, the setup process mainly includes the following steps:
[0114] Step S001: Select the blockchain engine.
[0115] Step S002: Download and compile the blockchain engine code.
[0116] Step S003: Modify the configuration file according to the blockchain network information to be built. For example: the IP addresses (Internet Protocol) and ports of all nodes required by the network module; the consensus module needs to be configured to use which consensus algorithm, etc.
[0117] Specifically, when configuring the consensus module, if you prefer eventual consistency and performance, you can choose the Raft consensus algorithm; if you prefer Byzantine fault tolerance for malicious nodes, you can choose the BFT (Byzantine Fault Tolerance) consensus algorithm.
[0118] Step S004: Upload the compiled code and configuration files to the corresponding blockchain node.
[0119] Step S005: Execute the blockchain engine startup command to start the blockchain.
[0120] Step S006, Network Initialization.
[0121] Step S007, consensus initialization.
[0122] Step S008: Complete the blockchain startup.
[0123] Specifically, the blockchain engine initializes each module in the order of dependency; for example, the consensus module depends on the initialization of the network module.
[0124] Specifically, following the steps above, assuming the Raft consensus algorithm is chosen, you can first download the engine code, compile it, and deploy it on 5 (2n+1) servers. After deploying the consensus algorithm, start the blockchain. Because Raft-like consensus algorithms require a majority vote for consensus, it's best to have an odd number of nodes. This is beneficial for consensus and also facilitates later log viewing and analysis.
[0125] Please see again. Figure 2 , Figure 2 This is a schematic diagram of a network architecture provided in an embodiment of this application. For example... Figure 2 As shown, the network architecture may include a blockchain node cluster 1000, a backend server (server-side) cluster 100, and a terminal device (client-side) cluster 10. The blockchain node cluster 1000 may include at least two blockchain nodes. Figure 1 As shown, the blockchain node cluster 1000 may include blockchain node 1000a, blockchain node 1000b, ..., blockchain node 1000n; the backend server cluster 100 may specifically include backend server 100a, backend server 100b, ..., backend server 100n; and the terminal device cluster 10 may specifically include terminal device 10a, terminal device 10b, ..., terminal device 10n. The setup process for the blockchain node cluster 1000 can be referred to the above. Figure 1 The setup process shown will not be described in detail here.
[0126] like Figure 2As shown, terminal devices 10a, 10b, ..., 10n can respectively connect to backend servers 100a, 100b, ..., 100n to facilitate data interaction between the terminal devices and the backend servers; terminal devices 10a, 10b, ..., 10n can respectively connect to blockchain nodes 1000a, 1000b, ..., 1000n to facilitate data interaction between the terminal devices and the blockchain nodes; backend servers 100a, 100b, ..., 100n can respectively connect to blockchain nodes 1000a, 1000b, ..., 1000n to facilitate data interaction between the backend servers and the blockchain nodes; blockchain nodes 1000a, 1000b, ..., 1000n are interconnected to facilitate data interaction between the blockchain nodes.
[0127] It is understandable that blockchain nodes can transmit data or blocks through the aforementioned data connections. The blockchain network can establish data connections between blockchain nodes based on node identifiers. Each blockchain node in the network has a corresponding node identifier, and each blockchain node can store the node identifiers of other blockchain nodes that are connected to it. This allows it to broadcast acquired data or generated blocks to other blockchain nodes based on their node identifiers. For example, blockchain node 1000a can maintain a node identifier list as shown in Table 1, which stores the node names and node identifiers of other nodes.
[0128] Table 1
[0129] Blockchain node 1000a AAA.AAA.AAA.AAA Blockchain node 1000b BBB.BBB.BBB.BBB … … 1000n blockchain nodes CCC.CCC.CCC.CCC
[0130] The node identifier can be an Internet Protocol (IP) address or any other information that can be used to identify a blockchain node in a blockchain network. Table 1 only uses IP addresses as an example. For instance, blockchain node 1000a can send information (e.g., transaction data) to blockchain node 1000b using the node identifier BBB.BBB.BBB.BBB, and blockchain node 1000b can determine that the information was sent by blockchain node 1000a using the node identifier AAA.AAA.AAA.AAA.
[0131] In blockchain, before a block can be added to the chain, it must pass consensus among the consensus nodes in the blockchain network. Only after consensus is reached can the block be added to the blockchain. Understandably, when blockchain is used in some scenarios by commercial organizations, not all participating nodes in the blockchain (i.e., the blockchain nodes in the aforementioned blockchain node cluster of 1000) have sufficient resources and the necessity to become consensus nodes. For example, in... Figure 2 In the blockchain node cluster 1000 shown, blockchain nodes 1000a, 1000b, and 1000n can be used as consensus nodes. Consensus nodes in blockchain node cluster 1000 participate in consensus, that is, reaching consensus on blocks (containing a batch of transactions), including generating blocks and voting on blocks; while non-consensus nodes do not participate in consensus, but help propagate block and voting messages, and synchronize states with each other.
[0132] It is understood that the above-mentioned data connection is not limited to the connection method. It can be connected directly or indirectly through wired communication, or directly or indirectly through wireless communication, or through other connection methods. This application does not impose any restrictions on this.
[0133] It is understood that the blockchain-based data processing method provided in this application embodiment can be executed by a computer device, which includes, but is not limited to, the aforementioned blockchain node (which can be a terminal or a server), a backend server, and a terminal device. The aforementioned server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The aforementioned terminal device can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these.
[0134] It is understood that the embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.
[0135] It is understood that, in the specific implementation of this application, the data related to account registration transactions, social interaction on-chain transactions, etc., when applied to specific products or technologies, requires user permission or consent, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0136] like Figure 2As shown, each terminal device in the terminal device cluster can have an application client installed. When the application client runs on each terminal device, it can interact with any of the backend servers in the aforementioned backend server cluster 100, enabling any of the backend servers in the cluster to receive business data from each terminal device. This application client can be a client for social applications with the ability to display text, images, audio, and video data, such as game applications, video editing applications, instant messaging applications, live streaming applications, short video applications, video applications, music applications, shopping applications, novel applications, payment applications, or browsers. This application client can be a standalone client or an embedded sub-client integrated into another client (such as an instant messaging client, social client, video client, etc.), and is not limited here.
[0137] The terminal device bound to the first object can perform social interaction operations through the application client of a social application. To achieve decentralization of online social interaction for the object, it is necessary to first ensure the decentralization of the social account system used by the object. Therefore, this application embodiment provides a data processing method based on blockchain, such as... Figure 2 As shown, the terminal device bound to the first object can respond to the first object's account registration request for the social application by running the application client. It generates a private key for the first object based on blockchain rules, which are stored on the terminal device corresponding to the first object. Then, it generates a public key and an account address corresponding to the first object based on the private key. Next, it sends an account registration transaction for the first object to the blockchain network based on the private key, public key, and account address. This allows the blockchain network to package the account registration transaction into the target block and perform consensus on the target block. If a registration success message is received from the backend server corresponding to the social application, the account address is identified as a social account. Subsequently, the private key, public key, and social account will be used to provide the first object with the ability to perform social interactions within the social application. This registration success message is generated by the backend server when it reaches the target block and successfully completes consensus on the blockchain. In short, the social media account information of the first party is stored in the blockchain. Therefore, even if the social media account information of the first party is changed in the backend server due to a malicious attack, it can still be verified in the blockchain, ensuring the decentralization of the social media account system used by the party. Subsequently, data related to social interactions performed by terminal devices through the application client of social applications can also be recorded on the blockchain based on private keys, public keys and social media accounts, thereby realizing the decentralization of online social interaction.
[0138] To facilitate understanding of the above process, please refer to the following: Figures 3a-3b Among them, such as Figures 3a-3bThe terminal device 20 shown can be the one described above. Figure 2 Any terminal device in the terminal device cluster 10 shown, such as terminal device 20, can be terminal device 10a; Figures 3a-3b The backend server 200 shown can be the one described above. Figure 2 Any of the backend servers in the backend server cluster 100 shown, such as backend server 200, could be backend server 200b; for example... Figures 3a-3b The blockchain network 2000 shown can be the above Figure 2 The blockchain network shown is composed of 1000 blockchain node clusters. Blockchain node 2001 in blockchain network 2000 can be one of the aforementioned... Figure 2 Any blockchain node in the blockchain node cluster 1000 shown, such as blockchain node 2001, is blockchain node 1000a.
[0139] Please refer to [the website / information] first. Figure 3a , Figure 3a This is a schematic diagram illustrating a scenario of decentralized social media account registration request being uploaded to the blockchain, as provided in an embodiment of this application. Assuming that terminal device 20 is bound to object A, and terminal device 20 has the application client of social application 21 installed, if object A does not yet have a social media account to log in to the social application, object A can first register an account through the application client of social application 21. Figure 3a As shown, the account registration interface of social application 21 displays a regular registration option 211 and an on-chain registration option 212. Object A can trigger regular registration option 211 to register for social application 21, that is, directly apply for account registration for social application 21 from the backend server 200 corresponding to social application 21. Object A can also trigger on-chain registration option 212 to register for social application 21, that is, complete the registration for social application 21 through the blockchain network 2000. Assuming object A triggers on-chain registration option 212, terminal device 20 can respond to object A's triggering operation of on-chain registration option 212 by generating an account registration request for social application 21. Subsequently, as... Figure 3aAs shown, terminal device 20 can respond to the account registration request, then generate a private key B for object A based on blockchain rules, and then generate a public key C and account address D corresponding to object A based on private key B. The blockchain rules can be pre-set private key generation rules, which may include private key length, types of characters that can be used in the private key, random rules, etc. At this point, object A's account registration is not successful. Terminal device 20 also needs to generate an account registration transaction 22 based on private key B, public key C, and account address D. This account registration transaction 22 is used to store object A's relevant identity information for registering with social application 21 on the blockchain. Terminal device 20 will send this account registration transaction 22 to any blockchain node in the blockchain network 2000, such as blockchain node 2001, and then wait for the blockchain network to process the account registration transaction 22.
[0140] like Figure 3a As shown, in the blockchain network 2000, the account registration transaction 22 can be packaged into the target block 23. Then, the blockchain network 2000 will perform consensus processing on the target block 23. If the blockchain network 2000 passes the consensus on the target block 23, the target block 23 will be added to the blockchain for storage.
[0141] Please see also Figure 3b , Figure 3b This is a schematic diagram illustrating a scenario of successful decentralized social media account registration provided in an embodiment of this application. For example... Figure 3b As shown, the backend server 200 corresponding to the social application 21 traverses blockchain 24 in the blockchain network 2000. The backend server 200 can traverse blockchain 24 at a fixed frequency, or when a new block is added to blockchain 24, any blockchain node in the blockchain network 2000 sends a notification to the backend server 200, and then the backend server 200 traverses blockchain 24 once. Alternatively, it can traverse blockchain 24 at other frequencies; this application does not impose any restrictions. When the backend server 200 first traverses blockchain 24 and reaches the account registration transaction 22 in the target block 23, the backend server 200 can generate a registration success message 25 to indicate that the social account of object A has been successfully registered, and then send it to the terminal device 20. Upon receiving the registration success message 25 from the backend server 200, the terminal device 20 can identify the account address D as the social account of object A and save the private key B and public key C. When object A uses social application 21 through terminal device 20, private key B, public key C, and social account can provide object A with the ability to perform social interactions in the social application.
[0142] As described above, when the first user registers an account on a social application, they no longer directly apply to the application's backend server or store the information there. Instead, they first generate a private key, public key, and account address associated with them. Then, through the account registration transaction, this information is stored on the blockchain, thus achieving decentralization of the social account system. Because blockchain technology has the characteristic of immutable data, even if the backend server is maliciously attacked, the first user's correct identity information can still be verified, greatly improving the security of their online social interactions. Furthermore, the public and private keys associated with the first user are generated and stored based on the terminal devices associated with them, without needing to go through a backend server. The public and private keys of different users are generated and stored based on the terminal devices bound to different users, ensuring their security and reducing the possibility of leakage.
[0143] Further, please see Figure 4 , Figure 4 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application. The method can be implemented by a terminal device (e.g., the one described above). Figure 2 The method is executed by any terminal device in the terminal device cluster 10 of the corresponding embodiment. The following description will use the execution of this method by a terminal device as an example. The blockchain-based data processing method may include at least the following steps S101-S104:
[0144] Step S101: In response to the first object's account registration request for the social application, a private key is generated for the first object based on blockchain rules; the blockchain rules are stored in the terminal device corresponding to the first object.
[0145] Specifically, the first user needs a social media account corresponding to the social media application to have the permission to log in or use the application normally. Therefore, when the first user uses the social media application for the first time, they need to register a social media account for the application through the client software installed on their device. The device can then respond to the user's account registration request and generate a private key for the user based on blockchain rules. These blockchain rules may include private key generation rules, such as the length of the private key, the types of characters that can be included, the rules for random characters, and uniqueness verification rules.
[0146] Specifically, the terminal device can integrate and install a blockchain-related SDK (Software Development Kit). The generation of the aforementioned private key can also be achieved through the SDK, meaning that blockchain rules can be stored in the SDK. Furthermore, all subsequent interactions between the terminal device and the blockchain network can be achieved through the SDK.
[0147] Step S102: Generate the public key corresponding to the first object and the account address corresponding to the first object based on the private key.
[0148] Specifically, a feasible implementation process for generating the public key and account address corresponding to the first object based on the private key can be as follows: Asymmetric encryption is performed on the private key to obtain the public key corresponding to the first object; one-way hash encryption is performed on the public key to obtain the account address corresponding to the first object. Asymmetric encryption means that encryption and decryption use different keys, one as the public key and the other as the private key. Information encrypted with the public key can only be decrypted with the private key, and vice versa. Common asymmetric encryption methods include ECC (Elliptic Curve Cryptography) and RSA (a public-key cryptography algorithm), etc., which are not limited here. Hash encryption refers to performing a hash function on the public key to obtain the account address. It should be noted that when the terminal device needs to send transactions or requests to the blockchain network, it needs to sign with the private key to prove ownership. This signature is unforgeable and can be verified by the public key corresponding to the private key. Furthermore, an account address can only have one private key, and this signature cannot be changed.
[0149] To better understand the creation process of the above identity account system (including private key, public key, and account address), please refer to [link / reference needed]. Figure 5 , Figure 5 This is a schematic diagram illustrating the creation process of a social identity account system provided in an embodiment of this application. For example... Figure 5 As shown, terminal device 50 (which can be the above-mentioned) Figure 2In the terminal device cluster 10 shown, for example, terminal device 20 can be an application client 51 with a social application and a blockchain SDK (Software Application Development Kit) 52 integrated in terminal device 10b). Terminal device 50 responds to the account application operation of the first object through the application client 51, and then sends an account registration request to the blockchain SDK 52. The blockchain SDK 52 responds to the account registration request and can first store a private key 53 according to the blockchain rules, and then perform one-way elliptic curve multiplication on the private key 53 (i.e., the above asymmetric encryption processing) to obtain the public key 54. Then, one-way hash function operation (i.e., the above hash encryption processing) is performed on the public key 54 to obtain the account address 55. Then, the blockchain SDK 52 can return the private key 53, the public key 54 and the account address 55 to the application client 51.
[0150] pass Figure 5 The creation process shown demonstrates that application client 51 can directly generate the corresponding account address and public / private keys according to blockchain rules via blockchain SDK 52. The entire process bypasses the backend server of application client 51; the calculations are completed within blockchain SDK 52, achieving decentralization of the social application's identity account system. Subsequent requests or transactions associated with this account address, which can also be considered as requests or transactions initiated by the first object, all require the signature of this private key to be sent to the blockchain network. The blockchain network then verifies the signature based on the public key.
[0151] Step S103: Send an account registration transaction for the first object to the blockchain network according to the private key, the public key and the account address, so that the blockchain network packages the account registration transaction into the target block and performs consensus on the target block.
[0152] Specifically, after the terminal device generates the identity account system of the social application designed in this embodiment for the first object, the first object's account registration is not yet successful. The terminal device still needs to send an account registration transaction to the blockchain to indicate that the account is registered. Only when the account registration transaction is successfully written into the blockchain is the first object's account registration considered to be initially completed, but it still needs to wait for the social application's backend server to make a final confirmation.
[0153] Specifically, a feasible implementation process for sending an account registration transaction for a first target to the blockchain network based on a private key, public key, and account address, so that the blockchain network packages the account registration transaction into the target block and performs consensus on the target block, can be as follows: Generate an account registration request; the account registration request carries the public key and account address; sign the account registration request using the private key to obtain signature data; package the account registration request and signature data to obtain the account registration transaction for the first target; send the account registration transaction to the blockchain network so that the blockchain network verifies the signature data using the public key to obtain a verification result; if the verification result is successful, package the account registration transaction into the target block and perform consensus on the target block.
[0154] Step S104: If a registration success message is received from the backend server corresponding to the social application, the account address is determined as a social account; the private key, the public key, and the social account are used to provide the first object with the ability to perform social interactions in the social application; the registration success message is generated by the backend server when the consensus on the target block is successfully uploaded to the blockchain.
[0155] Specifically, successful account registration for the first party requires confirmation from the social application's server-side, i.e., the corresponding backend server. For the backend server to collect information about registered users, it only needs to traverse the blockchain's block information and collect the information of accounts marked as registered. Understandably, the backend server can traverse the blockchain at a fixed frequency, or it can wait to receive a notification of a new block being added to the blockchain network before traversing it; this application does not impose any restrictions. When the backend server traverses the blockchain and encounters an account registration transaction in the target block for the first time, it can obtain the account identity information of the first party carried in the first party's account registration transaction, generate a registration success message, and then send it to the terminal device.
[0156] Specifically, after receiving a registration success notification from the backend server, the terminal device can log in to the social application using its account address as the primary user account. Subsequently, after the primary user logs in to the social application using this social account, the aforementioned identity account system (private key, public key, and social account) can be used to provide the primary user with the ability to perform social interactions within the social application. These social interactions include all online social interactions performed by the primary user through the social application, such as posting social information, adding users, and engaging in real-time conversations. Because the primary user's identity account system for the social application is already decentralized, social interactions can also be decentralized based on this identity account system, thereby achieving the decentralization of the entire social application.
[0157] Optionally, when the first object performs a social information publishing operation, the terminal device can respond to the first object's social information publishing operation through its social account, generating a social information publishing request, which includes the information to be published. The terminal device can then obtain the private key corresponding to the first object, and sign the social information publishing request using the private key to obtain social information publishing signature data. The social information publishing request and the social information publishing signature data are then packaged together to obtain a social information publishing transaction. The terminal device can then send the social information publishing transaction to the blockchain network, which will package the transaction into a social block and then perform consensus and on-chain processing of the social block. Afterwards, if the terminal device receives a social information publishing instruction from the backend server carrying the information to be published and the block hash of the social block, it will display the information to be published and the block hash in the social application according to the instruction. This social information publishing instruction is generated by the backend server when it successfully traverses the social block and achieves consensus on-chain processing; the block hash can be used to query the block information of the social block.
[0158] To facilitate understanding of the process of publishing social information, we will use publishing a post as an example. Please refer to [link / reference]. Figure 6 , Figure 6 This is an interactive diagram illustrating a post publishing implementation provided in an embodiment of this application. For example... Figure 6 As shown, the interaction process mainly includes the following steps S61-S64:
[0159] Step S61: The terminal device requests the blockchain network to upload the post to the blockchain.
[0160] Specifically, the terminal device can respond to the first object's post publishing operation by generating a post publishing request, which includes the post the first object intends to publish. Then, the terminal device can obtain the first object's private key through the integrated blockchain-related SDK, sign the post publishing request to obtain post publishing signature data, and package the signature data and the post publishing request into a post publishing transaction. Finally, the terminal device directly sends this post publishing transaction to the blockchain network via the blockchain SDK, thereby applying to put the post on the chain. This ensures that the data in the post cannot be tampered with and exists permanently on the blockchain.
[0161] Step S62: The background server polls for new blocks in the blockchain network.
[0162] Specifically, whenever a new block is added to the blockchain network, the backend server can iterate through the new block and read its transactions. In other words, the backend server continuously polls the blockchain for new blocks, parses each new block, and stores the valid data in the corresponding database according to the social data structure design. Although the data is still stored in the server-side database, the original data is on the blockchain and can be verified. Therefore, simply tampering with the database is meaningless.
[0163] Step S63: The backend server iterates through the post publishing transactions, retrieves the post publishing transactions, and parses the post information.
[0164] In step S64, the backend server issues a display command, and the terminal device displays the post to the first target.
[0165] Specifically, terminal devices can retrieve data from the backend server using traditional methods such as calling APIs (interfaces) for display. Optionally, each piece of data can be appended with a block hash. Clicking the hyperlink directly takes you to the block explorer to view the block information. In other words, the posts seen by the terminal device can be appended with the block hash of the block to which the transaction published the post belongs. When a first party has doubts about the authenticity of the content displayed in the post, they can verify it on the blockchain using this block hash.
[0166] Understandably, in order to ensure the decentralization of social applications, in addition to the decentralization of the identity account system, the design of the friend network of an object should also adopt a decentralized approach. One feasible approach is to establish peer-to-peer (P2P) connections directly between terminal devices. In this way, social interactions such as adding or deleting objects and instant conversations between objects can be achieved based on peer-to-peer connections without going through the backend server of the social application. The object's object list can be stored on the blockchain or cached on the terminal device without being affected by the backend server.
[0167] Optionally, when the first object performs an object addition operation, the terminal device can respond to the object addition operation performed by the first object through its social media account, generating an object addition request that includes the second object's social media account. Then, it establishes an object peer-to-peer connection with the object terminal device bound to the second object. If the object peer-to-peer connection is successfully established, an object addition request is sent to the object terminal device through the object peer-to-peer connection, causing the object terminal device to respond to the object addition request and perform the object addition operation, thus obtaining the object addition result. If the object addition result is that the object refuses to add, then the object addition is determined to have failed. If the object addition result is that the object allows to add, then the private key of the first object is obtained, and the object is allowed to add based on the private key. The result is signed to obtain the addition result signature data; the object addition permission result and the addition result signature data are packaged together to obtain the first object addition permission transaction; the first object addition permission transaction is sent to the blockchain network so that the blockchain network can reach a consensus on the first object addition permission transaction and put it on the chain; if the object addition success instruction is received from the backend server, the social media account of the second object is added to the object list of the first object according to the object addition success instruction; the object addition success instruction is generated by the backend server when it determines that the first object addition permission transaction and the second object addition permission transaction have been successfully consensused and put on the chain; the second object addition permission transaction is generated by the object terminal device according to the object addition permission result.
[0168] To facilitate understanding of the decentralized implementation process of adding objects as described above, we will use the example of adding object B (which can be the first object mentioned above) to object A (which can be the second object mentioned above) as an illustration. Please refer to [link / reference needed]. Figure 7 , Figure 7 This is a schematic diagram illustrating an object addition implementation provided in an embodiment of this application. Assume that terminal device a is bound to object A, and terminal device b is bound to object B. For example... Figure 7 As shown, the process of adding this object mainly includes the following steps S71-S76.
[0169] In step S71, terminal device a responds to the input operation of object A, obtains the social media account of object B, and then generates an object add request carrying the social media account of object B.
[0170] Step S72: The blockchain node receives the object addition request sent by terminal device a, and determines whether object B's social media account is registered. If object B's social media account is registered, then proceed to step S74; if object B's social media account is not registered, then proceed to step S73.
[0171] Specifically, a blockchain node can query the social media account of object B in the blockchain ledger. If a transaction is found that corresponds to the social media account of object B, then it is confirmed that the social media account of object B has been registered.
[0172] Step S73: The blockchain node sends an "Account Not Found" message to terminal device a, ending the object addition process.
[0173] Step S74: Terminal device a establishes a peer-to-peer connection with terminal device b; if the peer-to-peer connection is established successfully, proceed to step S75; if the peer-to-peer connection fails to be established, the object addition process fails, and all processes end.
[0174] Specifically, when terminal device A establishes a peer-to-peer (P2P) connection with terminal device B, neither device A nor B knows the other's IP address and port information, and therefore cannot directly establish a connection request. At this point, a trusted third-party device is needed to obtain the other's IP address and port information. This third-party device stores social media accounts and the corresponding IP addresses and port information of the terminal devices associated with those accounts. This third-party device can be a dedicated communication server, a backend server as mentioned above, or a blockchain node in a blockchain network. Both terminal devices A and B establish a connection with the third-party device, informing it of the social media account they wish to connect to. The third-party device then obtains the IP address and port information of the terminal device associated with the desired social media account and returns it to the corresponding terminal device. In this way, both terminal devices A and B can obtain each other's IP address and port information, thus establishing a P2P network connection.
[0175] Specifically, terminal device A will actively establish a P2P network connection with terminal device B. If the connection fails to be established, the object addition will fail. Optionally, terminal device A can cache the object addition request and continue the object addition operation the next time it initiates a P2P connection with terminal device B.
[0176] In step S75, terminal device a sends an object add request to terminal device b through an object point-to-point connection.
[0177] Step S76: Terminal device b responds to object B's selection operation for the object addition request, determines the object addition result. If the object addition result is that the object refuses to add, the object addition is determined to have failed, and all processes end; if the object addition result is that the object allows to add, then step S77 is executed.
[0178] Specifically, after receiving the request to add an object, terminal device B can display a pop-up window waiting for object B to make a selection, i.e., whether to agree to add object A as a friend.
[0179] In step S77, both terminal device a and terminal device b send an object to allow the addition of a transaction to the blockchain network for on-chain processing.
[0180] Step S78: The object is allowed to be added to the blockchain successfully. Terminal device a and terminal device b update the object list stored locally and end all processes.
[0181] Specifically, terminal device a will add object B's social media account to object A's object list, and terminal device b will add object A's social media account to object B's object list.
[0182] It's understandable that each terminal device can maintain a local object list and object grouping information. When communication is needed, it can directly retrieve object information from its local cache, establish a P2P connection, and then send a message. The blockchain updates the relevant object list each time a terminal device adds or deletes friends. The object list cached locally on the terminal device can also be periodically synchronized from the blockchain to its local machine.
[0183] Optionally, when the first object performs an instant conversation operation, the terminal device can respond to the first object's instant conversation operation via social media account by displaying the first object's object list; respond to the trigger operation targeting the social media account of the second object in the object list by displaying the instant conversation interface with the second object; respond to the first object's conversation message generation operation by generating an instant conversation message; and send the instant conversation message to the object's terminal device via an object-to-object peer-to-peer connection. The instant conversation message can include text, video, voice, etc. It can be understood that the sending of instant conversation messages does not require forwarding through the backend server of the social application, but directly achieves peer-to-peer communication and exchange through object-to-peer connections, thereby realizing the decentralization of online social networking.
[0184] Using the method provided in this application embodiment, when responding to a first object's account registration request for a social application, a private key is generated for the first object based on blockchain rules. Further, a public key and an account address corresponding to the first object are generated based on the private key. The blockchain rules are stored in the terminal device corresponding to the first object. Then, an account registration transaction for the first object is sent to the blockchain network based on the private key, public key, and account address. The blockchain network packages the account registration transaction into the target block and performs consensus on the target block. If a registration success notification is received from the backend server corresponding to the social application, the account address is identified as a social account. This private key, public key, and social account are used to provide the first object with the ability to perform social interactions within the social application. The registration success notification is generated by the backend server when it reaches the target block and successfully completes consensus on the blockchain. Therefore, the object's account information is stored in the blockchain. Even if the backend server is attacked, the object's account information will not be lost, achieving decentralization of the object's social account. Furthermore, subsequent social interactions based on the private key, public key, and social account can continue to be recorded on the blockchain, thus achieving decentralization of the object's online social interactions.
[0185] Furthermore, from the above Figure 4 As described in the corresponding embodiments, the private key of the first object is not customized by the first object, but generated by the terminal device. It is generally long and complex, making it difficult for the first object to directly remember the private key. However, directly storing the first object's private key on the terminal device is insecure and prone to leakage. Therefore, embodiments of this application allow the first object to customize a password, which is used to encrypt and store the first object's private key. Please refer to... Figure 8 , Figure 8 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application. The method can be implemented by a terminal device (e.g., the one described above). Figure 2 This method is executed by any terminal device in the terminal device cluster 10 of the corresponding embodiment. The following description uses the execution of this method by a terminal device as an example. The blockchain-based data processing method may include at least the following steps S201-S204:
[0186] Step S201: The password setting page for the social media account of the first person is displayed.
[0187] Specifically, upon successful registration of the first user's account, the terminal device can display a password setting page for that user's social media account. Through this page, the user can customize their password. Optionally, the password setting page can also display password requirements, such as a minimum password length of 8 characters and the inclusion of uppercase and lowercase letters.
[0188] Step S202: In response to the input operation of the first object on the password setting page, obtain the password entered by the first object as the first password.
[0189] Step S203: Perform reversible encryption on the private key according to the first password to obtain the first encrypted file.
[0190] Specifically, the first cipher acts as an encryption factor to reversibly encrypt the private key. Reversible encryption means that the encrypted data, after being encrypted using the encryption factor, can be decrypted using the same encryption factor to restore the original data.
[0191] Step S204: Store the first encrypted file. After the first encrypted file is successfully stored, display a password setting success message on the password setting page.
[0192] Specifically, it can be understood that the terminal device will store the first encrypted file. In subsequent social interaction operations, the first person only needs to enter the first password, and the terminal device can obtain the first person's private key by decrypting the first encrypted file.
[0193] Using the method provided in this application embodiment, the first object does not need to remember a relatively complex private key, but only needs to remember a custom first password. The terminal device reversibly encrypts the first object's private key based on the first password and only stores the encrypted first encrypted file, reducing the risk of private key leakage.
[0194] Furthermore, there are various reversible encryption methods. Using a single reversible encryption method is easily cracked. Therefore, an encryption pool can be designed, containing multiple encryption methods. The first object can define a custom random code to match the encryption methods in the pool, increasing the difficulty of cracking the encrypted file corresponding to the private key. For easier understanding, please refer to [link to documentation]. Figure 9 , Figure 9 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application. The method can be implemented by a terminal device (e.g., the one described above). Figure 2 This method is executed by any terminal device in the terminal device cluster 10 in the corresponding embodiment. The following description uses the execution of this method by a terminal device as an example. The blockchain-based data processing method may include at least the following steps S301-S305:
[0195] Step S301: Display the password setting page for the social media account; the password setting page includes a password setting text box and a random code setting text box.
[0196] Step S302: In response to the first object's setting operation on the password setting text box, obtain the password set by the first object as the second password; in response to the first object's setting operation on the random code setting text box, obtain the random code set by the first object as the target random code.
[0197] Step S303: Obtain an encryption method that matches the target random code from the encryption pool and use it as the target encryption method; perform reversible encryption processing on the private key according to the second password and the target encryption method to obtain the second encrypted file.
[0198] Specifically, the encryption pool contains multiple encryption methods. The terminal device can use a specific algorithm, such as modulo or hash, to select a particular encryption method from the pool as the target encryption method. Based on the target encryption method and the second password, the terminal device can then perform reversible encryption of the private key to obtain the second encrypted file.
[0199] Step S304: Associate and store the second encrypted file, the target random code, and the social media account of the first object.
[0200] Step S305: After the second encrypted file, the target random code, and the social media account of the first object are successfully associated and stored, a password setting success message is displayed on the password setting page.
[0201] Optionally, in response to the first object's social interaction on-chain operation for a social application, a social interaction on-chain request is generated; a password input text box is displayed in the social application; in response to the first object's input operation for the password input text box, the password entered by the first object is obtained as the input password; if the input password is the same as the second password, the second encrypted file and the target random code associated with the first object's social account are obtained; the target encryption method matching the target random code is obtained from the encryption pool; the second encrypted file is reversibly decrypted according to the input password and the target encryption method to obtain the private key; the social interaction on-chain request is signed using the private key to obtain social interaction signature data; the social interaction on-chain request and the social interaction signature data are packaged to obtain a social interaction on-chain transaction; the social interaction on-chain transaction is sent to the blockchain network, and the blockchain network packages the social interaction on-chain transaction into a new target block, and performs consensus on the new target block. In short, after the terminal device stores the second encrypted file, in subsequent social interaction on-chain operations, the first object only needs to enter the second password, and the terminal device can obtain the first object's private key by decrypting the second encrypted file.
[0202] As described above, the terminal device does not directly store the private key. Instead, it generates a second encrypted file corresponding to the private key based on the second password set by the first object and the target random code, and then saves the second encrypted file to improve the security of private key storage. When the first object needs to change terminal devices, it can directly transfer the second encrypted file to the transfer terminal device. Optionally, the terminal device can respond to the first object's account transfer operation on the transfer terminal device, generate a target transfer code, and then establish a peer-to-peer connection with the transfer terminal device to receive the response transfer code sent by the transfer terminal device through the peer-to-peer connection. If the response transfer code is the same as the target transfer code, the second encrypted file, the target random code, and the social account are sent to the transfer terminal device. The transfer terminal device can then obtain the verification password entered by the first object, perform reversible decryption processing on the second encrypted file based on the verification password and the target random code to obtain the decryption private key, and send a verification transaction to the blockchain network based on the decryption private key and the first object's social account. If a transfer success notification is received from the transfer terminal device, the account transfer is confirmed to be successful. This transfer success notification is generated by the transfer terminal device when it confirms that the verification transaction has been successfully uploaded to the blockchain.
[0203] To better understand the above private key transfer process, please refer to [link / reference]. Figure 10 , Figure 10 This is an interactive schematic diagram of private key transfer provided in an embodiment of this application. Suppose a first user wants to change their terminal device from terminal device 1 to terminal device 2. To continue using the social application normally on terminal device 2, they need to transfer their private key, specifically, the second encrypted file corresponding to the private key, from terminal device 1 to terminal device 2. For example... Figure 10 As shown, the interaction between terminal device 1 and terminal device 2 during this transfer process mainly includes the following steps S1-S6:
[0204] In step S1, terminal device 1 can respond to the account transfer operation of the first object for terminal device 2 and generate a target transfer code.
[0205] Specifically, the target transfer code is used to verify the identity of the recipient.
[0206] Step S2: Terminal device 1 and terminal device 2 establish a point-to-point (P2P) connection.
[0207] In step S3, terminal device 2 sends the response transfer code input by the first object to terminal device 1.
[0208] Step S4: If terminal device 1 determines that the response transfer code and the target transfer code are the same, it sends the social account, the second encrypted file, and the target random code to terminal device 2.
[0209] In step S5, terminal device 2 obtains the verification password input by the first object, and then verifies the correctness of the private key based on the verification password.
[0210] Specifically, after receiving the file, terminal device 2 will display a password input box, prompting the user to enter a previously set second password for verification. Then, terminal device 2 will obtain the verification password entered by the first party. Based on the verification password and the target random code, it can reversibly decrypt the second encrypted file to obtain the decryption private key. At this point, terminal device 2 needs to send a verification transaction to the blockchain to represent the change of the first party's terminal device. If the verification transaction is successfully recorded on the blockchain, it means that the verification private key is correct, and the transfer is successful.
[0211] Step S6: If terminal device 2 determines that the private key is correct, it sends a transfer success message to sending terminal device 1.
[0212] Optionally, the system displays a password cloud storage page for the social media account; responds to input on the password cloud storage page to obtain the available contact account of the first target; performs reversible encryption on the second password based on the available contact account and the target encryption method to obtain a third encrypted file; sends the third encrypted file and the available contact account to the backend server corresponding to the social application, and then the backend server associates and stores the third encrypted file and the available contact account; if a storage success message is received from the backend server, the storage success message is displayed. The available contact account can include an email address, phone number, etc. In short, using the target encryption method determined by the previously determined target random code, and using the available contact account as an encryption factor, the second password is encrypted into ciphertext to obtain the third encrypted file, which is then submitted to the backend server for storage. In this way, even if the backend server possesses the third encrypted file and the available contact account, it does not know the target encryption method and therefore cannot decrypt the second password of the first target.
[0213] Optionally, the system displays a password recovery page for social media accounts; responds to input operations on the password recovery page, retrieves the recovery account entered by the first user; sends the recovery account to the backend server; if the backend server detects that the recovery account matches an available contact account, it retrieves a third encrypted file, generates a recovery verification code for the third encrypted file, and sends the verification code to the input recovery account; if the system receives a verification code notification from the backend server, the terminal device displays a verification code input box on the password recovery page; responds to input operations on the verification code input box, retrieves the verification code entered by the first user; sends the verification code to the backend server; if the backend server verifies that the input verification code and the recovery verification code match, it receives the third encrypted file returned by the backend server; performs reversible decryption processing on the third encrypted file according to the input recovery account and the target encryption method to obtain a second password, and displays the second password on the password recovery page. In short, when the first user attempts to retrieve their password, the backend server first sends a retrieval verification code to the user's available contact account. The user then submits the verification code to complete identity verification. If the verification is successful, the backend server returns a third encrypted file. Once the terminal device receives this third encrypted file, it can use the available contact account as an encryption factor and the target encryption method determined by the previously selected random code to decipher the second password.
[0214] Optionally, you can also reset the password for your social media account, discarding the second password and generating a new one. The password reset function simply requires using the second password and the target encryption method to decipher the private key. Then, the key saving process is repeated. Finally, a new encrypted file containing the private key is generated using the new password.
[0215] Please see Figure 11 , Figure 11 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of this application. The data processing device can be a computer program (including program code) running on a computer device; for example, the data processing device is application software. The device can be used to execute corresponding steps in the data processing method provided in the embodiments of this application. Figure 11 As shown, the data processing device 1 may include: a first generation module 101, a second generation module 102, a transaction registration module 103, and an account determination module 104.
[0216] The first generation module 101 is used to respond to the account registration request of the first object for the social application and generate a private key for the first object based on the blockchain rules; the blockchain rules are stored in the terminal device corresponding to the first object.
[0217] The second generation module 102 is used to generate the public key corresponding to the first object and the account address corresponding to the first object based on the private key;
[0218] The transaction registration module 103 is used to send an account registration transaction for the first object to the blockchain network based on the private key, public key and account address, so that the blockchain network can package the account registration transaction into the target block and perform consensus on the target block and put it on the chain.
[0219] The account confirmation module 104 is used to confirm the account address as a social account if a registration success message is received from the backend server corresponding to the social application. The private key, public key, and social account are used to provide the first object with the ability to perform social interactions in the social application. The registration success message is generated by the backend server when the target block consensus is successfully uploaded to the chain.
[0220] The specific implementation methods of the first generation module 101, the second generation module 102, the transaction registration module 103, and the account confirmation module 104 can be found above. Figure 4 The specific descriptions of steps S101-S104 in the corresponding embodiments will not be repeated here.
[0221] The second generation module 102 includes a first encryption unit 1021 and a second encryption unit 1022.
[0222] The first encryption unit 1021 is used to perform asymmetric encryption on the private key to obtain the public key corresponding to the first object;
[0223] The second encryption unit 1022 is used to perform one-way hash encryption on the public key to obtain the account address corresponding to the first object.
[0224] The specific implementation methods of the first encryption unit 1021 and the second encryption unit 1022 can be found in the above description. Figure 4 The specific description of step S102 in the corresponding embodiment will not be repeated here.
[0225] The transaction registration module 103 includes a transaction registration generation unit 1031 and a transaction registration sending unit 1032.
[0226] The registration transaction generation unit 1031 is used to generate an account registration request; the account registration request carries a public key and an account address.
[0227] The registration transaction generation unit 1031 is also used to sign the account registration request using a private key to obtain signature data;
[0228] The registration transaction generation unit 1031 is also used to package the account registration request and signature data to obtain an account registration transaction for the first object;
[0229] The registration transaction sending unit 1032 is also used to send the account registration transaction to the blockchain network so that the blockchain network can verify the signature data according to the public key and obtain the verification result. When the verification result is a successful verification result, the account registration transaction is packaged into the target block and consensus is achieved on the target block.
[0230] The specific implementation methods of the registration transaction generation unit 1031 and the registration transaction sending unit 1032 can be found in the above description. Figure 4 The specific description of step S103 in the corresponding embodiment will not be repeated here.
[0231] The data processing device 1 mentioned above also includes a first password setting module 105.
[0232] The first password setting module 105 is used to display the password setting page for social media accounts;
[0233] The first password setting module 105 is also used to respond to the input operation of the first object on the password setting page, and to obtain the password entered by the first object as the first password;
[0234] The first password setting module 105 is also used to perform reversible encryption processing on the private key according to the first password to obtain the first encrypted file;
[0235] The first password setting module 105 is also used to store the first encrypted file. After the first encrypted file is successfully stored, a password setting success message is displayed on the password setting page.
[0236] The specific implementation of the first password setting module 105 can be found in the above description. Figure 8 The specific descriptions of steps S201-S204 in the corresponding embodiments will not be repeated here.
[0237] The data processing device 1 mentioned above also includes a second password setting module 106.
[0238] The second password setting module 106 is used to display the password setting page for social media accounts; the password setting page includes a password setting text box and a random code setting text box;
[0239] The second password setting module 106 is also used to respond to the setting operation of the first object on the password setting text box, and to obtain the password set by the first object as the second password;
[0240] The second password setting module 106 is also used to respond to the setting operation of the first object for the random code setting text box, and to obtain the random code set by the first object as the target random code;
[0241] The second password setting module 106 is also used to obtain an encryption method that matches the target random code from the encryption pool, and use it as the target encryption method;
[0242] The second password setting module 106 is also used to perform reversible encryption processing on the private key according to the second password and the target encryption method to obtain the second encrypted file;
[0243] The second password setting module 106 is also used to associate and store the second encrypted file, the target random code and the social media account of the first object;
[0244] The second password setting module 106 is also used to display a password setting success message on the password setting page after the second encrypted file, the target random code, and the social media account of the first object are successfully associated and stored.
[0245] The specific implementation of the second password setting module 106 can be found in the above description. Figure 9 The specific descriptions of steps S301-S305 in the corresponding embodiments will not be repeated here.
[0246] The aforementioned data processing device 1 further includes a social interaction blockchain module 107.
[0247] The social interaction on-chain module 107 is used to respond to the first object's social interaction on-chain operation for social applications and generate a social interaction on-chain request;
[0248] The social interaction on-chain module 107 is also used to display a password input text box in social applications;
[0249] The social interaction on-chain module 107 is also used to respond to the input operation of the first object on the password input text box, and to obtain the password entered by the first object as the input password;
[0250] The social interaction blockchain module 107 is also used to obtain the second encrypted file and the target random code stored in association with the social account of the first object if the entered password is the same as the second password;
[0251] The social interaction on-chain module 107 is also used to obtain the target encryption method that matches the target random code in the encryption pool;
[0252] The social interaction on-chain module 107 is also used to perform reversible decryption of the second encrypted file based on the input password and the target encryption method to obtain the private key;
[0253] The social interaction on-chain module 107 is also used to sign the social interaction on-chain request using a private key to obtain social interaction signature data;
[0254] The social interaction on-chain module 107 is also used to package the social interaction on-chain request and social interaction signature data to obtain the social interaction on-chain transaction.
[0255] The social interaction on-chain module 107 is also used to send social interaction on-chain transactions to the blockchain network so that the blockchain network can package the social interaction on-chain transactions into a new target block and perform consensus on the new target block.
[0256] The specific implementation of the social interaction on-chain module 107 can be found above. Figure 9 The optional descriptions in the corresponding embodiments will not be repeated here.
[0257] The aforementioned data processing device 1 further includes an account transfer module 108.
[0258] Account transfer module 108 is used to respond to the first object's account transfer operation on the transfer terminal device and generate a target transfer code;
[0259] The account transfer module 108 is also used to establish a point-to-point connection with the transfer terminal device and receive the response transfer code sent by the transfer terminal device through the point-to-point connection;
[0260] The account transfer module 108 is also used to send the second encrypted file, the target random code, and the social account to the transfer terminal device if the response transfer code is the same as the target transfer code, so that the transfer terminal device can obtain the verification password entered by the first object, perform reversible decryption processing on the second encrypted file according to the verification password and the target random code to obtain the decryption private key, and send the verification transaction to the blockchain network according to the decryption private key and the social account of the first object.
[0261] The account transfer module 108 is also used to confirm that the account transfer was successful if a transfer success notification message is received from the transfer terminal device; the transfer success notification message is generated by the transfer terminal device when it confirms that the transaction has been successfully verified on the blockchain.
[0262] The specific implementation of the account transfer module 108 can be found in the above description. Figure 9 The optional descriptions in the corresponding embodiments will not be repeated here.
[0263] The data processing device 1 mentioned above also includes a password cloud storage module 109.
[0264] Password cloud storage module 109 is used to display the password cloud storage page for social media accounts;
[0265] The password cloud storage module 109 is also used to respond to input operations on the password cloud storage page and obtain the available contact account of the first object;
[0266] The password cloud storage module 109 is also used to perform reversible encryption processing 109 on the second password based on the available contact account and the target encryption method to obtain the third encrypted file;
[0267] The password cloud storage module 109 is also used to send the third encrypted file and the available contact account to the backend server of the social application, so that the backend server can associate and store the third encrypted file and the available contact account.
[0268] The password cloud storage module 109 is also used to display a storage success message if a storage success message is received from the backend server.
[0269] The specific implementation of the password cloud storage module 109 can be found in the above description. Figure 9 The optional descriptions in the corresponding embodiments will not be repeated here.
[0270] The data processing device 1 mentioned above also includes a password cloud retrieval module 110.
[0271] Password cloud retrieval module 110 is used to display the password cloud retrieval page for social media accounts;
[0272] The password cloud retrieval module 110 is also used to respond to input operations on the password cloud retrieval page and obtain the retrieval account entered by the first object.
[0273] The password cloud retrieval module 110 is also used to send the entered retrieval account to the backend server, so that when the backend server detects that the entered retrieval account is the same as the available contact account, it obtains the third encrypted file, generates a retrieval verification code for the third encrypted file, and sends the retrieval verification code to the entered retrieval account.
[0274] The password cloud retrieval module 110 is also used to display a verification code input box on the password cloud retrieval page if a verification code has been sent and a notification message has been received from the backend server.
[0275] The password cloud retrieval module 110 is also used to respond to input operations for the verification code input box and obtain the input verification code entered by the first object;
[0276] The password cloud retrieval module 110 is also used to send the entered verification code to the backend server;
[0277] The password cloud retrieval module 110 is also used to receive a third encrypted file returned by the backend server if the backend server verifies that the input verification code and the retrieved verification code are the same.
[0278] The password cloud retrieval module 110 is also used to perform reversible decryption processing on the third encrypted file based on the input retrieval account and the target encryption method to obtain the second password, which is then displayed on the password cloud retrieval page.
[0279] The specific implementation of the password cloud retrieval module 110 can be found in the above description. Figure 9 The optional descriptions in the corresponding embodiments will not be repeated here.
[0280] Social interaction includes the posting of social information;
[0281] The aforementioned data processing device 1 also includes: a social information publishing module 111.
[0282] The social information publishing module 111 is used to respond to the social information publishing operation performed by the first object through a social account and generate a social information publishing request; the social information publishing request includes the information to be published.
[0283] The social information publishing module 111 is also used to obtain the private key corresponding to the first object, and to perform signature processing on the social information publishing request based on the private key to obtain social information publishing signature data;
[0284] The social information publishing module 111 is also used to package the social information publishing request and the social information publishing signature data to obtain a social information publishing transaction;
[0285] The social information publishing module 111 is also used to send social information publishing transactions to the blockchain network, so that the blockchain network can package the social information publishing transactions into the social block and perform consensus on the social block and put it on the chain;
[0286] The social information publishing module 111 is also used to display the information to be published and the block hash in the social application according to the social information publishing instruction sent by the backend server, if it receives the social information publishing instruction carrying the information to be published and the block hash of the social block; the social information publishing instruction is generated by the backend server when the consensus of the social block is successfully uploaded to the chain; the block hash is used to query the block information of the social block.
[0287] The specific implementation of the social information publishing module 111 can be found in the above description. Figure 4 The optional descriptions in the corresponding embodiments will not be repeated here.
[0288] Social interaction includes adding objects;
[0289] The aforementioned data processing device 1 further includes an object adding module 112.
[0290] The object addition module 112 is used to respond to the object addition operation performed by the first object through its social media account and generate an object addition request; the object addition request includes the social media account of the second object.
[0291] The object adding module 112 is also used to establish a point-to-point connection between the object and the object terminal device bound to the second object;
[0292] The object adding module 112 is also used to send an object adding request to the object terminal device through the object point-to-point connection if the object point-to-point connection is successfully established, so that the object terminal device responds to the object adding request to perform the object adding operation and obtain the object adding result;
[0293] The object addition module 112 is also used to determine that the object addition failed if the object addition result is that the object is rejected.
[0294] The object adding module 112 is also used to obtain the private key of the first object if the object adding result is an object adding allowed result, and to perform signature processing on the object adding allowed result according to the private key to obtain the addition result signature data;
[0295] The object adding module 112 is also used to package the object's allowed addition result and the addition result signature data to obtain the first object allowed addition transaction;
[0296] The object adding module 112 is also used to send the first object adding permission transaction to the blockchain network so that the blockchain network can reach a consensus on the first object adding permission transaction and put it on the chain;
[0297] The object addition module 112 is also used to add the social media account of the second object to the object list of the first object if a successful object addition instruction is received from the backend server. The successful object addition instruction is generated by the backend server when it is determined that the consensus on the first object allowing the addition of transactions and the second object allowing the addition of transactions is successfully put on the chain. The second object allowing the addition of transactions is generated by the object terminal device based on the object allowing the addition result.
[0298] The specific implementation of the object addition module 112 can be found in the above description. Figure 4 The optional descriptions in the corresponding embodiments will not be repeated here.
[0299] Social interaction includes real-time conversations with objects;
[0300] The aforementioned data processing device 1 further includes: an object real-time session module 113.
[0301] The object instant conversation module 113 is used to respond to the object instant conversation operation made by the first object through a social account and display the object list of the first object.
[0302] The object instant conversation module 113 is also used to respond to a triggered operation on the social media account of the second object in the object list and display an instant conversation interface with the second object;
[0303] The object instant conversation module 113 is also used to respond to the first object's conversation message generation operation and generate an instant conversation message;
[0304] The object instant conversation module 113 is also used to send instant conversation messages to the object terminal device via the object peer-to-peer connection.
[0305] The specific implementation of the object instant conversation module 113 can be found in the above description. Figure 4 The optional descriptions in the corresponding embodiments will not be repeated here.
[0306] Please see Figure 12 , Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 12 As shown above, Figure 11 The data processing device 1 in the corresponding embodiment can be applied to a computer device 1000, which may include a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include a user interface 1003 and at least one communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the processor 1001. Figure 12 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.
[0307] In such Figure 12 In the computer device 1000 shown, the network interface 1004 provides network communication elements; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0308] In response to the first object's account registration request for a social application, a private key is generated for the first object based on blockchain rules; the blockchain rules are stored in the terminal device corresponding to the first object.
[0309] Generate the public key corresponding to the first object and the account address corresponding to the first object based on the private key;
[0310] The account registration transaction for the first object is sent to the blockchain network based on the private key, public key and account address, so that the blockchain network can package the account registration transaction into the target block and perform consensus on the target block and put it on the chain;
[0311] If a registration success message is received from the backend server corresponding to the social application, the account address is identified as the social account; the private key, public key, and social account are used to provide the first object with the ability to perform social interactions in the social application; the registration success message is generated by the backend server when it successfully connects to the target block consensus.
[0312] It should be understood that the computer device 1000 described in the embodiments of this application can execute the data processing method described in any of the corresponding embodiments above, and will not be repeated here. In addition, the beneficial effects of using the same method will not be repeated here either.
[0313] Furthermore, it should be noted that this application also provides a computer-readable storage medium storing a computer program executed by the aforementioned data processing apparatus 1. This computer program includes program instructions, which, when executed by the processor, can perform the data processing method described in any of the corresponding embodiments described above. Therefore, further details will not be repeated here. Additionally, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application.
[0314] The aforementioned computer-readable storage medium can be an internal storage unit of the data processing apparatus or computer device provided in any of the foregoing embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0315] Furthermore, it should be noted that this application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in any of the preceding corresponding embodiments.
[0316] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0317] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the foregoing description as a network element. Whether these network elements are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can implement the described network elements using different methods for each specific application, but such implementation should not be considered beyond the scope of this application.
[0318] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A data processing method based on blockchain, characterized in that, include: In response to the first object's account registration request for the social application, a private key is generated for the first object based on blockchain rules; The blockchain rules are stored in the terminal device corresponding to the first object; Generate the public key corresponding to the first object and the account address corresponding to the first object based on the private key; The account registration transaction for the first object is sent to the blockchain network according to the private key, the public key, and the account address, so that the blockchain network packages the account registration transaction into the target block and performs consensus on the target block and puts it on the chain; wherein, the account registration transaction includes an account registration request and signature data, the account registration request carries the public key and the account address, and the signature data is obtained by signing the account registration request with the private key; If a registration success message is received from the backend server corresponding to the social application, the account address is identified as a social account; the private key, the public key, and the social account are used to provide the first object with the ability to perform social interactions in the social application; the registration success message is generated by the backend server when it successfully connects to the target block consensus chain.
2. The method according to claim 1, characterized in that, The step of generating the public key corresponding to the first object and the account address corresponding to the first object based on the private key includes: The private key is subjected to asymmetric encryption to obtain the public key corresponding to the first object; The public key is subjected to one-way hash encryption to obtain the account address corresponding to the first object.
3. The method according to claim 1, characterized in that, The step of sending an account registration transaction for the first object to the blockchain network based on the private key, the public key, and the account address, so that the blockchain network packages the account registration transaction into the target block and performs consensus on the target block and puts it on the chain, includes: Generate an account registration request; sign the account registration request using the private key to obtain signature data; The account registration request and the signature data are packaged together to obtain an account registration transaction for the first object; The account registration transaction is sent to the blockchain network so that the blockchain network can verify the signature data according to the public key and obtain the verification result. When the verification result is a successful verification result, the account registration transaction is packaged into the target block and consensus is achieved on the target block.
4. The method according to claim 1, characterized in that, Also includes: Displays the password settings page for the aforementioned social media account; In response to the first object's input operation on the password setting page, the password entered by the first object is obtained and used as the first password; The private key is reversibly encrypted using the first password to obtain the first encrypted file; The first encrypted file is stored, and after the first encrypted file is successfully stored, a password setting success message is displayed on the password setting page.
5. The method according to claim 1, characterized in that, Also includes: Displays a password settings page for the social media account; the password settings page includes a password settings text box and a random code settings text box; In response to the first object's setting operation on the password setting text box, the password set by the first object is obtained and used as the second password; In response to the first object's setting operation on the text box for the random code, the random code set by the first object is obtained as the target random code; Obtain an encryption method from the encryption pool that matches the target random code, and use it as the target encryption method; The private key is reversibly encrypted using the second password and the target encryption method to obtain the second encrypted file. The second encrypted file, the target random code, and the social media account of the first object are associated and stored together. After the second encrypted file, the target random code, and the social media account of the first object are successfully associated and stored, a password setting success message is displayed on the password setting page.
6. The method according to claim 5, characterized in that, Also includes: In response to the first object's on-chain social interaction operation for the social application, a social interaction on-chain request is generated; Display a password input text box in the social application; In response to the input operation of the first object on the password input text box, the password entered by the first object is obtained as the input password; If the input password is the same as the second password, then the second encrypted file and the target random code stored in association with the social account of the first object are obtained; Obtain the target encryption method that matches the target random code from the encryption pool; The second encrypted file is reversibly decrypted based on the input password and the target encryption method to obtain the private key; The social interaction on-chain request is signed using the private key to obtain social interaction signature data; The social interaction on-chain request and the social interaction signature data are packaged together to obtain the social interaction on-chain transaction; The social interaction on-chain transaction is sent to the blockchain network so that the blockchain network packages the social interaction on-chain transaction into a new target block and performs consensus on the new target block.
7. The method according to claim 5, characterized in that, Also includes: In response to the account transfer operation of the first object on the transfer terminal device, a target transfer code is generated; Establish a point-to-point connection with the transfer terminal device and receive the response transfer code sent by the transfer terminal device through the point-to-point connection; If the response transfer code is the same as the target transfer code, the second encrypted file, the target random code, and the social media account are sent to the transfer terminal device so that the transfer terminal device can obtain the verification password input by the first object, perform reversible decryption processing on the second encrypted file according to the verification password and the target random code to obtain the decryption private key, and send a verification transaction to the blockchain network according to the decryption private key and the social media account of the first object. If a transfer success notification is received from the transfer terminal device, the account transfer is confirmed to be successful. The successful transfer notification is generated by the transfer terminal device when it determines that the verification transaction has been successfully uploaded to the blockchain.
8. The method according to claim 5, characterized in that, Also includes: Displays the password cloud storage page for the aforementioned social media account; In response to an input operation on the password cloud storage page, obtain the available contact account of the first object; The second password is reversibly encrypted using the available contact account and the target encryption method to obtain a third encrypted file; The third encrypted file and the available contact account are sent to the backend server corresponding to the social application, so that the backend server associates and stores the third encrypted file with the available contact account; If a storage success message is received from the backend server, then the storage success message will be displayed.
9. The method according to claim 8, characterized in that, Also includes: Displays a password recovery page for the aforementioned social media account; In response to an input operation on the password cloud retrieval page, obtain the retrieval account entered by the first object; The input recovery account is sent to the backend server, so that when the backend server detects that the input recovery account is the same as the available contact account, it obtains the third encrypted file, generates a recovery verification code for the third encrypted file, and sends the recovery verification code to the input recovery account. If a verification code has been sent and a notification message is received from the backend server, a verification code input box will be displayed on the password cloud retrieval page. In response to an input operation in the verification code input box, obtain the verification code entered by the first object; The input verification code is sent to the backend server; If the backend server verifies that the input verification code and the retrieved verification code are the same, then the server receives the third encrypted file returned by the backend server. The third encrypted file is reversibly decrypted based on the input account and the target encryption method to obtain the second password, which is then displayed on the password cloud retrieval page.
10. The method according to claim 1, characterized in that, The social interaction includes the posting of social information; The method further includes: In response to the social information posting operation performed by the first object through the social account, a social information posting request is generated; the social information posting request includes information to be posted. Obtain the private key corresponding to the first object, and perform signature processing on the social information publishing request based on the private key to obtain social information publishing signature data; The social information publishing request and the social information publishing signature data are packaged together to obtain a social information publishing transaction; The social information publishing transaction is sent to the blockchain network, so that the blockchain network packages the social information publishing transaction into a social block and performs consensus on the social block and puts it on the chain; If a social information publishing instruction carrying the information to be published and the block hash of the social block is received from the backend server, the information to be published and the block hash are displayed in the social application according to the social information publishing instruction; the social information publishing instruction is generated by the backend server when the consensus on the social block is successfully uploaded to the chain; the block hash is used to query the block information of the social block.
11. The method according to claim 1, characterized in that, The social interaction includes adding objects; The method further includes: In response to the object addition operation performed by the first object through the social media account, an object addition request is generated; the object addition request includes the social media account of the second object. Establish a peer-to-peer connection between the object terminal device bound to the second object; If the object peer-to-peer connection is successfully established, the object add request is sent to the object terminal device through the object peer-to-peer connection, so that the object terminal device responds to the object add request to perform the object add operation and obtain the object add result; If the result of adding the object is that the object is rejected, then the object addition is determined to have failed. If the object addition result is an object addition allowed result, then obtain the private key of the first object, and perform signature processing on the object addition allowed result according to the private key to obtain the addition result signature data; The object's allowed addition results and the signature data of the addition results are packaged together to obtain the first object's allowed addition transaction; The first object is allowed to add transactions, which are then sent to the blockchain network to enable the blockchain network to reach consensus and upload the first object's allowed transactions. If the backend server receives an object addition success instruction, the social media account of the second object is added to the object list of the first object according to the object addition success instruction; the object addition success instruction is generated by the backend server when it determines that the consensus on allowing the first object to add transactions and allowing the second object to add transactions has been successfully put on the chain; the second object allowing the addition of transactions is generated by the object terminal device according to the object addition permission result.
12. The method according to claim 11, characterized in that, The social interaction includes real-time conversations with objects; The method further includes: In response to the first object's real-time conversation operation via the social account, display the first object's object list; In response to a triggered operation targeting the social media account of the second object in the object list, an instant conversation interface with the second object is displayed; In response to the session message generation operation of the first object, generate an instant session message; The instant conversation message is sent to the target terminal device through the object peer-to-peer connection.
13. A data processing device based on blockchain, characterized in that, include: The first generation module is used to respond to the account registration request of the first object for the social application and generate a private key for the first object based on the blockchain rules. The blockchain rules are stored in the terminal device corresponding to the first object; The second generation module is used to generate the public key corresponding to the first object and the account address corresponding to the first object based on the private key. The transaction registration module is used to send an account registration transaction for the first object to the blockchain network based on the private key, the public key, and the account address, so that the blockchain network packages the account registration transaction into the target block and performs consensus on the target block and puts it on the chain; wherein, the account registration transaction includes an account registration request and signature data, the account registration request carries the public key and the account address, and the signature data is obtained by signing the account registration request with the private key; The account confirmation module is used to identify the account address as a social account if it receives a registration success notification from the backend server corresponding to the social application; the private key, the public key, and the social account are used to provide the first object with the ability to perform social interactions in the social application; the registration success notification is generated by the backend server when it successfully connects the target block to the consensus chain.
14. A computer device, characterized in that, include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide data communication functions, the memory is used to store program code, and the processor is used to call the program code to execute the method according to any one of claims 1-12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and to execute the method of any one of claims 1-12.
16. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they can perform the method described in any one of claims 1-12.