CN110968442B - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN110968442B
CN110968442B CN201911207374.XA CN201911207374A CN110968442B CN 110968442 B CN110968442 B CN 110968442B CN 201911207374 A CN201911207374 A CN 201911207374A CN 110968442 B CN110968442 B CN 110968442B
Authority
CN
China
Prior art keywords
information
block
user
matching
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911207374.XA
Other languages
Chinese (zh)
Other versions
CN110968442A (en
Inventor
蔡弋戈
秦青
王乐庆
李琴
杨晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911207374.XA priority Critical patent/CN110968442B/en
Publication of CN110968442A publication Critical patent/CN110968442A/en
Application granted granted Critical
Publication of CN110968442B publication Critical patent/CN110968442B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/008Reliability or availability analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the application discloses a data processing method and equipment, wherein the method comprises the following steps: acquiring number information selected by a user according to a number template, and associating the number information with user information corresponding to the user; transmitting the number information and the user information associated with the number information to a blockchain node so that the blockchain node generates a number block based on the number information and the user information, and adding the number block into a blockchain; generating at least one random number by adopting a random function according to the number template, generating at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determining a matching number according to the at least one hash value; and determining the matching degree of the number information in the number block according to the matching number, and determining the grade information of the user information corresponding to the number information according to the matching degree. By adopting the application, the data reliability of data processing and distribution can be ensured.

Description

Data processing method and device
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a data processing method and apparatus.
Background
The arrival of the mobile internet age, data has penetrated every industry and business function area today, becoming an important production factor. People excavate and use a large amount of data, change the life style of people, in order to improve the interactivity among user groups and increase the user enthusiasm, data rewards are usually carried out on business objects, the data rewards generally adopt a random mode, for example, rewards objects corresponding to the data rewards and users are randomly extracted, but the data rewards bring great hidden danger when the data is increased, for example, the data rewards are changed to obtain improper interests, so that the interests of the users are damaged, and the data reliability of data processing and distribution cannot be guaranteed.
Disclosure of Invention
The embodiment of the application provides a data processing method and device, which can ensure the data reliability of data processing and distribution.
In one aspect, an embodiment of the present application provides a data processing method, which may include:
Acquiring number information selected by a user according to a number template, and associating the number information with user information corresponding to the user;
Transmitting the number information and the user information associated with the number information to a blockchain node so that the blockchain node generates a number block based on the number information and the user information, and adding the number block into a blockchain; a number block includes a number information and a user information associated with the number information;
Generating at least one random number by adopting a random function according to the number template, generating at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determining a matching number according to the at least one hash value;
And determining the matching degree of the number information in the number block according to the matching number, and determining the grade information of the user information corresponding to the number information according to the matching degree.
The method for obtaining the number information selected by the user according to the number template, and associating the number information with the user information corresponding to the user comprises the following steps:
Obtaining number information selected by a user according to a number template; matching the number information with the number template to generate a matching result;
If the matching result is that the matching is passed, the number information and the user information corresponding to the user are associated, and if the matching result is that the matching is not passed, prompt information is sent to the user.
Wherein sending the number information and the user information associated with the number information to the blockchain node includes:
encrypting the number information and the user information associated with the number information by using a target private key to generate a ciphertext;
The ciphertext is sent to a blockchain node in the blockchain to cause the blockchain link point to generate a number block based on the ciphertext.
Wherein, according to the number template, adopting a random function to generate at least one random number, generating at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determining a matching number according to the at least one hash value, comprising:
Obtaining the template number of sub-templates in the number template; generating at least one random number with the same number as the templates by adopting a random function;
generating at least one hash value by respectively combining each random number in at least one random number with the number of users, the maximum block height information of the number block and the minimum block height information of the number block;
a matching number is determined based on the at least one hash value.
Wherein determining the matching number according to the at least one hash value comprises:
generating at least one hash value into decimal numbers corresponding to the at least one hash value respectively through numerical conversion, and determining at least one target numerical value according to the decimal numbers;
determining hit number fragments corresponding to each target value according to the sub-templates;
and generating the matching number from the at least one hit number segment according to the time sequence of the generation of the at least one random number.
Wherein, according to the matching number, confirm the matching degree of the number information in the number block, confirm the grade information of the user information that the number information corresponds according to matching degree, include:
Obtaining a number block corresponding to the stored number information and the user information from the block chain, and obtaining the number information from the number block;
Obtaining hit number fragments in the matched number and number information fragments in the number information, and counting the same fragment numbers of the hit number fragments and the number information fragments;
And determining the matching degree of the number information according to the same fragment number, and determining the grade information of the user information corresponding to the number information according to the matching degree.
The method for obtaining the number block corresponding to the stored number information and the user information from the block chain, and obtaining the number information from the number block comprises the following steps:
Acquiring a target public key corresponding to a target private key, and acquiring a number block corresponding to the stored number information and the user information from a block chain according to address information corresponding to the target public key;
And obtaining the ciphertext from the number block, decrypting the ciphertext by adopting the target public key, and generating the number information and the user information related to the number information.
In one aspect, an embodiment of the present application provides a data processing apparatus, which may include:
The number acquisition unit is used for acquiring the number information selected by the user according to the number template and correlating the number information with the user information corresponding to the user;
the information sending unit is used for sending the number information and the user information associated with the number information to the block chain node so that the block chain node generates a number block based on the number information and the user information and adds the number block into the block chain; a number block includes a number information and a user information associated with the number information;
The information matching unit is used for generating at least one random number by adopting a random function according to the number template, generating at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determining a matching number according to the at least one hash value;
And the information determining unit is used for determining the matching degree of the number information in the number block according to the matching number and determining the grade information of the user information corresponding to the number information according to the matching degree.
The number obtaining unit is specifically configured to:
Obtaining number information selected by a user according to a number template; matching the number information with the number template to generate a matching result;
If the matching result is that the matching is passed, the number information and the user information corresponding to the user are associated, and if the matching result is that the matching is not passed, prompt information is sent to the user.
The information sending unit is specifically configured to:
encrypting the number information and the user information associated with the number information by using a target private key to generate a ciphertext;
The ciphertext is sent to a blockchain node in the blockchain to cause the blockchain link point to generate a number block based on the ciphertext.
Wherein the information matching unit includes:
The hash generation subunit is used for acquiring the template number of the sub-templates in the number template; generating at least one random number with the same number as the templates by adopting a random function; generating at least one hash value by respectively combining each random number in at least one random number with the number of users, the maximum block height information of the number block and the minimum block height information of the number block;
and the information matching subunit is used for determining a matching number according to at least one hash value.
The information matching subunit is specifically configured to:
generating at least one hash value into decimal numbers corresponding to the at least one hash value respectively through numerical conversion, and determining at least one target numerical value according to the decimal numbers;
determining hit number fragments corresponding to each target value according to the sub-templates;
and generating the matching number from the at least one hit number segment according to the time sequence of the generation of the at least one random number.
Wherein the information determination unit includes:
The information acquisition subunit is used for acquiring a number block corresponding to the stored number information and the user information from the block chain and acquiring the number information from the number block;
The information determining subunit is used for acquiring hit number fragments in the matched number and number information fragments in the number information, and counting the same fragment numbers of the hit number fragments and the number information fragments; and determining the matching degree of the number information according to the same fragment number, and determining the grade information of the user information corresponding to the number information according to the matching degree.
The information acquisition subunit is specifically configured to:
Acquiring a target public key corresponding to a target private key, and acquiring a number block corresponding to the stored number information and the user information from a block chain according to address information corresponding to the target public key;
And obtaining the ciphertext from the number block, decrypting the ciphertext by adopting the target public key, and generating the number information and the user information related to the number information.
In one aspect, embodiments of the present application provide a computer-readable storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-described method steps.
In one aspect, a computer device is provided, including a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps described above.
In the embodiment of the application, the number information is associated with the user information corresponding to the user by acquiring the number information selected by the user according to the number template; the method comprises the steps of sending number information and user information associated with the number information to a blockchain node, enabling the blockchain node to generate a number block based on the number information and the user information, adding the number block into a blockchain, generating at least one random number by adopting a random function according to a number template, generating at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determining a matching number according to the at least one hash value; and determining the matching degree of the number information in the number block according to the matching number, and determining the grade information of the user information corresponding to the number information according to the matching degree. And determining the matching number through the hash value which cannot be tampered and predicted, further determining the grade information of the user information corresponding to the number information, and ensuring the data reliability of data processing and distribution.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1a is a system architecture diagram for data processing according to an embodiment of the present application;
FIG. 1b is a schematic diagram of a scenario of a data sharing system according to an embodiment of the present application;
FIG. 1c is a block chain result diagram according to an embodiment of the present application;
FIG. 1d is a flowchart of a block generation method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a data processing method according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of a data processing method according to an embodiment of the present application;
FIG. 4 is a schematic view of a scenario of data processing according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Fig. 1a is a system architecture diagram for data processing according to an embodiment of the present invention. The blockchain network 10h establishes a connection with a cluster of user terminals through the communication bus 10d, which may include: user terminal 10a, user terminal 10b, user terminal 10c. The blockchain network 10h includes a blockchain node 10f, a..and a blockchain node 10g, the server 10e associates the number information with user information corresponding to the user by acquiring the number information selected by the user according to the number template, and sends the number information to the blockchain node, the blockchain link point generates a number block based on the number information and the user information, and adds the number block to the blockchain, one number block includes one number information and one user information associated with the one number information, the server 10e generates at least one random number according to the number template by adopting a random function, generates at least one hash value according to the at least one random number, the number of the users and the block height information of the number block, determines a matching number according to the at least one hash value, and the server 10e acquires the number information from the blockchain, calculates the matching degree of the number information and the matching number, and determines the grade information of the user information corresponding to the number information according to the matching degree.
The device according to the embodiment of the application can comprise a server and an agent with data transmission and storage, and the user terminal comprises: terminal devices such as tablet computers, smart phones, personal Computers (PCs), notebook computers, palm computers, and the like.
The blockchain underlying platform may include processing modules for user management, basic services, smart contracts, operation monitoring, and the like. The user management module is responsible for identity information management of all blockchain participants, including maintenance of public and private key generation (account management), key management, maintenance of corresponding relation between the real identity of the user and the blockchain address (authority management) and the like, and under the condition of authorization, supervision and audit of transaction conditions of certain real identities, and provision of rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node devices, is used for verifying the validity of a service request, recording the service request on a storage after the effective request is identified, for a new service request, the basic service firstly analyzes interface adaptation and authenticates the interface adaptation, encrypts service information (identification management) through an identification algorithm, and transmits the encrypted service information to a shared account book (network communication) in a complete and consistent manner, and records and stores the service information; the intelligent contract module is responsible for registering and issuing contracts, triggering contracts and executing contracts, a developer can define contract logic through a certain programming language, issue the contract logic to a blockchain (contract registering), invoke keys or other event triggering execution according to the logic of contract clauses to complete the contract logic, and simultaneously provide a function of registering contract upgrading; the operation monitoring module is mainly responsible for deployment in the product release process, modification of configuration, contract setting, cloud adaptation and visual output of real-time states in product operation, for example: alarms, monitoring network conditions, monitoring node device health status, etc.
The platform product service layer provides basic capabilities and implementation frameworks of typical applications, and developers can complete the blockchain implementation of business logic based on the basic capabilities and the characteristics of the superposition business. The application service layer provides the application service based on the block chain scheme to the business participants for use.
In the following, description will be given of specific implementation scenarios provided in connection with fig. 1b, fig. 1c, and fig. 1d, where the data sharing system shown in fig. 1b is a data sharing system, and the data sharing system 100 refers to a system for performing data sharing between nodes, where the data sharing system may include a plurality of nodes 101, and the plurality of nodes 101 may be respective clients in the data sharing system. Each node 101 may receive input information while operating normally and maintain shared data within the data sharing system based on the received input information. In order to ensure the information intercommunication in the data sharing system, information connection can exist between each node in the data sharing system, and the nodes can transmit information through the information connection. For example, when any node in the data sharing system receives input information, other nodes in the data sharing system acquire the input information according to a consensus algorithm, and store the input information as data in the shared data, so that the data stored on all nodes in the data sharing system are consistent.
Each node in the data sharing system has a node identifier corresponding to the node identifier, and each node in the data sharing system can store the node identifiers of other nodes in the data sharing system, so that the generated block can be broadcast to other nodes in the data sharing system according to the node identifiers of other nodes. Each node can maintain a node identification list shown in the following table, and the node names and the node identifications are correspondingly stored in the node identification list. The node identifier may be an IP (Internet Protocol, protocol interconnected between networks) address and any other information that can be used to identify the node, and the IP address is only illustrated in table 1.
Table 1 correspondence between node names and node identifications
Node name Node identification
Node 1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258
Each node in the data sharing system stores one and the same blockchain. The blockchain is composed of a plurality of blocks, see fig. 1c, the blockchain is composed of a plurality of blocks, the starting block comprises a block head and a block main body, the block head stores an input information characteristic value, a version number, a time stamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a father block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the father block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain are associated with the block data stored in the father block, and the safety of the input information in the block is ensured.
When each block in the blockchain is generated, referring to fig. 1d, when the node where the blockchain is located receives input information, checking the input information, after the checking is completed, storing the input information into a memory pool, and updating a hash tree used for recording the input information; then, updating the update time stamp to the time of receiving the input information, trying different random numbers, and calculating the characteristic value for a plurality of times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
Wherein SHA-256 is a eigenvalue algorithm used for calculating eigenvalues; version (version number) is version information of the related block protocol in the block chain; the prev_hash is the block header characteristic value of the parent block of the current block; merkle _root is a characteristic value of input information; ntime is the update time of the update timestamp; the nbits is the current difficulty, is a fixed value in a period of time, and is determined again after exceeding a fixed period of time; x is a random number; TARGET is a eigenvalue threshold that can be determined from nbits.
Thus, when the random number meeting the formula is calculated, the information can be correspondingly stored to generate the block head and the block main body, and the current block is obtained. And then, the node where the blockchain is located sends the newly generated blocks to other nodes in the data sharing system where the newly generated blocks are located according to the node identification of other nodes in the data sharing system, the other nodes verify the newly generated blocks, and the newly generated blocks are added into the blockchain stored in the newly generated blocks after the verification is completed.
Referring to fig. 2, a flow chart of a data processing method is provided in an embodiment of the application. As shown in fig. 2, the method according to the embodiment of the present application may include the following steps S101 to S104.
S101, obtaining number information selected by a user according to a number template, and associating the number information with user information corresponding to the user;
Specifically, the data processing device obtains the number information selected by the user according to the number template, correlates the number information with the user information corresponding to the user, and it can be understood that the number template is a standard for selecting the number information by the user, including information such as the length and the number of the number information, the number information is specifically digital information, for example, the number template setting number information is composed of three number segments, the length of each number segment is three digits, the number information selected by the user can be digits "xxxxxx" of nine digits, the data processing device obtains the number information selected by the user, correlates the number information with the user information corresponding to the user, the user information is a user login name, and specifically can be a mobile phone number, or an identity card number, and it is required to be explained that the data processing device can detect whether the number information selected by the user meets the standard of the number template, for example, if the number information selected by the user is eight digits, false prompting information is sent out to prompt the user to reselect the number information.
S102, transmitting the number information and the user information associated with the number information to a block chain node so that the block chain node generates a number block based on the number information and the user information, and adding the number block into a block chain; a number block includes a number information and a user information associated with the number information;
Specifically, the data processing device sends the number information and the user information associated with the number information to the blockchain node, so that the blockchain node generates a number block based on the number information and the user information, the number block is added to the blockchain, it can be understood that one number information is associated with one user information, that is, the user information and the number information are in one-to-one correspondence, the data processing device sends the number information and the user information corresponding to the number information to the blockchain node, the blockchain node processes data in the blockchain, a server for maintaining normal operation of the blockchain can include a plurality of nodes, information among the nodes can be shared, it is required to be explained that the data processing device sends the user information corresponding to each number information and the number information to the blockchain node, after the blockchain node receives the user information and the number information, the number block is generated based on the user information and the number information, and the number block is added to the blockchain, one number block includes one number information associated with one user information, the number block includes a block header and a block body, the block header includes a hash number of the blockchain, a hash number of the hash of the block information and a hash of the block information is used for storing the user number information.
S103, generating at least one random number by adopting a random function according to the number template, generating at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determining a matching number according to the at least one hash value;
specifically, the data processing device generates at least one random number according to the number template by adopting a random function, generates at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determines a matching number according to the at least one hash value.
S104, according to the matching number, determining the matching degree of the number information in the number block, and according to the matching degree, determining the grade information of the user information corresponding to the number information.
Specifically, the data processing device determines the matching degree of the number information in the number block according to the matching number, determines the grade information of the user information corresponding to the number information according to the matching degree, and it can be understood that the number information and the matching number have a plurality of number segments, the matching degree corresponds to the number of the matching number and the number of the same number segment of the number information, the more the number of the same number segments is, the higher the matching degree is, the data processing device obtains the plurality of number information and the user information corresponding to the plurality of number information from the number block, calculates the matching degree corresponding to each number information according to the matching number, determines the grade information of the user information corresponding to the number information according to the matching degree, and specifically, if the number information has three number segments, the matching degree of the number information of which the three number segments are the same is 3, the grade information of the user information corresponding to the number information is the first grade, the matching degree of the number information of which the two number segments are the same is 2, the grade information of the user information corresponding to the number information is the second grade, the grade information of the number segment is the same number information of the number information is the same number information is the grade 1, and the grade information of the user information corresponding to the number information of the number information is the grade of the user information is the grade of the number information is the number information.
In the embodiment of the application, the number information is associated with the user information corresponding to the user by acquiring the number information selected by the user according to the number template; the method comprises the steps of sending number information and user information associated with the number information to a blockchain node, enabling the blockchain node to generate a number block based on the number information and the user information, adding the number block into a blockchain, generating at least one random number by adopting a random function according to a number template, generating at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determining a matching number according to the at least one hash value; and determining the matching degree of the number information in the number block according to the matching number, and determining the grade information of the user information corresponding to the number information according to the matching degree. And determining the matching number through the hash value which cannot be tampered and predicted, further determining the grade information of the user information corresponding to the number information, and ensuring the data reliability of data processing and distribution.
Referring to fig. 3, a flow chart of a data processing method is provided in an embodiment of the present application. As shown in fig. 3, the method according to the embodiment of the present application may include the following steps S201 to S207.
S201, obtaining number information selected by a user according to a number template; matching the number information with the number template to generate a matching result; if the matching result is that the matching is passed, the number information and the user information corresponding to the user are associated, and if the matching result is that the matching is not passed, prompt information is sent to the user.
Specifically, the data processing equipment acquires number information selected by a user according to a number template; matching the number information with the number template to generate a matching result; if the matching result is that the matching is passed, the number information and the user information corresponding to the user are associated, if the matching result is that the matching is not passed, prompt information is sent to the user, and it can be understood that the number template is a standard of selecting the number information for the user, including information such as length, number and the like of the number information, the number information is specifically digital information, the user information is a user login name, specifically may be a mobile phone number or an identity card number, the data processing device obtains the number information selected by the user according to the number template, matches the number information with the number template to generate a matching result, if the number information is the same as the standard of the number template, associates the number information with the user information corresponding to the user, if the number information selected by the user does not meet the standard of the number template, for example, the number template is set to be nine digits, if the number information selected by the user is nine digits, the number information is associated with the user information, if the number information selected by the user is eight digits, false prompt information is input, the prompt information may include voice prompt information and text prompt information, and prompt information to prompt the user to reselect the number information.
S202, encrypting the number information and the user information associated with the number information by using a target private key to generate a ciphertext;
Specifically, the data processing device encrypts the number information and the user information associated with the number information by using a target private key to generate a ciphertext, and it is understood that the target private key is a key that is not disclosed in the asymmetric key cryptosystem and is generated by an asymmetric encryption algorithm, where the encryption algorithm includes: and the data processing equipment adopts a target private key to encrypt the user information related to the number information and the number information, wherein the encryption process is to adopt a preset encryption method to generate the number shaking ciphertext information from the user information and the number shaking information, and the ciphertext information can be decrypted through a target public key corresponding to the target private key to generate the number information and the user information corresponding to the number information.
S203, the ciphertext is sent to a blockchain node in the blockchain, so that the blockchain node generates a number block based on the ciphertext.
Specifically, the data processing device sends the ciphertext to a blockchain node in the blockchain to enable the blockchain link point to generate a number block based on the ciphertext, and it can be understood that the data processing device sends the ciphertext to the blockchain node in the blockchain, the blockchain link point generates the number block according to the ciphertext, the time information and the hash value of the last block, and the number block is added into the blockchain as a new block.
S204, obtaining the template number of the sub-templates in the number template; generating at least one random number with the same number as the templates by adopting a random function; generating at least one hash value by respectively combining each random number in at least one random number with the number of users, the maximum block height information of the number block and the minimum block height information of the number block;
Specifically, the data processing equipment acquires the template number of the sub-templates in the number template; generating at least one random number with the same number as the templates by adopting a random function; each random number in at least one random number is respectively determined with the number of users, the maximum block height information of the number block and the minimum block height information of the number block, at least one hash value is generated, it can be understood that the number of templates is the number of number segments of the number information, the random numbers are randomly generated by a random function, the random numbers have unpredictability, a plurality of random numbers which are mutually independent can be randomly generated, the random numbers are mutually uncorrelated, the number of users is the number of users participating in selecting the number information, the height information of the number block is the position information of the block in a block chain, the number block is the maximum value of the block height information in the at least one number block, the minimum block height information is the minimum value of the block height information in the at least one number block, the data processing equipment generates at least one random number by adopting a random function, the random number is generated according to the at least one random number, the number of users, the maximum block height information and the minimum block height information, for example, the random number is determined according to the number of one random number and the number segment, the hash value is nine, the number is generated according to the hash value of the number segment height information, and the number is the number of the same, and the number is the number value is nine.
S205, determining the matching number according to at least one hash value.
Specifically, the data processing device generates at least one hash value into decimal numbers corresponding to the hash values respectively through numerical conversion, and determines at least one target numerical value according to the decimal numbers; determining hit number fragments corresponding to each target value according to the sub-templates; according to the time sequence of at least one random number generation, at least one hit number segment is generated into a matching number, it can be understood that at least one hash value is generated into at least one decimal number corresponding to the hash value respectively through numerical conversion, the at least one hash value is the same as the number of number segments of the number information, the number of decimal numbers is the same as the number of hash values, at least one target value is determined according to the decimal number, the target value is generated through the decimal number, specifically, the last five of the decimal number can be selected as the target value, the hit number segment corresponding to each target value is determined according to a sub-template, the sub-template is a template corresponding to the number segment, for example, the number information is provided with three number segments, the number segments corresponding to the number information are different, and at least one hit number segment is combined according to the time sequence of at least one random number generation to generate the matching number.
S206, obtaining a number block corresponding to the stored number information and the user information from the block chain, and obtaining the number information from the number block;
Specifically, the data processing device acquires a target public key corresponding to a target private key, and acquires a number block corresponding to stored number information and user information from a block chain according to address information corresponding to the target public key; the method comprises the steps of obtaining ciphertext from a number block, decrypting the ciphertext by using a target public key to generate number information and user information related to the number information, wherein the target public key is a secret key corresponding to a target private key, the target public key is a secret key disclosed in an asymmetric key cryptosystem and is generated by an asymmetric encryption algorithm, and the encryption algorithm comprises: RSA encryption algorithm, elliptic curve encryption algorithm, etc., the data processing equipment obtains the target public key corresponding to the target private key, the target public key can generate the address information corresponding to the target public key, according to the address information corresponding to the target public key, the number block corresponding to the stored number information and the user information is obtained from the block chain, the ciphertext is obtained from the number block, the ciphertext is generated by adopting the target public key encryption, the ciphertext is decrypted by adopting the target public key, and the number information and the user information corresponding to the number information can be generated.
S207, obtaining hit number fragments in the matched number and number information fragments in the number information, and counting the same fragment numbers of the hit number fragments and the number information fragments; and determining the matching degree of the number information according to the same fragment number, and determining the grade information of the user information corresponding to the number information according to the matching degree.
Specifically, the data processing equipment acquires hit number fragments in the matched number and number information fragments in the number information, and counts the same fragment numbers of the hit number fragments and the number information fragments; the matching degree of the number information is determined according to the number of the same fragments, the grade information of the user information corresponding to the number information is determined according to the matching degree, it can be understood that the number information and the matching number are provided with a plurality of number sections, the matching degree is higher, the number of the number sections is higher, the data processing equipment acquires the number information and the user information corresponding to the number information from the number block, acquires hit number fragments and number information fragments in the matching number, counts the number information fragments of hit number fragments and number information fragments, determines the matching degree of the number information according to the number of the same fragments, determines the grade information of the user information corresponding to the number information according to the matching degree, if the number information is provided with three number sections, the matching degree of the number information corresponding to the number information is 3, the grade information of the user information corresponding to the number information is a first grade, the matching degree of the number information corresponding to the number information is 2, the grade information corresponding to the number information is a second grade, the grade information of the number information corresponding to the number information is 1, and the grade information corresponding to the number information is a third grade information of the number information. Referring to fig. 4, a schematic view of a scenario of data processing is provided in an embodiment of the present application. As shown in fig. 4, the data processing apparatus obtains number information selected by a user, associates the number information with user information corresponding to the user, for example, user information 1 associates number information 1, user information 2 associates number information 2,.
In the embodiment of the application, the number information is associated with the user information corresponding to the user by acquiring the number information selected by the user according to the number template; the method comprises the steps of sending number information and user information associated with the number information to a blockchain node, enabling the blockchain node to generate a number block based on the number information and the user information, adding the number block into a blockchain, generating at least one random number by adopting a random function according to a number template, generating at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determining a matching number according to the at least one hash value; and determining the matching degree of the number information in the number block according to the matching number, and determining the grade information of the user information corresponding to the number information according to the matching degree. And determining the matching number through the hash value which cannot be tampered and predicted, further determining the grade information of the user information corresponding to the number information, and ensuring the data reliability of data processing and distribution.
Referring to fig. 5, a schematic structural diagram of a data processing apparatus is provided in an embodiment of the present application. As shown in fig. 5, the data processing apparatus 1 of the embodiment of the present application may include: number acquisition unit 11, information transmission unit 12, information matching unit 13, information determination unit 14.
A number acquisition unit 11, configured to acquire number information selected by a user according to a number template, and associate the number information with user information corresponding to the user;
Specifically, the number obtaining unit 11 obtains the number information selected by the user according to the number template, and correlates the number information with the user information corresponding to the user, where it is understood that the number template is a criterion of selecting the number information by the user, including information such as a length and a number of the number information, and the number information is specifically digital information, for example, the number template sets the number information to be composed of three number segments, and each number segment has a length of three digits, then the number information selected by the user may be a digit "xxxxxx" of nine digits, the data processing device obtains the number information selected by the user, correlates the number information with the user information corresponding to the user, and the user information is a user login name, specifically may be a mobile phone number, or an identification card number.
An information transmitting unit 12 for transmitting the number information and the user information associated with the number information to the blockchain node so that the blockchain node generates a number block based on the number information and the user information, and adds the number block to the blockchain; a number block includes a number information and a user information associated with the number information;
Specifically, the information sending unit 12 sends the number information and the user information associated with the number information to the blockchain node, so that the blockchain node generates a number block based on the number information and the user information, and adds the number block to the blockchain.
An information matching unit 13, configured to generate at least one random number according to the number template by using a random function, generate at least one hash value according to the at least one random number, the number of users, and block height information of the number block, and determine a matching number according to the at least one hash value;
As shown in fig. 5, the information matching unit 13 of the embodiment of the present application may include: a hash generation subunit 131, an information matching subunit 132.
A hash generation subunit 131, configured to obtain the template number of the sub-templates in the number template; generating at least one random number with the same number as the templates by adopting a random function; generating at least one hash value by respectively combining each random number in at least one random number with the number of users, the maximum block height information of the number block and the minimum block height information of the number block;
an information matching subunit 132, configured to determine a matching number according to at least one hash value.
Specifically, the information matching unit 13 generates at least one random number according to the number template by using a random function, generates at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determines a matching number according to the at least one hash value.
The information determining unit 14 is configured to determine a matching degree of the number information in the number block according to the matching number, and determine the level information of the user information corresponding to the number information according to the matching degree.
As shown in fig. 5, the information determining unit 14 of the embodiment of the present application may include: an information acquisition subunit 141, an information determination subunit 142.
An information obtaining subunit 141, configured to obtain a number block corresponding to the stored number information and the user information from the blockchain, and obtain the number information from the number block;
An information determining subunit 142, configured to obtain hit number fragments in the matching number and number information fragments in the number information, and count the same number of fragments of the hit number fragments and the number information fragments; and determining the matching degree of the number information according to the same fragment number, and determining the grade information of the user information corresponding to the number information according to the matching degree.
Specifically, the information determining unit 14 determines the matching degree of the number information in the number block according to the matching number, determines the rank information of the user information corresponding to the number information according to the matching degree, and it can be understood that the number information and the matching number have a plurality of number segments, the matching degree corresponds to the number of the matching number and the number of the same number segment of the number information, the number of the same number segments is greater, the matching degree is higher, the data processing apparatus obtains the plurality of number information and the user information corresponding to the plurality of number information from the number block, calculates the matching degree corresponding to each number information according to the matching number, determines the rank information of the user information corresponding to the number information according to the matching degree, and specifically, if the number information has three number segments, the matching degree of the number information of which the three number segments are identical is 3, the rank information of the user information corresponding to the number information is a first rank, the matching degree of the number information of which the two number segments are identical is 2, the rank information of the user information corresponding to the number information is a second rank, and the rank information of the number information of the user information corresponding to the number segment is the same number information is 1.
In the embodiment of the application, the number information is associated with the user information corresponding to the user by acquiring the number information selected by the user according to the number template; the method comprises the steps of sending number information and user information associated with the number information to a blockchain node, enabling the blockchain node to generate a number block based on the number information and the user information, adding the number block into a blockchain, generating at least one random number by adopting a random function according to a number template, generating at least one hash value according to the at least one random number, the number of users and the block height information of the number block, and determining a matching number according to the at least one hash value; and determining the matching degree of the number information in the number block according to the matching number, and determining the grade information of the user information corresponding to the number information according to the matching degree. And determining the matching number through the hash value which cannot be tampered and predicted, further determining the grade information of the user information corresponding to the number information, and ensuring the data reliability of data processing and distribution.
Referring to fig. 6, a schematic structural diagram of a computer device is provided in an embodiment of the present application. As shown in fig. 6, the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 6, an operating system, network communication modules, user interface modules, and data processing applications may be included in memory 1005, which is a type of computer storage medium.
In the computer device 1000 shown in fig. 6, the network interface 1004 may provide a network communication function, and the user interface 1003 is mainly used as an interface for providing input to a user; the processor 1001 may be configured to invoke the data processing application stored in the memory 1005 to implement the description of the data processing method in any of the embodiments corresponding to fig. 2 to 4, which is not described herein.
It should be understood that the computer device 1000 described in the embodiments of the present application may perform the description of the data processing method in the embodiment corresponding to any of fig. 2 to 4, and may also perform the description of the data processing device in the embodiment corresponding to fig. 5, which is not described herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer readable storage medium, in which a computer program executed by the data processing apparatus mentioned above is stored, and the computer program includes program instructions, when executed by a processor, can execute the description of the data processing method in any of the embodiments corresponding to fig. 2 to 4, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in the embodiments may be accomplished by computer programs to instruct related hardware, and the programs may be stored in a computer readable storage medium, which when executed may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.

Claims (9)

1. A method of data processing, comprising:
Acquiring number information selected by a user according to a number template, and associating the number information with user information corresponding to the user;
Transmitting the number information and user information associated with the number information to a blockchain node, so that the blockchain node generates a number block based on the number information and the user information, and adding the number block into a blockchain; one of the number blocks includes one number information and one user information associated with the one number information;
Acquiring the template number of the sub-templates in the number template; generating at least one random number with the same quantity as the templates by adopting a random function; generating at least one hash value by respectively combining each random number in the at least one random number with the number of users, the maximum block height information of the number block and the minimum block height information of the number block; determining a matching number according to the at least one hash value; the at least one random number is randomly generated by the random function, has unpredictability, is mutually irrelevant, and is the number of users participating in selecting number information, and the block height information of the number block is determined by the position information of the number block in the block chain; the maximum block height information is the maximum value of the block height information in at least one number block, and the minimum block height information is the minimum value of the block height information in the at least one number block;
Determining the matching degree of the number information in the number block according to the matching number, and determining the grade information of the user information corresponding to the number information according to the matching degree; the rank information of the user information is used for data rewards.
2. The method of claim 1, wherein the obtaining the number information selected by the user according to the number template, and associating the number information with the user information corresponding to the user, comprises:
Obtaining number information selected by a user according to a number template; matching the number information with a number template to generate a matching result;
And if the matching result is that the matching is passed, correlating the number information with the user information corresponding to the user, and if the matching result is that the matching is not passed, sending prompt information to the user.
3. The method of claim 1, wherein the sending the number information and the user information associated with the number information to a blockchain node comprises:
Encrypting the number information and the user information associated with the number information by using a target private key to generate a ciphertext;
And sending the ciphertext to a blockchain node in a blockchain so that the blockchain node generates the number block based on the ciphertext.
4. The method of claim 1, wherein said determining a matching number from said at least one hash value comprises:
Generating decimal numbers corresponding to the at least one hash value respectively by the at least one hash value through numerical conversion, and determining at least one target numerical value according to the decimal numbers;
determining hit number fragments corresponding to each target numerical value according to the sub-templates;
And generating the matching number from the at least one hit number segment according to the time sequence of the generation of the at least one random number.
5. The method of claim 1, wherein the determining the matching degree of the number information in the number block according to the matching number, and determining the class information of the user information corresponding to the number information according to the matching degree, comprises:
obtaining a number block corresponding to the number information and the user information from the block chain, and obtaining the number information from the number block;
acquiring hit number fragments in the matched number and number information fragments in the number information, and counting the same fragment numbers of the hit number fragments and the number information fragments;
and determining the matching degree of the number information according to the same fragment number, and determining the grade information of the user information corresponding to the number information according to the matching degree.
6. The method of claim 5, wherein the obtaining a number block from the blockchain that stores the number information and the user information, and the obtaining the number information from the number block, comprises:
Acquiring a target public key corresponding to a target private key, and acquiring and storing a number block corresponding to the number information and the user information from the block chain according to address information corresponding to the target public key;
And obtaining a ciphertext from the number block, decrypting the ciphertext by adopting the target public key, and generating the number information and the user information related to the number information.
7. A data processing apparatus, comprising:
the number acquisition unit is used for acquiring number information selected by a user according to a number template and associating the number information with user information corresponding to the user;
An information sending unit, configured to send the number information and user information associated with the number information to a blockchain node, so that the blockchain node generates a number block based on the number information and the user information, and adds the number block to a blockchain; one of the number blocks includes one number information and one user information associated with the one number information;
The information matching unit includes: a hash generation subunit and an information matching subunit;
The hash generation subunit is used for acquiring the template number of the sub-templates in the number template; generating at least one random number with the same quantity as the templates by adopting a random function; generating at least one hash value by respectively combining each random number in the at least one random number with the number of users, the maximum block height information of the number block and the minimum block height information of the number block;
The information matching subunit is used for determining a matching number according to the at least one hash value; the at least one random number is randomly generated by the random function, has unpredictability, is mutually irrelevant, and is the number of users participating in selecting number information, and the block height information of the number block is determined by the position information of the number block in the block chain; the maximum block height information is the maximum value of the block height information in at least one number block, and the minimum block height information is the minimum value of the block height information in the at least one number block;
the information determining unit is used for determining the matching degree of the number information in the number block according to the matching number and determining the grade information of the user information corresponding to the number information according to the matching degree; the rank information of the user information is used for data rewards.
8. A computer readable storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method according to any of claims 1-6.
9. A computer device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1-6.
CN201911207374.XA 2019-11-29 2019-11-29 Data processing method and device Active CN110968442B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911207374.XA CN110968442B (en) 2019-11-29 2019-11-29 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911207374.XA CN110968442B (en) 2019-11-29 2019-11-29 Data processing method and device

Publications (2)

Publication Number Publication Date
CN110968442A CN110968442A (en) 2020-04-07
CN110968442B true CN110968442B (en) 2024-06-25

Family

ID=70032420

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911207374.XA Active CN110968442B (en) 2019-11-29 2019-11-29 Data processing method and device

Country Status (1)

Country Link
CN (1) CN110968442B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110070659A (en) * 2019-05-28 2019-07-30 中国大唐集团科学技术研究院有限公司华中电力试验研究院 A kind of Thermal Power Enterprises electricity coal based on block chain enters factory inspection receiving method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107862782B (en) * 2017-10-27 2020-11-13 贝壳找房(北京)科技有限公司 Lottery drawing method and device based on Ether house block chain
CN108924107B (en) * 2018-06-21 2020-08-21 桂林电子科技大学 Verifiable method for block chain remote medical data calling
CN109389399A (en) * 2018-10-18 2019-02-26 深圳前海乐寻坊区块链科技有限公司 Lottery industry method, apparatus, computer equipment and storage medium based on block chain
CN109615758B (en) * 2018-10-22 2022-10-04 中国平安人寿保险股份有限公司 Lottery drawing data processing method and device, storage medium and server
CN110493007B (en) * 2019-09-06 2021-07-13 腾讯科技(深圳)有限公司 Block chain based information verification method, device, equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110070659A (en) * 2019-05-28 2019-07-30 中国大唐集团科学技术研究院有限公司华中电力试验研究院 A kind of Thermal Power Enterprises electricity coal based on block chain enters factory inspection receiving method

Also Published As

Publication number Publication date
CN110968442A (en) 2020-04-07

Similar Documents

Publication Publication Date Title
CN111737724B (en) Data processing method and device, intelligent equipment and storage medium
CN111444211B (en) Block chain consensus node checking method, device, equipment and storage medium
KR101977109B1 (en) Large simultaneous digital signature service system based on hash function and method thereof
CN111080295A (en) Block chain-based electronic contract processing method and equipment
CN110601815B (en) Block chain data processing method and equipment
CN110035058B (en) Resource request method, device and storage medium
CN110263579B (en) Data processing method, system and related equipment
CN112085504B (en) Data processing method and device, computer equipment and storage medium
EP3544226B1 (en) Unified secure device provisioning
CN109962777A (en) The key in block catenary system is permitted to generate, obtain the method and apparatus of key
CN110502889B (en) Login method, login device, computer readable storage medium and computer equipment
CN111311211A (en) Data processing method and device based on block chain
CN111367923A (en) Data processing method, data processing device, node equipment and storage medium
CN110866265A (en) Data storage method, device and storage medium based on block chain
CN110928880A (en) Data processing method, device, terminal and medium based on block chain
CN113114665A (en) Data transmission method and device, storage medium and electronic device
CN111523142B (en) Data processing method, device, electronic equipment and medium
CN110647583B (en) Block chain construction method, device, terminal and medium
CN113254972A (en) Information security management method based on block chain
CN111259428A (en) Data processing method and device based on block chain, node equipment and storage medium
CN110570197B (en) Data processing method and device based on block chain
CN110602133B (en) Intelligent contract processing method, block chain management device and storage medium
CN110968442B (en) Data processing method and device
CN107172016B (en) Safety trust processing method and device
CN117914558A (en) Internet of things equipment trusted control method and system, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant