WO2020019799A1 - 对象选取方法及装置、电子设备 - Google Patents

对象选取方法及装置、电子设备 Download PDF

Info

Publication number
WO2020019799A1
WO2020019799A1 PCT/CN2019/084665 CN2019084665W WO2020019799A1 WO 2020019799 A1 WO2020019799 A1 WO 2020019799A1 CN 2019084665 W CN2019084665 W CN 2019084665W WO 2020019799 A1 WO2020019799 A1 WO 2020019799A1
Authority
WO
WIPO (PCT)
Prior art keywords
smart contract
preset
blockchain
candidate
identification information
Prior art date
Application number
PCT/CN2019/084665
Other languages
English (en)
French (fr)
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 WO2020019799A1 publication Critical patent/WO2020019799A1/zh

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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • One or more embodiments of the present specification relate to the field of blockchain technology, and particularly to a method and device for selecting an object, and an electronic device.
  • the preset number of objects may be randomly selected from the candidate objects. For example, when the system contains 10 devices, if you want to configure the 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. .
  • one or more embodiments of the present specification provide a method and an apparatus for selecting an object, and an electronic device.
  • an object selection method is proposed and applied to a blockchain node; the method includes:
  • the smart contract is used to read the identification information of the candidate object, and randomly arrange the identification information of the candidate object to make the candidate conform to the preset sorting rule The object is selected as the target object.
  • an object selection device is proposed and applied to a blockchain node; the device includes:
  • a determination unit which determines that the identification information of the candidate object is released to the blockchain
  • An invoking unit invokes a smart contract for selecting an object, where the smart contract is used to read identification information of the candidate object and randomly arrange the identification information of the candidate object so as to comply with a preset sorting rule Is selected as the target object.
  • an electronic device including:
  • Memory for storing processor-executable instructions
  • the processor implements the object selection method according to any one of the foregoing embodiments through the executable instructions.
  • FIG. 1 is a flowchart of a method for selecting an object according to an exemplary embodiment.
  • FIG. 2 is a schematic diagram of a lottery purchase real estate provided by an exemplary embodiment.
  • FIG. 3 is a schematic diagram of a smart contract-based lottery process provided by an exemplary embodiment.
  • FIG. 4 is a schematic structural diagram of a device according to an exemplary embodiment.
  • FIG. 5 is a block diagram of an object selection apparatus according to an exemplary embodiment.
  • the steps of the corresponding method are not necessarily performed in the order shown and described in this specification.
  • the method may include more or fewer steps than described in this specification.
  • a single step described in this specification may be divided into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for other embodiments. description.
  • FIG. 1 is a flowchart of a method for selecting an object according to an exemplary embodiment. As shown in Figure 1, the method is applied to a blockchain node and can include the following steps:
  • step 102 it is determined that the identification information of the candidate object is released to the blockchain.
  • the transaction can be used to publish the identification information of the candidate object to the blockchain, becoming one of the distributed databases of the blockchain. Data.
  • a narrow transaction refers to a value transfer issued by a user to the blockchain; for example, in a traditional Bitcoin blockchain network, a transaction can be a transfer initiated by a user in the blockchain.
  • the generalized transaction refers to a piece of business data with business intent issued by the user to the blockchain; for example, an operator can build an alliance chain based on actual business needs and rely on the alliance chain to deploy other types that are not related to value transfer Online business (for example, object selection business, renting business, vehicle scheduling business, insurance claims business, credit service, medical service, etc.), and in this type of alliance chain, the transaction can be a transaction issued by the user in the alliance chain.
  • Business message or business request for business intent. Transactions in this description should be interpreted as transactions in a broad sense.
  • the blockchain since the blockchain uses a distributed database, the identification information of candidate objects posted to the blockchain cannot be tampered with, and the prediction result can be ensured to be true and reliable.
  • the identification information of the candidate object may be issued to the blockchain by the above-mentioned blockchain node.
  • the identification information of the candidate object may be published to the blockchain by other blockchain nodes different from the above-mentioned blockchain node, and the above-mentioned blockchain node may learn that it is related to the identification information of the candidate object Can also record the identification information of the candidate object (or the hash value of the identification information of the candidate object) in a local database (ie, the blockchain ledger) maintained by the blockchain node.
  • the number of candidate objects is multiple, and the foregoing “identification information of candidate objects” should be understood as a set of identification information that includes all identification information corresponding to all candidate objects.
  • the candidate object may include any type of object, which depends on the applied scenario, and this specification does not limit this.
  • the candidate object when dispatching a calling task to a taxi, the candidate object may be a taxi license plate number, which is used to randomly assign a taxi to each calling task; for example, in the configuration of a device system composed of multiple electronic devices
  • the candidate object may be a device ID, which is used to select a specified number of electronic devices as the master device.
  • Step 104 Invoke a smart contract for selecting an object, where the smart contract is used to read the identification information of the candidate object and randomly arrange the identification information of the candidate object so as to comply with a preset sorting rule Is selected as the target object.
  • processing logic for randomly arranging identification information can be written in advance in the smart contract, so that the smart contract can automatically achieve random permutation based on the read identification information of the candidate object.
  • the processing logic on the smart contract is public content, and the entire processing process is automatically completed by the smart contract, there is no manual intervention, so that the result of the arrangement of the identification information of the candidate objects can ensure objectivity and fairness.
  • a preset ordering rule can be written into the smart contract in advance, so that the smart contract can automatically implement the selection of the target object based on the preset ordering rule.
  • the preset sorting rules on smart contracts are public content, and the entire processing process is automatically completed by smart contracts, there is no manual intervention, so that the selection result of the target object can ensure objectivity and fairness.
  • a transaction may be issued to the blockchain to call the smart contract; wherein the transaction includes the preset ordering rule so that the smart contract is based on the pre- Set a sorting rule to select the target object.
  • preset sorting rules in transactions, you can control the sorting rules used by smart contracts, so that they can adapt to the sorting requirements in different application scenarios and select the desired target objects.
  • a default preset ordering rule can be written into the smart contract in advance; when the preset ordering rule is not included in the transaction, the smart contract can select a target object based on the default preset ordering rule; When a certain sorting rule is included, the smart contract can select the target object according to the preset sorting rule included in the transaction.
  • the smart contract is further configured to publish an arrangement result of the identification information of the candidate object to the blockchain, so that the ranking result is in a public state, and it is convenient to be viewed and inspected by all parties. .
  • the candidate objects that meet the preset sorting rule may include: a preset number of candidate objects arranged earlier; for example, when the preset number is 100, the preset sorting rule is equivalent to selecting a random For the first 100 candidate objects after sorting, when the preset number is 3, the preset sorting rule is equivalent to selecting the first 3 candidate objects after random sorting.
  • a preset number of candidate objects arranged earlier; for example, when the preset number is 100, the preset sorting rule is equivalent to selecting a random For the first 100 candidate objects after sorting, when the preset number is 3, the preset sorting rule is equivalent to selecting the first 3 candidate objects after random sorting.
  • a preset number of any other value is also possible to set. The manual does not limit this.
  • alternative object matching the preset sorting rule actually means that the order of the identification information of the candidate object conforms to the preset sorting rule, for example, when the preset sorting rule is “select a randomly sorted "Top 100 candidate objects", if the order of identification information 1 of candidate object 1 is 50 and the order of identification information 2 of candidate object 2 is 123, candidate object 1 will be selected as the target object, Candidate 2 is not selected.
  • a preset sorting rule in any form may be set, such as selecting a candidate object with a random sorting order of 20 to 30, and then selecting a candidate object with a random sorting order that is a prime number, Another example is to select a random sorting order as a candidate for the solution of a preset formula, etc., which is not limited in this specification.
  • the smart contract further sends a notification message to an off-chain system, where the notification message includes information of the target object to instruct the off-chain system to assign a preset permission to the target object, so that The target object can perform related operations, while other candidate objects that have not been selected as target objects do not have the preset permissions and cannot perform related operations.
  • the off-chain system may include a vehicle license plate management system, and the preset authority includes the right to select a vehicle license plate, and the candidate object is a user who wishes to select a vehicle license plate; then, the target Objects can select vehicle license plates, while alternative objects that are not selected as target objects cannot select vehicle license plates, thereby achieving control over the number of vehicles.
  • the off-chain system includes a real estate management system
  • the preset authority includes the right to purchase real estate
  • the candidate object is a user who wishes to purchase a real estate in a certain building; then, When the number of candidate objects exceeds the total number of real estate of the real estate, a target object can be selected based on the total number of real estate, so that the target object can purchase real estate of the real estate, and the candidate objects not selected as the target object cannot be purchased. Real estate in this property.
  • FIG. 2 is a schematic diagram of a lottery purchase of real estate provided by an exemplary embodiment.
  • the user A can enter the lottery through the mobile phone 21 with the client installed
  • the required materials such as proof of identity, proof of deposit, etc., depend on the requirements of the real estate developer.
  • the user B wishes to participate in the lottery, he can input the materials required for the lottery through the mobile phone 22 with the client installed. The situation of other users will not be repeated here.
  • the device 23 is configured as the server end of the number-sharing system.
  • the device 23 interacts with the mobile phones 21-22 and the like used by the users A-B and the like, 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, the device 24 can implement a lottery operation by calling a smart contract.
  • FIG. 3 is a schematic diagram of a smart contract-based lottery process provided by an exemplary embodiment; as shown in FIG. 3, the process may include the following step:
  • step 302 the device 23 receives a registration request.
  • user A can upload a registration request to device 23 through mobile phone 21, and the registration request contains the materials required for the above-mentioned number; user B can upload a registration request to device 23 through mobile phone 22, and the registration request includes The required materials for the above-mentioned lottery.
  • other users may upload registration requests to the device 23 through the corresponding electronic devices, respectively.
  • step 304 the device 23 determines whether the user reporting the registration request has passed the verification.
  • the materials required for the lottery uploaded by the user need to be checked, including whether the materials are complete and whether the content of the materials meets the requirements.
  • the device 23 may perform a verification operation on the material.
  • the device 23 may send the materials required for the lottery uploaded by the user to the verifier, the verifier performs the verification operation on the material, and receives the verification result returned by the verifier.
  • Step 306 When the verification is passed, the device 23 generates a user number for the corresponding user.
  • the user can participate in the subsequent process of lottery based on the corresponding user number.
  • the device 23 may generate a user number for the corresponding user in the order in which the registration request is received, or the device 23 may assign a random user number different from other users to each user, or the device 23 may generate a user number by other means, This specification does not limit this.
  • step 308A the device 24 obtains a user number set and a lottery rule.
  • step 310A the device 24 issues a user number set and a lottery rule.
  • the device 24 may receive the user number set and the lottery rule uploaded by the device 23.
  • the user number set contains all the user numbers that need to participate in this lottery.
  • the lottery rule is used to indicate the selection method of the user number, for example, at least the number of users to be selected should be set based on the number of houses available for sale.
  • the device 24 can agree on the user number set and the lottery rule in the blockchain, so that the user number set and the lottery rule are published to the blockchain after the consensus is passed, so as to be recorded in the blockchain's distributed database, that is "Wind up.”
  • This specification does not limit the type of consensus algorithm used; for example, when the block chain where the device 24 is located is an alliance chain or a public chain, the device 24 may be based on algorithms such as PBFT (Practical Byzantine Fault Tolerance).
  • Other blockchain nodes initiate consensus, and after the consensus is passed, the user number set and lottery rules are published to the blockchain, so that it is recorded in the blockchain's distributed database; for example, when the device 24 is in When the blockchain is a public chain, the device 22 can compete with other blockchain nodes for bookkeeping rights based on the POW (Proof of Work, Proof of Work) algorithm, the POS (Proof of Stake, Proof of Stock) algorithm, or other algorithms, and The transaction data is entered into the corresponding block by the blockchain node that has obtained the right to book, and when the transaction containing the above user number set and lottery rule is recorded, the user number set and lottery rule can be recorded to the block Chain in a distributed database.
  • POW Proof of Work, Proof of Work
  • POS Proof of Stake, Proof of Stock
  • Step 308B the device 24 obtains user materials.
  • step 310B the device 24 stores the user material locally, and the hash value of the user material is chained.
  • the device 24 may further obtain user material corresponding to the user number contained in the user number set, and generate a hash value of the user material of each user. Then, by uploading the hash value of the user material, that is, publishing it to the blockchain, it is convenient for the regulatory body to verify the user material in the subsequent process, to avoid problems such as falsification of the user material, and to avoid the user material. Directly chain to prevent users' private information from being disclosed.
  • steps 308B-310B can be omitted.
  • Step 312 The smart contract randomly sorts the user numbers.
  • the user number set is recorded in a transaction on the blockchain, and the transaction can be marked as related to the lottery, so that the smart contract can find the transaction from the blockchain and obtain it User number collection.
  • the smart contract can obtain the user number set by scanning the transaction records of a specific address or the transaction records of a specific serial number.
  • the smart contract defines a function logic for randomly ordering user numbers in advance, so that the smart contract can randomly order the acquired user numbers based on the function logic. Since the smart contract is published on the blockchain, the functional logic defined in the smart contract is public data, thereby ensuring that the ranking results of the user numbers are objective and fair, and avoiding the black box operation caused by human intervention.
  • Step 314 The smart contract selects a user ID that meets the lottery rule.
  • the lottery rule is located in the same transaction as the user number set. After the smart contract finds a transaction containing the user number set, the smart contract can extract the lottery rule from the transaction. In another embodiment, the lottery rule and the user number set are located in different transactions, and the smart contract can find a transaction containing the lottery rule in a manner similar to finding a transaction containing the user number set for use in Randomly sort user numbers.
  • the smart contract may have a preset lottery rule built-in, and the user numbers may be randomly sorted based on the lottery rule, without the device 24 separately acquiring and publishing the lottery rule.
  • the smart contract can automatically select the user numbers that are ranked in the top 100 according to the order of each user number .
  • step 316 the smart contract returns a lottery result.
  • the smart contract may return the lottery result to the device 24, and the device 24 may further return the lottery result to the mobile phone 21-22, etc., so that the users A-B and the like can view it.
  • the smart contract may publish the random ordering result of the user number, the selected user number that conforms to the lottery rule, etc. to the blockchain to facilitate the inspection and verification of the lottery result.
  • FIG. 4 is a schematic structural diagram of a device according to an exemplary embodiment.
  • 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 on a logical level.
  • one or more embodiments of this specification do not exclude other implementations, such as a logic device or a combination of software and hardware, etc. That is to say, the execution body of the following processing flow is not limited to each A logic unit can also be a hardware or logic device.
  • the object selection device is applied to a blockchain node; the device may include:
  • the determining unit 51 determines that the identification information of the candidate object is released to the blockchain
  • the calling unit 52 calls a smart contract for selecting an object, where the smart contract is used to read the identification information of the candidate object and randomly arrange the identification information of the candidate object so as to conform to a preset ordering The candidate for the rule is selected as the target.
  • the calling unit 52 is specifically configured to:
  • the transaction includes the preset ordering rule, so that the smart contract selects the target object according to the preset ordering rule.
  • the smart contract is further configured to publish an arrangement result of the identification information of the candidate object on the blockchain.
  • the candidate objects that meet the preset sorting rule include: a preset number of candidate objects arranged earlier.
  • the smart contract further sends a notification message to an off-chain system, and the notification message includes information of the target object to instruct the off-chain system to assign a preset permission to the target object.
  • the off-chain system includes a vehicle license plate management system, and the preset authority includes a right to select a vehicle license plate;
  • the off-chain system includes a real estate management system
  • the preset authority includes an authority to purchase real estate.
  • the system, device, module, or unit described in the foregoing embodiments may be specifically implemented by a computer chip or entity, or 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 a combination of any of these devices.
  • a 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
  • Memory may include non-persistent 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 a computer-readable medium.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information can be stored by any method or technology.
  • Information may be computer-readable instructions, data structures, modules of a program, 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), and read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cartridges, 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.
  • computer-readable media does not include temporary computer-readable media, such as modulated data signals and carrier waves.
  • first, second, third, etc. may be used to describe various information in one or more embodiments of the present specification, 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
  • second information may also be referred to as first information.
  • word "if” as used herein can be interpreted as “at " or "when ! or "in response to a determination”.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本说明书一个或多个实施例提供一种对象选取方法及装置、电子设备,应用于区块链节点;所述方法包括:确定备选对象的标识信息被发布至区块链;调用用于选取对象的智能合约,所述智能合约用于读取所述备选对象的标识信息,并对所述备选对象的标识信息进行随机排列,以使得符合预设排序规则的备选对象被选取为目标对象。

