[go: up one dir, main page]

WO2020082873A1 - Object selection method and device and electronic device - Google Patents

Object selection method and device and electronic device Download PDF

Info

Publication number
WO2020082873A1
WO2020082873A1 PCT/CN2019/101681 CN2019101681W WO2020082873A1 WO 2020082873 A1 WO2020082873 A1 WO 2020082873A1 CN 2019101681 W CN2019101681 W CN 2019101681W WO 2020082873 A1 WO2020082873 A1 WO 2020082873A1
Authority
WO
WIPO (PCT)
Prior art keywords
seed
smart contract
random
seed data
blockchain
Prior art date
Application number
PCT/CN2019/101681
Other languages
French (fr)
Chinese (zh)
Inventor
谢桂鲁
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2020082873A1 publication Critical patent/WO2020082873A1/en

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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3821Electronic credentials
    • G06Q20/38215Use of certificates or encrypted proofs of transaction rights
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/582Pseudo-random number generators
    • 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
    • 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

Definitions

  • one or more embodiments of this specification provide an object selection method and apparatus, and electronic equipment.
  • Memory for storing processor executable instructions
  • FIG. 1 is a flowchart of an object selection method provided by an exemplary embodiment.
  • FIG. 5 is a block diagram of an object selection device provided by an exemplary embodiment.
  • Step 102 Invoke a smart contract for selecting an object.
  • the smart contract is used to generate a random seed according to the seed data provided by the candidate object, and generate a pseudo-random number based on the random seed through a pseudo-random number generator, so that The candidate object matching the pseudo-random number is selected as the target object.
  • the smart contract is used to splice all the seed data after receiving all the seed data provided by the candidate object, and implement and splice the initial value of the random seed according to a preset algorithm Data related update processing; wherein, the initial value of the random seed is a preset initial value.
  • a smart contract can describe a time period for receiving seed data, so that the seed data provided by the candidate object within the time period can be used to update the random seed, then the smart contract is before the end time of the time period , The seed data provided by the candidate will not be processed, but after the termination time is reached, all the seed data received within the time period will be spliced, and the spliced seed data will be used to update the random seed
  • the initial values of the spliced seed data and the random seed are calculated according to a preset algorithm, so as to obtain the updated random seed.
  • the preset initial value of the random seed may include any one of the following: the time stamp when the assignment operation is performed (that is, the moment when the preset initial value needs to be assigned to the random seed), the history area in the blockchain
  • the hash value of the block such as the most recently generated block in the blockchain
  • the specified transaction in the historical block in the blockchain such as the a transaction arranged by transaction time, a is the default value
  • the value of the random seed is also related to the reception timestamp of the seed data, so that the value of the random seed is affected by both the seed data and the reception timestamp, which can be further increased after the random seed is updated.
  • the randomness of the target so as to improve the fairness when selecting the target object, and avoid the fraud and cheating of the criminals.
  • the candidate object may be provided with multiple candidate pseudo-random number generators supported by the smart contract to be selected by the candidate user, which may further reflect fairness and openness, and Increased randomness.
  • a variety of pseudo-random number generators can be defined in the smart contract in advance, and the candidate object can also submit selection information for the pseudo-random number generator while providing seed data, so that the smart contract can count each candidate
  • the selection information of the object determines the number of selected times corresponding to each pseudo-random number generator, thereby arranging the number of selected times in a preset rank (eg, the number of selected times is ranked first, the number of selected times is ranked third, or any other rank)
  • the pseudo-random number generator is used to generate pseudo-random numbers.
  • the smart contract is also used to: store the pseudo-random number in the blockchain, so that the alternative user or supervisor can always check the pseudo-random number and pseudo-random number from the blockchain.
  • the relationship between the generator and the random seed is verified to ensure that there is no fraud or cheating in the process of generating pseudo-random numbers, or that possible fraud and cheating are discovered in time.
  • the smart contract is also used to: verify the qualification registration information of any object, and after the verification is passed, store the qualification information of the any object in the blockchain, so that all The any object becomes the candidate object; wherein, the qualification registration information includes the public key of the any object, and the qualification registration information is signed by the private key of the any object.
  • the qualification registration information includes the public key of the any object, and the qualification registration information is signed by the private key of the any object.
  • each candidate object may have a corresponding unique number, for example, the unique number may be the sort number of the candidate object, etc., which is not limited in this specification.
  • the unique number may be the sort number of the candidate object, etc., which is not limited in this specification.
  • the candidate object is a user who wants to purchase real estate of a certain building; then, When the number of alternative objects exceeds the total number of real estate of the real estate, the target object can be selected based on the total real estate, so that the target object can purchase real estate of the real estate, and the alternative objects not selected as the target object cannot be purchased The real estate of the building.
  • the device 23 is configured as a server of the number-signing system.
  • the device 23 interacts with the mobile phones 21-22 used by users A-B, etc., to assist them in registering the number-signing qualification, and interacts with the device 24 on the other hand.
  • the device 24 is configured as a blockchain node in the blockchain. Based on the information provided by the device 23, a smart contract can be configured and issued, and the smart contract can be invoked to realize the registration of the qualification and the number operation.
  • the real estate developer or the number notarization department can configure the smart contract to set the registration conditions for the number qualification and the stages included in the number shaking process (such as dividing the stages based on time or dividing the stages based on the block height on the blockchain Etc.), the processing logic adopted at each stage, etc., so that the smart contract can be used to implement the object selection scheme of this specification to complete the corresponding number-sharing operation.
  • the number-sharing process shown in FIG. 3 can be implemented.
  • the process can include the following steps:
  • step 301 the user registers for the qualification to dial the number.
  • the user A may submit the qualification registration information to the device 23 through the mobile phone 21, and submit a transaction containing the qualification registration information to the blockchain via the device 24.
  • the type can be configured or marked as the type of registered lottery qualification.
  • other users can also register for the lottery qualification in the above manner.
  • user A can also submit transactions containing qualification registration information to the blockchain through other blockchain nodes, for example, the mobile phone 21 can be configured as a zone Blockchain node, then user A can submit a transaction containing qualification registration information to the blockchain based on the mobile phone 21.
  • the mobile phone 21 can be configured as a zone Blockchain node, then user A can submit a transaction containing qualification registration information to the blockchain based on the mobile phone 21.
  • the above-mentioned transactions containing qualification registration information can be recorded in the blockchain ledger, and smart contracts can be queried and accessed from the blockchain ledger to obtain the qualification registration information contained in these transactions, thereby verifying whether the corresponding user can obtain Qualification for the lottery.
  • the device 24 can learn information such as the name or location of the smart contract, so that the device 24 can directly send the qualification registration information to the smart contract, and the smart contract can register the received qualification information Perform verification to determine whether the corresponding user can qualify for the lottery.
  • Step 302 the smart contract verifies the user information.
  • the smart contract after the smart contract obtains the qualification registration information of a certain user, it can verify the qualification registration information according to the predefined registration conditions to determine whether it meets the registration conditions; if it is met, the corresponding user is determined Have the qualification to shake the number, otherwise it is judged as not qualified to shake the number.
  • the qualification registration information contains the public key and other personal information of the corresponding user, and the qualification registration information should be signed by the user's private key to ensure that the content is true and valid and cannot be tampered with.
  • the verification results are transparent and traceable, and the verification results cannot be tampered with at will, ensuring the verification of the qualification registration information meets the requirements and avoiding dark box operations.
  • Step 304 the smart contract generates a qualification number for the authenticated user, and submits the allocation information of the qualification number to the blockchain to deposit the certificate in the blockchain ledger.
  • the smart contract may define the start time and the end time of the user registration phase, then the smart contract is only for the qualification registration received between the start time and the end time The information undergoes qualification verification and generates a qualification number, and the qualification registration information received outside the user registration stage is judged to be invalid.
  • the qualification numbers of each user are open, transparent, queryable, and cannot be tampered. Therefore, in the subsequent lottery process, Based on the qualification number, it can be accurately determined whether each user is shaken, with extremely high fairness, openness and credibility.
  • Step 305 the user submits seed data.
  • user A can send the seed data to the device 23 through the mobile phone 21 and publish the seed data to the blockchain via the device 24, so that the smart contract can obtain the seed data from the blockchain ledger; or
  • the mobile phone 21 is configured as a blockchain node, the mobile phone 21 can publish the seed data set by the user A to the blockchain, and the smart contract can obtain the seed data from the blockchain ledger; or, the device 24 Seed data can be sent directly to smart contracts. I will not repeat them here.
  • Step 306 after acquiring the seed data, the smart contract implements signature verification.
  • the smart contract can read the signature information of the received seed data; if the seed data is not signed, the smart contract cannot determine the source of the seed data, and it can be determined that the signature verification failed; if the seed data is signed If it does not belong to the user who passed the verification in step 302, the smart contract can determine that the source of the seed data is illegal, and it can be determined that the signature verification failed; if the signature of the seed data belongs to the user who passed the verification in step 302, the smart contract can It is further determined whether the seed data is received for the first time in the number shaking process. If it is not the first time it is received, it can be determined that it has not passed verification, and if it is received for the first time, it can be determined that it has passed signature verification.
  • the user signs the seed data through the private key held by the user, which is convenient for confirming the source of the seed data, and can avoid the repeated use of the seed data; at the same time, by signing the seed data, the criminal data can be avoided by criminals Perform tampering to prevent manipulation of the updated results of random seeds.
  • Step 307 the smart contract updates the random seed based on the seed data, and submits the seed data to the blockchain to store the certificate in the blockchain ledger.
  • the seed data and the random seed can be calculated based on a preset hash algorithm, and the random seed can be updated with the calculated value to obtain the updated random seed.
  • the hash algorithm may include SHA256, etc. This specification does not limit this.
  • a time stamp of the current time may be selected, and the hash value of the time stamp may be set as the initial value of the random seed.
  • the initial value of the random seed can also be set in other ways, which is not limited in this specification.
  • steps 305 to 307 correspond to the seed generation stage
  • the start time and end time of the seed generation stage can be defined in the smart contract to divide and define the seed generation stage.
  • each user who is qualified to shake can provide seed data. For example, user 1 to user n provide corresponding seed data 1 to seed data n, then the smart contract Can be handled as:
  • the smart contract updates the random seed whenever it receives a seed data, until all the seed data is applied to update the random seed.
  • the random seed is initially Z1; when seed data 1 is received, Z1 and seed data 1 can be hashed, and the hash value obtained is updated to a random seed Z2; further, when the seed is received After data 2, you can hash Z2 and seed data 2 and update the hash value to random seed Z3; ...
  • you receive seed data n you can hash Zn and seed data n And update the obtained hash value to a random seed Zn + 1, which is taken as the final value.
  • the smart contract can store the received seed data in the blockchain ledger, and the seed data contains the signature of the corresponding user, which can verify the source of the seed data and prevent tampering with the seed data. Further, the smart contract can also store each seed data in the blockchain ledger in association with the corresponding pre-update random seed and post-update random seed, so that users or regulators can check and prevent it from tampering with criminals. .
  • step 308 the smart contract generates a winning number according to the random seed, and publishes the winning number to the blockchain to deposit the certificate in the blockchain ledger.
  • a pseudo-random number generator is defined in the smart contract, and a corresponding pseudo-random number can be generated by inputting a random seed and a value range to the pseudo-random number generator.
  • the input random seed may be the final value obtained after updating the seed data.
  • the final value of the random seed is affected by the seed data, so that the criminals cannot predict or manipulate, so that the pseudo-random number has true random characteristics
  • the input value range can be the value range of the qualification number generated in the above step, so the generated pseudo-random number is the winning number, and can hit a certain qualification number, so that the user corresponding to the qualification number can get the real estate selection Purchase rights.
  • users or supervisors can conduct verification and verification at any time to avoid tampering by criminals.
  • user A can initiate a query request to device 23 through mobile phone 21, device 23 can query the blockchain ledger through device 24, and return the result of the query to the mobile phone 21 for viewing by user A , To ensure that you have the right to purchase real estate; similarly, when user A has an objection to the number shaking process, the same process can also be used to retrospectively query the relevant data in the blockchain ledger, the entire process and the data it generates Both are open and transparent.
  • FIG. 4 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 4.
  • the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410.
  • the processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it to form an object selection device at a logical level.
  • one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of hardware and software, etc., that is to say, the execution body of the following processing flow is not limited to each
  • the logic unit may also be a hardware or logic device.
  • the object selection device is applied to the blockchain node; the device may include:
  • the calling unit 51 calls a smart contract for selecting an object, the smart contract is used to generate a random seed according to the seed data provided by the candidate object, and generate a pseudo-random number based on the random seed through a pseudo-random number generator, to The candidate object matching the pseudo-random number is selected as the target object.
  • the smart contract is used to perform update processing related to the seed data on the random seed according to a preset algorithm after each time the seed data provided by the candidate object is received; wherein, the random seed
  • the initial value of is the preset initial value or the first seed data provided by the candidate object.
  • the smart contract is used to splice all the seed data after receiving all the seed data provided by the candidate object, and implement the initial value of the random seed according to a preset algorithm to be related to the spliced data Update processing; wherein, the initial value of the random seed is a preset initial value.
  • the preset initial value includes any of the following: the time stamp when the assignment operation is performed, the hash value of the historical block in the blockchain, the specified transaction in the historical block in the blockchain Hash value.
  • the value of the random seed is also related to the reception timestamp of the seed data.
  • Optional also includes:
  • the providing unit 52 provides multiple candidate pseudo-random number generators supported by the smart contract to the candidate object for selection by the candidate user.
  • the smart contract is also used to: deposit the seed data and / or the random seed in the blockchain.
  • the smart contract is also used to: deposit the pseudo-random number in the blockchain.
  • the seed data is signed by the candidate object through a private key; the smart contract is also used to: perform signature verification on the received seed data.
  • the computer includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
  • processors CPUs
  • input / output interfaces output interfaces
  • network interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory, random access memory (RAM) and / or non-volatile memory in computer-readable media, such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read only memory
  • flash RAM flash memory
  • first, second, third, etc. may use the terms first, second, third, etc. to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word "if” as used herein may be interpreted as "when” or “when” or “in response to a determination”.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Computer Security & Cryptography (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Provided in one or more embodiments of the present description are an object selection method and device and an electronic device, which are applied to a blockchain node. The method comprises: invoking an intelligent contract used to select an object, the intelligent contract being used to generate a random seed according to seed data provided by a candidate object, and generating a pseudo-random number on the basis of the random seed by means of a pseudo-random number generator such that a candidate object matching the pseudo-random number is selected to be a target object.

Description

对象选取方法及装置、电子设备Object selection method and device, electronic equipment 技术领域Technical field
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种对象选取方法及装置、电子设备。One or more embodiments of this specification relate to the field of blockchain technology, and in particular, to an object selection method and apparatus, and electronic equipment.
背景技术Background technique
当某一事件被设定为由预设数量的对象实施时,如果备选对象的数量超出该预设数量,则需要从这些备选对象中进行选择。当这些备选对象对于该事件的实施并无明显区别时,可以从这些备选对象中随机选取上述预设数量的对象。例如,当系统内包含10台设备时,如果希望配置为2台主设备、8台从设备的架构,可以从该10台设备中随机选取2台主设备,则剩余的8台设备为从设备。When an event is set to be implemented by a preset number of objects, if the number of candidate objects exceeds the preset number, you need to select from these candidate objects. When there is no obvious difference between these candidate objects for the implementation of the event, the preset number of objects can be randomly selected from these candidate objects. For example, when the system contains 10 devices, if you want to configure an architecture with 2 master devices and 8 slave devices, you can randomly select 2 master devices from the 10 devices, and the remaining 8 devices are slave devices. .
发明内容Summary of the invention
有鉴于此,本说明书一个或多个实施例提供一种对象选取方法及装置、电子设备。In view of this, one or more embodiments of this specification provide an object selection method and apparatus, and electronic equipment.
为实现上述目的,本说明书一个或多个实施例提供技术方案如下:To achieve the above purpose, one or more embodiments of this specification provide technical solutions as follows:
根据本说明书一个或多个实施例的第一方面,提出了一种对象选取方法,应用于区块链节点;所述方法包括:According to a first aspect of one or more embodiments of this specification, an object selection method is proposed, which is applied to blockchain nodes; the method includes:
调用用于选取对象的智能合约,所述智能合约用于根据备选对象提供的种子数据生成随机种子,并通过伪随机数发生器生成基于所述随机种子的伪随机数,以使得匹配于所述伪随机数的备选对象被选取为目标对象。Invoke a smart contract for selecting an object. The smart contract is used to generate a random seed based on the seed data provided by the candidate object, and generate a pseudo-random number based on the random seed through a pseudo-random number generator, so as to match The candidate object of the pseudo-random number is selected as the target object.
根据本说明书一个或多个实施例的第二方面,提出了一种对象选取装置,应用于区块链节点;所述装置包括:According to a second aspect of one or more embodiments of this specification, an object selection device is proposed for use in a blockchain node; the device includes:
调用单元,调用用于选取对象的智能合约,所述智能合约用于根据备选对象提供的种子数据生成随机种子,并通过伪随机数发生器生成基于所述随机种子的伪随机数,以使得匹配于所述伪随机数的备选对象被选取为目标对象。The calling unit calls a smart contract for selecting an object, and the smart contract is used to generate a random seed according to the seed data provided by the candidate object, and generate a pseudo-random number based on the random seed through a pseudo-random number generator, so that The candidate object matching the pseudo-random number is selected as the target object.
根据本说明书一个或多个实施例的第三方面,提出了一种电子设备,包括:According to a third aspect of one or more embodiments of this specification, an electronic device is provided, including:
处理器;processor;
用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
其中,所述处理器通过运行所述可执行指令以实现如上述实施例中任一所述的方法。Wherein, the processor executes the executable instruction to implement the method as described in any one of the above embodiments.
附图说明BRIEF DESCRIPTION
图1是一示例性实施例提供的一种对象选取方法的流程图。FIG. 1 is a flowchart of an object selection method provided by an exemplary embodiment.
图2是一示例性实施例提供的一种摇号选购不动产的示意图。Fig. 2 is a schematic diagram of a real estate purchased by a number sign provided by an exemplary embodiment.
图3是一示例性实施例提供的一种基于智能合约的摇号过程的示意图。FIG. 3 is a schematic diagram of a signing process based on a smart contract provided by an exemplary embodiment.
图4是一示例性实施例提供的一种设备的结构示意图。FIG. 4 is a schematic structural diagram of a device provided by an exemplary embodiment.
图5是一示例性实施例提供的一种对象选取装置的框图。FIG. 5 is a block diagram of an object selection device provided by an exemplary embodiment.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail here, examples of which are shown in the drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numerals in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification, as detailed in the appended claims.
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. In addition, the single step described in this specification may be decomposed into multiple steps for description in other embodiments; and the multiple steps described in this specification may also be combined into a single step in other embodiments description.
图1是一示例性实施例提供的一种对象选取方法的流程图。如图1所示,该方法应用于区块链节点,可以包括以下步骤:FIG. 1 is a flowchart of an object selection method provided by an exemplary embodiment. As shown in Figure 1, this method is applied to blockchain nodes and can include the following steps:
步骤102,调用用于选取对象的智能合约,所述智能合约用于根据备选对象提供的种子数据生成随机种子,并通过伪随机数发生器生成基于所述随机种子的伪随机数,以使得匹配于所述伪随机数的备选对象被选取为目标对象。Step 102: Invoke a smart contract for selecting an object. The smart contract is used to generate a random seed according to the seed data provided by the candidate object, and generate a pseudo-random number based on the random seed through a pseudo-random number generator, so that The candidate object matching the pseudo-random number is selected as the target object.
在一实施例中,由于随机种子是基于备选对象提供的种子数据而产生,使得该随机种子具备真正的高度随机性,无法被不法分子预测和设定,使得基于该随机种子产生的 伪随机数同样具备高度随机性,从而防止不法分子造假作弊。同时,由于随机种子的生成过程、伪随机数的生成过程均有智能合约实现,而智能合约被存证于区块链中,使得该智能合约的内容公开且不可篡改,使得对于目标对象的选择过程公平、公开、可验证,进一步降低了不法分子造假作弊的可能性。In an embodiment, since the random seed is generated based on the seed data provided by the candidate object, the random seed has a truly high randomness, which cannot be predicted and set by criminals, making the pseudo-random generated based on the random seed The numbers also have a high degree of randomness, thus preventing fraudulent fraud and cheating. At the same time, because the generation process of random seeds and pseudo-random numbers are both implemented by smart contracts, and the smart contract is stored in the blockchain, the content of the smart contract is open and cannot be tampered, which makes the choice of the target object The process is fair, open and verifiable, which further reduces the possibility of fraudulent fraud.
在一实施例中,所述智能合约用于在每次收到备选对象提供的种子数据后,按照预设算法对所述随机种子实施与所述种子数据相关的更新处理。随机种子的初始取值可以为预设初始值;或者,当收到备选对象提供的第一个种子数据后,可以将该第一个种子数据作为随机种子的初始取值。当随机种子为Z1时,若收到备选对象提供的种子数据1,可以基于预设算法对随机种子Z1和该种子数据1进行计算,使得随机种子被更新为Z2;进一步地,若收到备选对象提供的种子数据2,可以基于预设算法对随机种子Z2和该种子数据2进行计算,使得随机种子被更新为Z3,直至备选对象提供的所有种子数据都参与了对随机种子的更新处理。In one embodiment, the smart contract is used to update the random seed according to a preset algorithm after receiving the seed data provided by the candidate object. The initial value of the random seed may be a preset initial value; or, after receiving the first seed data provided by the candidate object, the first seed data may be used as the initial value of the random seed. When the random seed is Z1, if the seed data 1 provided by the candidate is received, the random seed Z1 and the seed data 1 can be calculated based on a preset algorithm, so that the random seed is updated to Z2; further, if received For the seed data 2 provided by the candidate object, the random seed Z2 and the seed data 2 can be calculated based on a preset algorithm, so that the random seed is updated to Z3 until all the seed data provided by the candidate object participates in the random seed Update processing.
在一实施例中,所述智能合约用于在收到备选对象提供的所有种子数据后,对所有种子数据进行拼接,并按照预设算法对所述随机种子的初始取值实施与拼接后数据相关的更新处理;其中,所述随机种子的初始取值为预设初始值。例如,智能合约中可以描述用于接收种子数据的时间段,使得备选对象在该时间段内提供的种子数据,可以用于对随机种子进行更新,则智能合约在该时间段的终止时刻之前,不会对备选对象提供的种子数据进行处理,而是在该终止时刻到达之后,将该时间段内收到的所有种子数据进行拼接后,将拼接后种子数据应用于对随机种子进行更新,比如按照预设算法对该拼接后种子数据与随机种子的初始取值进行计算,从而得到更新后的随机种子。In an embodiment, the smart contract is used to splice all the seed data after receiving all the seed data provided by the candidate object, and implement and splice the initial value of the random seed according to a preset algorithm Data related update processing; wherein, the initial value of the random seed is a preset initial value. For example, a smart contract can describe a time period for receiving seed data, so that the seed data provided by the candidate object within the time period can be used to update the random seed, then the smart contract is before the end time of the time period , The seed data provided by the candidate will not be processed, but after the termination time is reached, all the seed data received within the time period will be spliced, and the spliced seed data will be used to update the random seed For example, the initial values of the spliced seed data and the random seed are calculated according to a preset algorithm, so as to obtain the updated random seed.
在一实施例中,随机种子的预设初始值可以包括下述任一:实施赋值操作时(即需要向随机种子赋予该预设初始值的时刻)的时间戳、区块链中的历史区块(例如区块链中最近生成的一个区块)的哈希值、区块链中的历史区块中的指定交易(例如按照交易时刻排列的第a笔交易,a为预设数值)的哈希值。In an embodiment, the preset initial value of the random seed may include any one of the following: the time stamp when the assignment operation is performed (that is, the moment when the preset initial value needs to be assigned to the random seed), the history area in the blockchain The hash value of the block (such as the most recently generated block in the blockchain), the specified transaction in the historical block in the blockchain (such as the a transaction arranged by transaction time, a is the default value) Hash value.
在一实施例中,上述的预设算法可以包括消息摘要算法,可以计算随机种子与种子数据的哈希值,以作为更新后的随机种子。当然,该预设算法还可以包括其他类型的算法,本说明书并不对此进行限制。In an embodiment, the above-mentioned preset algorithm may include a message digest algorithm, which may calculate a hash value of a random seed and seed data as an updated random seed. Of course, the preset algorithm may also include other types of algorithms, which are not limited in this specification.
在一实施例中,所述随机种子的取值还与所述种子数据的接收时间戳相关,使得随机种子的取值同时受到种子数据和接收时间戳的影响,可以进一步增加随机种子被更新后的随机性,从而提升对目标对象进行选取时的公平性,避免不法分子造假作弊。In an embodiment, the value of the random seed is also related to the reception timestamp of the seed data, so that the value of the random seed is affected by both the seed data and the reception timestamp, which can be further increased after the random seed is updated The randomness of the target, so as to improve the fairness when selecting the target object, and avoid the fraud and cheating of the criminals.
在一实施例中,可以向所述备选对象提供所述智能合约支持的多个备选的伪随机数发生器,以由所述备选用户进行选择,可以进一步体现出公平、公开,并且增加了随机性。例如,可以预先在智能合约中定义多种伪随机数发生器,而备选对象在提供种子数据的同时,还可以提交对伪随机数发生器的选择信息,使得智能合约可以通过统计各个备选对象的选择信息,确定各个伪随机数发生器对应的被选择次数,从而将被选择次数排列于预设名次(如被选择次数排列于第一、被选择次数排列于第三或其他任意名次)的伪随机数发生器应用于生成伪随机数。In an embodiment, the candidate object may be provided with multiple candidate pseudo-random number generators supported by the smart contract to be selected by the candidate user, which may further reflect fairness and openness, and Increased randomness. For example, a variety of pseudo-random number generators can be defined in the smart contract in advance, and the candidate object can also submit selection information for the pseudo-random number generator while providing seed data, so that the smart contract can count each candidate The selection information of the object determines the number of selected times corresponding to each pseudo-random number generator, thereby arranging the number of selected times in a preset rank (eg, the number of selected times is ranked first, the number of selected times is ranked third, or any other rank) The pseudo-random number generator is used to generate pseudo-random numbers.
在一实施例中,所述智能合约还用于:将所述种子数据和/或所述随机种子存证于区块链中,使得备选用户或监管方可以随时从区块链中对种子数据、随机种子等进行查证,以确保随机种子的更新过程不会发生造假作弊,或者及时发现可能的造假作弊情况。In one embodiment, the smart contract is also used to: deposit the seed data and / or the random seed in the blockchain, so that the alternative user or regulator can always seed the blockchain Check the data and random seeds to ensure that there is no fraud or fraud in the update process of random seeds, or discover possible fraud and cheating in a timely manner.
在一实施例中,所述智能合约还用于:将所述伪随机数存证于区块链中,使得备选用户或监管方可以随时从区块链中对伪随机数、伪随机数发生器与随机种子之间的关系进行验证,以确保伪随机数的生成过程不会发生造假作弊,或者及时发现可能的造假作弊情况。In an embodiment, the smart contract is also used to: store the pseudo-random number in the blockchain, so that the alternative user or supervisor can always check the pseudo-random number and pseudo-random number from the blockchain. The relationship between the generator and the random seed is verified to ensure that there is no fraud or cheating in the process of generating pseudo-random numbers, or that possible fraud and cheating are discovered in time.
在一实施例中,所述智能合约还用于:对任一对象的资格注册信息进行验证,并在验证通过后将所述任一对象的资格信息存证于区块链中,以使所述任一对象成为所述备选对象;其中,所述资格注册信息包括所述任一对象的公钥,且所述资格注册信息由所述任一对象的私钥进行签名。通过验证资格注册信息,可以确保备选对象都满足预设要求。由于资格注册信息由私钥进行签名,使得每一对象的身份信息都明确、可追溯,避免暗箱操作。In an embodiment, the smart contract is also used to: verify the qualification registration information of any object, and after the verification is passed, store the qualification information of the any object in the blockchain, so that all The any object becomes the candidate object; wherein, the qualification registration information includes the public key of the any object, and the qualification registration information is signed by the private key of the any object. By verifying the qualification registration information, you can ensure that all candidates meet the preset requirements. Because the qualification registration information is signed by the private key, the identity information of each object is clear and traceable, avoiding dark box operations.
在一实施例中,所述种子数据由所述备选对象通过私钥进行签名;所述智能合约还用于:对收到的种子数据进行签名验证,以确保备选对象提供的种子数据不会被不法分子篡改。In an embodiment, the seed data is signed by the candidate object through a private key; the smart contract is also used to: perform signature verification on the received seed data to ensure that the seed data provided by the candidate object is not Will be tampered with by criminals.
在一实施例中,备选对象的数量为多个,智能合约可以从这些备选对象中选取部分对象,以作为预设数量的目标对象,该预设数量可以为一个或多个。In an embodiment, the number of candidate objects is multiple, and the smart contract may select some objects from these candidate objects as a preset number of target objects, and the preset number may be one or more.
在一实施例中,备选对象可以包括任意类型的对象,这取决于所应用的场景,本说明书并不对此进行限制。例如,在向出租车派发叫车任务时,备选对象可以为出租车牌照号,用于为每一叫车任务随机指派一辆出租车;再例如,在配置多台电子设备构成的设备系统时,备选对象可以为设备ID,用于选取指定数量的电子设备以作为主设备。In an embodiment, the candidate objects may include any type of objects, depending on the applied scenario, and this specification does not limit this. For example, when dispatching a taxi task to a taxi, the candidate object may be a taxi license plate number, which is used to randomly assign a taxi for each taxi task; for example, when configuring a device system composed of multiple electronic devices At this time, the candidate object may be a device ID, which is used to select a specified number of electronic devices as the master device.
在一实施例中,每一备选对象可以存在对应的唯一编号,比如该唯一编号可以为备选对象的排序号码等,本说明书并不对此进行限制。通过将基于随机种子生成的伪随机数与各个备选对象对应的唯一编号进行比较,可以确定与伪随机数相同的唯一编号,从而将该唯一编号对应的备选对象选取为目标对象。当然,还可以通过其他方式在伪随机数与备选对象之间进行匹配,从而确定出被选取的目标对象。In an embodiment, each candidate object may have a corresponding unique number, for example, the unique number may be the sort number of the candidate object, etc., which is not limited in this specification. By comparing the pseudo-random number generated based on the random seed with the unique number corresponding to each candidate object, the same unique number as the pseudo-random number can be determined, so that the candidate object corresponding to the unique number is selected as the target object. Of course, the pseudo-random number and the candidate object can also be matched in other ways to determine the selected target object.
在一实施例中,所述智能合约还向链外系统发送通知消息,所述通知消息包含所述目标对象的信息,以指示所述链外系统向所述目标对象赋予预设权限,使得该目标对象可以实施相关操作,而其他未被选取为目标对象的备选对象则不具有该预设权限、无法实施相关操作。In an embodiment, the smart contract also sends a notification message to the off-chain system, where the notification message includes information of the target object to instruct the off-chain system to grant preset permissions to the target object, so that The target object can perform related operations, and other candidate objects not selected as the target object do not have the preset authority and cannot perform related operations.
例如,对于需要控制车辆数量的地区,所述链外系统可以包括车辆牌照管理系统,而所述预设权限包括对车辆牌照的选取权限,备选对象为希望选取车辆牌照的用户;那么,目标对象可以选取车辆牌照,而未被选取为目标对象的备选对象则无法选取车辆牌照,从而实现对车辆数量的控制。又例如,对于需要摇号买房的地区,所述链外系统包括不动产管理系统,所述预设权限包括对不动产的选购权限,备选对象为希望选购某一楼盘的不动产的用户;那么,当备选对象的数量超出该楼盘的不动产总数时,可以基于该不动产总数选取目标对象,使得该目标对象可以选购该楼盘的不动产,而未被选取为目标对象的备选对象则无法选购该楼盘的不动产。For example, for areas where the number of vehicles needs to be controlled, the off-chain system may include a vehicle license plate management system, and the preset authority includes the authority to select a vehicle license plate, and the candidate object is a user who wishes to select a vehicle license plate; then, the target The object can select the vehicle license plate, and the alternative objects that have not been selected as the target object cannot select the vehicle license plate, thereby realizing the control of the number of vehicles. For another example, for areas where a house purchase is required, the off-chain system includes a real estate management system, and the preset authority includes the purchasing authority for real estate. The candidate object is a user who wants to purchase real estate of a certain building; then, When the number of alternative objects exceeds the total number of real estate of the real estate, the target object can be selected based on the total real estate, so that the target object can purchase real estate of the real estate, and the alternative objects not selected as the target object cannot be purchased The real estate of the building.
为了便于理解,下面以选购不动产时的摇号过程为例,对本说明书的对象选取方案进行描述。图2是一示例性实施例提供的一种摇号选购不动产的示意图;如图2所示,假定用户A希望参与针对某一楼盘的摇号,该用户A可以通过安装有客户端的手机21输入注册摇号资格所需的资格注册信息,比如身份证明材料、存款证明材料、对应于数字身份的公钥、个人资料等(这取决于楼盘开发商或相关法律法规的要求)。类似地,如果用户B希望参与摇号,可以通过安装有客户端的手机22输入注册摇号资格所需的资格注册,其他用户的情况此处不再一一赘述。For ease of understanding, the following describes the object selection scheme in this manual by taking the signing process when purchasing real estate as an example. FIG. 2 is a schematic diagram of a real estate purchase provided by an exemplary embodiment; as shown in FIG. 2, assuming that user A wishes to participate in the real deal for a real estate, the user A can enter registration through the mobile phone 21 with the client installed Qualification registration information required for the qualification of the number, such as identification documents, deposit certification materials, public keys corresponding to digital identities, personal data, etc. (this depends on the requirements of the property developer or relevant laws and regulations). Similarly, if user B wishes to participate in the number dialing, he can enter the qualification registration required for registering the number dialing qualification through the mobile phone 22 on which the client is installed. The situation of other users will not be repeated here.
设备23被配置为摇号系统的服务端,该设备23一方面与用户A-B等使用的手机21-22等进行交互、以协助其注册摇号资格,另一方面与设备24进行交互。设备24被配置为区块链中的一个区块链节点,基于设备23所提供的信息,可以配置、发布智能合约,并通过调用智能合约以实现摇号资格的注册和摇号操作等。楼盘开发商或摇号公证部门可以对智能合约进行配置,以设定对摇号资格的注册条件、摇号过程包含的各个阶段(如基于时间划分各个阶段或者基于区块链上的区块高度划分各个阶段等)、每一 阶段所采取的处理逻辑等,使得该智能合约可以用于实现本说明书的对象选取方案,以完成相应的摇号操作。The device 23 is configured as a server of the number-signing system. The device 23 interacts with the mobile phones 21-22 used by users A-B, etc., to assist them in registering the number-signing qualification, and interacts with the device 24 on the other hand. The device 24 is configured as a blockchain node in the blockchain. Based on the information provided by the device 23, a smart contract can be configured and issued, and the smart contract can be invoked to realize the registration of the qualification and the number operation. The real estate developer or the number notarization department can configure the smart contract to set the registration conditions for the number qualification and the stages included in the number shaking process (such as dividing the stages based on time or dividing the stages based on the block height on the blockchain Etc.), the processing logic adopted at each stage, etc., so that the smart contract can be used to implement the object selection scheme of this specification to complete the corresponding number-sharing operation.
假定已完成对智能合约的配置过程,并且该智能合约已被发布至区块链中,那么基于该智能合约可以实现如图3所示的摇号过程,该过程可以包括以下步骤:Assuming that the configuration process of the smart contract has been completed, and the smart contract has been released into the blockchain, then based on the smart contract, the number-sharing process shown in FIG. 3 can be implemented. The process can include the following steps:
步骤301,用户注册摇号资格。In step 301, the user registers for the qualification to dial the number.
在一实施例中,以上述的用户A为例,该用户A可以通过手机21向设备23提交资格注册信息,并经由设备24向区块链中提交包含该资格注册信息的交易,该交易的类型可以被配置或标记为注册摇号资格的类型。类似地,其他用户也可以通过上述方式注册摇号资格。In an embodiment, taking the above user A as an example, the user A may submit the qualification registration information to the device 23 through the mobile phone 21, and submit a transaction containing the qualification registration information to the blockchain via the device 24. The type can be configured or marked as the type of registered lottery qualification. Similarly, other users can also register for the lottery qualification in the above manner.
除了通过设备24向区块链提交包含资格注册信息的交易之外,用户A也可以通过其他区块链节点向区块链提交包含资格注册信息的交易,比如该手机21可以被配置为一区块链节点,那么用户A可以基于该手机21向区块链提交包含资格注册信息的交易。In addition to submitting transactions containing qualification registration information to the blockchain through device 24, user A can also submit transactions containing qualification registration information to the blockchain through other blockchain nodes, for example, the mobile phone 21 can be configured as a zone Blockchain node, then user A can submit a transaction containing qualification registration information to the blockchain based on the mobile phone 21.
上述包含资格注册信息的交易可以被记录至区块链账本中,智能合约可以从区块链账本中进行查询和访问,以获取这些交易中包含的资格注册信息,从而验证相应的用户是否可以获得摇号资格。The above-mentioned transactions containing qualification registration information can be recorded in the blockchain ledger, and smart contracts can be queried and accessed from the blockchain ledger to obtain the qualification registration information contained in these transactions, thereby verifying whether the corresponding user can obtain Qualification for the lottery.
在一实施例中,以设备24为例,设备24可以获知智能合约的名称或位置等信息,使得设备24可以直接将资格注册信息发送至智能合约,而智能合约可以针对收到的资格注册信息进行验证,以确定相应的用户是否可以获得摇号资格。In an embodiment, taking the device 24 as an example, the device 24 can learn information such as the name or location of the smart contract, so that the device 24 can directly send the qualification registration information to the smart contract, and the smart contract can register the received qualification information Perform verification to determine whether the corresponding user can qualify for the lottery.
步骤302,智能合约验证用户信息。Step 302, the smart contract verifies the user information.
在一实施例中,智能合约获得某一用户的资格注册信息后,可以按照预先定义的注册条件对该资格注册信息进行验证,以确定其是否满足该注册条件;如果满足,则判定相应的用户具备摇号资格,否则判定为不具备摇号资格。In an embodiment, after the smart contract obtains the qualification registration information of a certain user, it can verify the qualification registration information according to the predefined registration conditions to determine whether it meets the registration conditions; if it is met, the corresponding user is determined Have the qualification to shake the number, otherwise it is judged as not qualified to shake the number.
在一实施例中,资格注册信息中包含对应用户的公钥和其他个人信息,且资格注册信息应当由用户的私钥进行签名,以确保其内容的真实有效、不可篡改。In one embodiment, the qualification registration information contains the public key and other personal information of the corresponding user, and the qualification registration information should be signed by the user's private key to ensure that the content is true and valid and cannot be tampered with.
步骤303,智能合约将验证结果提交至区块链,以存证于区块链账本中。Step 303, the smart contract submits the verification result to the blockchain to deposit the certificate in the blockchain ledger.
在一实施例中,通过将验证结果存证于区块链账本中,使得验证结果透明、可追溯,并且无法随意篡改验证结果,确保对于资格注册信息的验证符合要求,避免暗箱操作。In one embodiment, by storing the verification results in the blockchain ledger, the verification results are transparent and traceable, and the verification results cannot be tampered with at will, ensuring the verification of the qualification registration information meets the requirements and avoiding dark box operations.
步骤304,智能合约为通过验证的用户生成资格编号,并将资格编号的分配信息提 交至区块链,以存证于区块链账本中。Step 304, the smart contract generates a qualification number for the authenticated user, and submits the allocation information of the qualification number to the blockchain to deposit the certificate in the blockchain ledger.
在一实施例中,智能合约可以通过预设方式生成资格编号,比如按照公钥的取值大小、资格注册信息的接收时刻的早晚等进行排序,并将顺序号作为相应的资格编号。当然,还可以通过其他方式生成资格编号,本说明书并不对此进行限制。In an embodiment, the smart contract may generate the qualification number in a preset manner, such as sorting according to the value of the public key, the morning and evening of the reception time of the qualification registration information, etc., and using the sequence number as the corresponding qualification number. Of course, the qualification number can also be generated in other ways, and this specification does not limit this.
在一实施例中,如果按照公钥的取值大小生成资格编号,智能合约需要等待收到所有用户提交的资格注册信息之后,才能够获得各个用户的公钥,从而为所有通过验证的用户生成资格编号。In an embodiment, if the qualification number is generated according to the value of the public key, the smart contract needs to wait for receiving the qualification registration information submitted by all users before it can obtain the public key of each user, so as to generate for all users who pass the verification Qualification number.
在一实施例中,如果按照资格注册信息的接收时刻生成资格编号,智能合约可以在每收到一条资格注册信息后,就为相应的用户生成资格编号。In one embodiment, if the qualification number is generated according to the moment of receipt of the qualification registration information, the smart contract may generate the qualification number for the corresponding user after each piece of qualification registration information is received.
在一实施例中,假定以时间段来划分各个阶段,智能合约可以定义有用户注册阶段的起始时刻、终止时刻,那么智能合约只针对该起始时刻与终止时刻之间收到的资格注册信息进行资格验证、生成资格编号,而在用户注册阶段之外收到的资格注册信息则判定为无效。In an embodiment, assuming that each stage is divided by time period, the smart contract may define the start time and the end time of the user registration phase, then the smart contract is only for the qualification registration received between the start time and the end time The information undergoes qualification verification and generates a qualification number, and the qualification registration information received outside the user registration stage is judged to be invalid.
在一实施例中,通过将所有参与摇号的用户对应的资格编号存证于区块链账本中,使得各个用户的资格编号公开、透明、可查询且不可篡改,因而在后续的摇号过程中,可以基于该资格编号准确地确定各个用户是否摇中,具有极高的公平性、公开性和可信度。In one embodiment, by depositing the qualification numbers corresponding to all users involved in the lottery in the blockchain ledger, the qualification numbers of each user are open, transparent, queryable, and cannot be tampered. Therefore, in the subsequent lottery process, Based on the qualification number, it can be accurately determined whether each user is shaken, with extremely high fairness, openness and credibility.
步骤305,用户提交种子数据。Step 305, the user submits seed data.
与步骤301相类似的,用户A可以将种子数据通过手机21发送至设备23,并经由设备24将种子数据发布至区块链,从而由智能合约从区块链账本中获取该种子数据;或者,当手机21被配置为区块链节点时,可由该手机21将用户A设定的种子数据发布至区块链,并由智能合约从区块链账本中获取该种子数据;或者,设备24可以直接将种子数据发送至智能合约。此处不再一一赘述。Similar to step 301, user A can send the seed data to the device 23 through the mobile phone 21 and publish the seed data to the blockchain via the device 24, so that the smart contract can obtain the seed data from the blockchain ledger; or When the mobile phone 21 is configured as a blockchain node, the mobile phone 21 can publish the seed data set by the user A to the blockchain, and the smart contract can obtain the seed data from the blockchain ledger; or, the device 24 Seed data can be sent directly to smart contracts. I will not repeat them here.
在一实施例中,种子数据可以为用户所提供的任意内容。实际上,正是由于种子数据的内容随意、不可控,使得在基于种子数据对随机种子进行更新时,增加了随机种子的内容随机性,使得随机种子的更新结果不易受到操控,避免不法分子借此操纵摇号过程。In one embodiment, the seed data can be any content provided by the user. In fact, it is precisely because the content of the seed data is random and uncontrollable that when the random seed is updated based on the seed data, the randomness of the content of the random seed is increased, so that the update result of the random seed is not easy to be manipulated, avoiding borrowing This process of manipulating the sign.
步骤306,智能合约获取种子数据后,实施签名验证。Step 306, after acquiring the seed data, the smart contract implements signature verification.
在一实施例中,智能合约可以读取收到的种子数据的签名信息;如果种子数据未签名,则智能合约无法确定该种子数据的来源,可以判定为签名验证未通过;如果种子数据的签名并不属于步骤302中通过验证的用户,则智能合约可以判定为种子数据的来源不合法,可以判定为签名验证未通过;如果种子数据的签名属于步骤302中通过验证的用户,则智能合约可以进一步判定该种子数据是否为本次摇号过程中首次收到,若非首次收到可以判定为未通过验证,若首次收到则可以判定为通过签名验证。In an embodiment, the smart contract can read the signature information of the received seed data; if the seed data is not signed, the smart contract cannot determine the source of the seed data, and it can be determined that the signature verification failed; if the seed data is signed If it does not belong to the user who passed the verification in step 302, the smart contract can determine that the source of the seed data is illegal, and it can be determined that the signature verification failed; if the signature of the seed data belongs to the user who passed the verification in step 302, the smart contract can It is further determined whether the seed data is received for the first time in the number shaking process. If it is not the first time it is received, it can be determined that it has not passed verification, and if it is received for the first time, it can be determined that it has passed signature verification.
因此,用户通过自身持有的私钥对种子数据进行签名,便于确认该种子数据的来源,还可以避免对种子数据的重复使用;同时,通过对种子数据进行签名,可以避免不法分子对种子数据进行篡改,防止随机种子的更新结果被操控。Therefore, the user signs the seed data through the private key held by the user, which is convenient for confirming the source of the seed data, and can avoid the repeated use of the seed data; at the same time, by signing the seed data, the criminal data can be avoided by criminals Perform tampering to prevent manipulation of the updated results of random seeds.
步骤307,智能合约基于种子数据更新随机种子,并将种子数据提交至区块链,以存证于区块链账本中。Step 307, the smart contract updates the random seed based on the seed data, and submits the seed data to the blockchain to store the certificate in the blockchain ledger.
在一实施例中,可以基于预设的哈希算法对种子数据和随机种子进行计算,并用计算得到的数值对随机种子进行更新,得到更新后的随机种子。比如该哈希算法可以包括SHA256等,本说明书并不对此进行限制。通过将种子数据应用于对随机种子进行更新,并且该种子数据由参与摇号的用户提供、具有极大的随机性,因而可使随机种子产生随机、不可预先猜测出的变化,可以避免不法分子对随机种子的取值进行操控。In an embodiment, the seed data and the random seed can be calculated based on a preset hash algorithm, and the random seed can be updated with the calculated value to obtain the updated random seed. For example, the hash algorithm may include SHA256, etc. This specification does not limit this. By applying the seed data to update the random seed, and the seed data is provided by the users participating in the lottery, it has great randomness, so that the random seed can produce random, unpredictable changes, which can avoid the criminals The value of the random seed is manipulated.
在一实施例中,在针对随机种子进行赋值时,可以选取当前时刻的时间戳,并将该时间戳的哈希值设置为随机种子的初始值。当然,还可以通过其他方式设置随机种子的初始值,本说明书并不对此进行限制。In an embodiment, when assigning a value to a random seed, a time stamp of the current time may be selected, and the hash value of the time stamp may be set as the initial value of the random seed. Of course, the initial value of the random seed can also be set in other ways, which is not limited in this specification.
在一实施例中,步骤305~307对应于种子生成阶段,智能合约中可以定义有该种子生成阶段的起始时刻、终止时刻,以用于划分和限定该种子生成阶段。在该起始时刻与终止时刻之间的时间段内,具有摇号资格的每个用户都可以提供种子数据,比如由用户1~用户n分别提供相应的种子数据1~种子数据n,那么智能合约的处理方式可以为:In an embodiment, steps 305 to 307 correspond to the seed generation stage, and the start time and end time of the seed generation stage can be defined in the smart contract to divide and define the seed generation stage. In the time period between the start time and the end time, each user who is qualified to shake can provide seed data. For example, user 1 to user n provide corresponding seed data 1 to seed data n, then the smart contract Can be handled as:
一种情况下,智能合约每当收到一个种子数据时,就对随机种子进行更新,直至所有种子数据都被应用于对随机种子实施更新。比如,随机种子在初始时为Z1;当收到种子数据1后,可以将Z1与种子数据1进行哈希计算,并将得到的哈希值更新为随机种子Z2;进一步的,当收到种子数据2后,可以将Z2与种子数据2进行哈希计算,并将得到的哈希值更新为随机种子Z3;……当收到种子数据n后,可以将Zn与种子数据n进行哈希计算,并将得到的哈希值更新为随机种子Zn+1,该随机种子Zn+1被作为最 终取值。In one case, the smart contract updates the random seed whenever it receives a seed data, until all the seed data is applied to update the random seed. For example, the random seed is initially Z1; when seed data 1 is received, Z1 and seed data 1 can be hashed, and the hash value obtained is updated to a random seed Z2; further, when the seed is received After data 2, you can hash Z2 and seed data 2 and update the hash value to random seed Z3; ... When you receive seed data n, you can hash Zn and seed data n And update the obtained hash value to a random seed Zn + 1, which is taken as the final value.
另一种情况下,智能合约可以获取在种子生成阶段内收到的所有种子数据,比如种子数据1~种子数据n,并对这些种子数据进行拼接后,得到拼接后种子数据;然后,智能合约可以将该拼接后种子数据与随机种子的初始值进行哈希计算,得到更新后的随机种子。In another case, the smart contract can obtain all the seed data received during the seed generation stage, such as seed data 1 to seed data n, and after splicing these seed data, the post-splicing seed data is obtained; then, the smart contract The spliced seed data and the initial value of the random seed can be hashed to obtain the updated random seed.
在一实施例中,智能合约可以将收到的种子数据存证于区块链账本中,该种子数据包含对应用户的签名,可以验证该种子数据的来源,并且防止对该种子数据进行篡改。进一步的,智能合约还可以将各个种子数据与对应的更新前随机种子、更新后随机种子相关联地存证于区块链账本中,以便于用户或监管方进行核对查验,防止不法分子进行篡改。In one embodiment, the smart contract can store the received seed data in the blockchain ledger, and the seed data contains the signature of the corresponding user, which can verify the source of the seed data and prevent tampering with the seed data. Further, the smart contract can also store each seed data in the blockchain ledger in association with the corresponding pre-update random seed and post-update random seed, so that users or regulators can check and prevent it from tampering with criminals. .
步骤308,智能合约根据随机种子生成中签号码,并将中签号码发布至区块链,以存证于区块链账本中。In step 308, the smart contract generates a winning number according to the random seed, and publishes the winning number to the blockchain to deposit the certificate in the blockchain ledger.
在一实施例中,智能合约中定义有伪随机数发生器,通过向该伪随机数发生器输入随机种子和取值范围,即可生成相应的伪随机数。其中,输入的随机种子可以为经由种子数据更新后得到的最终取值,该随机种子的最终取值受到了种子数据的影响,使得不法分子无法预测或操控,使得伪随机数具有真正的随机特性;同时,输入的取值范围可以为上述步骤中生成的资格编号的取值范围,因而生成的伪随机数为中签号码,可以命中某一资格编号,使得该资格编号对应的用户获得不动产的选购权限。In an embodiment, a pseudo-random number generator is defined in the smart contract, and a corresponding pseudo-random number can be generated by inputting a random seed and a value range to the pseudo-random number generator. Among them, the input random seed may be the final value obtained after updating the seed data. The final value of the random seed is affected by the seed data, so that the criminals cannot predict or manipulate, so that the pseudo-random number has true random characteristics At the same time, the input value range can be the value range of the qualification number generated in the above step, so the generated pseudo-random number is the winning number, and can hit a certain qualification number, so that the user corresponding to the qualification number can get the real estate selection Purchase rights.
在一实施例中,通过将中签号码存证于区块链账本上,使得用户或监管方可以随时进行查证核验,避免不法分子进行篡改。以用户A为例,用户A可以通过手机21向设备23发起查询请求,设备23可以通过设备24对区块链账本进行查询,并将查询到的摇号结果返回手机21,以由用户A进行查看,确保自己是否具备不动产的选购权限;类似地,当用户A对摇号过程存在异议时,同样可以通过上述过程,对区块链账本中的相关数据进行追溯查询,整个过程及其产生的数据均公开透明。In one embodiment, by depositing the winning number on the blockchain ledger, users or supervisors can conduct verification and verification at any time to avoid tampering by criminals. Taking user A as an example, user A can initiate a query request to device 23 through mobile phone 21, device 23 can query the blockchain ledger through device 24, and return the result of the query to the mobile phone 21 for viewing by user A , To ensure that you have the right to purchase real estate; similarly, when user A has an objection to the number shaking process, the same process can also be used to retrospectively query the relevant data in the blockchain ledger, the entire process and the data it generates Both are open and transparent.
图4是一示例性实施例提供的一种设备的示意结构图。请参考图4,在硬件层面,该设备包括处理器402、内部总线404、网络接口406、内存408以及非易失性存储器410,当然还可能包括其他业务所需要的硬件。处理器402从非易失性存储器410中读取对应的计算机程序到内存408中然后运行,在逻辑层面上形成对象选取装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑 器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。FIG. 4 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 4. At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410. Of course, it may include hardware required for other services. The processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it to form an object selection device at a logical level. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of hardware and software, etc., that is to say, the execution body of the following processing flow is not limited to each The logic unit may also be a hardware or logic device.
请参考图5,在软件实施方式中,该对象选取装置应用于区块链节点;该装置可以包括:Please refer to FIG. 5. In the software implementation, the object selection device is applied to the blockchain node; the device may include:
调用单元51,调用用于选取对象的智能合约,所述智能合约用于根据备选对象提供的种子数据生成随机种子,并通过伪随机数发生器生成基于所述随机种子的伪随机数,以使得匹配于所述伪随机数的备选对象被选取为目标对象。The calling unit 51 calls a smart contract for selecting an object, the smart contract is used to generate a random seed according to the seed data provided by the candidate object, and generate a pseudo-random number based on the random seed through a pseudo-random number generator, to The candidate object matching the pseudo-random number is selected as the target object.
可选的,所述智能合约用于在每次收到备选对象提供的种子数据后,按照预设算法对所述随机种子实施与所述种子数据相关的更新处理;其中,所述随机种子的初始取值为预设初始值或首个由备选对象提供的种子数据。Optionally, the smart contract is used to perform update processing related to the seed data on the random seed according to a preset algorithm after each time the seed data provided by the candidate object is received; wherein, the random seed The initial value of is the preset initial value or the first seed data provided by the candidate object.
可选的,所述智能合约用于在收到备选对象提供的所有种子数据后,对所有种子数据进行拼接,并按照预设算法对所述随机种子的初始取值实施与拼接后数据相关的更新处理;其中,所述随机种子的初始取值为预设初始值。Optionally, the smart contract is used to splice all the seed data after receiving all the seed data provided by the candidate object, and implement the initial value of the random seed according to a preset algorithm to be related to the spliced data Update processing; wherein, the initial value of the random seed is a preset initial value.
可选的,所述预设初始值包括下述任一:实施赋值操作时的时间戳、区块链中的历史区块的哈希值、区块链中的历史区块中的指定交易的哈希值。Optionally, the preset initial value includes any of the following: the time stamp when the assignment operation is performed, the hash value of the historical block in the blockchain, the specified transaction in the historical block in the blockchain Hash value.
可选的,所述随机种子的取值还与所述种子数据的接收时间戳相关。Optionally, the value of the random seed is also related to the reception timestamp of the seed data.
可选的,还包括:Optional, also includes:
提供单元52,向所述备选对象提供所述智能合约支持的多个备选的伪随机数发生器,以由所述备选用户进行选择。The providing unit 52 provides multiple candidate pseudo-random number generators supported by the smart contract to the candidate object for selection by the candidate user.
可选的,所述智能合约还用于:将所述种子数据和/或所述随机种子存证于区块链中。Optionally, the smart contract is also used to: deposit the seed data and / or the random seed in the blockchain.
可选的,所述智能合约还用于:将所述伪随机数存证于区块链中。Optionally, the smart contract is also used to: deposit the pseudo-random number in the blockchain.
可选的,所述智能合约还用于:对任一对象的资格注册信息进行验证,并在验证通过后将所述任一对象的资格信息存证于区块链中,以使所述任一对象成为所述备选对象;其中,所述资格注册信息包括所述任一对象的公钥,且所述资格注册信息由所述任一对象的私钥进行签名。Optionally, the smart contract is also used to verify the qualification registration information of any object, and after the verification is passed, the qualification information of the any object is stored in the blockchain to enable the task An object becomes the candidate object; wherein, the qualification registration information includes the public key of the any object, and the qualification registration information is signed by the private key of the any object.
可选的,所述种子数据由所述备选对象通过私钥进行签名;所述智能合约还用于:对收到的种子数据进行签名验证。Optionally, the seed data is signed by the candidate object through a private key; the smart contract is also used to: perform signature verification on the received seed data.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现, 或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The system, device, module or unit explained in the above embodiments may be specifically implemented by a computer chip or entity, or implemented by a product with a certain function. A typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or any combination of these devices.
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computer includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory, random access memory (RAM) and / or non-volatile memory in computer-readable media, such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including permanent and non-permanent, removable and non-removable media, can store information by any method or technology. The information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic cassette tapes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements not only includes those elements, but also includes Other elements not explicitly listed, or include elements inherent to such processes, methods, goods, or equipment. Without more restrictions, the element defined by the sentence "include one ..." does not exclude that there are other identical elements in the process, method, commodity, or equipment that includes the element.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order shown or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非 旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only, and is not intended to limit one or more embodiments of this specification. The singular forms "a", "said" and "the" used in one or more embodiments of the present specification and the appended claims are also intended to include the majority forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more associated listed items.
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although one or more embodiments in this specification may use the terms first, second, third, etc. to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to a determination".
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。The above are only preferred embodiments of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. Anything within the spirit and principle of one or more embodiments of this specification, Any modifications, equivalent replacements, improvements, etc., should be included within the scope of protection of one or more embodiments of this specification.

Claims (21)

  1. 一种对象选取方法,应用于区块链节点;所述方法包括:An object selection method applied to blockchain nodes; the method includes:
    调用用于选取对象的智能合约,所述智能合约用于根据备选对象提供的种子数据生成随机种子,并通过伪随机数发生器生成基于所述随机种子的伪随机数,以使得匹配于所述伪随机数的备选对象被选取为目标对象。Invoke a smart contract for selecting an object. The smart contract is used to generate a random seed based on the seed data provided by the candidate object, and generate a pseudo-random number based on the random seed through a pseudo-random number generator, so as to match The candidate object of the pseudo-random number is selected as the target object.
  2. 根据权利要求1所述的方法,所述智能合约用于在每次收到备选对象提供的种子数据后,按照预设算法对所述随机种子实施与所述种子数据相关的更新处理;其中,所述随机种子的初始取值为预设初始值或首个由备选对象提供的种子数据。The method according to claim 1, wherein the smart contract is used to perform update processing related to the seed data on the random seed according to a preset algorithm after receiving the seed data provided by the candidate object each time; The initial value of the random seed is a preset initial value or the first seed data provided by the candidate object.
  3. 根据权利要求1所述的方法,所述智能合约用于在收到备选对象提供的所有种子数据后,对所有种子数据进行拼接,并按照预设算法对所述随机种子的初始取值实施与拼接后数据相关的更新处理;其中,所述随机种子的初始取值为预设初始值。The method according to claim 1, the smart contract is used to splice all seed data after receiving all the seed data provided by the candidate object, and implement the initial value of the random seed according to a preset algorithm Update processing related to the data after splicing; wherein the initial value of the random seed is a preset initial value.
  4. 根据权利要求2或3所述的方法,所述预设初始值包括下述任一:实施赋值操作时的时间戳、区块链中的历史区块的哈希值、区块链中的历史区块中的指定交易的哈希值。The method according to claim 2 or 3, wherein the preset initial value includes any one of the following: a time stamp when performing an assignment operation, a hash value of a historical block in the blockchain, and a history in the blockchain The hash value of the specified transaction in the block.
  5. 根据权利要求1所述的方法,所述随机种子的取值还与所述种子数据的接收时间戳相关。The method according to claim 1, the value of the random seed is further related to a time stamp of reception of the seed data.
  6. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    向所述备选对象提供所述智能合约支持的多个备选的伪随机数发生器,以由所述备选用户进行选择。A plurality of candidate pseudo-random number generators supported by the smart contract are provided to the candidate object for selection by the candidate user.
  7. 根据权利要求1所述的方法,所述智能合约还用于:将所述种子数据和/或所述随机种子存证于区块链中。According to the method of claim 1, the smart contract is further used to: deposit the seed data and / or the random seed in a blockchain.
  8. 根据权利要求1所述的方法,所述智能合约还用于:将所述伪随机数存证于区块链中。According to the method of claim 1, the smart contract is further used to deposit the pseudo-random number in the blockchain.
  9. 根据权利要求1所述的方法,所述智能合约还用于:对任一对象的资格注册信息进行验证,并在验证通过后将所述任一对象的资格信息存证于区块链中,以使所述任一对象成为所述备选对象;其中,所述资格注册信息包括所述任一对象的公钥,且所述资格注册信息由所述任一对象的私钥进行签名。According to the method of claim 1, the smart contract is further used to verify the qualification registration information of any object, and store the qualification information of any object in the blockchain after the verification is passed, To make the any object become the candidate object; wherein the qualification registration information includes the public key of the any object, and the qualification registration information is signed by the private key of the any object.
  10. 根据权利要求9所述的方法,所述种子数据由所述备选对象通过私钥进行签名;所述智能合约还用于:对收到的种子数据进行签名验证。The method according to claim 9, wherein the seed data is signed by the candidate object through a private key; the smart contract is further used to: perform signature verification on the received seed data.
  11. 一种对象选取装置,应用于区块链节点;所述装置包括:An object selection device applied to blockchain nodes; the device includes:
    调用单元,调用用于选取对象的智能合约,所述智能合约用于根据备选对象提供的 种子数据生成随机种子,并通过伪随机数发生器生成基于所述随机种子的伪随机数,以使得匹配于所述伪随机数的备选对象被选取为目标对象。The calling unit calls a smart contract for selecting an object, and the smart contract is used to generate a random seed according to the seed data provided by the candidate object, and generate a pseudo-random number based on the random seed through a pseudo-random number generator, so that The candidate object matching the pseudo-random number is selected as the target object.
  12. 根据权利要求11所述的装置,所述智能合约用于在每次收到备选对象提供的种子数据后,按照预设算法对所述随机种子实施与所述种子数据相关的更新处理;其中,所述随机种子的初始取值为预设初始值或首个由备选对象提供的种子数据。The apparatus according to claim 11, wherein the smart contract is used to perform update processing related to the seed data on the random seed according to a preset algorithm after each time the seed data provided by the candidate object is received; The initial value of the random seed is a preset initial value or the first seed data provided by the candidate object.
  13. 根据权利要求11所述的装置,所述智能合约用于在收到备选对象提供的所有种子数据后,对所有种子数据进行拼接,并按照预设算法对所述随机种子的初始取值实施与拼接后数据相关的更新处理;其中,所述随机种子的初始取值为预设初始值。The apparatus according to claim 11, the smart contract is used to splice all seed data after receiving all the seed data provided by the candidate object, and implement the initial value of the random seed according to a preset algorithm Update processing related to the data after splicing; wherein the initial value of the random seed is a preset initial value.
  14. 根据权利要求12或13所述的装置,所述预设初始值包括下述任一:实施赋值操作时的时间戳、区块链中的历史区块的哈希值、区块链中的历史区块中的指定交易的哈希值。The device according to claim 12 or 13, the preset initial value includes any one of the following: a time stamp when performing an assignment operation, a hash value of a historical block in the blockchain, and a history in the blockchain The hash value of the specified transaction in the block.
  15. 根据权利要求11所述的装置,所述随机种子的取值还与所述种子数据的接收时间戳相关。The apparatus according to claim 11, the value of the random seed is further related to a reception time stamp of the seed data.
  16. 根据权利要求11所述的装置,还包括:The apparatus according to claim 11, further comprising:
    提供单元,向所述备选对象提供所述智能合约支持的多个备选的伪随机数发生器,以由所述备选用户进行选择。The providing unit provides multiple candidate pseudo-random number generators supported by the smart contract to the candidate object for selection by the candidate user.
  17. 根据权利要求11所述的装置,所述智能合约还用于:将所述种子数据和/或所述随机种子存证于区块链中。The apparatus according to claim 11, the smart contract is further used to: deposit the seed data and / or the random seed in a blockchain.
  18. 根据权利要求11所述的装置,所述智能合约还用于:将所述伪随机数存证于区块链中。According to the apparatus of claim 11, the smart contract is further used to store the pseudo-random number in the blockchain.
  19. 根据权利要求11所述的装置,所述智能合约还用于:对任一对象的资格注册信息进行验证,并在验证通过后将所述任一对象的资格信息存证于区块链中,以使所述任一对象成为所述备选对象;其中,所述资格注册信息包括所述任一对象的公钥,且所述资格注册信息由所述任一对象的私钥进行签名。According to the apparatus of claim 11, the smart contract is further used to verify the qualification registration information of any object, and store the qualification information of the any object in the blockchain after the verification is passed, To make the any object become the candidate object; wherein the qualification registration information includes the public key of the any object, and the qualification registration information is signed by the private key of the any object.
  20. 根据权利要求19所述的装置,所述种子数据由所述备选对象通过私钥进行签名;所述智能合约还用于:对收到的种子数据进行签名验证。The apparatus according to claim 19, the seed data is signed by the candidate object through a private key; the smart contract is further used to: perform signature verification on the received seed data.
  21. 一种电子设备,包括:An electronic device, including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-10中任一项所述的方法。Wherein, the processor executes the executable instruction to implement the method according to any one of claims 1-10.
PCT/CN2019/101681 2018-10-25 2019-08-21 Object selection method and device and electronic device WO2020082873A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811249392.X 2018-10-25
CN201811249392.XA CN109615370A (en) 2018-10-25 2018-10-25 Object select method and device, electronic equipment

Publications (1)

Publication Number Publication Date
WO2020082873A1 true WO2020082873A1 (en) 2020-04-30

Family

ID=66002979

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/101681 WO2020082873A1 (en) 2018-10-25 2019-08-21 Object selection method and device and electronic device

Country Status (3)

Country Link
CN (1) CN109615370A (en)
TW (1) TW202016827A (en)
WO (1) WO2020082873A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2597955A (en) * 2020-08-11 2022-02-16 Nchain Holdings Ltd Pseudo-ramdom selection on the blockchain

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109615370A (en) * 2018-10-25 2019-04-12 阿里巴巴集团控股有限公司 Object select method and device, electronic equipment
CN109584432B (en) * 2018-10-26 2020-06-30 阿里巴巴集团控股有限公司 Object selection method and device and electronic equipment
CN110460435B (en) * 2019-07-01 2021-01-01 创新先进技术有限公司 Data interaction method and device, server and electronic equipment
US10735189B2 (en) 2019-07-01 2020-08-04 Alibaba Group Holding Limited Data exchange for multi-party computation
CN110572477A (en) * 2019-09-26 2019-12-13 腾讯科技(深圳)有限公司 Priority evaluation method and related equipment thereof
CN112653652B (en) * 2019-10-11 2022-06-14 中移物联网有限公司 Streaming media transmission method, device, terminal and computer-readable storage medium
CN110910559B (en) * 2019-11-25 2021-06-25 杭州趣链科技有限公司 Lottery drawing method based on block chain
CN111708762B (en) * 2020-06-18 2023-09-01 北京金山云网络技术有限公司 Authority authentication method and device and server device
CN112131307B (en) * 2020-07-15 2021-05-25 北京天德科技有限公司 Novel multi-block chain and multi-intelligent contract interaction architecture
CN112131587B (en) * 2020-09-21 2024-07-12 杭州云象网络技术有限公司 Intelligent contract pseudo-random number security inspection method, system, medium and device
CN112751846B (en) * 2020-12-28 2022-09-06 杭州趣链科技有限公司 Block chain-based electronic game random reward control method, device and equipment
CN116710890A (en) * 2021-03-26 2023-09-05 华为技术有限公司 Random number generation device and generation method, random number generation system, and chip
CN115083062B (en) * 2022-07-22 2022-12-09 阿里健康科技(杭州)有限公司 Information processing method, information transmitting method, computer device, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107820690A (en) * 2017-08-21 2018-03-20 达闼科技成都有限公司 Information choosing method, device, electronic equipment and computer-readable recording medium
CN108170403A (en) * 2017-12-29 2018-06-15 北京欧链科技有限公司 Data screening method and apparatus
US20180267789A1 (en) * 2017-03-20 2018-09-20 Fujitsu Limited Updatable random functions
CN108648323A (en) * 2018-05-10 2018-10-12 广州市申迪计算机系统有限公司 Choosing method, device, computer equipment and the storage medium of target information
CN109615370A (en) * 2018-10-25 2019-04-12 阿里巴巴集团控股有限公司 Object select method and device, electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414918A (en) * 2007-10-17 2009-04-22 北京搜狐新媒体信息技术有限公司 Method, apparatus and system for on-line generating random data
CN107742352B (en) * 2017-09-20 2018-08-24 黄玉宇 Decentralization lot/queuing strategy and system based on block chain and intelligent contract
CN107862782B (en) * 2017-10-27 2020-11-13 贝壳找房(北京)科技有限公司 Lottery drawing method and device based on Ether house block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180267789A1 (en) * 2017-03-20 2018-09-20 Fujitsu Limited Updatable random functions
CN107820690A (en) * 2017-08-21 2018-03-20 达闼科技成都有限公司 Information choosing method, device, electronic equipment and computer-readable recording medium
CN108170403A (en) * 2017-12-29 2018-06-15 北京欧链科技有限公司 Data screening method and apparatus
CN108648323A (en) * 2018-05-10 2018-10-12 广州市申迪计算机系统有限公司 Choosing method, device, computer equipment and the storage medium of target information
CN109615370A (en) * 2018-10-25 2019-04-12 阿里巴巴集团控股有限公司 Object select method and device, electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2597955A (en) * 2020-08-11 2022-02-16 Nchain Holdings Ltd Pseudo-ramdom selection on the blockchain
WO2022033811A1 (en) * 2020-08-11 2022-02-17 Nchain Licensing Ag Pseudo-ramdom selection on the blockchain
US20230275770A1 (en) * 2020-08-11 2023-08-31 Nchain Licensing Ag Pseudo-random selection on the blockchain

Also Published As

Publication number Publication date
CN109615370A (en) 2019-04-12
TW202016827A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
WO2020082873A1 (en) Object selection method and device and electronic device
WO2020082883A1 (en) Object selection method and device and electronic device
TWI736809B (en) Asset management method and device, electronic equipment
US20230281192A1 (en) Method of generating globally verifiable unique identifiers using a scalable interlinked blockchain structure
CN108898389B (en) Content verification method and device based on block chain and electronic equipment
TWI735820B (en) Asset management method and device, electronic equipment
CN110166442B (en) Data processing method and device based on block chain
TWI759563B (en) Asset management method and device, electronic equipment
TWI724389B (en) Credit evaluation method and device, electronic equipment
CN108335206B (en) Asset management method and device and electronic equipment
US11669832B2 (en) Blockchain-implemented method and system for access control on remote internet-enabled resources
TWI709055B (en) Equity distribution method and device, electronic equipment
TW202022857A (en) Invoice creating method and device based on block chain and electronic device
TW202022754A (en) Invoice creating method and device based on block chain and electronic equipment
EP3533174A1 (en) Method and system for directing an exchange associated with an anonymously held token on a blockchain
CN111383114A (en) Asset information management method and device based on block chain
CN110490776A (en) A kind of study authentication method, device and electronic equipment based on block chain
TW202014926A (en) Blockchain-based data processing method and apparatus, and electronic device
CN111294379A (en) Block chain network service platform, authority hosting method thereof and storage medium
CN111709860A (en) Homote advice processing method, device, equipment and storage medium
WO2020019799A1 (en) Object selection method and device and electronic device
CN113221191B (en) Block chain-based data evidence storage method, device, equipment and storage medium
TW202008229A (en) Event prediction method and apparatus, and electronic device
Xie et al. Simulation-based blockchain design to secure biopharmaceutical supply chain
CN110033367A (en) Based on the contract record method and device of block chain, electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19874988

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19874988

Country of ref document: EP

Kind code of ref document: A1