Data processing method and device based on block chain, electronic equipment and storage medium

By using blockchain technology and smart contracts in lottery transactions, generating and matching random target data and user business data, the problem of lack of openness and transparency in existing lottery transaction methods is solved, and a decentralized, automated and efficient Data processing system.

CN119397602APending Publication Date: 2025-02-07BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Application Number
CN202411245330.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The lack of openness and transparency of existing lottery trading methods has led users to question the fairness of lottery.

Method used

Using a blockchain-based data processing method, random target data is generated through the first smart contract and stored on the blockchain, the second smart contract processes the business data selected by the user and attaches the user's signature to store it on the blockchain, the third smart contract is The contract matches the target data with the business data to generate a target list.

Benefits of technology

A decentralized, automated and user-trusted data processing system is implemented, reducing human intervention and potential fraud, and enhancing the efficiency and transparency of the data processing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119397602A_ABST
    Figure CN119397602A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device based on a block chain, electronic equipment and a storage medium, and relates to the technical field of information, in particular to the technical field of block chains. According to the specific implementation scheme, random target data is generated through a first smart contract, the target data is stored in a block chain, and the first smart contract comprises logic for generating the random data; service data selected by the user is acquired through a second smart contract, the service data is added with a user signature and stored in the block chain, and the second smart contract comprises service logic for processing the service data; and matching the target data with the business data through a third smart contract to obtain a target list, the third smart contract including a matching rule between the target data and the business data. According to the invention, complete decentration of the data processing process is realized, and the data processing process is open and transparent and cannot be tampered and repudiated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of information technology, specifically to the field of blockchain technology, and in particular to a blockchain-based data processing method, device, electronic device, and storage medium. Background Art

[0002] Data processing process Taking the lottery transaction process as an example, lottery has a long history as a popular leisure activity. In the process of the development of the lottery industry, the lottery operation model has been constantly improved, and each link from issuance, betting, lottery drawing, prize drawing to prize redemption has become more transparent and fair. However, it is inevitable that the traditional lottery is controlled by one institution, so the public has a certain degree of distrust in the lottery and will question the fairness of the lottery.

[0003] It can be seen from this that the current lottery transaction method is not open and transparent enough for users and cannot be trustworthy. Summary of the invention

[0004] The present invention provides a blockchain-based data processing method, device, electronic device, and storage medium.

[0005] According to one aspect of the present disclosure, a blockchain-based data processing method is provided, the method comprising:

[0006] Generate random target data through a first smart contract, and store the target data in a blockchain, wherein the first smart contract includes logic for generating random data;

[0007] Obtaining the business data selected by the user through a second smart contract, and storing the business data with the user's signature in the blockchain, wherein the second smart contract includes business logic for processing the business data;

[0008] The target data is matched with the business data through a third smart contract to obtain a target list, wherein the third smart contract contains a matching rule between the target data and the business data.

[0009] According to another aspect of the present disclosure, there is provided a data processing device based on blockchain, comprising:

[0010] A generation module, configured to generate random target data through a first smart contract and store the target data in a blockchain, wherein the first smart contract includes logic for generating random data;

[0011] An acquisition module, used to acquire the business data selected by the user through a second smart contract, and store the business data with the user's signature in the blockchain, wherein the second smart contract contains business logic for processing the business data;

[0012] A matching module is used to match the target data with the business data through a third smart contract to obtain a target list, wherein the third smart contract contains a matching rule between the target data and the business data.

[0013] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method in any of the above technical solutions.

[0017] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods described in the above technical solutions.

[0018] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements any one of the methods described in the above technical solutions when executed by a processor.

[0019] The present disclosure provides a data processing method, device, equipment and storage medium based on blockchain. The present disclosure adopts a first smart contract to generate random target data and store the target data in the blockchain, ensuring the unpredictability and fairness of the data processing process; then, a second smart contract is used to process the business data selected by the user and upload it to the chain together with the user's signature, ensuring the security of the transaction and the non-repudiation of the user's transaction behavior; finally, the third smart contract executes the data matching logic to automatically match the target data with the business data, so that the target list can be determined quickly and accurately. This method jointly creates a decentralized, automated, and user-trusted data processing system, reduces human intervention and potential fraud, and enhances the efficiency and transparency of the entire data processing process to achieve an open and transparent data processing process.