Description

对象选取方法及装置、电子设备 技术领域
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种对象选取方法及装置、电子设备。
背景技术
当某一事件被设定为由预设数量的对象实施时,如果备选对象的数量超出该预设数量,则需要从这些备选对象中进行选择。当这些备选对象对于该事件的实施并无明显区别时,可以从这些备选对象中随机选取上述预设数量的对象。例如,当系统内包含10台设备时,如果希望配置为2台主设备、8台从设备的架构,可以从该10台设备中随机选取2台主设备,则剩余的8台设备为从设备。
发明内容
有鉴于此,本说明书一个或多个实施例提供一种对象选取方法及装置、电子设备。
为实现上述目的,本说明书一个或多个实施例提供技术方案如下:
根据本说明书一个或多个实施例的第一方面,提出了一种对象选取方法,应用于区块链节点;所述方法包括:
确定备选对象的标识信息被发布至区块链;
调用用于选取对象的智能合约,所述智能合约用于读取所述备选对象的标识信息,并对所述备选对象的标识信息进行随机排列,以使得符合预设排序规则的备选对象被选取为目标对象。
根据本说明书一个或多个实施例的第二方面,提出了一种对象选取装置,应用于区块链节点;所述装置包括:
确定单元,确定备选对象的标识信息被发布至区块链;
调用单元,调用用于选取对象的智能合约,所述智能合约用于读取所述备选对象的标识信息,并对所述备选对象的标识信息进行随机排列,以使得符合预设排序规则的备选对象被选取为目标对象。
根据本说明书一个或多个实施例的第三方面,提出了一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器通过所述可执行指令实现如上述实施例中任一所述的对象选取方法。
附图说明
图1是一示例性实施例提供的一种对象选取方法的流程图。
图2是一示例性实施例提供的一种摇号选购不动产的示意图。
图3是一示例性实施例提供的一种基于智能合约的摇号过程的示意图。
图4是一示例性实施例提供的一种设备的结构示意图。
图5是一示例性实施例提供的一种对象选取装置的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。
图1是一示例性实施例提供的一种对象选取方法的流程图。如图1所示,该方法应用于区块链节点,可以包括以下步骤:
步骤102,确定备选对象的标识信息被发布至区块链。
在一实施例中,通过在区块链的客户端上创建交易(transfer),可以通过该交易将 备选对象的标识信息发布至区块链上,成为区块链的分布式数据库中的一笔数据。
需要指出的是:区块链中的交易,存在狭义的交易以及广义的交易之分。狭义的交易是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易可以是用户在区块链中发起的一笔转账。而广义的交易是指用户向区块链发布的一笔具有业务意图的业务数据;例如,运营方可以基于实际的业务需求搭建一个联盟链,依托于联盟链部署一些与价值转移无关的其它类型的在线业务(比如,对象选取业务、租房业务、车辆调度业务、保险理赔业务、信用服务、医疗服务等),而在这类联盟链中,交易可以是用户在联盟链中发布的一笔具有业务意图的业务消息或者业务请求。本说明书中的交易,应当倾向于理解为广义上的交易。
在一实施例中,由于区块链采用分布式数据库,使得发布至区块链上的备选对象的标识信息无法被篡改,可以确保预测结果真实、可靠。
在一实施例中,备选对象的标识信息可由上述的区块链节点向区块链发布。在另一实施例中,备选对象的标识信息可由区别于上述区块链节点的其他区块链节点向区块链发布,而上述区块链节点可以获知与该备选对象的标识信息相关的信息,还可以将该备选对象的标识信息(或该备选对象的标识信息的哈希值)记录在该区块链节点维护的本地数据库(即区块链账本)中。
在一实施例中,备选对象的数量为多个,上述“备选对象的标识信息”应当理解为一标识信息集合,该标识信息集合包含了所有备选对象分别对应的所有标识信息。
在一实施例中,备选对象可以包括任意类型的对象,这取决于所应用的场景,本说明书并不对此进行限制。例如,在向出租车派发叫车任务时,备选对象可以为出租车牌照号,用于为每一叫车任务随机指派一辆出租车;再例如,在配置多台电子设备构成的设备系统时,备选对象可以为设备ID,用于选取指定数量的电子设备以作为主设备。
步骤104,调用用于选取对象的智能合约,所述智能合约用于读取所述备选对象的标识信息,并对所述备选对象的标识信息进行随机排列,以使得符合预设排序规则的备选对象被选取为目标对象。
在一实施例中,智能合约中可以预先写入对标识信息进行随机排列的处理逻辑,使得该智能合约可以基于读取的备选对象的标识信息自动实现随机排列。其中,由于智能合约上的处理逻辑为公开内容,并且整个处理过程由智能合约自动完成、不存在人工干预,使得对备选对象的标识信息的排列结果能够确保客观、公正。
在一实施例中,智能合约中可以预先写入预设排序规则,使得该智能合约可以基于该预设排序规则自动实现对目标对象的选取。其中,由于智能合约上的预设排序规则为公开内容,并且整个处理过程由智能合约自动完成、不存在人工干预,使得对目标对象的选取结果能够确保客观、公正。
在一实施例中,可以向所述区块链中发布交易,以对所述智能合约进行调用;其中,所述交易中包含所述预设排序规则,以使所述智能合约根据所述预设排序规则选取所述目标对象。换言之,通过在交易中包含预设排序规则,可以控制智能合约采用的排序规则,使其能够适应不同的应用场景下的排序需求,选取所需的目标对象。
在一实施例中,智能合约中可以预先写入默认的预设排序规则;当交易中未包含预设排序规则时,智能合约可以基于该默认的预设排序规则选取目标对象;而当交易中包含某一预设排序规则时,智能合约可以根据交易中包含的预设排序规则选取目标对象。
在一实施例中,所述智能合约还用于将所述备选对象的标识信息的排列结果发布至所述区块链上,使得该排序结果处于公开状态,便于接受各方的查看与检验。
在一实施例中,所述符合预设排序规则的备选对象可以包括:排列在先的预设数量的备选对象;譬如当该预设数量为100时,预设排序规则相当于选取随机排序后的前100个备选对象,当该预设数量为3时,预设排序规则相当于选取随机排序后的前3个备选对象,当然还可以设置其他任意数值的预设数量,本说明书并不对此进行限制。容易理解的是,“符合预设排序规则的备选对象”实际上是指该备选对象的标识信息的排列顺序符合该预设排序规则,譬如当预设排序规则为“选取随机排序后的前100个备选对象”时,若备选对象1的标识信息1的排列顺序为50、备选对象2的标识信息2的排列顺序为123,则备选对象1会被选取为目标对象、备选对象2不会被选取。在其他实施例中,还可以设置任意形式的预设排序规则,譬如选取随机排序后的排列顺序为20~30的备选对象,再譬如选取随机排序后的排列顺序为质数的备选对象,又譬如选取随机排序后的排列顺序为预设算式的解的备选对象等,本说明书并不对此进行限制。
在一实施例中,所述智能合约还向链外系统发送通知消息,所述通知消息包含所述目标对象的信息,以指示所述链外系统向所述目标对象赋予预设权限,使得该目标对象可以实施相关操作,而其他未被选取为目标对象的备选对象则不具有该预设权限、无法实施相关操作。
例如,对于需要控制车辆数量的地区,所述链外系统可以包括车辆牌照管理系统, 而所述预设权限包括对车辆牌照的选取权限,备选对象为希望选取车辆牌照的用户;那么,目标对象可以选取车辆牌照,而未被选取为目标对象的备选对象则无法选取车辆牌照,从而实现对车辆数量的控制。又例如,对于需要摇号买房的地区,所述链外系统包括不动产管理系统,所述预设权限包括对不动产的选购权限,备选对象为希望选购某一楼盘的不动产的用户;那么,当备选对象的数量超出该楼盘的不动产总数时,可以基于该不动产总数选取目标对象,使得该目标对象可以选购该楼盘的不动产,而未被选取为目标对象的备选对象则无法选购该楼盘的不动产。
为了便于理解,下面以选购不动产时的摇号过程为例,对本说明书的对象选取方案进行描述。图2是一示例性实施例提供的一种摇号选购不动产的示意图;如图2所示,假定用户A希望参与针对某一楼盘的摇号,该用户A可以通过安装有客户端的手机21输入摇号所需的材料,比如身份证明材料、存款证明材料等,这取决于楼盘开发商的要求。类似地,如果用户B希望参与摇号,可以通过安装有客户端的手机22输入摇号所需的材料,其他用户的情况此处不再一一赘述。
设备23被配置为摇号系统的服务端,该设备23一方面与用户A-B等使用的手机21-22等进行交互,另一方面与设备24进行交互。设备24被配置为区块链中的一个区块链节点,基于设备23所提供的信息,设备24可以通过调用智能合约实现摇号操作。下面结合图3对设备23-24实施的摇号过程进行描述;其中,图3是一示例性实施例提供的一种基于智能合约的摇号过程的示意图;如图3所示,该过程可以包括以下步骤:
步骤302,设备23接收报名请求。
在一实施例中,用户A可以通过手机21向设备23上传报名请求,该报名请求中包含上述的摇号所需的材料;用户B可以通过手机22向设备23上传报名请求,该报名请求中包含上述的摇号所需的材料。类似地,其他用户可以分别通过相应的电子设备向设备23上传报名请求。
步骤304,设备23确定上报报名请求的用户是否已通过核验。
在一实施例中,需要对用户上传的摇号所需的材料进行核验,包括材料是否齐全、材料内容是否符合要求等。
在一实施例中,设备23可以实施针对材料的核验操作。在另一实施例中,设备23可以将用户上传的摇号所需的材料发送至核验方,由核验方实施针对材料的核验操作,并接收核验方返回的核验结果。
步骤306,当确认通过核验时,设备23为相应的用户生成用户编号。
在一实施例中,通过为用户生成用户编号,使得该用户可以基于相应的用户编号参与到后续的摇号过程中。例如,设备23可以按照收到报名请求的顺序为相应的用户生成用户编号,或者设备23可以向每一用户分配与其他用户不同的随机的用户编号,或者设备23可以通过其他方式生成用户编号,本说明书并不对此进行限制。
步骤308A,设备24获取用户编号集合、摇号规则。
步骤310A,设备24发布用户编号集合、摇号规则。
在一实施例中,设备24可以接收设备23上传的用户编号集合和摇号规则。用户编号集合包含所有需要参与本次摇号的用户编号。摇号规则用于指示对用户编号的选择方式,比如至少应当基于可售房屋的数量而设定需要选取的用户数量。设备24可以在区块链中对用户编号集合和摇号规则进行共识,使得该用户编号集合和摇号规则在通过共识后被发布至区块链,以记录至区块链的分布式数据库中,即“上链”。本说明书并不限定采用的共识算法的类型;例如,当设备24所处的区块链为联盟链或公有链时,该设备24可以基于诸如PBFT(Practical Byzantine Fault Tolerance,实用拜占庭容错)算法向其他区块链节点发起共识,并在通过共识后将该用户编号集合和摇号规则发布至区块链,使其被记录至区块链的分布式数据库中;再例如,当设备24所处的区块链为公有链时,该设备22可以与其他区块链节点基于POW(Proof of Work,工作量证明)算法、POS(Proof of Stake,股权证明)算法或其他算法竞争记账权,并由获得记账权的区块链节点向相应区块内记入交易数据,而当包含上述用户编号集合和摇号规则的交易被记入时,该用户编号集合和摇号规则可以被记录至区块链的分布式数据库中。
步骤308B,设备24获取用户材料。
步骤310B,设备24在本地存储用户材料,并将用户材料的哈希值上链。
在一实施例中,针对获取的用户编号集合,设备24可以进一步获取该用户编号集合中所含用户编号对应的用户材料,并生成每一用户的用户材料的哈希值。然后,通过将用户材料的哈希值上链,即发布至区块链中,便于在后续过程中由监管部门等对用户材料进行核查、避免用户材料出现弄虚作假等问题,而且可以避免将用户材料直接上链、防止用户的隐私信息被公开。
在一实施例中,可以省去步骤308B-310B。
步骤312,智能合约对用户编号进行随机排序。
在一实施例中,用户编号集合被记录于区块链上的某一交易中,该交易可以被标记为与摇号相关,使得智能合约可以据此从区块链中查找到该交易,并获取用户编号集合。例如,智能合约可以通过扫描特定地址的交易记录或者特定流水号的交易记录,即可获得该用户编号集合。
在一实施例中,智能合约中预先定义了对用户编号进行随机排序的功能逻辑,使得智能合约可以基于该功能逻辑对获取的用户编号进行随机排序。由于智能合约被发布于区块链上,使得智能合约中定义的功能逻辑为公开数据,从而确保对于用户编号的排序结果客观、公平,避免人为干预造成的暗箱操作等情况。
步骤314,智能合约选取符合摇号规则的用户编号。
在一实施例中,摇号规则与用户编号集合位于同一交易中,智能合约在查找到包含该用户编号集合的交易后,可以从该交易中提取摇号规则。在另一实施例中,摇号规则与用户编号集合分别位于不同的交易中,智能合约可以通过类似于查找到包含该用户编号集合的交易的方式,查找到包含该摇号规则的交易,以用于对用户编号进行随机排序。
在其他实施例中,智能合约可以内置有预先设定的摇号规则,可以基于该摇号规则对用户编号进行随机排序,而无需设备24单独获取和发布摇号规则。
在一实施例中,当摇号规则为选取排列在前100名的用户编号时,针对随机排序后的用户编号,智能合约可以根据各个用户编号的排列顺序而自动选取排列在前100名的用户编号。
步骤316,智能合约返回摇号结果。
在一实施例中,智能合约可以将摇号结果返回至设备24,而设备24可以将该摇号结果进一步返回至手机21-22等,以便于用户A-B等进行查看。
在一实施例中,智能合约可以将用户编号的随机排序结果、选取的符合摇号规则的用户编号等发布至区块链上,以便于针对摇号结果进行检验、核查。
图4是一示例性实施例提供的一种设备的示意结构图。请参考图4,在硬件层面,该设备包括处理器402、内部总线404、网络接口406、内存408以及非易失性存储器410,当然还可能包括其他业务所需要的硬件。处理器402从非易失性存储器410中读取对应的计算机程序到内存408中然后运行,在逻辑层面上形成对象选取装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻 辑单元,也可以是硬件或逻辑器件。
请参考图5,在软件实施方式中,该对象选取装置应用于区块链节点;该装置可以包括:
确定单元51,确定备选对象的标识信息被发布至区块链;
调用单元52,调用用于选取对象的智能合约,所述智能合约用于读取所述备选对象的标识信息,并对所述备选对象的标识信息进行随机排列,以使得符合预设排序规则的备选对象被选取为目标对象。
可选的,所述调用单元52具体用于:
向所述区块链中发布交易,以对所述智能合约进行调用;
其中,所述交易中包含所述预设排序规则,以使所述智能合约根据所述预设排序规则选取所述目标对象。
可选的,所述智能合约还用于将所述备选对象的标识信息的排列结果发布至所述区块链上。
可选的,所述符合预设排序规则的备选对象包括:排列在先的预设数量的备选对象。
可选的,所述智能合约还向链外系统发送通知消息,所述通知消息包含所述目标对象的信息,以指示所述链外系统向所述目标对象赋予预设权限。
可选的,
所述链外系统包括车辆牌照管理系统,所述预设权限包括对车辆牌照的选取权限;
或者,所述链外系统包括不动产管理系统,所述预设权限包括对不动产的选购权限。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/ 或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用 的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。

