CN108335208B - Method and apparatus for processing information - Google Patents

Method and apparatus for processing information Download PDF

Info

Publication number
CN108335208B
CN108335208B CN201810167676.8A CN201810167676A CN108335208B CN 108335208 B CN108335208 B CN 108335208B CN 201810167676 A CN201810167676 A CN 201810167676A CN 108335208 B CN108335208 B CN 108335208B
Authority
CN
China
Prior art keywords
target
block
hash value
user
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
CN201810167676.8A
Other languages
Chinese (zh)
Other versions
CN108335208A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810167676.8A priority Critical patent/CN108335208B/en
Publication of CN108335208A publication Critical patent/CN108335208A/en
Application granted granted Critical
Publication of CN108335208B publication Critical patent/CN108335208B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the application discloses a method and a device for processing information. One embodiment of the method comprises: receiving and recording target transaction information by using a block chain; in response to determining that a preset end condition is met, determining a final hash value based on a block hash value of a newly generated block in the block chain and a target hash value of the block; and matching the final hash value with the block chain account address of the user related to the target transaction information of each block record, and determining the target user based on the matching result. This embodiment improves fairness in determining a target user.

Description

Method and apparatus for processing information
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for processing information.
Background
With the development of internet technology, a large number of internet enterprises come into play. In order to attract more users, some reward measures are generally required, and one or more users are selected as target users fairly from a large number of users so as to send the reward to the target users. In this process, how to fairly determine the target user from a plurality of users is particularly important.
The existing method usually adopts a univariate treasure algorithm to determine the target user. The specific implementation process is as follows: firstly, acquiring the time of a plurality of participants (for example, 50 participants) participating in the activity at the last time, and summing the acquired times to obtain a first numerical value; then, an unknown value (for example, a result of a lottery of a standing prize to be won) obtained from a third party is used as a second value; and then, determining the target user based on the parameters such as the first numerical value, the second numerical value, the activity participation number and the like.
Disclosure of Invention
The embodiment of the application provides a method and a device for processing information.
In a first aspect, an embodiment of the present application provides a method for processing information, where the method includes: receiving and recording target transaction information by using a block chain; in response to determining that a preset end condition is met, determining a final hash value based on a block hash value of a newly generated block in a block chain and a target hash value of the block, wherein the target hash value of each block is determined based on the target transaction information recorded by the block, the block hash value of a last block of the block and the target hash value of the last block; and matching the final hash value with the block chain account address of the user related to the target transaction information of each block record, and determining the target user based on the matching result.
In some embodiments, the targeted transaction information includes: identification of the target activity, any string of characters entered by the user.
In some embodiments, the ending condition is that the number of people participating in the target activity reaches a preset value or the height of a block reaches a preset value, wherein the height of the block is the sum of the height of the initial block and the required number of blocks, and the required number of blocks is obtained by the following steps: determining the ratio of the total time length of the target activity to the minimum time length generated by the block; and rounding the carry of the ratio.
In some embodiments, the matching the final hash value with the blockchain account address of the user to which the target transaction information of each blockrecord relates, and determining the target user based on the matching result includes: respectively extracting target bytes of the final hash value and target bytes of a user's blockchain account address related to the target transaction information recorded by each block, and converting each extracted target byte into data of a target data type; and matching the target byte converted data extracted from the final hash value with the target byte converted data extracted from each blockchain account address, and determining a target user based on the matching result.
In some embodiments, the determining the target user based on the matching result includes: and taking the data obtained by converting the target bytes extracted from the final hash value as target data, and taking the user corresponding to the data closest to the target data in the data obtained by converting the target bytes extracted from each block chain account address as a target user.
In some embodiments, after the determining the target user based on the matching result, the method further comprises: and pushing prompt information to the target user, wherein the prompt information is used for prompting the user to be determined as the target user.
In some embodiments, the hint information includes winning result information; and after the target user is determined based on the matching result, the method further comprises: and generating a winning result page, wherein the winning result page comprises the winning result information.
In a second aspect, an embodiment of the present application provides an apparatus for processing information, the apparatus including: the receiving unit is configured to receive and record target transaction information by using the block chain; an execution unit configured to determine a final hash value based on a chunk hash value of a newly generated chunk in a chunk chain and a target hash value of the chunk in response to determining that a preset end condition is satisfied, wherein the target hash value of each chunk is determined based on target transaction information recorded for the chunk, the chunk hash value of a previous chunk of the chunk, and the target hash value of the previous chunk; and the determining unit is configured to match the final hash value with the blockchain account address of the user related to the target transaction information of each blockrecord, and determine the target user based on the matching result.
In some embodiments, the targeted transaction information includes: identification of the target activity, any string of characters entered by the user.
In some embodiments, the ending condition is that the number of people participating in the target activity reaches a preset value or the height of a block reaches a preset value, wherein the height of the block is the sum of the height of the initial block and the required number of blocks, and the required number of blocks is obtained by the following steps: determining the ratio of the total duration of the target activity to the minimum duration of block generation; rounding the ratio carry.
In some embodiments, the determining unit comprises: the extraction module is configured to respectively extract a target byte of the final hash value and a target byte of a block chain account address of the user related to the target transaction information recorded in each block, and convert each extracted target byte into data of a target data type; and the matching module is configured to match the target byte converted data extracted from the final hash value with the target byte converted data extracted from each blockchain account address, and determine a target user based on a matching result.
In some embodiments, the matching module is further configured to: and taking the data obtained by converting the target bytes extracted from the final hash value as target data, and taking the user corresponding to the data closest to the target data in the data obtained by converting the target bytes extracted from each block chain account address as a target user.
In some embodiments, the apparatus further comprises: and the pushing unit is configured to push prompt information to the target user, wherein the prompt information is used for prompting the user to be determined as the target user.
In some embodiments, the hint information includes winning result information; and the apparatus further comprises: a generating unit configured to generate a winning result page, wherein the winning result page includes the winning result information.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device to store one or more programs that, when executed by the one or more processors, cause the one or more processors to implement a method as in any embodiment of a method for processing information.
In a fourth aspect, embodiments of the present application provide a computer-readable medium on which a computer program is stored, which when executed by a processor, implements a method as in any one of the embodiments of the method for processing information.
According to the method and the device for processing information, the target transaction information is received and recorded by using the block chain, then, in response to the fact that the preset end condition is met, the final hash value is determined based on the block hash value of the block which is generated newly in the block chain and the target hash value of the block, the final hash value is matched with the block chain account address of the user related to the target transaction information recorded by each block, and the target user is determined based on the matching result. Therefore, the target user can be determined by utilizing cryptography and the blockchain technology, and the block chain has the characteristics of decentralization and non-falsification and does not need to depend on a numerical value provided by a third party, so that the fairness of determining the target user is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram for one embodiment of a method for processing information according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a method for processing information according to the present application;
FIG. 4 is a schematic block diagram illustrating one embodiment of an apparatus for processing information according to the present application;
FIG. 5 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present application, the embodiments and features of the embodiments may be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which the method for processing information or the apparatus for processing information of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a data processing server that processes data (e.g., any character string input by a user in a text box in a page) transmitted by the terminal apparatuses 101, 102, 103. The data processing server may perform processing such as storing, determining a hash value, and the like on the received data, and determine a target user based on the processing result.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (for example, to provide distributed services), or as a single software or software module. And is not particularly limited herein.
It should be noted that the method for processing information provided in the embodiment of the present application is generally executed by the server 105, and accordingly, the apparatus for processing information is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for processing information in accordance with the present application is shown. The method for processing information comprises the following steps:
and step 201, receiving and recording target transaction information by using the block chain.
In this embodiment, a method execution agent (e.g., a server as shown in fig. 1) for processing information may be run with a blockchain. The block chain is a chain data structure formed by combining blocks in a sequential connection mode according to a time sequence, and is a distributed account book which is guaranteed in a cryptology mode and cannot be tampered and forged. One or more transaction messages may be recorded in each of the blocks constituting the block chain. In practice, each tile in the chain of tiles may record transaction information for a plurality of activities (e.g., treasure snatching activities, lottery activities, etc.), each of which may correspond to an identifier for distinguishing between different activities.
Generally, a block is composed of a block header and a block body. The block header of the block may record the hash value of the last block. Here, the hash value of the tile may be referred to as a tile hash value. Each chunk in the chain of chunks may contain the chunk hash value of the last chunk. In practice, the Hash value may also be referred to as a Hash value (Hash values, hash codes, hash sums, or hashes), and the Hash value is a value generated by a Hash Function (Hash Function, may also be referred to as a Hash algorithm, hash Function, or the like). The hash function may compress information or data into a digest so that the amount of data becomes small, fixing the format of the data. The hash function may mix data to create a new data, and the created data is a hash value. The hash value is typically represented by a short string of random letters and numbers. The tile body may typically be used to record transaction information over a period of time. It should be noted that the above-mentioned block chain structure and the information recorded in the blocks are well-known technologies that are widely researched and applied at present, and are not described herein again.
In this embodiment, the execution body may receive and record the target transaction information by using the blockchain. The target transaction information may be transaction information generated by a user participating in a target activity (e.g., a certain activity pre-specified by a technician). In practice, after a target activity begins, users may participate in the target activity and may send information to the blockchain, and each user may be predefined to participate only once. After the execution body confirms that the target activity starts or receives an instruction for starting the target activity, the target transaction information can be received and recorded by using the block chain.
In some optional implementations of this embodiment, the target transaction information may include: identification of the target activity, any string of characters entered by the user. In practice, the user may browse a page of the target activity, which may contain information for prompting the user to make any character string input, such as "please input any content in the lower text box", using a client (e.g., terminal devices 101, 102, 103 shown in fig. 1). The user can input any content at the corresponding position, and after submitting the request for participating in the target activity, target transaction information containing the content input by the user and the identification of the target activity is generated and recorded in the block. Since the target transaction information includes any character string input by the user, for the execution main body, the content input by the user is random, and the target hash value and the final hash value of each block are determined by using the random content, so that each user can fairly influence the calculation result of the final hash value, and the fairness of determining the target user is improved.
In response to determining that the preset end condition is satisfied, a final hash value is determined based on the block hash value of the block newly generated in the block chain and the target hash value of the block 202.
In this embodiment, the execution body may store a preset end condition in advance, and in response to determining that the end condition is satisfied, the execution body may determine a final hash value based on the chunk hash value of the newly generated chunk in the chunk chain and the target hash value of the chunk. The preset ending condition may be various conditions, for example, the proportion of the total number of the users who participate in the game reaches a preset value, the time reaches a preset time, and the like. Here, if it is determined that the predetermined end condition is satisfied, the chunk hash value of the newly generated chunk in the chunk chain and the target hash value of the chunk may be used as inputs of the hash function, and data output by the hash function may be used as a final hash value.
It should be noted that, after the target activity starts, the target hash value of each chunk generated in the blockchain is determined based on the target transaction information recorded by the chunk, the chunk hash value of the previous chunk of the chunk, and the target hash value of the previous chunk. Specifically, the execution body may use a newly generated chunk running in the blockchain at the start time of the target activity as an initial chunk, and use a preset value (e.g., 0) as a target hash value of a previous chunk of the initial chunk. For an initial block, the target transaction information recorded in the initial block, the block hash value of the previous block, and the target hash value of the previous block (i.e., the preset value) may be used as inputs of a hash function, and the data output by the hash function may be used as the target hash value of the initial block. Then, for each block generated in sequence, the target transaction information recorded by the block, the block hash value of the block immediately preceding the block in the block chain, and the target hash value of the immediately preceding block may be used as inputs of the hash function, and the data output by the hash function may be used as the target hash value of the block until the above-mentioned end condition is satisfied. When the above termination condition is satisfied, the hash value of the block newly generated in the block chain and the target hash value of the block may be used as the input of the hash function, and the data output by the hash function may be used as the final hash value.
In some optional implementations of the embodiment, the ending condition may be that the number of people participating in the target activity reaches a preset value or the block height reaches a preset value. The block height may be the sum of the initial block height and the required number of blocks, and the required number of blocks may be obtained by: firstly, determining the ratio of the total duration of the target activities (which can be preset) to the minimum duration of block generation (which can be statistically determined in advance); and then, rounding the ratio carry. The number obtained after rounding is the number of the required blocks. Wherein the height of the initial block may be an order of the initial block in the block chain.
And step 203, matching the final hash value with the block chain account address of the user related to the target transaction information of each block record, and determining the target user based on the matching result.
In this embodiment, the execution agent may match the final hash value with a blockchain account address of a user related to the target transaction information of each blockchain record, and determine the target user based on a matching result. Each block can record one or more target transaction information, each user can participate in a target activity only once, and each target transaction information corresponds to one user. Each user has a blockchain account address. In practice, each user involved in the blockchain has a public key and a private key, and for each user, the public key of the user can be used to generate the blockchain account address of the user through a one-way hash algorithm. Here, the user's blockchain account address may be a string of various forms (e.g., may be a 42-bit string beginning with "0 x"). It should be noted that the generation method of the blockchain account address of the user is a well-known technology widely researched and applied in the field of blockchain technology, and is not described herein again.
In some optional implementations of this embodiment, the executing entity may directly match the final hash value with the blockchain account address of each user involved in the target transaction information of each blockrecord. And determining the user corresponding to the block chain account address which indicates the closest match result to the final hash value as a target user. The number of target users is not limited to one, and may be plural. At this time, a plurality of users may be sequentially selected as target users in the descending order of the proximity.
In some optional implementations of this embodiment, the executing entity may determine the target user according to the following objectives:
and step one, respectively extracting the target byte of the final hash value and the target byte of the block chain account address of the user related to the target transaction information of each block record, and converting each extracted target byte into data of a target data type. The target byte may be a byte at one or more positions (e.g., the last 8 bytes) preset by a technician. The target data type may be a data type (e.g., unsigned 64-bit integer data type uint 64) preset by a technician.
And secondly, matching the target byte converted data extracted from the final hash value with the target byte converted data extracted from each blockchain account address, and determining a target user based on the matching result. Here, the target byte-converted data extracted from the final hash value may be set as target data, and the user corresponding to the data closest to the target data among the target byte-converted data extracted from each block chain account address may be set as the target user. The number of target users is not limited to one, and may be plural. In this case, a plurality of users may be sequentially selected as target users in descending order of proximity to the target data.
In some optional implementation manners of this embodiment, after determining the target user based on the matching result, the executing body may further push prompt information to the target user, where the prompt information may be used to prompt the user to be determined as the target user.
In some optional implementations of the embodiment, the prompt information may include winning result information, and the winning result information may include a name of the target user, personal information, and the like. After determining the target user based on the matching result, the execution body may further generate a winning result page, wherein the winning result page may include the winning result information. After the winning result page is generated, the execution body can push the winning result page to the client used by each user participating in the target activity, so that each user can browse the winning result.
With continuing reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for processing information according to the present embodiment. In the application scenario of fig. 3, after the activity starts, the server may receive and record the target transaction information by using the blockchain, and for each chunk sequentially generated in the blockchain after the activity starts, the server may determine the target hash value of the chunk based on the target transaction information recorded by the chunk, the chunk hash value of the previous chunk, and the target hash value of the previous chunk. And then determining whether a preset ending condition is met, if not, continuing to determine the target hash value after the next block is generated until the ending condition is met. After determining that the end condition is met, determining a final hash value based on the block hash value of the current newly generated block and the target hash value of the block. And finally, matching the final hash value with the block chain account address of the user related to the target transaction information of each block record, and determining the target user based on the matching result.
In the method provided by the embodiment of the application, the target transaction information is received and recorded by using the block chain, then, in response to the fact that the preset ending condition is met, a final hash value is determined based on the block hash value of the block newly generated in the block chain and the target hash value of the block, finally, the final hash value is matched with the block chain account address of the user related to the target transaction information recorded by each block, and the target user is determined based on the matching result. The block chain has the characteristics of decentralization and non-falsification, and does not need to depend on numerical values provided by a third party, so that the fairness of determining a target user is improved, and meanwhile, the block chain is used for storing calculation results, and the fairness of the checking activities of an auditing department can be guaranteed.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for processing information, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable in various electronic devices.
As shown in fig. 4, the apparatus 400 for processing information according to the present embodiment includes: a receiving unit 401 configured to receive and record target transaction information by using a block chain; an executing unit 402, configured to determine, in response to determining that a preset end condition is met, a final hash value based on a block hash value of a newly generated block in the block chain and a target hash value of the block, where the target hash value of each block is determined based on the target transaction information recorded for the block, the block hash value of a previous block of the block, and the target hash value of the previous block; the determining unit 403 is configured to match the final hash value with the blockchain account address of the user related to the target transaction information of each block record, and determine the target user based on the matching result.
In some optional implementations of this embodiment, the target transaction information may include: identification of the target activity, any string of characters entered by the user.
In some optional implementations of this embodiment, the ending condition may be any one of: the number of people participating in the target activity reaches a preset numerical value; the block height reaches a preset value, wherein the block height is the sum of the height of the initial block and the required number of blocks, and the required number of blocks is obtained through the following steps: determining the ratio of the total duration of the target activities to the minimum duration generated by the blocks; and rounding the carry of the ratio.
In some optional implementations of the present embodiment, the determining unit 403 may include an extracting module and a matching module (not shown in the figure). The extracting module may be configured to extract a target byte of the final hash value and a target byte of a blockchain account address of the user related to the target transaction information of each block record, and convert each extracted target byte into data of a target data type. The matching module may be configured to match the target byte-converted data extracted from the final hash value with the target byte-converted data extracted from each blockchain account address, and determine a target user based on a matching result.
In some optional implementation manners of this embodiment, the matching module may be further configured to use, as the target data, the target byte-converted data extracted from the final hash value, and use, as the target user, a user corresponding to data closest to the target data in the target byte-converted data extracted from each blockchain account address.
In some optional implementations of this embodiment, the apparatus further includes a pushing unit (not shown in the figure). The pushing unit may be configured to push a prompt message to the target user, where the prompt message is used to prompt the user to be determined as the target user.
In some optional implementations of this embodiment, the prompt information may include winning result information; and the above apparatus may further comprise a generating unit (not shown in the figure). Wherein the generating unit may be configured to generate a winning result page, wherein the winning result page includes the winning result information.
In the apparatus provided by the above embodiment of the present application, the receiving unit 401 receives and records the target transaction information by using the blockchain, and then the executing unit 402, in response to determining that the preset termination condition is satisfied, determines a final hash value based on the block hash value of the newly generated block in the blockchain and the target hash value of the block, and finally the determining unit 403 matches the final hash value with the blockchain account address of the user related to the target transaction information recorded in each block, and determines the target user based on the matching result. Therefore, the target user can be determined by utilizing cryptography and the block chain technology, and the block chain has the characteristics of decentralization and non-falsification and does not need to depend on numerical values provided by a third party, so that the fairness of determining the target user is improved, and meanwhile, the block chain is utilized to store calculation results, and the fairness of checking activities of an audit department can be ensured.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the use range of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 501. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, an executing unit, and a determining unit. Where the names of these elements do not in some cases constitute a limitation of the element itself, for example, a determination element may also be described as a "unit to determine a target user".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: receiving and recording target transaction information by using a block chain; in response to determining that a preset termination condition is met, determining a final hash value based on a block hash value of a newly generated block in the block chain and a target hash value of the block; and matching the final hash value with the block chain account address of the user related to the target transaction information of each block record, and determining the target user based on the matching result.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (16)