[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0022] Figure 1 is a schematic diagram of the steps of the blockchain-based data processing method in an embodiment of the present disclosure;

[0023] Figure 2 is a system schematic diagram corresponding to the blockchain-based data processing method in one embodiment of the present disclosure;

[0024] Figure 3 A block diagram of a blockchain-based data processing device in an embodiment of the present disclosure;

[0025] Figure 4 It is a block diagram of an electronic device used to implement the blockchain-based data processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0027] In order to facilitate understanding of the technical solution of the present application, some abbreviations and key terms are explained as follows:

[0028] 1. Blockchain: Blockchain is a decentralized, distributed database technology that stores transaction data through increasing blocks and uses cryptography to ensure the security and immutability of data. Each block contains the hash value of the previous block, forming a chain structure. The data is stored in the nodes of the entire network, which is highly secure and transparent. The general use scenarios of blockchain are: The most common application of blockchain is cryptocurrency, but it is also widely used in supply chain management, financial services, medical health and other fields. Its advantages are: Blockchain technology can achieve decentralized, immutable data storage, ensure the security and transparency of transactions, and reduce the cost and risk of intermediate links. The problems it can solve are: In supply chain management, blockchain can solve problems such as information opacity and insufficient supply chain risk management; in financial services, blockchain can reduce transaction time, reduce costs, and improve transparency.

[0029] 2. Smart Contract: A smart contract is an automated contract based on blockchain technology. It is a pre-programmed automatic contract execution program that can execute and manage various terms in the contract without the intervention of a third party. The general use scenarios of smart contracts are: Smart contracts are widely used in the field of financial services to execute financial transactions, contract management and settlement. Its advantages are: Smart contracts can reduce human errors, improve transaction efficiency, while reducing costs and enhancing the reliability of contract performance. The problems it can solve are: In financial services, smart contracts can solve problems such as slow transaction speed, high handling fees, and low efficiency of traditional contract execution.

[0030] 3. Hash encryption algorithm: The hash algorithm is irreversible. The hash plus salt algorithm is a technology used to encrypt data. By adding random data (salt) to the original data, the data security and protection are increased, and common dictionary brute force attacks can be prevented. The use scenarios of the hash encryption algorithm are: the hash plus salt algorithm is often used to store user passwords and protect user privacy data. Its advantages are: hash plus salt can reduce the risk of password cracking, improve data security, and protect user privacy. The problem it can solve is: in user password storage, the hash plus salt algorithm can effectively prevent passwords from being cracked by brute force and rainbow table attacks, and protect user privacy data from being leaked.

[0031] 4. Signature algorithm: The signature algorithm is a technology used to verify the integrity and authenticity of data. Through digital signatures, the source and content of the data can be proved whether it has been tampered with. Usage scenarios: Signature algorithms are often used in fields such as identity authentication and digital certificate issuance. The advantages of signature algorithms are: signature algorithms can verify the integrity and authenticity of data, prevent data from being tampered with or forged, and ensure data security. The problems it can solve are: In the field of identity authentication, signature algorithms can solve problems such as identity forgery, data tampering, and information security risks, and ensure the security of data transmission and storage.

[0032] Taking the lottery transaction process as an example, the existing lottery system mostly allows users to purchase lottery tickets through machine selection mode or self-selection mode to obtain lottery numbers. Then when the final prize is drawn, the winning number is randomly generated. Finally, the randomly generated winning number is compared with the lottery number purchased by the user to see if it wins. This method cannot be open and transparent. For example, whether the winning number generated at the end is random, whether the numbers purchased by the user are consciously filtered, or whether the winning number generated at the end is preset and has been known by internal personnel in advance, so as to leak information, etc. There are many loopholes in this transaction method. For users, this method is not open and transparent enough and cannot be trusted.