Claims (13)

  1. 一种对象选取方法,应用于区块链节点;所述方法包括:
    确定备选对象的标识信息被发布至区块链;
    调用用于选取对象的智能合约,所述智能合约用于读取所述备选对象的标识信息,并对所述备选对象的标识信息进行随机排列,以使得符合预设排序规则的备选对象被选取为目标对象。
  2. 根据权利要求1所述的方法,所述调用用于选取对象的智能合约,包括:
    向所述区块链中发布交易,以对所述智能合约进行调用;
    其中,所述交易中包含所述预设排序规则,以使所述智能合约根据所述预设排序规则选取所述目标对象。
  3. 根据权利要求1所述的方法,所述智能合约还用于将所述备选对象的标识信息的排列结果发布至所述区块链上。
  4. 根据权利要求1所述的方法,所述符合预设排序规则的备选对象包括:排列在先的预设数量的备选对象。
  5. 根据权利要求1所述的方法,所述智能合约还向链外系统发送通知消息,所述通知消息包含所述目标对象的信息,以指示所述链外系统向所述目标对象赋予预设权限。
  6. 根据权利要求5所述的方法,
    所述链外系统包括车辆牌照管理系统,所述预设权限包括对车辆牌照的选取权限;
    或者,所述链外系统包括不动产管理系统,所述预设权限包括对不动产的选购权限。
  7. 一种对象选取装置,应用于区块链节点;所述装置包括:
    确定单元,确定备选对象的标识信息被发布至区块链;
    调用单元,调用用于选取对象的智能合约,所述智能合约用于读取所述备选对象的标识信息,并对所述备选对象的标识信息进行随机排列,以使得符合预设排序规则的备选对象被选取为目标对象。
  8. 根据权利要求7所述的装置,所述调用单元具体用于:
    向所述区块链中发布交易,以对所述智能合约进行调用;
    其中,所述交易中包含所述预设排序规则,以使所述智能合约根据所述预设排序规则选取所述目标对象。
  9. 根据权利要求7所述的装置,所述智能合约还用于将所述备选对象的标识信息的排列结果发布至所述区块链上。
  10. 根据权利要求7所述的装置,所述符合预设排序规则的备选对象包括:排列在 先的预设数量的备选对象。
  11. 根据权利要求7所述的装置,所述智能合约还向链外系统发送通知消息,所述通知消息包含所述目标对象的信息,以指示所述链外系统向所述目标对象赋予预设权限。
  12. 根据权利要求11所述的装置,
    所述链外系统包括车辆牌照管理系统,所述预设权限包括对车辆牌照的选取权限;
    或者,所述链外系统包括不动产管理系统,所述预设权限包括对不动产的选购权限。
  13. 一种电子设备,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器通过所述可执行指令实现如权利要求1-6中任一项所述的对象选取方法。