1. A method for processing information, comprising:
receiving and recording target transaction information by using a block chain;
in response to determining that a preset end condition is met, determining a final hash value based on a block hash value of a newly generated block in the block chain and a target hash value of the block, wherein the target hash value of each block is determined based on target transaction information recorded by the block, a block hash value of a last block of the block, and a target hash value of the last block, and the target transaction information includes: any character string input by a user;
and matching the final hash value with the block chain account address of the user related to the target transaction information of each block record, and determining the target user based on the matching result.
2. The method for processing information of claim 1, wherein the target transaction information comprises: identification of a target activity.
3. The method for processing information according to claim 1, wherein the end condition is that the number of people participating in the target activity reaches a preset value or a block height reaches a preset value, wherein the block height is a sum of an initial block height and a required block number, and the required block number is obtained by: determining a ratio of a total duration of the target activity to a minimum duration of block generation; and rounding the ratio carry.
4. The method for processing information according to claim 1, wherein the matching the final hash value with the blockchain account address of the user to which the target transaction information of each blockrecord relates, and the determining the target user based on the matching result comprises:
respectively extracting target bytes of the final hash value and target bytes of a block chain account address of the user related to the target transaction information of each block record, and converting each extracted target byte into data of a target data type;
and matching the target byte converted data extracted from the final hash value with the target byte converted data extracted from each blockchain account address, and determining a target user based on the matching result.
5. The method for processing information of claim 4, wherein said determining a target user based on a matching result comprises:
and taking the data obtained after the target byte conversion extracted from the final hash value as target data, and taking a user corresponding to the data closest to the target data in the data obtained after the target byte conversion extracted from each block chain account address as a target user.
6. The method for processing information of claim 1, wherein after said determining a target user based on a matching result, said method further comprises:
and pushing prompt information to the target user, wherein the prompt information is used for prompting the user to be determined as the target user.
7. The method for processing information according to claim 6, wherein the hint information includes winning result information; and
after the determining the target user based on the matching result, the method further comprises:
and generating a winning result page, wherein the winning result page comprises the winning result information.
8. An apparatus for processing information, comprising:
the receiving unit is configured to receive and record target transaction information by using the block chain;
an execution unit, configured to determine, in response to determining that a preset end condition is satisfied, a final hash value based on a chunk hash value of a newly generated chunk in the chunk chain and a target hash value of the chunk, where the target hash value of each chunk is determined based on target transaction information recorded for the chunk, the chunk hash value of a previous chunk of the chunk, and the target hash value of the previous chunk, where the target transaction information includes: an arbitrary character string input by a user;
and the determining unit is configured to match the final hash value with the blockchain account address of the user related to the target transaction information of each blockrecord, and determine the target user based on the matching result.
9. The apparatus for processing information according to claim 8, wherein the target transaction information comprises: identification of a target activity.
10. The apparatus for processing information according to claim 8, wherein the end condition is that the number of persons participating in the target activity reaches a preset value or a block height reaches a preset value, wherein the block height is a sum of an initial block height and a required block number, and the required block number is obtained by: determining a ratio of a total duration of the target activity to a minimum duration of block generation; and rounding the ratio carry.
11. The apparatus for processing information according to claim 8, wherein said determining unit comprises:
the extraction module is configured to respectively extract the target byte of the final hash value and the target byte of the block chain account address of the user related to the target transaction information recorded in each block, and convert each extracted target byte into data of a target data type;
and the matching module is configured to match the target byte converted data extracted from the final hash value with the target byte converted data extracted from each blockchain account address, and determine a target user based on a matching result.
12. The apparatus for processing information according to claim 11, wherein said matching module is further configured to:
and taking the data obtained after the target byte conversion extracted from the final hash value as target data, and taking a user corresponding to the data closest to the target data in the data obtained after the target byte conversion extracted from each block chain account address as a target user.
13. The apparatus for processing information according to claim 8, wherein said apparatus further comprises:
and the pushing unit is configured to push prompt information to the target user, wherein the prompt information is used for prompting that the user is determined to be the target user.
14. An apparatus for processing information according to claim 13, wherein said cue information includes winning result information; and
the device further comprises:
a generating unit configured to generate a winning result page, wherein the winning result page includes the winning result information.
15. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
16. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN201810167676.8A 2018-02-28 2018-02-28 Method and apparatus for processing information Active CN108335208B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810167676.8A CN108335208B (en) 2018-02-28 2018-02-28 Method and apparatus for processing information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810167676.8A CN108335208B (en) 2018-02-28 2018-02-28 Method and apparatus for processing information