[0033] In order to solve the above technical problems, the present disclosure provides a new data processing method based on blockchain, see Figure 1 As shown, Figure 1 : is a schematic diagram of the steps of a blockchain-based data processing method in an embodiment of the present disclosure, the method comprising:

[0034] Step S101, generating random target data through a first smart contract, and storing the target data in a blockchain, wherein the first smart contract includes logic for generating random data.

[0035] Specifically, the first smart contract is a smart contract specifically used to generate random target data. In this way, random target data is generated by the first smart contract to ensure the randomness and security of the target data. When generating random target data by the first smart contract, a random number generation mechanism can be built into the first smart contract, which can combine the chain information of the current block (such as block hash, timestamp, etc.) to generate an unpredictable value, and then determine the final target data through a series of calculations. It should be noted that the generated target data is random and irregular. Optionally, after determining the random target data, the target data can be encrypted and stored on the blockchain together with the digital signature of the issuing organization, so that the target data can be traceable, that is, no matter who can prove that the target data (encrypted) must be issued by this organization, no one can disguise the data issued by this organization, and it can be known when it was issued to ensure the randomness, security and non-tamperability of the target data. It should be noted that in the scheme disclosed in the present invention, the target data specifically refers to the winning number, so in the following embodiments, it is understandable if the target data is directly replaced by the winning number.

[0036] Step S102, obtaining the business data selected by the user through the second smart contract, and attaching the business data with the user's signature to store it in the blockchain. The second smart contract contains the business logic for processing the business data.

[0037] Specifically, the so-called business data refers to the transaction number corresponding to the user's purchase of lottery tickets. A second smart contract is deployed on the blockchain, which is specifically used to process business data, that is, to process the transaction number selected by the user when purchasing lottery tickets. Specifically, users operate through a user interface (UI) that interacts with the smart contract to select the lottery number they want to buy. After the user selects the number, the UI will construct a transaction containing the number selected by the user and the user's account information. Then the user digitally signs the transaction content and generates a signature using their private key to prove the identity of the initiator of the transaction. Finally, the user sends the signed transaction to the blockchain network and requests the smart contract to execute the purchase logic. After the second smart contract receives the transaction, it first verifies the validity of the transaction, including checking the correctness of the signature. After the signature verification is passed, the second smart contract executes the purchase logic, which may include checking whether the number is valid, whether it has been purchased, etc. Finally, the second smart contract records the number selected by the user and the relevant purchase information (including the user's signature) on the blockchain. In this way, all purchase information recorded on the blockchain is public and can be viewed by anyone, ensuring the transparency of the transaction. Since the purchase information is stored on the blockchain, each transaction is traceable, increasing the credibility of the system. In this way, through the second smart contract, the user's number selection and purchase behavior are securely recorded on the blockchain, providing a reliable, transparent and automated solution for the purchase link of the lottery system.

[0038] Step S103, matching the target data with the business data through a third smart contract to obtain a target list, wherein the third smart contract contains a matching rule between the target data and the business data.

[0039] Specifically, a third smart contract is deployed on the blockchain, wherein the third smart contract contains matching rules between target data and business data. For the lottery field, the third smart contract includes lottery logic and winning rules. When the scheduled lottery time is reached, the first smart contract automatically triggers the lottery logic, publishes the encrypted target data and the corresponding decryption key, and the third smart contract uses the published key to decrypt the target data to obtain the original target data. Then, the third smart contract collects all user business data recorded by the second smart contract from the blockchain to execute the matching logic and compare the decrypted target data with the user business data. Finally, the third smart contract determines which business data matches the target data according to the preset winning rules to generate a target list. Generally, in order to ensure security, the third smart contract may also verify the user signature associated with the business data to ensure the validity of the purchase. The target list, that is, the winning list, will eventually be published on the blockchain and can be viewed and verified by all participants. Since all operations are performed on the blockchain, the entire process is transparent and anyone can verify the fairness of the results. In this way, the automation characteristics of the third smart contract reduce manual intervention, improve efficiency, and reduce the risk of operational errors and fraud. Secondly, the rules encoded in the third smart contract ensure the consistency and accuracy of the lottery and matching process.

[0040] The present disclosure provides a data processing method, device, equipment and storage medium based on blockchain. The present disclosure adopts a first smart contract to generate random target data and store the target data in the blockchain, ensuring the unpredictability and fairness of the data processing process; then, a second smart contract is used to process the business data selected by the user and upload it to the chain together with the user's signature, ensuring the security of the transaction and the non-repudiation of the user's transaction behavior; finally, the third smart contract executes the data matching logic to automatically match the target data with the business data, so that the target list can be determined quickly and accurately. This method jointly creates a decentralized, automated, and user-trusted data processing system, reduces human intervention and potential fraud, and enhances the efficiency and transparency of the entire data processing process to achieve an open and transparent data processing process.

[0041] In some optional embodiments, generating random target data through a first smart contract and storing the target data in a blockchain includes:

[0042] Deploy the first smart contract in the blockchain;

[0043] Calling the first smart contract to generate random target data, and encrypting the target data to obtain encrypted target data;

[0044] Generate a first digital signature on the encrypted target data using the private key of the issuing institution through the first smart contract;

[0045] The encrypted target data and the first digital signature are stored in the blockchain.

[0046] When generating random target data through the first smart contract, that is, generating random winning numbers, first, a specially designed first smart contract is deployed on the blockchain platform, and the first smart contract has the function of generating random numbers and performing related encryption operations. After the first smart contract is deployed, a random target number is generated by calling the function of the first smart contract. This number is completely randomly generated without rules to ensure the fairness of the lottery. Secondly, in order to protect the confidentiality of the target data before the lottery, the generated target data is encrypted. This usually involves the use of encryption algorithms and possible salt values ​​to enhance security. Thirdly, the encrypted target data is signed using the private key held by the issuing institution to generate a first digital signature. This first digital signature proves the source and integrity of the target data and ensures its non-repudiation. Finally, the encrypted target data and the corresponding first digital signature are stored together on the blockchain. Due to the immutability of the blockchain, this step ensures the security and transparency of the target data, allowing all network participants to verify but not change these key information.

[0047] In this way, the first smart contract deployed in the blockchain ensures the decentralization and automation of the lottery process; secondly, the random target data generated by the calling contract is encrypted to ensure confidentiality and security before the lottery is drawn, preventing potential prediction and tampering; then, the first digital signature generated by the issuing agency's private key provides undeniable authentication for the encrypted target data, enhancing the credibility of the lottery results; finally, the encrypted number and signature are stored on the blockchain, utilizing the blockchain's tamper-proof and transparent characteristics to ensure permanent recording and public verifiability of the lottery results.

[0048] In some optional embodiments, encrypting the target data to obtain the encrypted target data includes:

[0049] The target data is encrypted using a hash-salting algorithm to obtain the encrypted target data.

[0050] Specifically, when encrypting the target data, first generate a random salt value, and combine the salt value with the target data. When combining the salt value with the target data, the salt value is usually spliced ​​to the front or back of the target data, or the two are mixed in some way. Then, use a hash function (such as SHA-256) to hash the target data combined with the salt value, and convert the input (salt value + target data) into a hash value of a fixed length through the hash function, so that the encrypted target data can be obtained. It should be noted that the salt value of each target data is unique, so that even if two target data are the same, their hash values ​​will be different due to different salt values.

[0051] Finally, the generated salt value is stored together with the hash value, because only the correct salt value can verify the correctness of the hash value. The salt value and hash value are securely stored on the blockchain or in a related secure database to ensure that they are not accessed by unauthorized persons. If the target data needs to be verified or decrypted, the input data is re-hashed using the same salt value and compared with the stored hash value. Through this encryption process, even if someone obtains the hash value, the original target data cannot be reversed, because the hash function is one-way, and due to the existence of the salt value, the same target data will produce different hash values, thereby enhancing security. In the lottery system, the target data is encrypted by the salted hash algorithm, which ensures the confidentiality of the target data before the lottery, while ensuring the security and non-tamperability of the lottery process.

[0052] In this way, by encrypting the target data using a hash and salt algorithm, the encrypted target data ensures the security and confidentiality of the data, effectively prevents unauthorized access and tampering, and at the same time enhances the security and trustworthiness of the lottery process, ensuring the fairness and unpredictability of the entire lottery system.

[0053] In some optional embodiments, obtaining the business data selected by the user through the second smart contract, and attaching the business data with the user's signature and storing it in the blockchain includes:

[0054] Deploy a second smart contract in the blockchain;

[0055] Call the second smart contract to randomly generate business data and obtain the business data selected by the user;

[0056] Digitally signing the business data to obtain a second digital signature;

[0057] The business data and the second digital signature are stored in the blockchain.

[0058] Specifically, when obtaining the business data selected by the user through the second smart contract, that is, when obtaining the transaction number selected by the user, the second smart contract is first deployed on the blockchain platform. The second smart contract is responsible for processing the logic of the user's lottery purchase, including generating a transaction number and recording the user's choice. The user requests to purchase a lottery ticket by calling the deployed second smart contract. When purchasing a lottery ticket, a machine selection method can be used. Specifically, the second smart contract randomly generates a set of business data, and these numbers are the business data selected by the user. In order to ensure the security of the transaction and the authenticity of the user's identity, the user needs to digitally sign the selected business data. This process can use the user's private key, so that a unique second digital signature can be generated. It should be said that the second digital signature is the result of encrypting the hash value of the business data using the user's private key. This signature verifies the user's choice and ownership of the business data. After obtaining the second digital signature, the second smart contract stores the business data selected by the user and the corresponding second digital signature on the blockchain. Since the second digital signature provides a security layer, it ensures that only users with the corresponding private key can sign the business data, thereby preventing unauthorized modification or impersonation. This step ensures the immutability and transparency of the transaction.

[0059] Since all transaction records stored on the blockchain are public, anyone can verify business data and signatures, which increases the transparency and traceability of the system. After the lottery is drawn, the smart contract can use the business data and signatures stored on the blockchain to verify which users have won the prize, ensuring the fairness of the lottery process. Through this process, the second smart contract not only provides a secure and transparent method to record users' lottery purchases, but also enhances the security of transactions and user trust through digital signature technology, providing a solid foundation for the smooth operation of the lottery system.

[0060] In this way, by deploying the second smart contract in the blockchain, the system realizes the random generation and secure recording of the business data selected by the user. At the same time, through the digital signature technology, each business data is uniquely authenticated by the user, ensuring the non-repudiation and authenticity of the transaction. Finally, storing this information on the blockchain further enhances the data's immutability and transparency, providing a safe, reliable and publicly auditable record for the lottery purchase process, thereby enhancing user trust and effectively preventing fraud.

[0061] In some optional embodiments, obtaining the business data selected by the user through the second smart contract, and attaching the business data with the user's signature and storing it in the blockchain includes:

[0062] Deploy a second smart contract in the blockchain;

[0063] Get the business data selected by the user, and obtain the business data selected by the user;

[0064] Digitally signing the business data to obtain a third digital signature;

[0065] The business data and the third digital signature are stored in the blockchain.

[0066] Specifically, a second smart contract is deployed on the blockchain. When users select lottery numbers through the system interface or machine selection, the second smart contract will receive and confirm these numbers to ensure that the business data selected by each user is accurate. Then, in order to further ensure the security of the transaction and verify the identity of the user, the system will digitally sign these business data and generate a third digital signature. Finally, the third smart contract stores the business data selected by the user together with its third digital signature on the blockchain, and uses the blockchain's tamper-proof and transparent characteristics to provide a permanent and verifiable record for each user's number selection. The entire process not only improves the security and trust of lottery purchases, but also ensures the openness and traceability of all transactions through blockchain technology.

[0067] In this way, the business data selected by the user is obtained and recorded through the second smart contract, combined with the third digital signature generated by the user's signature, and the information is stored in the blockchain. These features together ensure the security, authenticity and non-repudiation of the transaction. This mechanism not only provides a tamper-proof record, ensuring the confidentiality and integrity of the user's number selection, but also allows all participants to verify the legitimacy of the transaction through the transparency of the blockchain, thereby enhancing the credibility of the entire lottery system and the trust of users.

[0068] In some optional embodiments, the target data is matched with the business data through a third smart contract to obtain a target list, including:

[0069] Deploy a third smart contract in the blockchain;

[0070] When the preset prize draw time is met, the third smart contract is triggered to match the target data with all business data to obtain a matching result;

[0071] Get the target list based on the matching results.

[0072] Specifically, a dedicated smart contract, called the third smart contract, is deployed on the blockchain platform, which is responsible for the lottery logic and the matching process between the winning numbers and the user's transaction numbers. The third smart contract is set with preset lottery time conditions, which define when the lottery process can be triggered. Once the preset lottery time is reached, the third smart contract automatically triggers the lottery logic. This trigger can be time-driven, such as at a specific date and time, or after a specific condition is met, such as all lottery tickets are sold out. The lottery logic includes comparing the target data that is predetermined and securely stored on the blockchain with the business data selected by all users through the second smart contract. In order to ensure the validity and authenticity of each business data, the third smart contract may also verify the user signature associated with each business data. The third smart contract processes the comparison results to determine which business data matches the target data, thereby generating a matching result. Finally, based on the matching results, a target list can be generated, in which all winning transaction numbers and their corresponding users are listed.

[0073] Optionally, the generated target list can be recorded and stored on the blockchain, thus ensuring the transparency and tamper-proof nature of the results. If the bonus distribution logic is encoded in the third smart contract, it will automatically execute and distribute the bonus to the users on the target list.

[0074] In this way, an automated, efficient and transparent lottery process is achieved through the third smart contract, ensuring the fair and impartial matching of target data and user business data, while satisfying the automatic triggering mechanism under the preset lottery time conditions, improving the security and credibility of the entire lottery system. The immutability of the smart contract ensures the accuracy and authenticity of the lottery results, while storing the target list on the blockchain provides a publicly verifiable record for all participants, enhancing user confidence and reducing potential disputes and fraud, thus bringing a high degree of transparency and reliability to the lottery system.

[0075] In some optional embodiments, see Figure 2 , Figure 2 This is a system diagram corresponding to the blockchain-based data processing method in one embodiment of the present disclosure. The flowchart describes a blockchain-based lottery system, which involves three main smart contracts, namely the first smart contract, the second smart contract and the third smart contract, which correspond to contract α, purchase contract β and lottery contract γ respectively, and each contract is responsible for a different part of the lottery process. The following is a detailed working principle:

[0076] First, deploy the first smart contract, Contract α, which aims to generate random winning numbers and store them securely. Specifically, a random winning number is generated first, and then encrypted with a secret key to obtain the encrypted number a (a = winning number * secret key). Next, the digest hash value of the encrypted number a is signed using the issuing institution's private key to obtain a digital signature A (A = (private key * digest hash (a))). Finally, the encrypted number and signature A are stored together on the blockchain to ensure the security and non-repudiation of the winning number.

[0077] Next, the second smart contract, the purchase contract β, is deployed, and the user purchases the lottery ticket through the purchase contract β. If the number is selected by machine, the contract β will randomly generate a number b. Then, the user digitally signs the machine-selected number b to generate a signature B (B = (private key * digest hash (b))). Finally, the machine-selected number b and signature B are sent to the blockchain network together and stored on the blockchain. If a self-selected number is used, a self-selected number C is provided. The user also digitally signs the self-selected number C to generate a signature C (C = (private key * digest hash (C))). Finally, the self-selected number C and signature C are also sent to the blockchain network and stored on the blockchain.

[0078] Finally, deploy the second smart contract, the lottery contract γ. When the lottery time comes, the lottery contract γ will be triggered to execute the lottery logic. Contract γ uses a salt value and hash encryption algorithm to encrypt the winning number to obtain a secure lottery number. The encrypted lottery number will be published on the blockchain and can be viewed by all participants. All users' purchase records (including machine-selected and self-selected numbers) and corresponding signatures are already stored on the blockchain. After the lottery, the smart contract γ or related logic will be used to verify and match the encrypted lottery number with the number purchased by the user. Once the match is completed, the winning result will be published on the blockchain, and all participants can verify the authenticity of the winning information.

[0079] In this way, the entire process utilizes the transparency, security and immutability of blockchain, as well as the non-repudiation of digital signatures, ensuring the fairness and trustworthiness of the lottery system.

[0080] The following describes an embodiment of the device of the present application, which can be used to execute the blockchain-based data processing method in the above-mentioned embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the blockchain-based data processing method in the above-mentioned embodiment of the present application.

[0081] The present disclosure also provides a data processing device 300 based on blockchain, such as Figure 3 As shown, including:

[0082] A generation module 301 is used to generate random target data through a first smart contract and store the target data in a blockchain, wherein the first smart contract includes logic for generating random data;

[0083] An acquisition module 302 is used to acquire the business data selected by the user through a second smart contract, and store the business data with the user's signature in the blockchain, wherein the second smart contract contains business logic for processing the business data;

[0084] The matching module 303 is used to match the target data with the business data through the third smart contract to obtain a target list, and the third smart contract contains matching rules between the target data and the business data.

[0085] In some optional embodiments, the generation module 301 generates random target data through a first smart contract and stores the target data in a blockchain, including:

[0086] Deploy the first smart contract in the blockchain;

[0087] Calling the first smart contract to generate random target data, and encrypting the target data to obtain encrypted target data;

[0088] Generate a first digital signature on the encrypted target data using the private key of the issuing institution through the first smart contract;

[0089] The encrypted target data and the first digital signature are stored in the blockchain.

[0090] In some optional embodiments, the generating module 301 encrypts the target data to obtain the encrypted target data, including:

[0091] The target data is encrypted using a hash-salting algorithm to obtain the encrypted target data.

[0092] In some optional embodiments, the acquisition module 302 acquires the business data selected by the user through the second smart contract, and stores the business data with the user's signature in the blockchain, including:

[0093] Deploy a second smart contract in the blockchain;

[0094] Call the second smart contract to randomly generate business data and obtain the business data selected by the user;

[0095] Digitally signing the business data to obtain a second digital signature;

[0096] The business data and the second digital signature are stored in the blockchain.

[0097] In some optional embodiments, the acquisition module 302 acquires the business data selected by the user through the second smart contract, and stores the business data with the user's signature in the blockchain, including:

[0098] Deploy a second smart contract in the blockchain;

[0099] Get the business data selected by the user, and obtain the business data selected by the user;

[0100] Digitally signing the business data to obtain a third digital signature;

[0101] The business data and the third digital signature are stored in the blockchain.

[0102] In some optional embodiments, the matching module 303 matches the target data with the business data through a third smart contract to obtain a target list, including:

[0103] Deploy a third smart contract in the blockchain;

[0104] When the preset prize draw time is met, the third smart contract is triggered to match the target data with all business data to obtain a matching result;

[0105] Get the target list based on the matching results.

[0106] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0107] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0108] Figure 4 A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0109] like Figure 4As shown, the electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0110] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0111] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as a data processing method based on blockchain. For example, in some embodiments, the data processing method based on blockchain may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the applet distribution described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform a data processing method based on blockchain in any other appropriate manner (e.g., by means of firmware).