PCT/CN2019/084665 2018-07-27 2019-04-26 对象选取方法及装置、电子设备 WO2020019799A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810848406.3 2018-07-27
CN201810848406.3A CN109242677A (zh) 2018-07-27 2018-07-27 对象选取方法及装置、电子设备

Publications (1)

Publication Number Publication Date
WO2020019799A1 true WO2020019799A1 (zh) 2020-01-30

Family

ID=65073218

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/084665 WO2020019799A1 (zh) 2018-07-27 2019-04-26 对象选取方法及装置、电子设备

Country Status (3)

Country Link
CN (1) CN109242677A (zh)
TW (1) TW202008291A (zh)
WO (1) WO2020019799A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109242677A (zh) * 2018-07-27 2019-01-18 阿里巴巴集团控股有限公司 对象选取方法及装置、电子设备
CN109584432B (zh) * 2018-10-26 2020-06-30 阿里巴巴集团控股有限公司 对象选取方法及装置、电子设备
CN109918044B (zh) * 2019-02-26 2021-03-30 太原理工大学 一种基于区块链技术的抽签/排序方法
CN110164022B (zh) * 2019-06-13 2020-01-17 北京艾摩瑞策科技有限公司 一种在区块链上的随机摇号方法及其设备
CN112418856A (zh) * 2020-11-25 2021-02-26 政采云有限公司 一种摇号方法、装置、区块链、设备及计算机存储介质
CN113570479B (zh) * 2021-08-03 2023-12-12 贝壳找房(北京)科技有限公司 一种房产交易数据的区块链传输方法、系统及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107820690A (zh) * 2017-08-21 2018-03-20 达闼科技成都有限公司 信息选取方法、装置、电子设备及计算机可读存储介质
US20180165598A1 (en) * 2016-12-09 2018-06-14 Cognitive Scale, Inc. Method for Providing Financial-Related, Blockchain-Associated Cognitive Insights Using Blockchains
CN109242677A (zh) * 2018-07-27 2019-01-18 阿里巴巴集团控股有限公司 对象选取方法及装置、电子设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180165598A1 (en) * 2016-12-09 2018-06-14 Cognitive Scale, Inc. Method for Providing Financial-Related, Blockchain-Associated Cognitive Insights Using Blockchains
CN107820690A (zh) * 2017-08-21 2018-03-20 达闼科技成都有限公司 信息选取方法、装置、电子设备及计算机可读存储介质
CN109242677A (zh) * 2018-07-27 2019-01-18 阿里巴巴集团控股有限公司 对象选取方法及装置、电子设备