Publications (2)

Publication Number Publication Date
CN108335208A CN108335208A (en) 2018-07-27
CN108335208B true CN108335208B (en) 2022-11-08

Family

ID=62930170

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810167676.8A Active CN108335208B (en) 2018-02-28 2018-02-28 Method and apparatus for processing information

Country Status (1)

Country Link
CN (1) CN108335208B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110084651A (en) * 2019-05-07 2019-08-02 百度在线网络技术(北京)有限公司 A kind of lottery drawing method based on block chain, device and terminal
CN110633983A (en) * 2019-09-05 2019-12-31 腾讯科技(深圳)有限公司 Target event execution method and device based on block chain
CN110958317B (en) * 2019-11-29 2022-08-09 腾讯科技(深圳)有限公司 Data processing method and equipment
CN114999053A (en) * 2022-05-06 2022-09-02 北京数联众创科技有限公司 Block chain traceable, public and transparent competition lottery drawing method, device and application

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105913174A (en) * 2016-04-07 2016-08-31 彭军红 Lottery issuing method based on block chains
CN105976248A (en) * 2016-04-29 2016-09-28 邓迪 Crowd funding lotting method and system
CN106504174A (en) * 2016-09-27 2017-03-15 布比(北京)网络技术有限公司 Lottery industry publishing system and device based on block chain
CN107103097A (en) * 2017-05-22 2017-08-29 中链科技有限公司 Drawing method and terminal device based on block chain technology
CN107566124A (en) * 2017-08-24 2018-01-09 深圳市易成自动驾驶技术有限公司 Common recognition method for building up, block catenary system and storage medium based on lottery mechanism
CN107679149A (en) * 2017-09-26 2018-02-09 武汉斗鱼网络科技有限公司 A kind of data processing method and server
CN107742352A (en) * 2017-09-20 2018-02-27 黄玉宇 Decentralization lot/queuing strategy and system based on block chain and intelligent contract

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105913174A (en) * 2016-04-07 2016-08-31 彭军红 Lottery issuing method based on block chains
CN105976248A (en) * 2016-04-29 2016-09-28 邓迪 Crowd funding lotting method and system
CN106504174A (en) * 2016-09-27 2017-03-15 布比(北京)网络技术有限公司 Lottery industry publishing system and device based on block chain
CN107103097A (en) * 2017-05-22 2017-08-29 中链科技有限公司 Drawing method and terminal device based on block chain technology
CN107566124A (en) * 2017-08-24 2018-01-09 深圳市易成自动驾驶技术有限公司 Common recognition method for building up, block catenary system and storage medium based on lottery mechanism
CN107742352A (en) * 2017-09-20 2018-02-27 黄玉宇 Decentralization lot/queuing strategy and system based on block chain and intelligent contract
CN107679149A (en) * 2017-09-26 2018-02-09 武汉斗鱼网络科技有限公司 A kind of data processing method and server