[0112] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0113] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0114] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0115] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0116] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0117] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0118] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0119] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A data processing method based on blockchain, the method comprising: Generate random target data through a first smart contract, and store the target data in a blockchain, wherein the first smart contract includes logic for generating random data; Obtaining the business data selected by the user through a second smart contract, and storing the business data with the user's signature in the blockchain, wherein the second smart contract includes business logic for processing the business data; The target data is matched with the business data through a third smart contract to obtain a target list, wherein the third smart contract contains a matching rule between the target data and the business data.

2. The method according to claim 1, wherein: The step of generating random target data through the first smart contract and storing the target data in the blockchain includes: Deploying the first smart contract in the blockchain; Calling the first smart contract to generate random target data, and encrypting the target data to obtain encrypted target data; Generate a first digital signature for the encrypted target data using the private key of the issuing institution through the first smart contract; The encrypted target data and the first digital signature are stored in the blockchain.

3. The method according to claim 2, wherein: The step of encrypting the target data to obtain the encrypted target data includes: The target data is encrypted using a hash-salting algorithm to obtain encrypted target data.

4. The method according to claim 1, wherein: The method of obtaining the business data selected by the user through the second smart contract and attaching the business data to the user's signature and storing it in the blockchain includes: Deploying the second smart contract in the blockchain; Calling the second smart contract to randomly generate business data to obtain the business data selected by the user; Digitally signing the business data to obtain a second digital signature; The business data and the second digital signature are stored in the blockchain.