Also Published As

Publication number Publication date
TW202008291A (zh) 2020-02-16
CN109242677A (zh) 2019-01-18

Similar Documents

Publication Publication Date Title
WO2020019799A1 (zh) 对象选取方法及装置、电子设备
TWI762818B (zh) 基於區塊鏈的發票創建方法及裝置、電子設備
US11341490B2 (en) Carbon footprint blockchain network
AU2020200682B2 (en) Systems and methods of secure provenance for distributed transaction databases
TWI722586B (zh) 資料共享方法、裝置及系統、電子設備
TWI771618B (zh) 基於區塊鏈的作品版權分配方法和裝置
WO2020119286A1 (zh) 基于区块链的发票创建方法及装置、电子设备
US11030681B2 (en) Intermediate blockchain system for managing transactions
CN110166442B (zh) 一种基于区块链的数据处理方法和装置
CN111898139B (zh) 数据读写方法及装置、电子设备
WO2020082873A1 (zh) 对象选取方法及装置、电子设备
JP2020535543A (ja) コンプライアンス対応のトークン化及び資産価値の制御のための方法、装置、及びコンピュータ可読媒体
JP2019511059A (ja) リスク情報を出力し、リスク情報を構築するための方法及びデバイス
CN113111387A (zh) 基于区块链的金融资产多方共享交易元数据信息的方法、装置及系统
JP2020014193A (ja) 暗号学的に保護されたトークンベースの代替管理を行うためのコンピュータネットワークシステム、および当該システムを利用する方法
WO2020119293A1 (zh) 内容推送方法及装置、电子设备
TW202014926A (zh) 基於區塊鏈的資料處理方法及裝置、電子設備
TWI706664B (zh) 基於多個區塊鏈網路的資料存證方法及系統
WO2020019785A1 (zh) 事件预测方法及装置、电子设备
TW202025057A (zh) 欄位更新方法及裝置、電子設備
WO2020108052A1 (zh) 一种基于多个区块链网络的数据读取方法及系统
TW202016833A (zh) 認證方法及裝置、電子設備
WO2020108152A1 (zh) 身份数据的防误用方法及装置、电子设备
CN114331428A (zh) 一种非同质化通证分配方法及装置
TW202008230A (zh) 事件預測方法及裝置、電子設備

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: 19840502

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: 19840502

Country of ref document: EP

Kind code of ref document: A1