CN110474918B - Resource allocation verification method and related device - Google Patents

Resource allocation verification method and related device Download PDF

Info

Publication number
CN110474918B
CN110474918B CN201910780153.5A CN201910780153A CN110474918B CN 110474918 B CN110474918 B CN 110474918B CN 201910780153 A CN201910780153 A CN 201910780153A CN 110474918 B CN110474918 B CN 110474918B
Authority
CN
China
Prior art keywords
information
resource configuration
encrypted
ciphertext
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910780153.5A
Other languages
Chinese (zh)
Other versions
CN110474918A (en
Inventor
朱德飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910780153.5A priority Critical patent/CN110474918B/en
Publication of CN110474918A publication Critical patent/CN110474918A/en
Application granted granted Critical
Publication of CN110474918B publication Critical patent/CN110474918B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0207Discounts or incentives, e.g. coupons or rebates
    • G06Q30/0212Chance discounts or incentives
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Strategic Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Game Theory and Decision Science (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The application discloses a verification method and a related device for resource allocation, which are used for verifying a resource allocation result and are beneficial to improving the fairness of the resource allocation. The method comprises the following steps: acquiring information to be encrypted and resource configuration indication information; encrypting the information to be encrypted by adopting the check information to obtain ciphertext information; recording the ciphertext information and the resource allocation indication information to a block chain for synchronous storage, so that the client side can acquire the ciphertext information and the resource allocation indication information through the block chain; determining a resource configuration result according to the information to be encrypted and the resource configuration indication information; and sending the check information and the resource configuration result to the client so that the client generates target information according to the check information and the ciphertext information, determining a target configuration result according to the target information and the resource configuration indication information, and comparing the target configuration result with the resource configuration result to obtain a verification result.

Description

Resource allocation verification method and related device
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and a related apparatus for verifying resource allocation.
Background
Lottery, as a traditional marketing means, attracts consumers by offering lottery opportunities and providing prizes or awards after winning a prize. At present, more and more internet enterprises are also beginning to utilize lottery activities to attract users to participate, so as to increase users using their products and increase the attention of users. For example, a merchant in the e-commerce platform may attract consumer consumption by setting up a lottery.
Currently, the existing online lottery is mainly based on random numbers calculated by a program to determine whether a user wins a prize or gets a prize. However, since all lottery processes are executed by the background program, some users may perform a destruction operation on the background program by means of embedding code or downloading a malicious application program, and tamper with the random number calculated by the program, thereby changing the lottery result, and resulting in that the fairness of the lottery is destroyed.
Disclosure of Invention
The embodiment of the application provides a verification method and a related device for resource allocation, and the server records ciphertext information and resource allocation indication information to a block chain, so that a subsequent client can reversely deduce whether a received resource allocation result is tampered or not based on verification information, the ciphertext information stored in the block chain and the resource allocation indication information, and the ciphertext information and the resource allocation indication information stored in the block chain are difficult to be tampered, so that the verification of the resource allocation result can be effectively carried out, and the fairness of a scheme is favorably improved.
A first aspect of an embodiment of the present application provides a method for verifying resource allocation, including:
acquiring information to be encrypted and resource configuration indication information;
encrypting the information to be encrypted by adopting the check information to obtain ciphertext information;
recording the ciphertext information and the resource allocation indication information to a block chain for synchronous storage, so that the client side can acquire the ciphertext information and the resource allocation indication information through the block chain;
determining a resource configuration result according to the information to be encrypted and the resource configuration indication information;
and sending the check information and the resource configuration result to the client so that the client generates target information according to the check information and the ciphertext information, determining a target configuration result according to the target information and the resource configuration indication information, and comparing the target configuration result with the resource configuration result to obtain a verification result.
A second aspect of the present application provides a method for verifying resource allocation, including:
acquiring ciphertext information and resource allocation indication information through a block chain, wherein the block chain is acquired after the server stores the ciphertext information and the resource allocation indication information, and the ciphertext information is acquired after the server encrypts the information to be encrypted by adopting verification information;
receiving verification information and a resource configuration result sent by a server;
generating target information according to the check information and the ciphertext information;
determining a target configuration result according to the target information and the resource configuration indication information;
and comparing the target configuration result with the resource configuration result to obtain a verification result.
A third aspect of the present embodiment provides a device for verifying resource allocation, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring information to be encrypted and resource configuration indication information;
the encryption unit is used for encrypting the information to be encrypted by adopting the check information to obtain ciphertext information;
the storage unit is used for recording the ciphertext information and the resource allocation indication information to the block chain for synchronous storage, so that the client side can acquire the ciphertext information and the resource allocation indication information through the block chain;
the determining unit is used for determining a resource configuration result according to the information to be encrypted and the resource configuration indication information;
and the sending unit is used for sending the verification information and the resource configuration result to the client so that the client generates target information according to the verification information and the ciphertext information, determines a target configuration result according to the target information and the resource configuration indication information, and compares the target configuration result with the resource configuration result to obtain a verification result.
In one possible design, in one implementation of the third aspect of the embodiments of the present application,
the acquisition unit is further configured to acquire a first random number and resource configuration indication information, where the resource configuration indication information includes an interval set and a resource configuration information set, the interval set includes M intervals, the resource configuration information set includes M resource configuration information, M is an integer greater than 1, the intervals and the resource configuration information have a unique corresponding relationship, and the first random number is within a range of the M intervals;
the encryption unit is also used for encrypting the first random number by adopting the check information to obtain ciphertext information;
the determining unit is further used for determining a target interval according to the first random number, and the target interval belongs to the interval set;
and the determining unit is further used for determining a resource configuration result according to the target interval and the resource configuration set.
In one possible design, in an implementation manner of the third aspect of the embodiment of the present application, the apparatus further includes a generating unit;
the acquisition unit is further used for acquiring a random algorithm, a random seed and resource configuration indication information, wherein the resource configuration indication information comprises an interval set and a resource configuration information set, the interval set comprises M intervals, the resource configuration information set comprises M resource configuration information, and the intervals and the resource configuration information have unique corresponding relations;
the encryption unit is also used for encrypting the random algorithm and the random seeds by adopting the check information to obtain ciphertext information, and the ciphertext information comprises algorithm ciphertext information and seed ciphertext information;
the generating unit is used for generating a second random number according to a random algorithm and the random seed, and the second random number is in the range of the M intervals;
the determining unit is further used for determining a target interval according to the second random number, and the target interval belongs to the interval set;
and the determining unit is further used for determining a resource configuration result according to the target interval and the resource configuration set.
In one possible design, in one implementation of the third aspect of the embodiments of the present application,
the generating unit is also used for generating a random key;
the encryption unit is also used for encrypting the information to be encrypted by adopting a random key to obtain ciphertext information;
and the sending unit is also used for sending the random key and the resource configuration result to the client.
A fourth aspect of the present embodiment provides a device for verifying resource allocation, including:
the system comprises an acquisition unit, a processing unit and a resource allocation unit, wherein the acquisition unit is used for acquiring ciphertext information and resource allocation indication information through a block chain, the block chain is obtained after a server stores the ciphertext information and the resource allocation indication information, and the ciphertext information is obtained after the server encrypts information to be encrypted by adopting check information;
the receiving unit is used for receiving the verification information and the resource configuration result sent by the server;
the generating unit is used for generating target information according to the verification information and the ciphertext information;
the determining unit is used for determining a target configuration result according to the target information and the resource configuration indication information;
and the comparison unit is used for comparing the target configuration result with the resource configuration result to obtain a verification result.
In one possible design, in an implementation manner of the fourth aspect of the embodiment of the present application, the display unit further includes a display unit;
the receiving unit is also used for receiving the ciphertext display instruction and the configuration indication display instruction;
and the display unit is used for responding to the ciphertext display instruction and the configuration indication display instruction and displaying the ciphertext information and the resource configuration indication information through the interactive application interface.
In one possible design, in one implementation of the fourth aspect of the embodiments of the present application,
the receiving unit is also used for receiving an application starting instruction;
the receiving unit is also used for responding to the application starting instruction and receiving a resource configuration result sent by the server;
the receiving unit is also used for receiving a result checking instruction after receiving the resource configuration result;
and the receiving unit is also used for responding to the result checking instruction and receiving the random key sent by the server.
A fifth aspect of embodiments of the present application provides a server, including: a memory, a transceiver, a processor, and a bus system;
wherein, the memory is used for storing programs;
the processor is used for executing the program in the memory and comprises the following steps:
acquiring information to be encrypted and resource configuration indication information;
encrypting the information to be encrypted by adopting the check information to obtain ciphertext information;
recording the ciphertext information and the resource allocation indication information to a block chain for synchronous storage, so that the client side can acquire the ciphertext information and the resource allocation indication information through the block chain;
determining a resource configuration result according to the information to be encrypted and the resource configuration indication information;
sending the check information and the resource configuration result to the client so that the client generates target information according to the check information and the ciphertext information, determining a target configuration result according to the target information and the resource configuration indication information, and comparing the target configuration result with the resource configuration result to obtain a verification result;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
A sixth aspect of the embodiments of the present application provides a terminal device, including: a memory, a transceiver, a processor, and a bus system;
wherein, the memory is used for storing programs;
the processor is used for executing the program in the memory and comprises the following steps:
acquiring ciphertext information and resource allocation indication information through a block chain, wherein the block chain is acquired after the server stores the ciphertext information and the resource allocation indication information, and the ciphertext information is acquired after the server encrypts the information to be encrypted by adopting verification information;
receiving verification information and a resource configuration result sent by a server;
generating target information according to the check information and the ciphertext information;
determining a target configuration result according to the target information and the resource configuration indication information;
comparing the target configuration result with the resource configuration result to obtain a verification result;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
A seventh aspect of embodiments of the present application provides a computer-readable storage medium having stored therein instructions, which, when executed on a computer, cause the computer to perform the method of any of the above aspects.
An eighth aspect of embodiments of the present application provides a computer program product containing instructions which, when run on a computer or processor, cause the computer or processor to perform the method of any of the above aspects.
According to the technical scheme, the embodiment of the application has the following advantages:
the embodiment of the application provides a verification method and a related device for resource allocation, and the server records ciphertext information and resource allocation indication information to a block chain, so that a subsequent client can reversely deduce whether a received resource allocation result is tampered or not based on verification information, the ciphertext information stored in the block chain and the resource allocation indication information, and the ciphertext information and the resource allocation indication information stored in the block chain are difficult to be tampered, so that the verification of the resource allocation result can be effectively carried out, and the fairness of a scheme is favorably improved.
Drawings
FIG. 1 is a schematic diagram of an architecture of a verification system for resource allocation in an embodiment of the present application;
FIG. 2 is a schematic illustration of decentralized distributed data records in an embodiment of the present application;
FIG. 3 is a block chain diagram according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a verification method for resource allocation according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a method for verifying resource allocation according to an embodiment of the present application;
fig. 6 is a schematic diagram illustrating a ciphertext information comparison process based on a block chain in the embodiment of the present application;
FIG. 7 is a schematic diagram of a lottery interface based on blockchains in an embodiment of the present application;
FIG. 8 is a schematic diagram of another lottery interface based on blockchains in an embodiment of the present application;
FIG. 9 is a schematic diagram of yet another lottery interface based on blockchains in an embodiment of the present application;
FIG. 10 is a schematic diagram of an embodiment of a device for verifying resource allocation in an embodiment of the present application;
FIG. 11 is a schematic diagram of an embodiment of a device for verifying resource allocation in an embodiment of the present application;
fig. 12 is a schematic structural diagram of a server according to an embodiment of the present application;
fig. 13 is a block diagram illustrating a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application.
Detailed Description
The embodiment of the application provides a verification method and a related device for resource allocation, and the server records ciphertext information and resource allocation indication information to a block chain, so that a subsequent client can reversely deduce whether a received resource allocation result is tampered or not based on verification information, the ciphertext information stored in the block chain and the resource allocation indication information, and the ciphertext information and the resource allocation indication information stored in the block chain are difficult to tamper, so that the verification of the resource allocation result can be effectively carried out, and the fairness of the scheme is favorably improved.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "corresponding" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Currently, the existing online lottery is mainly based on random numbers calculated by a program to determine whether a user wins a prize or gets a prize. However, since all lottery processes are executed by the background program, some users may perform a destruction operation on the background program by means of embedding code or downloading a malicious application program, and tamper with the random number calculated by the program, thereby changing the lottery result, and resulting in that the fairness of the lottery is destroyed. In addition, because the lottery drawing process is executed by a background program, the transparency of the lottery drawing process is low, and a user can only see the lottery drawing result, even if the lottery drawing process is certified, the user still can easily question whether the lottery drawing result is real or not, whether black box operation exists or not, and the like, so that the enthusiasm of the user for participating in the lottery drawing and the application prospect of online lottery drawing are influenced.
It should be understood that the resource configuration verification method provided in the embodiment of the present application may be applied to a scenario in which resource configuration is performed based on randomly generated data, for example, in a lottery event, in order to prevent cheating of a user, a result of the lottery event may be verified after the lottery event is ended. Based on the above scenario, the present application utilizes a mechanism of a block chain to implement a trusted and reliable data processing system, which may be specifically a lottery system.
For convenience of understanding, the present application provides a resource configuration verification method, which is applied to a resource configuration verification system shown in fig. 1, please refer to fig. 1, where fig. 1 is an architecture schematic diagram of a resource configuration verification system in an embodiment of the present application, as shown in the figure, the resource configuration verification system includes a terminal device a, a terminal device B, a server a, and a server B inside a block chain, and further includes a terminal device C outside the block chain, where the terminal device a, the terminal device B, the server a, and the server B are connected through a network. Assuming that the server a is a service server, the service server may specifically be a lottery server, and after generating a random number, the server a generates ciphertext information by using the check information, and then synchronizes the ciphertext information to the terminal device a, the terminal device B, the server B, and the terminal device C through a block chain. The server A determines a lottery result according to the random number and the reward distribution configuration information, sends the corresponding lottery result to the terminal equipment C, and sends verification information to the terminal equipment C after lottery drawing is finished. Therefore, the user can receive the verification information through the terminal equipment C, decrypt the encrypted random number and obtain a specific target lottery result based on the decrypted random number and the reward distribution configuration. If the target lottery result is identical to the initially acquired lottery result, it indicates that the lottery data has not been falsified, and conversely, indicates that the lottery data may have been falsified, so that it is possible to reflect the situation or complaint, etc. to the customer service staff of the lottery event.
It should be noted that the terminal device includes, but is not limited to, a tablet computer, a notebook computer, a palm computer, a mobile phone, a voice interaction device, and a Personal Computer (PC), and is not limited herein. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
For convenience of understanding, please refer to fig. 2, and fig. 2 is a schematic diagram of decentralized distributed data recording in an embodiment of the present application, and as shown in the figure, a BlockChain (BlockChain) may be regarded as a distributed data recording account, and has a decentralized distributed data recording manner, and data recorded on the BlockChain can not be deleted and tampered, regardless of a terminal device, a server, or a cloud server, and the data is involved in recording of the data. The block chain technology mainly enables any plurality of nodes participating in a system to generate a series of data blocks (blocks) through correlation by using a cryptography method, wherein each data block contains all information exchange data of the system within a certain time, and a data fingerprint is generated for verifying the validity of the information and linking (chain) the next data block.
Based on the above description, please refer to fig. 3, and fig. 3 is a schematic diagram of a block chain in the embodiment of the present application, as shown in the figure, a block T +1, and a block T +2 are connected in series on the same chain (Chian) according to the occurrence order, and are log records of state changes of the whole ledger. The block records all transaction and status results over a period of time, which is a consensus on the current ledger status. The leading chunk hash value of a chunk is used to correlate the previous chunk, such as the leading chunk hash value of chunk T +1 is used to correlate chunk T. The transaction in the block represents an operation on the ledger, resulting in a change in the state of the ledger, such as adding a transfer record. The metadata is used to record specific transaction contents, such as a transaction timestamp, ciphertext information of the transaction, block length, and the like.
In implementation, it is assumed that there is a distributed data record ledger, and the ledger is only allowed to be added, but not to be deleted. The basic structure of the account book bottom layer is a linear linked list, the linked list is formed by connecting blocks in series, as shown in fig. 3, and the subsequent block records the hash value of the leading block. New data must be added to a new block. Whether the block (and the transaction within the block) is legitimate can be quickly verified by calculating the hash value. Any maintenance node has a record of all blocks and can propose a new legal block, but must go through a certain consensus mechanism to agree on the block that is finally selected.
In the application, randomly generated random numbers can be recorded in the block transaction, and a credible and reliable lottery drawing system is realized by utilizing a block chain mechanism.
With reference to the above description, the following describes a method for verifying a resource allocation in the present application from the perspective of a server, please refer to fig. 4, where fig. 4 is a schematic diagram of a method for verifying a resource allocation provided in an embodiment of the present application; one embodiment of the method for verifying resource allocation in the embodiment of the present application includes:
401. acquiring information to be encrypted and resource configuration indication information;
in this embodiment, before the server performs resource allocation, information to be encrypted and resource allocation indication information are first acquired. In particular, the resource configuration may be a probabilistic type lottery activity (i.e., the distribution of prizes or prizes based on a probability distribution), including but not limited to a lottery form such as a carousel, a flipping card, or a ticker. The information to be encrypted may be a random number, the resource allocation indication information may be reward distribution configuration, and the specific reward may be determined according to the random number to be encrypted and the reward distribution configuration, that is, the lottery result is obtained. The random number to be encrypted may be randomly generated by the server, the bonus distribution configuration may also be generated by the server, or the random number may be preset by the holder of the lottery event and stored in the server, which is not limited herein.
402. Encrypting the information to be encrypted by adopting the check information to obtain ciphertext information;
in this embodiment, the server may randomly generate the check information, and encrypt the random number to be encrypted by using the check information, thereby obtaining ciphertext information (i.e., the encrypted random number); in addition, the check information may also be pre-stored in the server, and the server may randomly select one of the check information from the check information set to encrypt the random number to be encrypted.
403. Recording the ciphertext information and the resource allocation indication information to a block chain for synchronous storage, so that the client side can acquire the ciphertext information and the resource allocation indication information through the block chain;
in this embodiment, after the random number to be encrypted is encrypted, the encrypted ciphertext information and the resource allocation indication information may be recorded to the block chain for storage. The cipher text information is encrypted through the check information, the resource configuration indication information can be encrypted or not encrypted, and a user can acquire the corresponding resource configuration indication information before resource configuration is started under the condition that the resource configuration indication information is not encrypted; when the resource allocation instruction information is encrypted, the user can obtain only the encrypted resource allocation instruction information before resource allocation is started. It can be understood that, in a scenario where the resource allocation indication information is specifically the bonus distribution configuration, the user only knows that the bonus distribution configuration does not affect the lottery result (which is equivalent to a rule that the user only knows the bonus distribution), and the user must know the corresponding random number to be able to know the final lottery result by combining the bonus distribution configuration, so the resource allocation indication information recorded to the blockchain may be encrypted or unencrypted.
Specifically, referring to table 1, table 1 is an illustration of a block where ciphertext information is located, that is, an example of a format in which the ciphertext information is stored in a block chain.
TABLE 1
Field(s) Description of the invention Size and breadth
pre-tx-hash Check hash value representing the entire contents of the previous transaction 32 bytes
timestamp Time stamp for submitting transaction 4 bytes
size Length of this block 4 bytes
message Ciphertext information Length of indefinite length
Transaction-hash Carrying out Hash calculation on the fields to obtain Hash values 32 bytes
The content shown in table 1 is only one example, and the "size" field may be set or not set in the block, and the size of each field may be defined according to the actual situation.
404. Determining a resource configuration result according to the information to be encrypted and the resource configuration indication information;
in this embodiment, after obtaining the information to be encrypted and the resource configuration indication information, the server may determine to obtain a resource configuration result according to the information to be encrypted and the resource configuration indication information; the determining of the resource allocation result according to the information to be encrypted and the resource allocation indication information may be performed before the ciphertext information and the resource allocation indication information are recorded in the blockchain for synchronous storage, may also be performed after the ciphertext information and the resource allocation indication information are recorded in the blockchain for synchronous storage, and may also be performed synchronously, which is not limited specifically herein.
405. And sending the check information and the resource configuration result to the client so that the client generates target information according to the check information and the ciphertext information, determining a target configuration result according to the target information and the resource configuration indication information, and comparing the target configuration result with the resource configuration result to obtain a verification result.
In this embodiment, after the server determines the resource configuration result, the resource configuration result may be sent to the client, so that the client may obtain the corresponding resource configuration result. Generally, while the server sends the resource allocation result to the client, it may also send check information to the client, where the check information can be used to decrypt the ciphertext information recorded on the blockchain to obtain the target information corresponding to the ciphertext information. That is to say, after the client acquires the check information, if the user needs to verify the resource configuration result, the client may decrypt the ciphertext information acquired from the block chain based on the check information to acquire target information, determine the target configuration result according to the target information and the resource configuration indication information, compare the target configuration result with the resource configuration result, and if the target configuration result is consistent with the resource configuration result, the verification is passed, and the relevant data of the resource configuration is not tampered; if the target configuration result is inconsistent with the resource configuration result, the verification is not passed, the related data of the resource configuration may be tampered, and the user may give feedback or complain to the related resource configuration party or the related customer service personnel. In addition, the server may send the resource configuration result and the check information to the client at the same time, or send the resource configuration result to the client at the first time first, and after the resource configuration result is sent, the server sends the check information to the client at the second time, where the first time is usually earlier than the second time, that is, the client receives the check information after receiving the resource configuration result, and then the client verifies the received resource configuration result by using the check information.
It should be noted that the check information can be used for decrypting the ciphertext information recorded to the blockchain, in addition to encrypting the information to be encrypted; specifically, the check information may be a symmetric key, and the symmetric key can encrypt information to be encrypted into ciphertext information and can restore the ciphertext information into the information to be encrypted. In addition, the check information may specifically be an asymmetric key, for example, the check information is a public key, and then after the information to be encrypted is encrypted by using the check information and ciphertext information is obtained, the decryption key corresponding to the check information needs to be sent to the client, for example, when the check information is a public key, the private key corresponding to the public key is sent to the client, so that the client can decrypt the ciphertext information according to the decryption key corresponding to the check information. Taking the example that the verification information is a symmetric key, the server may use a reliable random number or random string algorithm to obtain a key, which is a salt (salt) that is commonly used in a hash algorithm. In the random string algorithm, a character set is given, and a length of a randomly generated character string is given, so that the character string can be randomly generated, for example, if the given character set is { a.,. z }, and has a length of 5, a character string with a length of 5 is randomly generated. The server may obtain a random number using a random algorithm, such as generating a random number using a random () function. The encryption Algorithm for encrypting the information to be encrypted by the server through the key may be a Secure Hash Algorithm (Secure Hash Algorithm), and specifically may be SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, and SHA-512/256. The hash function compresses a message or data into a digest so that the amount of data becomes small, fixing the format of the data. This function mixes the data shuffled and recreates a fingerprint called a hash value (or hash value). The hash value is typically represented by a short string of random letters and numbers.
Optionally, on the basis of each embodiment corresponding to fig. 4, in an optional embodiment of the method for verifying resource configuration provided in this embodiment of the present application, the obtaining information to be encrypted and resource configuration indication information includes:
acquiring a first random number and resource configuration indication information, wherein the resource configuration indication information comprises an interval set and a resource configuration information set, the interval set comprises M intervals, the resource configuration information set comprises M resource configuration information, M is an integer larger than 1, the intervals and the resource configuration information have a unique corresponding relation, and the first random number is in the range of the M intervals;
the method for encrypting the information to be encrypted by adopting the check information to obtain the ciphertext information comprises the following steps:
encrypting the first random number by using the check information to obtain ciphertext information;
determining a resource configuration result according to the information to be encrypted and the resource configuration indication information, wherein the resource configuration result comprises the following steps:
determining a target interval according to the first random number, wherein the target interval belongs to an interval set;
and determining a resource configuration result according to the target interval and the resource configuration set.
In this embodiment, the server may randomly generate a first random number, where the first random number is used to obtain the resource allocation result by combining the resource allocation indication information. The resource allocation indication information may specifically include a section combination composed of M sections and a resource allocation information set composed of M resource allocation information, where each section in the section set has a unique corresponding relationship with one resource allocation information of the resource allocation information set. That is, after the first random number is generated, a target interval in the interval set may be determined, the first random number falls into the target interval, and then the corresponding resource allocation information may be determined according to the unique correspondence between the interval and the resource allocation information.
For example, it is assumed that in the lottery activity, the award distribution configuration (i.e., the resource allocation indication information) specifically includes four sections, which are respectively a section 1[0,0.1 ], a section 2[0.1,0.3), a section 3[0.3, 0.6) and a section 4[0.6, 1.0], wherein the award corresponding to the section 1[0,0.1) is a first-class award, the award corresponding to the section 2[0.1,0.3) is a second-class award, the award corresponding to the section 3[0.3, 0.6) is a third-class award, and the award corresponding to the section 4[0.6, 1.0] is a comfort award. Obviously, the intervals 1 to 4 are four intervals in the interval set, and the first-class prize, the second-class prize, the third-class prize and the consolation prize are the resource allocation information corresponding to each interval in the interval set. Therefore, the server can randomly generate a random number between the intervals [0,1], determine which interval the random number falls into based on the numerical value of the random number, and determine the corresponding reward based on the interval in which the random number falls. For example, when the random number generated by the server is 0.5, the random number 0.5 falls within the section 3[0.3, 0.6), that is, the corresponding prize is a three-equal prize.
Optionally, on the basis of each embodiment corresponding to fig. 4, in an optional embodiment of the method for verifying resource configuration provided in this embodiment of the present application, the obtaining information to be encrypted and resource configuration indication information includes:
acquiring a random algorithm, a random seed and resource configuration indication information, wherein the resource configuration indication information comprises an interval set and a resource configuration information set, the interval set comprises M intervals, the resource configuration information set comprises M resource configuration information, and the intervals and the resource configuration information have a unique corresponding relation;
the method for encrypting the information to be encrypted by adopting the check information to obtain the ciphertext information comprises the following steps:
encrypting the random algorithm and the random seeds by using the check information to obtain ciphertext information, wherein the ciphertext information comprises algorithm ciphertext information and seed ciphertext information;
determining a resource configuration result according to the information to be encrypted and the resource configuration indication information, wherein the resource configuration result comprises the following steps:
generating a second random number according to a random algorithm and the random seeds, wherein the second random number is in the range of M intervals;
determining a target interval according to the second random number, wherein the target interval belongs to an interval set;
and determining a resource configuration result according to the target interval and the resource configuration set.
In this embodiment, a random seed and a random algorithm may be used to generate a random number, and the random number may be used to determine the resource allocation result. The random algorithm may be pre-stored in the server, and includes, but is not limited to, a numerical probability algorithm, a las vegas algorithm, a monte carlo algorithm, or a schwaneld algorithm. The random seed is a seed used to generate a random number in conjunction with a random algorithm and may be considered an initial value or initial sequence that generates the random number.
Similarly, when a user needs to verify whether a resource configuration result is correct through a client, the user can firstly obtain corresponding algorithm ciphertext information and seed ciphertext information from the block chain through the client, decrypt the algorithm ciphertext information and the seed ciphertext information based on the verification information to obtain a random algorithm and a random seed, then generate a random number according to the random seed and the random algorithm, determine a target configuration result according to the random number, and finally compare whether the target configuration result is consistent with the received resource configuration result to complete the verification of the resource configuration.
It can be understood that, since the algorithm ciphertext information corresponding to the random algorithm, the seed ciphertext information corresponding to the random seed, and the resource configuration indication information are published in advance on the block chain, the user can determine the resource configuration result based on the random algorithm and the random seed obtained by decryption, and therefore, there is no space for the operation of the black box in the resource configuration process, and the resource configuration result is not changed, so that the disclosure and fairness of the resource configuration can be ensured.
Optionally, on the basis of each embodiment corresponding to fig. 4, in an optional embodiment of the method for verifying resource allocation provided in this embodiment of the present application, the encrypting the information to be encrypted by using the check information to obtain the ciphertext information includes:
generating a random key;
encrypting the information to be encrypted by adopting a random key to obtain ciphertext information;
sending the checking information and the resource configuration result to the client, wherein the sending comprises the following steps:
and sending the random key and the resource configuration result to the client.
In this embodiment, the server may randomly generate a random key to encrypt the information to be encrypted, and send the random key to the client while or after sending the resource configuration result to the client, so that the client can decrypt the ciphertext information based on the random key. The random key can be a symmetric key, and based on the random key, the information to be encrypted can be encrypted to obtain ciphertext information; the decryption processing can also be carried out on the ciphertext information to obtain decryption information corresponding to the ciphertext information.
With reference to the above description, the following describes a method for verifying resource allocation in the embodiment of the present application from the perspective of a client, please refer to fig. 5, where fig. 5 is a flowchart illustrating a method for verifying resource allocation in the embodiment of the present application; one embodiment of the method for verifying resource allocation in the embodiment of the present application includes:
501. acquiring ciphertext information and resource allocation indication information through a block chain, wherein the block chain is acquired after the server stores the ciphertext information and the resource allocation indication information, and the ciphertext information is acquired after the server encrypts the information to be encrypted by adopting verification information;
in this embodiment, after the server records the ciphertext information and the resource configuration indication information onto the blockchain, the client may obtain the ciphertext information and the resource configuration indication information on the blockchain. Specifically, the ciphertext information may be obtained by the server encrypting a random number by using a randomly generated random key; the cipher text information may also include algorithm cipher text information and seed cipher text information, where the algorithm cipher text information is obtained by the server encrypting a random algorithm with a random key, the seed cipher text information is obtained by the server encrypting the random algorithm with the random key, and the random algorithm and the random seed are used to obtain a random number.
502. Receiving verification information and a resource configuration result sent by a server;
in this embodiment, the client may receive the resource configuration result sent by the server at a first time, and then receive the check information sent by the server at a second time, where the first time is usually earlier than the second time, that is, the client receives the check information after receiving the resource configuration result, so that the client verifies the received resource configuration result by using the check information.
503. Generating target information according to the check information and the ciphertext information;
in this embodiment, after receiving the check information sent by the server and acquiring the ciphertext information from the block chain, the client may perform decryption processing on the ciphertext information by using the check information to obtain the target information.
504. Determining a target configuration result according to the target information and the resource configuration indication information;
in this embodiment, when the information to be encrypted is a random number, the target information obtained by decrypting the ciphertext information using the check information is also a random number, and therefore, the target configuration result may be determined according to the random number obtained by decryption and the resource configuration indication information. Under the condition that the information to be encrypted is a random algorithm and a random seed, the target information obtained by decrypting the ciphertext information by using the check information is the random algorithm and the random seed, at this time, a corresponding random number needs to be obtained according to the random algorithm and the random seed, and then a target configuration result is determined according to the random number and the resource configuration indication information.
505. And comparing the target configuration result with the resource configuration result to obtain a verification result.
In this embodiment, after the client determines that the target configuration result is obtained, the target configuration result may be compared with the resource configuration result sent by the server, and if the target configuration result is consistent with the resource configuration result, it represents that the resource configuration result is not tampered, and the resource configuration result is correct; if the target configuration result is inconsistent with the resource configuration result, the resource configuration result is incorrect, which represents that the resource configuration result may have been tampered with.
In the embodiment of the application, the client can reversely deduce whether the received resource configuration result is tampered based on the check information sent by the server, the ciphertext information and the resource configuration indication information stored in the blockchain, and because the ciphertext information and the resource configuration indication information are disclosed on the blockchain in advance and the ciphertext information and the resource configuration indication information stored in the blockchain are difficult to be tampered, the client can effectively check the resource configuration result, and a dark box operation space in an activity process does not exist, thereby being beneficial to ensuring the disclosure, fairness and fairness of the resource configuration.
Optionally, on the basis of each embodiment corresponding to fig. 5, in an optional embodiment of the method for verifying resource allocation provided in this embodiment of the present application, after obtaining the ciphertext information and the resource allocation indication information through the blockchain, the method further includes:
receiving a ciphertext display instruction and a configuration indication display instruction;
and responding to the ciphertext display instruction and the configuration indication display instruction, and displaying the ciphertext information and the resource configuration indication information through the interactive application interface.
In this embodiment, before the resource configuration result is published, if the client acquires the ciphertext information and the resource configuration indication information through the blockchain, the ciphertext display instruction and the configuration indication display instruction triggered by the user may be acquired, and then the ciphertext information and the resource configuration indication information are displayed through the interactive application interface in response to the ciphertext display instruction and the configuration indication display instruction, so that the user can view the corresponding ciphertext information and the resource configuration indication information.
Optionally, on the basis of each embodiment corresponding to fig. 5, in an optional embodiment of the method for verifying resource configuration provided in this embodiment of the present application, the receiving the verification information and the resource configuration result sent by the server includes:
receiving an application starting instruction;
responding to an application starting instruction, and receiving a resource configuration result sent by a server;
after receiving a resource configuration result, receiving a result checking instruction;
and receiving the random key sent by the server in response to the result checking instruction.
In this embodiment, after the user triggers the application start instruction at the client, the client may receive the resource configuration result from the server in response to the application start instruction, and display the resource configuration result on the interactive application interface of the client. After the resource configuration result is displayed, if the user needs to verify the resource configuration result, the user can trigger a result verification instruction, the client responds to the result verification instruction, receives a random key from the server, decrypts the ciphertext information on the block chain by adopting the random key to obtain target information, and verifies the resource configuration result based on the target information and the resource configuration indication information.
For convenience of understanding, the method for verifying the resource configuration provided by the embodiment of the present application will be described in detail below with reference to specific examples. Referring to fig. 6, fig. 6 is a schematic diagram illustrating a ciphertext information comparison process based on a block chain in an embodiment of the present application. As shown in the figure:
s1, after generating the random number, the server encrypts the random number by using the check information and stores the random number into a block chain, wherein the block chain also stores preset lottery distribution configuration;
s2, the players participating in the lottery can acquire the encrypted random number and lottery distribution configuration from the blockchain;
and S3, after the lottery is finished, namely after the lottery result is published, the player can decrypt the encrypted random number by using the verification information provided by the server to obtain the target information, then obtain the corresponding target lottery result based on the target information and the lottery distribution configuration, finally compare the target lottery result with the actual lottery result, if the two lottery results are consistent, the lottery result is correct and is not tampered maliciously, and if the two lottery results are inconsistent, the lottery result is wrong and is tampered maliciously.
Referring to fig. 7, fig. 7 is a schematic diagram of a lottery interface based on a blockchain in an embodiment of the present application; as shown in fig. 7, (a) of fig. 7 shows a main interface of a lottery on which a user can draw a lottery by spending points, specifically, in a carousel form, which is divided into four awards, i.e., a first-class award, a second-class award, a third-class award, and a consolation award; fig. 7 (b) shows a lottery interface showing whether the ciphertext information and the lottery distribution configuration need to be published in advance before the user formally performs the lottery, the user may publish the ciphertext information and the lottery distribution configuration in advance and open the lottery directly without publishing before clicking the button "spend 20 credits once! "choose between two options.
Referring to fig. 8, fig. 8 is a schematic diagram of another lottery interface based on a blockchain in the embodiment of the present application; FIG. 8 (a) shows that the user has "pre-published ciphertext message and lottery distribution configuration" and "directly opened the lottery without publishing! "two options select and click the first button; fig. 8 (b) shows that the user displays the corresponding ciphertext information and prize distribution configuration on the lottery interface after clicking "the ciphertext information and the lottery distribution configuration are published in advance".
Referring to fig. 9, fig. 9 is a schematic diagram of another lottery interface based on a blockchain in the embodiment of the present application; fig. 9 (a) shows that, after the lottery is ended, the user can select between two options of "verify lottery result" and "continue lottery"; fig. 9 (b) shows that, after the user selects the "verify lottery result" option, the lottery interface may display the check information received by the client from the server, and the user may perform verification of the lottery result by clicking the "one-click verification" option on the current interface; fig. 9 (c) shows the verification result displayed on the lottery interface after the user clicks "one-click verification" on the interface to trigger the verification operation, where the verification result is specifically verification pass.
Referring to fig. 10, fig. 10 is a schematic diagram of an embodiment of a verification apparatus for resource allocation in this embodiment, where the verification apparatus 100 for resource allocation includes:
an obtaining unit 1001 configured to obtain information to be encrypted and resource configuration indication information;
the encryption unit 1002 is configured to encrypt information to be encrypted by using the check information to obtain ciphertext information;
the storage unit 1003 is configured to record the ciphertext information and the resource allocation indication information to a blockchain for synchronous storage, so that the client obtains the ciphertext information and the resource allocation indication information through the blockchain;
a determining unit 1004, configured to determine a resource configuration result according to the information to be encrypted and the resource configuration indication information;
a sending unit 1005, configured to send the verification information and the resource configuration result to the client, so that the client generates target information according to the verification information and the ciphertext information, determines a target configuration result according to the target information and the resource configuration indication information, and compares the target configuration result with the resource configuration result to obtain a verification result.
Alternatively, on the basis of fig. 10, in an optional embodiment of the verification apparatus 100 for resource configuration provided in the embodiment of the present application,
the acquiring unit 1001 is further configured to acquire a first random number and resource configuration indication information, where the resource configuration indication information includes an interval set and a resource configuration information set, the interval set includes M intervals, the resource configuration information set includes M resource configuration information, M is an integer greater than 1, the intervals and the resource configuration information have a unique corresponding relationship, and the first random number is within a range of the M intervals;
the encrypting unit 1002 is further configured to encrypt the first random number by using the check information to obtain ciphertext information;
a determining unit 1004, further configured to determine a target interval according to the first random number, where the target interval belongs to the interval set;
the determining unit 1004 is further configured to determine a resource configuration result according to the target interval and the resource configuration set.
Optionally, on the basis of fig. 10, in an optional embodiment of the verification apparatus 100 for resource configuration provided in the embodiment of the present application, the verification apparatus further includes a generating unit 1006;
the acquiring unit 1001 is further configured to acquire a random algorithm, a random seed, and resource configuration indication information, where the resource configuration indication information includes an interval set and a resource configuration information set, the interval set includes M intervals, the resource configuration information set includes M resource configuration information, and the intervals and the resource configuration information have a unique corresponding relationship;
the encrypting unit 1002 is further configured to encrypt the random algorithm and the random seed by using the check information to obtain ciphertext information, where the ciphertext information includes algorithm ciphertext information and seed ciphertext information;
a generating unit 1006, configured to generate a second random number according to a random algorithm and a random seed, where the second random number is within a range of M intervals;
a determining unit 1004, further configured to determine a target interval according to the second random number, where the target interval belongs to the interval set;
the determining unit 1004 is further configured to determine a resource configuration result according to the target interval and the resource configuration set.
Alternatively, on the basis of fig. 10, in an optional embodiment of the verification apparatus 100 for resource configuration provided in the embodiment of the present application,
a generating unit 1006, further configured to generate a random key;
the encryption unit 1002 is further configured to encrypt information to be encrypted by using a random key to obtain ciphertext information;
the sending unit 1005 is further configured to send the random key and the resource configuration result to the client.
Referring to fig. 11, fig. 11 is a schematic view of an embodiment of a verification apparatus for resource allocation in an embodiment of the present application, where the verification apparatus for resource allocation 110 includes:
the obtaining unit 1101 is configured to obtain ciphertext information and resource allocation indication information through a block chain, where the block chain is obtained by storing the ciphertext information and the resource allocation indication information by a server, and the ciphertext information is obtained by encrypting information to be encrypted by the server using check information;
a receiving unit 1102, configured to receive check information and a resource configuration result sent by a server;
a generating unit 1103 configured to generate target information from the verification information and the ciphertext information;
a determining unit 1104, configured to determine a target configuration result according to the target information and the resource configuration indication information;
a comparing unit 1105, configured to compare the target configuration result with the resource configuration result to obtain a verification result.
Optionally, on the basis of fig. 11, in an optional embodiment of the apparatus 110 for verifying a resource configuration provided in the embodiment of the present application, a display unit 1106 is further included;
the receiving unit 1102 is further configured to receive a ciphertext display instruction and a configuration indication display instruction;
and a display unit 1106, configured to display the ciphertext information and the resource configuration indication information through an interactive application interface in response to the ciphertext display instruction and the configuration indication display instruction.
Alternatively, on the basis of fig. 11, in an optional embodiment of the verification apparatus 110 for resource configuration provided in this application embodiment,
a receiving unit 1102, further configured to receive an application start instruction;
the receiving unit 1102 is further configured to receive a resource configuration result sent by the server in response to the application start instruction;
the receiving unit 1102 is further configured to receive a result checking instruction after receiving the resource configuration result;
the receiving unit 1102 is further configured to receive the random key sent by the server in response to the result checking instruction.
Fig. 12 is a schematic diagram of a server 1200 according to an embodiment of the present disclosure, where the server 1200 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 1222 (e.g., one or more processors) and a memory 1232, and one or more storage media 1230 (e.g., one or more mass storage devices) for storing applications 1242 or data 1244. Memory 1232 and storage media 1230 can be, among other things, transient storage or persistent storage. The program stored in the storage medium 1230 may include one or more modules (not shown), each of which may include a series of instruction operations for the server. Still further, the central processor 1222 may be configured to communicate with the storage medium 1230, to execute a series of instruction operations in the storage medium 1230 on the server 1200.
The server 1200 may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input-output interfaces 1258, and/or one or more operating systems 1241, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
The steps performed by the server in the above embodiment may be based on the server structure shown in fig. 12.
In the embodiment of the present application, the CPU 1222 included in the server further has the following functions:
acquiring information to be encrypted and resource configuration indication information;
encrypting the information to be encrypted by adopting the check information to obtain ciphertext information;
recording the ciphertext information and the resource allocation indication information to a block chain for synchronous storage, so that the client side can acquire the ciphertext information and the resource allocation indication information through the block chain;
determining a resource configuration result according to the information to be encrypted and the resource configuration indication information;
and sending the check information and the resource configuration result to the client so that the client generates target information according to the check information and the ciphertext information, determining a target configuration result according to the target information and the resource configuration indication information, and comparing the target configuration result with the resource configuration result to obtain a verification result.
As shown in fig. 13, for convenience of description, only the parts related to the embodiments of the present application are shown, and details of the specific technology are not disclosed, please refer to the method part of the embodiments of the present application. The terminal device may be any terminal device including a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a Point of Sales (POS), a vehicle-mounted computer, and the like, taking the terminal device as the mobile phone as an example:
fig. 13 is a block diagram illustrating a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Referring to fig. 13, the handset includes: radio Frequency (RF) circuitry 1310, memory 1320, input unit 1330, display unit 1340, sensor 1350, audio circuitry 1360, wireless fidelity (WiFi) module 1370, processor 1380, and power supply 1390. Those skilled in the art will appreciate that the handset configuration shown in fig. 13 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile phone in detail with reference to fig. 13:
RF circuit 1310 may be used for receiving and transmitting signals during a message transmission or communication session, and in particular, for receiving downlink information from a base station and processing the received downlink information in processor 1380; in addition, the data for designing uplink is transmitted to the base station. In general, the RF circuit 1310 includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuit 1310 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
The memory 1320 may be used to store software programs and modules, and the processor 1380 executes various functional applications and data processing of the cellular phone by operating the software programs and modules stored in the memory 1320. The memory 1320 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, etc. Further, the memory 1320 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1330 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. Specifically, the input unit 1330 may include a touch panel 1331 and other input devices 1332. Touch panel 1331, also referred to as a touch screen, can collect touch operations by a user (e.g., operations by a user on or near touch panel 1331 using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 1331 may include two portions of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1380, where the touch controller can receive and execute commands sent by the processor 1380. In addition, the touch panel 1331 may be implemented by various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 1330 may include other input devices 1332 in addition to the touch panel 1331. In particular, other input devices 1332 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1340 may be used to display information input by a user or information provided to the user and various menus of the cellular phone. The display unit 1340 may include a display panel 1341, and optionally, the display panel 1341 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, touch panel 1331 can overlay display panel 1341, and when touch panel 1331 detects a touch operation on or near touch panel 1331, processor 1380 can be configured to determine the type of touch event, and processor 1380 can then provide a corresponding visual output on display panel 1341 based on the type of touch event. Although in fig. 13, the touch panel 1331 and the display panel 1341 are two independent components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 1331 and the display panel 1341 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 1350, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 1341 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 1341 and/or the backlight when the mobile phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The audio circuit 1360, speaker 1361, microphone 1362 may provide an audio interface between the user and the handset. The audio circuit 1360 may transmit the electrical signal converted from the received audio data to the speaker 1361, and the electrical signal is converted into a sound signal by the speaker 1361 and output; on the other hand, the microphone 1362 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 1360, and then processes the audio data by the audio data output processor 1380, and then sends the audio data to, for example, another cellular phone via the RF circuit 1310, or outputs the audio data to the memory 1320 for further processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 1370, and provides wireless broadband internet access for the user. Although fig. 13 shows the WiFi module 1370, it is understood that it does not belong to the essential constitution of the handset, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 1380 is a control center of the mobile phone, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 1320 and calling data stored in the memory 1320, thereby integrally monitoring the mobile phone. Optionally, processor 1380 may include one or more processing units; alternatively, processor 1380 may integrate an application processor, which handles primarily the operating system, user interface, and applications, and a modem processor, which handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated within processor 1380.
The handset also includes a power supply 1390 (e.g., a battery) to provide power to the various components, which may optionally be logically coupled to the processor 1380 via a power management system to manage charging, discharging, and power consumption management via the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which are not described herein.
In the embodiment of the present application, the processor 1080 included in the terminal device further has the following functions:
acquiring ciphertext information and resource allocation indication information through a block chain, wherein the block chain is acquired after the server stores the ciphertext information and the resource allocation indication information, and the ciphertext information is acquired after the server encrypts the information to be encrypted by adopting verification information;
receiving verification information and a resource configuration result sent by a server;
generating target information according to the check information and the ciphertext information;
determining a target configuration result according to the target information and the resource configuration indication information;
and comparing the target configuration result with the resource configuration result to obtain a verification result.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A verification method for resource configuration is applied to a server, and comprises the following steps:
acquiring information to be encrypted and resource configuration indication information, wherein the information to be encrypted comprises a random number to be encrypted, and the random number to be encrypted is randomly generated by the server;
encrypting the information to be encrypted by using the verification information to obtain ciphertext information, wherein the ciphertext information comprises an encrypted random number;
recording the ciphertext information and the resource allocation indication information to a block chain for synchronous storage, so that a client side obtains the ciphertext information and the resource allocation indication information through the block chain;
determining a resource configuration result according to the information to be encrypted and the resource configuration indication information;
sending the verification information and the resource configuration result to the client, so that the client generates target information according to the verification information and the ciphertext information, determines a target configuration result according to the target information and the resource configuration indication information, and compares the target configuration result with the resource configuration result to obtain a verification result; and the verification information is used for decrypting the ciphertext information to obtain the corresponding target information.
2. The method for verifying resource allocation according to claim 1, wherein the obtaining information to be encrypted and resource allocation indication information includes:
acquiring a first random number and resource configuration indication information, wherein the resource configuration indication information comprises an interval set and a resource configuration information set, the interval set comprises M intervals, the resource configuration information set comprises M resource configuration information, M is an integer greater than 1, the intervals and the resource configuration information have a unique corresponding relationship, and the first random number is in the range of the M intervals;
the encrypting process is carried out on the information to be encrypted by adopting the check information to obtain the ciphertext information, and the encrypting process comprises the following steps:
encrypting the first random number by using the verification information to obtain ciphertext information;
the determining a resource configuration result according to the information to be encrypted and the resource configuration indication information includes:
determining a target interval according to the first random number, wherein the target interval belongs to the interval set;
and determining a resource configuration result according to the target interval and the resource configuration set.
3. The method for verifying resource allocation according to claim 1, wherein the obtaining information to be encrypted and resource allocation indication information includes:
acquiring a random algorithm, a random seed and resource configuration indication information, wherein the resource configuration indication information comprises an interval set and a resource configuration information set, the interval set comprises M intervals, the resource configuration information set comprises M resource configuration information, and the intervals and the resource configuration information have unique corresponding relations;
the encrypting process is carried out on the information to be encrypted by adopting the check information to obtain the ciphertext information, and the encrypting process comprises the following steps:
encrypting the random algorithm and the random seeds by using check information to obtain ciphertext information, wherein the ciphertext information comprises algorithm ciphertext information and seed ciphertext information;
the determining a resource configuration result according to the information to be encrypted and the resource configuration indication information includes:
generating a second random number according to the random algorithm and the random seed, wherein the second random number is within the range of the M intervals;
determining a target interval according to the second random number, wherein the target interval belongs to the interval set;
and determining a resource configuration result according to the target interval and the resource configuration set.
4. The method for verifying resource allocation according to claim 1, wherein the encrypting the information to be encrypted by using the check information to obtain ciphertext information comprises:
generating a random key;
encrypting the information to be encrypted by adopting the random key to obtain ciphertext information;
sending the verification information and the resource configuration result to the client, including:
and sending the random key and the resource configuration result to the client.
5. A resource configuration verification method is applied to a client, and comprises the following steps:
acquiring ciphertext information and resource allocation indication information through a block chain, wherein the block chain is acquired by a server after the ciphertext information and the resource allocation indication information are stored, the ciphertext information is acquired by the server after the server encrypts information to be encrypted by adopting check information, the information to be encrypted comprises a random number to be encrypted, the random number to be encrypted is randomly generated by the server, and the ciphertext information comprises the encrypted random number;
receiving the verification information and the resource configuration result sent by the server;
generating target information according to the verification information and the ciphertext information; the verification information is used for decrypting the ciphertext information to obtain the corresponding target information;
determining a target configuration result according to the target information and the resource configuration indication information;
and comparing the target configuration result with the resource configuration result to obtain a verification result.
6. The method for verifying resource allocation according to claim 5, wherein after obtaining the ciphertext information and the resource allocation indication information via the blockchain, the method further comprises:
receiving a ciphertext display instruction and a configuration indication display instruction;
and responding to the ciphertext display instruction and the configuration indication display instruction, and displaying the ciphertext information and the resource configuration indication information through an interactive application interface.
7. The method for verifying resource allocation according to claim 5, wherein the receiving the verification information and the resource allocation result sent by the server includes:
receiving an application starting instruction;
responding to the application starting instruction, and receiving the resource configuration result sent by the server;
after receiving the resource configuration result, receiving a result checking instruction;
and responding to the result checking instruction, and receiving the random key sent by the server.
8. An apparatus for verifying resource allocation, applied to a server, the apparatus comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring information to be encrypted and resource configuration indication information, the information to be encrypted comprises a random number to be encrypted, and the random number to be encrypted is randomly generated by the server;
the encryption unit is used for encrypting the information to be encrypted by adopting the check information to obtain ciphertext information, and the ciphertext information comprises an encrypted random number;
the storage unit is used for recording the ciphertext information and the resource allocation indication information to a block chain for synchronous storage, so that a client side can acquire the ciphertext information and the resource allocation indication information through the block chain;
the determining unit is used for determining a resource configuration result according to the information to be encrypted and the resource configuration indication information;
a sending unit, configured to send the verification information and the resource configuration result to the client, so that the client generates target information according to the verification information and the ciphertext information, determines a target configuration result according to the target information and the resource configuration indication information, and compares the target configuration result with the resource configuration result to obtain a verification result; and the verification information is used for decrypting the ciphertext information to obtain the corresponding target information.
9. An apparatus for verifying resource allocation, applied to a client, the apparatus comprising:
the system comprises an acquisition unit, a resource allocation indicating unit and a block chain, wherein the block chain is obtained by storing ciphertext information and resource allocation indicating information by a server, the ciphertext information is obtained by encrypting information to be encrypted by the server by using check information, the information to be encrypted comprises a random number to be encrypted, the random number to be encrypted is randomly generated by the server, and the ciphertext information comprises the encrypted random number;
a receiving unit, configured to receive the verification information and the resource configuration result sent by the server;
the generating unit is used for generating target information according to the verification information and the ciphertext information; the verification information is used for decrypting the ciphertext information to obtain the corresponding target information;
a determining unit, configured to determine a target configuration result according to the target information and the resource configuration indication information;
and the comparison unit is used for comparing the target configuration result with the resource configuration result to obtain a verification result.
10. A server, comprising: a memory, a transceiver, a processor, and a bus system;
wherein the memory is used for storing programs;
the processor is used for executing the program in the memory and comprises the following steps:
acquiring information to be encrypted and resource configuration indication information, wherein the information to be encrypted comprises a random number to be encrypted, and the random number to be encrypted is randomly generated by the server;
encrypting the information to be encrypted by using the verification information to obtain ciphertext information, wherein the ciphertext information comprises an encrypted random number;
recording the ciphertext information and the resource allocation indication information to a block chain for synchronous storage, so that a client side obtains the ciphertext information and the resource allocation indication information through the block chain;
determining a resource configuration result according to the information to be encrypted and the resource configuration indication information;
sending the verification information and the resource configuration result to the client, so that the client generates target information according to the verification information and the ciphertext information, determines a target configuration result according to the target information and the resource configuration indication information, and compares the target configuration result with the resource configuration result to obtain a verification result; the verification information is used for decrypting the ciphertext information to obtain the corresponding target information;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
CN201910780153.5A 2019-08-22 2019-08-22 Resource allocation verification method and related device Active CN110474918B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910780153.5A CN110474918B (en) 2019-08-22 2019-08-22 Resource allocation verification method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910780153.5A CN110474918B (en) 2019-08-22 2019-08-22 Resource allocation verification method and related device

Publications (2)

Publication Number Publication Date
CN110474918A CN110474918A (en) 2019-11-19
CN110474918B true CN110474918B (en) 2022-06-07

Family

ID=68513408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910780153.5A Active CN110474918B (en) 2019-08-22 2019-08-22 Resource allocation verification method and related device

Country Status (1)

Country Link
CN (1) CN110474918B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111259019B (en) 2020-01-09 2023-05-12 腾讯科技(深圳)有限公司 Resource allocation method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109636998A (en) * 2019-01-09 2019-04-16 山东浪潮质量链科技有限公司 A kind of method and device drawn a lottery using block chain
CN109644136A (en) * 2016-09-27 2019-04-16 英特尔公司 The believable vehicle remote information processing analyzed using block chain data

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020901A (en) * 2018-12-25 2019-07-16 阿里巴巴集团控股有限公司 Resource allocation methods and device and electronic equipment based on block chain
CN109767271B (en) * 2019-01-18 2023-07-04 众安信息技术服务有限公司 Lottery method and equipment based on block chain
CN109672693B (en) * 2019-02-02 2021-06-04 江苏通付盾区块链科技有限公司 Lottery ticket prize exchanging method and device based on block chain

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109644136A (en) * 2016-09-27 2019-04-16 英特尔公司 The believable vehicle remote information processing analyzed using block chain data
CN109636998A (en) * 2019-01-09 2019-04-16 山东浪潮质量链科技有限公司 A kind of method and device drawn a lottery using block chain

Also Published As

Publication number Publication date
CN110474918A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
CN112733107B (en) Information verification method, related device, equipment and storage medium
CN109472166B (en) Electronic signature method, device, equipment and medium
CN111612168B (en) Management method and related device for machine learning task
CN110430194B (en) Information verification method, chess and card information verification method and device
US20170012950A1 (en) Method and apparatus for supporting secure chat
CN109600223A (en) Verification method, Activiation method, device, equipment and storage medium
CN107070909A (en) Method for sending information, message receiving method, apparatus and system
EP2270737A1 (en) Methods and systems for dynamic servicing of advertisements in a game or virtual reality environment
CN107852416A (en) The life cycle of monitoring computer network connection
WO2016115889A1 (en) Method and system for controlling encryption of information and analyzing information as well as terminal
CN107154935B (en) Service request method and device
AU2012282577B2 (en) An electronic data sharing device and method of use
JP2009009541A (en) Authentication system, terminal, server, authentication method, and program
JPWO2008117556A1 (en) Log acquisition system, log collection terminal, log acquisition terminal, log acquisition method and program using them
CN111181909B (en) Identity information acquisition method and related device
CN110933113B (en) Block chain-based interactive behavior detection method, device, equipment and storage medium
CN107342966B (en) Authority credentials distribution method and device
CN108874612B (en) Information acquisition method, related equipment and system
US20210205714A1 (en) Method and device for acquiring probability information of gacha system, and computer program
CN106250770A (en) For to the electronic equipment of content-encrypt and method
CN114372801A (en) Biological characteristic information identification method and related device
CN110572268B (en) Anonymous authentication method and device
CN114553612B (en) Data encryption and decryption method and device, storage medium and electronic equipment
CN110474918B (en) Resource allocation verification method and related device
JP2024120007A (en) Information processing system, server, and program

Legal Events

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