5. The method according to claim 1, wherein: The method of obtaining the business data selected by the user through the second smart contract and attaching the business data to the user's signature and storing it in the blockchain includes: Deploying the second smart contract in the blockchain; Get the business data selected by the user, and obtain the business data selected by the user; Digitally signing the business data to obtain a third digital signature; The business data and the third digital signature are stored in the blockchain.

6. The method according to any one of claims 1 to 5, wherein: The matching of the target data with the business data through the third smart contract to obtain a target list includes: Deploying the third smart contract in the blockchain; Under the condition that the preset prize drawing time is met, the third smart contract is triggered to match the target data with all business data to obtain a matching result; A target list is obtained according to the matching results.

7. A data processing device based on blockchain, comprising: A generation module, configured to generate random target data through a first smart contract and store the target data in a blockchain, wherein the first smart contract includes logic for generating random data; An acquisition module, used to acquire the business data selected by the user through a second smart contract, and store the business data with the user's signature in the blockchain, wherein the second smart contract contains business logic for processing the business data; A matching module is used to match the target data with the business data through a third smart contract to obtain a target list, wherein the third smart contract contains a matching rule between the target data and the business data.

8. The device according to claim 7, wherein: The generating module generates random target data through a first smart contract and stores the target data in a blockchain, including: Deploying the first smart contract in the blockchain; Calling the first smart contract to generate random target data, and encrypting the target data to obtain encrypted target data; Generate a first digital signature for the encrypted target data using the private key of the issuing institution through the first smart contract; The encrypted target data and the first digital signature are stored in the blockchain.

9. The device according to claim 8, wherein: The generating module encrypts the target data to obtain the encrypted target data, including: The target data is encrypted using a hash-salting algorithm to obtain encrypted target data.

10. The device according to claim 7, wherein: The acquisition module acquires the business data selected by the user through the second smart contract, and stores the business data with the user's signature in the blockchain, including: Deploying the second smart contract in the blockchain; Calling the second smart contract to randomly generate business data to obtain the business data selected by the user; Digitally signing the business data to obtain a second digital signature; The business data and the second digital signature are stored in the blockchain.

11. The device according to claim 7, wherein: The acquisition module acquires the business data selected by the user through the second smart contract, and stores the business data with the user's signature in the blockchain, including: Deploying the second smart contract in the blockchain; Get the business data selected by the user, and obtain the business data selected by the user; Digitally signing the business data to obtain a third digital signature; The business data and the third digital signature are stored in the blockchain.

12. The device according to any one of claims 7 to 11, wherein: The matching module matches the target data with the business data through a third smart contract to obtain a target list, including: Deploying the third smart contract in the blockchain; Under the condition that the preset prize drawing time is met, the third smart contract is triggered to match the target data with all business data to obtain a matching result; A target list is obtained according to the matching results.

13. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.

15. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Fair welfare lottery drawing method based on blockchain

    CN108831002A

  • Lottery ticket redemption method and device based on a block chain

    CN109905379A

  • Digital lottery issuing method based on block chain and block chain node

    CN110889793A

  • Lottery issuing method and device based on blockchain, and medium

    CN110990882A

  • Lottery drawing method and system based on block chain

    CN111008863A

Cited By

  • Multi-subject data collaborative risk supervision system and method based on block chain

    CN119989316A