Also Published As

Publication number Publication date
CN108335208A (en) 2018-07-27

Similar Documents

Publication Publication Date Title
CN108335208B (en) Method and apparatus for processing information
EP3451328B1 (en) Method and apparatus for verifying information
US10580413B2 (en) Method and apparatus for outputting information
CN108491267B (en) Method and apparatus for generating information
CN109978629B (en) Advertisement putting method and device, electronic equipment and storage medium
CN107592255B (en) Information display method and equipment
CN110580641B (en) Method and apparatus for redeeming items
CN108737486B (en) Information pushing method and device
CN104364779B (en) Service provider system, service computer and terminal
CN108038172B (en) Search method and device based on artificial intelligence
CN109348298B (en) Method and equipment for pushing and playing multimedia data stream
CN108564406B (en) Incentive pushing method and device
CN107330126B (en) Method and apparatus for outputting information
CN113194109A (en) Method and device for pushing information
CN108810105A (en) For pushed information, the method and apparatus for showing information
CN112910643B (en) Method and device for generating random number in block chain
CN105245380B (en) Message propagation mode identification method and device
CN112822089B (en) Method and device for adding friends
CN111131354B (en) Method and apparatus for generating information
CN109033343B (en) Method and apparatus for generating information
CN114817346A (en) Service processing method and device, electronic equipment and computer readable medium
CN111784377B (en) Method and device for generating information
CN111291336A (en) Game registration method and device in game platform
CN108494982B (en) Method and apparatus for generating information
CN111784429B (en) Information pushing method and device

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
GR01 Patent grant