CN112214312B - Resource allocation system, method, terminal and storage medium - Google Patents

Resource allocation system, method, terminal and storage medium Download PDF

Info

Publication number
CN112214312B
CN112214312B CN202010982203.0A CN202010982203A CN112214312B CN 112214312 B CN112214312 B CN 112214312B CN 202010982203 A CN202010982203 A CN 202010982203A CN 112214312 B CN112214312 B CN 112214312B
Authority
CN
China
Prior art keywords
terminal
resource allocation
hash table
identification code
hash
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
CN202010982203.0A
Other languages
Chinese (zh)
Other versions
CN112214312A (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.)
Shenzhen University
Original Assignee
Shenzhen University
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 Shenzhen University filed Critical Shenzhen University
Priority to CN202010982203.0A priority Critical patent/CN112214312B/en
Publication of CN112214312A publication Critical patent/CN112214312A/en
Application granted granted Critical
Publication of CN112214312B publication Critical patent/CN112214312B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/582Pseudo-random number generators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application is applicable to the technical field of computers and provides a resource allocation system, a resource allocation method, a resource allocation terminal and a storage medium. The system comprises a first terminal, a second terminal and a resource management terminal: the method comprises the steps that a first terminal detects resource allocation operation of a user and acquires real-time first time when the resource allocation operation is detected; then, sorting hash tables contained in the first hash table sequence according to the first real-time; next, a first hash value associated with the device identification code is calculated based on the device identification code and the ordered first hash table sequence. The second terminal obtains the equipment identification code, the first hash value and the resource quantity and sends the equipment identification code, the first hash value and the resource quantity to the resource management terminal. And the resource management terminal performs resource allocation according to the equipment identification code, the first hash value, the resource quantity and the first account information associated with the second terminal. By adopting the technical scheme, the safety of effectively improving the resource allocation can be improved.

Description

Resource allocation system, method, terminal and storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a resource allocation system, a resource allocation method, a resource allocation terminal and a storage medium.
Background
With the development of technology, various virtual resource allocation modes are presented. Taking the allocation of virtual resources in the form of "red packets" as an example, a user may put virtual resources such as electronic greeting cards into "red packets" and then issue them individually to a certain user. Taking the allocation of virtual resources in the form of "user balances" as an example, a user may transfer money from "user balances" to other users as desired.
However, the current resource allocation method is not safe enough, and the resource allocation by the current resource allocation method has a certain threat to the resources of the users.
Disclosure of Invention
The embodiment of the application provides a resource allocation system, a resource allocation method, a terminal and a storage medium, which can solve the problem of low safety of the current resource allocation mode.
A first aspect of an embodiment of the present application provides a resource allocation system, including: the system comprises a first terminal, a second terminal and a resource management terminal;
the first terminal acquires resource allocation information, wherein the resource allocation information comprises the number of resources;
the first terminal responds to the resource allocation information to acquire a first real-time;
the first terminal acquires a first hash table sequence, and performs hash table sequencing on the first hash table sequence according to the first real-time to obtain a second hash table sequence;
The first terminal reads the equipment identification code of the first terminal and determines a first hash value associated with the equipment identification code according to the equipment identification code and the second hash table sequence; the equipment identification code, the first hash value and the resource quantity are used for resource allocation by a resource management terminal;
the second terminal acquires the equipment identification code, the first hash value and the resource quantity;
the second terminal reads the associated first account information and sends the terminal information, the equipment identification code, the first hash value and the resource quantity to the resource management terminal;
the resource management terminal determines a first account pointed by the first account information, and allocates resources to the first account according to the equipment identification code, the first hash value and the number of resources.
A second aspect of an embodiment of the present application provides a resource allocation method, applied to a first terminal, where the method includes:
acquiring resource allocation information, wherein the resource allocation information comprises the number of resources;
acquiring a first real-time in response to acquiring the resource allocation information;
acquiring a first hash table sequence, and carrying out hash table sequencing on the first hash table sequence according to the first real-time to obtain a second hash table sequence;
And reading the equipment identification code of the equipment, determining a first hash value associated with the equipment identification code according to the equipment identification code and the second hash table sequence, wherein the equipment identification code, the first hash value and the resource quantity are used for resource allocation by a resource management terminal.
A third aspect of the embodiments of the present application provides a resource allocation method, applied to a resource management terminal, where the method includes:
receiving a resource allocation request, wherein the resource request carries a first hash value, a device identification code of a first terminal and the number of resources;
when the resource allocation request is received, acquiring a second real-time;
ordering the hash tables contained in the third hash table sequence according to the second real-time to obtain a fourth hash table sequence;
determining a second hash value associated with the equipment identification code according to the equipment identification code and the fourth hash table sequence;
and if the first hash value is the same as the second hash value, determining a second account associated with the first terminal, and distributing resources to the second account according to the number of resources.
A first resource allocation device provided in a fourth aspect of the present application is configured in a first terminal, where the device includes:
The first acquisition unit is used for acquiring resource allocation information, wherein the resource allocation information comprises the number of resources;
the second acquisition unit is used for acquiring the first real-time in response to the acquisition of the resource allocation information;
the first ordering unit is used for acquiring a first hash table sequence, and carrying out hash table ordering on the first hash table sequence according to the first real-time to obtain a second hash table sequence;
the first computing unit is used for reading the equipment identification code of the first computing unit, determining a first hash value associated with the equipment identification code according to the equipment identification code and the second hash table sequence, and the equipment identification code, the first hash value and the resource quantity are used for resource allocation by the resource management terminal.
A second resource allocation device provided in a fifth aspect of the embodiments of the present application is configured in a resource management terminal, where the device includes:
the receiving unit is used for receiving a resource allocation request, wherein the resource request carries a first hash value, a device identification code of a first terminal and the number of resources;
a third obtaining unit, configured to obtain a second real-time when the resource allocation request is received;
The second sorting unit is used for sorting the hash tables contained in the third hash table sequence according to the second real-time to obtain a fourth hash table sequence;
a second calculation unit, configured to determine a second hash value associated with the device identifier according to the device identifier and the fourth hash table sequence;
and the resource allocation unit is used for determining a second account associated with the first terminal if the first hash value is the same as the second hash value, and allocating resources to the second account according to the number of resources.
A sixth aspect of the embodiments of the present application provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the above method when executing the computer program.
A seventh aspect of the embodiments of the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above method.
An eighth aspect of the embodiments of the present application provides a computer program product for enabling a terminal device to carry out the steps of the method when the computer program product is run on the terminal device.
In the embodiment of the application, a first terminal in a resource allocation system detects a resource allocation operation of a user, and acquires a first real-time when the resource allocation operation is detected; then, sorting hash tables contained in the first hash table sequence according to the first real-time; then, a first hash value associated with the device identification code is calculated according to the device identification code and the second hash table sequence obtained after the sorting. The second terminal in the resource allocation system can acquire the equipment identification code, the first hash value and the resource quantity obtained by the first terminal, and send the acquired equipment identification code, the first hash value, the resource quantity and the self-associated first account information to the resource management terminal in the resource allocation system. The resource management terminal can determine a first account pointed by the first account information, and allocate resources to the first account according to the equipment identification code, the first hash value and the number of resources. According to the embodiment of the application, the hash tables in the first hash table sequence are ordered according to the first real-time, and the first hash value associated with the equipment identification code is calculated, so that the resource management terminal can determine the effectiveness of resource allocation according to the first hash value to perform resource allocation, and compared with the case that the hash value is calculated through only one hash table or through the hash table with a fixed sequence, the safety of resource allocation can be effectively guaranteed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required for the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of an execution flow of a resource allocation system according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an implementation flow chart for ordering a first hash table sequence according to an embodiment of the present application;
fig. 3 is a schematic flowchart of an implementation of resource allocation for a first account according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a first implementation of a resource allocation method according to an embodiment of the present application;
fig. 5 is a schematic flow chart of a second implementation of a resource allocation method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a first resource allocation device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a second resource allocation device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a terminal provided in an embodiment of the present application;
Fig. 9 is a schematic structural diagram of a first terminal according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
With the development of technology, various virtual resource allocation modes are presented. Taking the allocation of virtual resources in the form of "red packets" as an example, a user may put virtual resources such as electronic greeting cards into "red packets" and then issue them individually to a certain user. Taking the allocation of virtual resources in the form of "user balances" as an example, a user may transfer money from "user balances" to other users as desired.
However, the current resource allocation method is not safe enough, and the resource allocation by the current resource allocation method has a certain threat to the resources of the users.
In order to illustrate the technical solution of the present application, the following description is made by specific examples.
Fig. 1 shows a schematic execution flow of a resource allocation system provided in an embodiment of the present application, where the system includes a first terminal, a second terminal, and a resource management terminal.
The first terminal generally refers to a terminal used by a resource provider, and the terminal may be an intelligent terminal capable of connecting to a network, such as a mobile phone or an intelligent watch, or may be an offline terminal, such as a digital wallet. And the first terminal. The second terminal refers to a terminal used by a resource receiver, and the terminal can be a mobile phone, a POS machine and other terminals. The resource management terminal refers to a terminal that manages virtual resources, and takes the "user balance" as an example, the resource management terminal may be a funds management server of a bank.
Specifically, the execution flow of the above-described resource allocation system may include the following steps S101 to S107.
In step S101, the first terminal acquires resource allocation information.
The resource allocation information refers to information generated according to a resource allocation requirement of a user on a virtual resource, and may include the number of resources for performing resource allocation, and the like. Taking the transfer as an example, the resource allocation information is the transfer information of the user, and may include the amount of the transfer.
In the embodiment of the application, the user holds the first terminal, when the user needs to perform resource allocation, the user can operate in a display of the first terminal, input the number of resources needing to be allocated, complete the resource allocation operation, and obtain the resource allocation information.
Step S102, the first terminal responds to the resource allocation information and acquires first real-time.
In the embodiment of the present application, when the first terminal acquires the resource allocation information, the current time may be acquired as the real-time first real-time.
For example, the user may input the number of resources to be allocated on the display of the first terminal, click the confirm key to confirm, and generate the resource allocation information. After detecting that the confirmation key is clicked, the first terminal can acquire the resource allocation information, and acquire the current moment as the first real-time while acquiring the resource allocation information.
It should be noted that, the specific accuracy of the first real-time may be adjusted according to actual needs, for example, the first real-time may be accurate to a minute, that is, if the current time is 10 points 05 minutes 05 seconds, 10 points 05 minutes may be used as the first real-time.
Step S103, the first terminal obtains a first hash table sequence, and performs hash table sequencing on the first hash table sequence according to the first real-time to obtain a second hash table sequence.
The first hash table sequence is a hash table sequence containing a plurality of Zhang Haxi tables and is used for the first terminal to carry out encryption operation. The specific generation mode of the first hash table sequence can be adjusted according to actual conditions.
In order to ensure the reliability of the resource exchange, in some embodiments of the present application, the first hash table sequence may be that, before the user performs the resource allocation operation, the resource management terminal applies to the first hash table sequence, and generates, by using the resource management terminal, the first hash table sequence associated with the device identification number of the first terminal according to the device identification number of the first terminal. Then, the resource management terminal or a writing device associated with the resource management terminal writes the obtained first hash table sequence into a memory of the first terminal. After the first real-time is obtained, the first terminal may call the first hash table sequence stored in the first terminal, and sort the hash tables included in the first hash table sequence according to the first real-time.
In the embodiment of the application, because the device identification numbers of different first terminals are different, the resource management terminal can allocate different first hash table sequences for different first terminals, so that the uniqueness of the first hash table sequences associated with each first terminal is ensured, and the safety and reliability of resource exchange are improved. And when the first hash table sequence is stored in the first terminal, the first terminal can directly read the first hash table sequence in the memory, so that the problem of error occurrence in data transmission when the first hash table sequence is acquired in other modes is avoided, and the safety and reliability of resource exchange are further improved.
The specific sorting method can be selected by an administrator according to actual conditions.
In some embodiments of the present application, if the number of hash tables included in the first hash table sequence is a preset number, and each hash table is associated with a number, where each number is different, the order of the hash tables may be determined according to the relationship between the first real-time and the number, and the first hash table sequence may be ordered.
The preset number may be set by an administrator according to the response speed to the resource allocation and the requirement of safety, and may be, for example, 8 sheets, 16 sheets, or the like.
Specifically, as shown in fig. 2, the above-mentioned determination of the order of the hash table according to the relationship between the first real-time and the number may include the following steps S201 to S203.
Step S201, a preset pseudo-random number generator is obtained.
The pseudo-random number generator is used for calculating a random number sequence through a random seed value when the system needs the random number. When the pseudo random number is calculated, if the initial value (random seed) used is unchanged, the number sequence of the pseudo random number is also unchanged.
In some embodiments of the present application, the pseudo-random number generator may be selected by an administrator according to the actual situation, and the pseudo-random number generator should be capable of outputting random numbers with numbers greater than or equal to a preset number and different from each other.
Step S202, the first real-time is used as a random seed of a pseudo-random number generator to generate a random number.
In an embodiment of the present application, the first terminal may output a preset number of random numbers by using the pseudorandom number generator with the first real time as a random seed of the pseudorandom number generator, where the random number values in the preset number of random numbers are different.
Since the characteristic of the pseudo random number generator is that the number sequence of the pseudo random number to be output is not changed when the random seed is used. That is, the same pseudorandom number generator outputs in the same order using the same time as the random seed.
Step S203, according to the mapping relation between the random number and the number, determining the sequence of each hash table contained in the first hash table sequence, and according to the sequence, performing hash table sequencing on the first hash table sequence to obtain a second hash table sequence.
In an embodiment of the present application, after the first terminal obtains a preset number of random numbers through the pseudorandom number generator, an order of hash tables included in the first hash table sequence may be determined according to a mapping relationship between the random numbers and the numbers of the hash tables, and then hash table ordering is performed on the first hash table sequence according to the order, so as to obtain a second hash table sequence.
Taking 8 hash tables as a total, the serial numbers of the 8 hash tables are sequentially 1 to 8 as an example for explanation, if each random number output by the pseudo-random number generator is any integer from 1 to 8, the random number and the serial number can be equal as a mapping relationship. And arranging the hash table at the position of the random number equal to the number value according to the random number sequence output by the pseudo-random number generator, and finishing the ordering of the hash table to obtain a second hash table sequence.
In some embodiments of the present application, the mapping relationship between the random number and the number of the hash table may also be determined according to the numerical magnitude relationship of the random number.
Taking 8 hash tables as an example, the serial numbers of the 8 hash tables are sequentially 1 to 8, according to the numerical value of each random number output by the pseudo-random number generator, the random number with the largest numerical value corresponds to the serial number 8, and the serial number with the smallest numerical value corresponds to the serial number 1. And then, according to the random number sequence output by the pseudo-random number generator, sequencing the hash tables according to the preset relation, namely, sequencing the hash table with the number of 1 at the position of the random number with the minimum value in the random number, and so on, completing sequencing of the hash tables, and obtaining a second hash table sequence.
Step S104, the first terminal reads the self equipment identification code and determines a first hash value associated with the equipment identification code according to the equipment identification code and the second hash table sequence.
In the embodiment of the present application, after the ordering of the hash tables in the first hash table sequence is completed to obtain the second hash table sequence, the device identifier of the first terminal may be input into the first hash table according to the order of the hash tables in the second hash table sequence, the result may be input into the second Zhang Haxi table, and so on, through all the hash tables in the second hash table sequence, the first hash value associated with the device identifier may be finally obtained.
It should be noted that, the device identifier, the first hash value, and the number of resources are all used for resource allocation by the resource management terminal, that is, the resource management terminal may perform resource allocation according to the device identifier, the first hash value, and the number of resources.
In step S105, the second terminal acquires the device identification code, the first hash value, and the number of resources.
In some embodiments of the present application, after obtaining the first hash value, the first terminal may generate a two-dimensional code according to the first hash value, the number of resources, and the device identifier, and display the two-dimensional code.
And then, scanning the two-dimensional code by the second terminal, and analyzing the two-dimensional code obtained by scanning to obtain the equipment identification code, the first hash value and the resource quantity.
In practical applications, because there may be different resource management terminals, when the first terminal generates the two-dimensional code for resource allocation, the information in the two-dimensional code for resource allocation may further include a terminal entry pointed to by the resource management terminal for the current resource allocation. And when the second terminal scans the resource allocation two-dimensional code, the first hash value, the resource quantity, the equipment identification code and the terminal information of the second terminal are sent to the resource management terminal pointed by the current resource allocation according to the terminal entrance.
In some embodiments of the present application, the first terminal may recalculate the first hash value at a preset time interval according to steps S101 to S104, so as to dynamically refresh the two-dimensional code.
In some embodiments of the present application, the second terminal may further detect whether a first terminal exists within a preset distance, and when detecting that the first terminal exists within the preset distance, acquire, through near field communication, a first hash value, an equipment identifier code, and a resource number generated by the first terminal.
Step S106, the second terminal reads the associated first account information and sends the terminal information, the equipment identification code, the first hash value and the resource quantity to the resource management terminal.
The first account information may be a user resource account bound to the second terminal itself. The first account information may be obtained from the memory of the second terminal by the second terminal, or the second terminal may obtain the first account information bound with the device identification number according to the device identification number of the second terminal.
In the embodiment of the application, the second terminal may send the first hash value, the device identification code, the number of resources and the first account information associated with the second terminal reading to the resource management terminal. Specifically, the second terminal may generate a resource allocation request carrying the first account information, the device identifier code, the first hash value and the number of resources, and send the resource allocation request to the resource management terminal.
After the resource management terminal receives the information, the validity of the resource allocation can be confirmed according to the first hash value and the equipment identification code, and the resource allocation of the first terminal and the second terminal is completed according to the number of the resources and the first account information.
In the embodiment of the application, the first terminal does not need to be networked, does not need to interact with the resource management terminal directly, and only needs to obtain the first hash value, the equipment identification code and the resource quantity generated by the first terminal by the second terminal, and sends information to the resource management terminal, so that the resource management terminal can obtain the resource allocation request. Because networking operation can be omitted, the first terminal does not need a network connection module, hardware cost is effectively reduced, and meanwhile, an operator network is not required to be relied on, so that the distribution mode is more convenient.
In step S107, the resource management terminal determines a first account pointed by the first account information, and allocates resources to the first account according to the device identification code, the first hash value and the number of resources.
Specifically, after the second terminal sends the resource allocation request to the resource management terminal, as shown in fig. 3, the resource management terminal determines a first account pointed by the first account information, and allocates resources to the first account according to the device identifier, the first hash value and the number of resources, which may include the following steps S301 to S304.
In step S301, when a resource allocation request is received, a second real-time is acquired.
In the embodiment of the present application, when the resource allocation terminal acquires the device identifier, the first hash value and the number of resources, the time at the current time may be acquired as the second real-time.
Step S302, sorting hash tables contained in the third hash table sequence according to the second real-time to obtain a fourth hash table sequence.
The third hash table sequence also includes a hash table sequence with a plurality of Zhang Haxi tables, and under normal conditions, the hash tables in the third hash table sequence should be the same as the hash tables in the first hash table sequence. The third hash table sequence may be stored in the resource allocation terminal, or may be stored in another network server, and may be acquired from the other network server by the resource allocation terminal.
In some embodiments of the present application, before a user performs a resource allocation operation, the resource management terminal may apply for the resource management terminal, generate, by the resource management terminal, a first hash table sequence associated with a device identification number of the first terminal according to user information and the device identification number, and write, by the resource management terminal or a writing device associated with the resource management terminal, the obtained first hash table sequence into the first terminal; meanwhile, the resource management terminal uses the first hash table sequence as a third hash table sequence and stores the third hash table sequence in the resource allocation terminal or other network servers.
In an embodiment of the present application, if the resource allocation terminal obtains the second real-time, the hash tables included in the third hash table sequence may be ordered according to the second real-time to obtain a fourth hash table. The specific sorting method may refer to the foregoing specific description of the method for sorting the first hash table sequence according to the first real-time, which is not described in detail in this application. And, the algorithm for ordering the hash tables contained in the second hash table sequence should be the same as the algorithm for ordering the first hash table sequence according to the first real-time.
Step S303, calculating a second hash value associated with the equipment identification code according to the equipment identification code and the fourth hash table sequence.
In the embodiment of the present application, if the first hash table sequence is tampered or the sorting algorithm is tampered, the second hash value corresponding to the device identifier calculated by the resource allocation terminal according to the device identifier and the fourth hash table sequence is different from the first hash value. And under normal conditions, namely when the first hash table sequence is not tampered and the sorting algorithm is not tampered, as the third hash table sequence is the same as the first hash table sequence and the sorting algorithm is the same as the first hash table sequence, when the first real-time is the same as the second real-time, the second hash value corresponding to the equipment identification code calculated by the resource allocation terminal according to the equipment identification code and the fourth hash table sequence is the same as the first hash value.
It should be noted that, in order to ensure that the calculation results are the same under normal conditions, when the second real-time is acquired, the second terminal may acquire the third real-time, the third real-time is located between the first time point and the second time point, and any time point between the first time point and the second time point, which is the same as the precision of the first real-time, is then taken as the second real-time. The first time point and the second time point may be selected according to practical situations, for example, may be one minute before and after the third real-time.
In the description of the case where the accuracy of the first real-time is minutes and the first real-time is 8 points 04 minutes, if the third real-time obtained by the second terminal is 8 points 05 minutes, the first time point may be 8 points 04 minutes, and the second time point may be 8 points 06 minutes, and any time point between 8 points 04 minutes, 05 minutes, and 06 minutes may be regarded as the second real-time. At this time, only the second hash value calculated according to any time point is the same as the first hash value, and the resource allocation can be judged to be valid. That is, when the 8-point 04 score is taken as the second real-time, the calculated second hash value is the same as the first hash value, and it can be determined that the resource allocation is valid.
In addition, in the embodiment of the present application, the validity period of the resource allocation request may be controlled according to different selection manners of the first time point and the second time point. That is, although the second hash table sequence is identical to the first hash table sequence and the sorting algorithm is also identical, if there is no time point identical to the first real-time in any time point identical to the precision of the first real-time between the first time point and the second time point, the second hash value corresponding to the device identification code calculated by the resource allocation terminal according to the device identification code and the sorted second hash table sequence is different from the first hash value.
Continuing with the above example, since the first time point and the second time point are one minute before and after the third real-time, the difference between the first real-time when the first terminal acquires the resource allocation information and the second real-time when the resource management terminal receives the resource allocation request is within one minute, if any one time point between the first time point and the second time point, which is the same as the accuracy of the first real-time, can be ensured as the second real-time, there is the second real-time when the first hash value can be the same as the second hash value.
Step S304, if the first hash value is the same as the second hash value, determining a second account associated with the first terminal, and distributing the resources to the first account from the resources contained in the second account according to the number of the resources.
Specifically, in the embodiment of the present application, by comparing the first hash value and the second hash value, if the first hash value and the second hash value are the same, it is indicated that the information carried in the resource allocation request is generated by the first terminal, the first hash table sequence and the specific ordering algorithm in the first terminal are not tampered, and the resource allocation request is within the valid period, so that it can be determined that the resource allocation is valid, and further the resource allocation is performed for the first terminal according to the number of resources.
In some embodiments of the present application, the first terminal is associated with a second account, and the second account may be a user resource account bound to the first terminal itself.
In order to realize resource allocation, before the user performs the resource allocation operation, an activation operation may be performed on the resource management terminal, and the second account associated with the first terminal may be bound. When the first hash value is the same as the second hash value, a second account associated with the first terminal can be determined, and resources are allocated to the first account from resources contained in the second account according to the number of the resources.
In the embodiment of the application, a first terminal in a resource allocation system detects a resource allocation operation of a user, and acquires a first real-time when the resource allocation operation is detected; then, sorting hash tables contained in the first hash table sequence according to the first real-time; then, a first hash value associated with the device identification code is calculated according to the device identification code and the second hash table sequence obtained after the sorting. The second terminal in the resource allocation system can acquire the equipment identification code, the first hash value and the resource quantity obtained by the first terminal, and send the acquired equipment identification code, the first hash value, the resource quantity and the self-associated first account information to the resource management terminal in the resource allocation system. The resource management terminal can determine a first account pointed by the first account information, and allocate resources to the first account according to the equipment identification code, the first hash value and the number of resources. According to the embodiment of the application, the hash tables in the first hash table sequence are ordered according to the first real-time, and the first hash value associated with the equipment identification code is calculated, so that the resource management terminal can determine the effectiveness of resource allocation according to the first hash value to perform resource allocation, and compared with the case that the hash value is calculated through only one hash table or through the hash table with a fixed sequence, the safety of resource allocation can be effectively guaranteed.
Taking the first terminal as a digital wallet as an example for explanation, a user can apply for the digital wallet to a bank, the bank generates a first hash table sequence according to the equipment identification code of the digital wallet, writes the first hash table sequence into a storage module of the digital wallet through specific writing equipment, and issues the digital wallet with the first hash table sequence to the user. After obtaining the digital wallet, the user may bind the user's first bank card. When the payment operation is needed, the user can input the payment amount needed to be paid to the merchant in the digital wallet, and click to confirm to generate the resource allocation information. When the resource allocation information is obtained, the digital wallet can obtain the current moment as a first real-time, sort hash tables in a first hash table sequence stored in the digital wallet according to the first real-time, and then obtain a first hash value associated with the device identification code according to the digital wallet device identification code and the sorted second hash table sequence. Then, the digital wallet can generate a two-dimension code according to the first hash value, the payment amount, the server entrance of the bank and the equipment identification code, and recalculate and dynamically refresh the two-dimension code according to the fixed time interval.
The merchant who needs to collect money can use the second terminal, such as the mobile terminal or the POS machine, to scan the two-dimension code, obtain the information, and generate a resource allocation request according to the information and the terminal information. And then, according to the server entrance of the bank, sending the resource allocation request to the resource management terminal of the bank.
After receiving the resource allocation request sent by the second terminal, the resource management terminal of the bank can confirm the validity of the resource allocation according to the first hash value and the equipment identification code. Specifically, when the resource management terminal of the bank receives the resource allocation request sent by the second terminal, the current moment can be obtained as the second real-time. And then, a third hash table sequence is called from the resource management terminal, the hash tables in the third hash table sequence are ordered according to the first real-time, and a second hash value associated with the equipment identification code is calculated according to the equipment identification code and the fourth hash table sequence obtained after the ordering. If the first hash value is the same as the second hash value, the resource allocation can be judged to be effective, so that the transfer can be carried out from the first bank card to the second bank card according to the first bank card bound by the digital wallet and the second bank card related to the terminal information of the second terminal, the transfer amount is the same as the payment amount carried in the resource allocation request, and further the resource allocation is completed according to the requirements of users.
Fig. 4 is a schematic implementation flow chart of a resource allocation method according to an embodiment of the present application, where the method may be applied to a first terminal in the resource allocation system shown in fig. 1, and is applicable to a situation where security of resource allocation needs to be improved. The first terminal may be an intelligent terminal capable of connecting to a network, such as a mobile phone or an intelligent watch, or may be an offline terminal, such as a digital wallet.
Specifically, the above-described resource allocation method may include the following steps S401 to S404.
Step S401, acquiring resource allocation information.
The above-mentioned resource allocation information refers to information generated according to the resource allocation requirement of the user, and may include the number of resources for performing resource allocation, and the like.
In step S402, in response to acquiring the resource allocation information, a first real-time is acquired.
Step S403, a first hash table sequence is obtained, and hash table ordering is carried out on the first hash table sequence according to the first real-time, so as to obtain a second hash table sequence.
Step S404, the device identification code of the device is read, and a first hash value associated with the device identification code is determined according to the device identification code and the second hash table sequence.
The device identification code, the first hash value and the resource quantity are used for resource allocation by the resource management terminal.
For the specific implementation manners of the steps S401 to S404, reference may be made to the steps S101 to S104, which are not described in detail herein.
In some embodiments of the present application, after determining the first hash value associated with the device identifier, the first terminal may generate a two-dimensional code according to the first hash value, the number of resources, and the device identifier, and display the two-dimensional code. The two-dimensional code is used for resource allocation by the resource management terminal.
At this time, the first terminal does not need to be networked, does not need to interact with the resource management terminal directly, and only needs to obtain the first hash value, the equipment identification code and the resource quantity generated by the first terminal by the second terminal, and sends information to the resource management terminal, so that the resource management terminal can obtain the resource allocation request. Because networking operation can be omitted, the first terminal does not need a network connection module, hardware cost is effectively reduced, and meanwhile, an operator network is not required to be relied on, so that the distribution mode is more convenient.
In some embodiments of the present application, the first terminal may recalculate the first hash value at a preset time interval according to steps S101 to S104, so as to dynamically refresh the two-dimensional code.
In some embodiments of the present application, the first hash table sequence includes a predetermined number of hash tables; each hash table is associated with a number that is different from each other. The step S403 may include: acquiring a preset pseudo-random number generator; the first real-time is used as a random seed of the pseudo-random number generator to generate random numbers, the number of the random numbers is the same as the preset number, and the values of the random numbers are different; determining the sequence of each hash table contained in a first hash table sequence according to the mapping relation between the random number and the number, and sequentially carrying out hash table sequencing on the first hash table sequence to obtain a second hash table sequence. The specific implementation manner of this ordering manner may refer to the foregoing description of fig. 2, which is not repeated herein.
In the embodiment of the application, a first terminal detects a resource allocation operation of a user, and when the resource allocation operation is detected, a first real-time is obtained; then, sorting hash tables contained in the first hash table sequence according to the first real-time; then, a first hash value associated with the device identification code is calculated according to the device identification code and the second hash table sequence obtained after the sorting. The device identification code, the first hash value and the resource quantity are used for resource allocation of a resource management terminal. According to the method and the device for the resource allocation, the hash tables in the first hash table sequence are ordered according to the first time, and the first hash value associated with the equipment identification code is calculated, so that the resource management terminal can determine the effectiveness of the resource allocation according to the first hash value, and compared with the method and the device for the resource allocation, the method and the device for the resource allocation can more effectively guarantee the safety of the resource allocation by calculating the hash value through one hash table or the hash table with a fixed sequence.
In order to illustrate a specific implementation manner of the above-mentioned resource management terminal for confirming the validity of resource allocation, fig. 5 shows an implementation flow diagram of a resource allocation method provided in an embodiment of the present application, where the method may be applied to a resource allocation terminal in the resource management system shown in fig. 1, and is applicable to a situation where the security of resource allocation needs to be improved. The resource allocation terminal can be a server, a computer or the like.
Specifically, the above-described resource allocation method may include the following steps S501 to S505.
In step S501, a resource allocation request is received.
The resource allocation request is a request which is generated according to the resource allocation requirement of the user and carries information related to the resource allocation requirement. The resource allocation request carries a first hash value, a device identification code of the first terminal and the number of resources.
The resource allocation request may be that the second terminal scans the two-dimensional code of the first terminal to obtain the first hash value, the device identifier code, the number of resources, and other information, and sends the information to the resource allocation terminal.
In the embodiment of the present application, when the resource allocation terminal receives the resource allocation request, processing is required according to the resource allocation request, and whether the resource allocation is required is determined.
Step S502, when a resource allocation request is received, a second real-time is acquired.
In the embodiment of the present application, when the resource allocation terminal receives the resource allocation request, that is, when the resource allocation terminal acquires the device identifier code, the first hash value, and the number of resources, the current real-time may be acquired as the second real-time.
In some embodiments of the present application, the obtaining the second real-time when the resource allocation request is received may include: acquiring a third real-time when the resource allocation request is received, wherein the third real-time is positioned between the first time point and the second time point; any time point between the first time point and the second time point, which is the same as the precision of the first real-time, is taken as the second real-time.
Step S503, according to the second real-time, sorting the hash tables contained in the third hash table sequence to obtain a fourth hash table sequence.
Step S504, according to the device identification code and the fourth hash table sequence, a second hash value associated with the device identification code is determined.
For specific implementation manners of the steps S502 to S504, reference may be made to the steps S302 to S304, which are not described in detail herein.
In step S505, if the first hash value is the same as the second hash value, determining a second account associated with the first terminal, and allocating resources to the second account according to the number of resources.
Specifically, in some embodiments of the present application, the above-mentioned resource allocation request is sent by the second terminal, where the resource allocation request further carries first account information associated with the second terminal; the step S405 may include: determining a first account pointed by the first account information; and allocating the resources to the first account from the resources contained in the second account according to the quantity of the resources. The specific implementation manner of the resource allocation manner may refer to the specific description of step S305, which is not described in detail in the present application.
In other embodiments of the present application, before receiving the resource allocation request, the resource management terminal may further generate a first hash table sequence according to the device identifier code, and write the first hash table sequence into the memory of the first terminal.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order according to the present application.
Fig. 6 is a schematic structural diagram of a first resource allocation device 600 according to an embodiment of the present application, where the first resource allocation device 600 is configured on a first terminal. The first resource allocation apparatus 600 may include: a first acquisition unit 601, a second acquisition unit 602, a first ordering unit 603, and a first calculation unit 604.
A first obtaining unit 601, configured to obtain resource allocation information, where the resource allocation information includes the number of resources;
a second obtaining unit 602, configured to obtain a first real-time in response to obtaining the resource allocation information;
a first ordering unit 603, configured to obtain a first hash table sequence, and perform hash table ordering on the first hash table sequence according to the first real-time, so as to obtain a second hash table sequence;
a first calculating unit 604, configured to read a device identifier of the first calculating unit, and determine a first hash value associated with the device identifier according to the device identifier and the second hash table sequence, where the device identifier, the first hash value, and the number of resources are used for resource allocation by a resource management terminal.
In some embodiments of the present application, the first resource allocation device 600 further includes a two-dimensional code generating module, configured to generate a two-dimensional code according to the first hash value, the number of resources, and the device identifier, and display the two-dimensional code; the two-dimension code is used for resource allocation by the resource management terminal.
In some embodiments of the present application, the first hash table sequence includes a predetermined number of hash tables; each hash table is associated with a number that is different from each other. The first sorting unit 603 is specifically further configured to: acquiring a preset pseudo-random number generator; the first real-time is used as a random seed of the pseudo-random number generator, a random number is generated, the number of the random numbers is the same as the preset number, and the values of the random numbers are different; and determining the sequence of each hash table contained in the first hash table sequence according to the mapping relation between the random number and the number, and carrying out hash table sequencing on the first hash table sequence by the sequence to obtain a second hash table sequence.
It should be noted that, for convenience and brevity, the specific working process of the first resource allocation apparatus 600 may refer to the corresponding process of the method described in fig. 4, which is not described herein again.
Fig. 7 is a schematic structural diagram of a second resource allocation device 700 according to an embodiment of the present application, where the second resource allocation device 700 is configured on a first terminal. The second resource allocation device 700 may include: a receiving unit 701, a third acquiring unit 702, a second sorting unit 703, a second calculating unit 704, and a resource allocating unit 705.
A receiving unit 701, configured to receive a resource allocation request, where the resource request carries a first hash value, an equipment identifier of a first terminal, and a resource number;
a third obtaining unit 702, configured to obtain a second real-time when the resource allocation request is received;
a second sorting unit 703, configured to sort hash tables included in the third hash table sequence according to the second real-time, so as to obtain a fourth hash table sequence;
a second calculating unit 704, configured to determine a second hash value associated with the device identifier according to the device identifier and the fourth hash table sequence;
and the resource allocation unit 705 is configured to determine a second account associated with the first terminal if the first hash value is the same as the second hash value, and allocate resources to the second account according to the number of resources.
In some embodiments of the present application, the third obtaining unit 702 is further specifically configured to: acquiring a third real-time when the resource allocation request is received, wherein the third real-time is positioned between a first time point and a second time point; and taking any time point which is between the first time point and the second time point and has the same precision as the first real-time as the second real-time.
In some embodiments of the present application, the resource allocation request is sent by the second terminal, where the resource allocation request further carries first account information associated with the second terminal. The above-mentioned resource allocation unit 705 is further specifically configured to: determining a first account pointed by the first account information; and distributing resources to the first account from the resources contained in the second account according to the quantity of the resources.
In some embodiments of the present application, the second resource allocation apparatus 700 further includes a writing unit, configured to generate a first hash table sequence according to the device identifier code; and writing the first hash table sequence into a memory of the first terminal.
It should be noted that, for convenience and brevity, the specific working process of the second resource allocation apparatus 700 may refer to the corresponding process of the method described in fig. 5, and will not be described herein again.
Fig. 8 is a schematic diagram of a terminal according to an embodiment of the present application. The terminal 8 may include: a processor 80, a memory 81 and a computer program 82, such as a resource allocation device program, stored in the memory 81 and executable on the processor 80. The processor 80, when executing the computer program 82, implements the steps of the various resource allocation method embodiments described above, such as steps S401 to S404 shown in fig. 4. Alternatively, the processor 80, when executing the computer program 82, implements the steps in the above-described respective resource allocation method embodiments, such as steps S501 to S505 shown in fig. 5.
Alternatively, the processor 80, when executing the computer program 82, performs the functions of the modules/units of the apparatus embodiments described above, e.g., the functions of the units 601 to 604 shown in fig. 6. Alternatively still, the processor 80 may perform the functions of the modules/units of the apparatus embodiments described above, such as the units 701 to 705 of fig. 7, when executing the computer program 82.
The computer program may be divided into one or more modules/units, which are stored in the memory 81 and executed by the processor 80 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program in the terminal.
For example, the computer program may be divided into a first acquisition unit, a second acquisition unit, a first sorting unit and a first calculation unit. The specific functions of each unit are as follows: the first acquisition unit is used for acquiring resource allocation information, wherein the resource allocation information comprises the number of resources; the second acquisition unit is used for acquiring the first real-time in response to the acquisition of the resource allocation information; the first ordering unit is used for acquiring a first hash table sequence, and carrying out hash table ordering on the first hash table sequence according to the first real-time to obtain a second hash table sequence; the first computing unit is used for reading the equipment identification code of the first computing unit, determining a first hash value associated with the equipment identification code according to the equipment identification code and the second hash table sequence, and the equipment identification code, the first hash value and the resource quantity are used for resource allocation of a resource management terminal.
For another example, the computer program may also be split into a receiving unit, a third obtaining unit, a second sorting unit, a second computing unit and a resource allocation unit. The specific functions of each unit are as follows: the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a resource allocation request, and the resource request carries a first hash value, a device identification code and the number of resources; a third obtaining unit, configured to obtain a second real-time when the resource allocation request is received; the second sorting unit is used for sorting the hash tables contained in the third hash table sequence according to the second real-time to obtain a fourth hash table sequence; a second calculating unit, configured to calculate a second hash value associated with the device identifier according to the device identifier and the fourth hash table sequence; and the resource allocation unit is used for determining a second account associated with the first terminal if the first hash value is the same as the second hash value, and allocating resources to the second account according to the number of resources.
The terminal may include, but is not limited to, a processor 80, a memory 81. It will be appreciated by those skilled in the art that fig. 8 is merely an example of a terminal and is not intended to be limiting, and that more or fewer components than shown may be included, or certain components may be combined, or different components may be included, for example, the terminal may also include a display device, an input-output device, a network access device, a bus, etc.
The processor 80 may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 81 may be an internal storage unit of the terminal, such as a hard disk or a memory of the terminal. The memory 81 may also be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal. Further, the memory 81 may also include both an internal storage unit and an external storage device of the terminal. The memory 81 is used for storing the computer program and other programs and data required by the terminal. The memory 81 may also be used to temporarily store data that has been output or is to be output.
In some embodiments of the present application, when the terminal is a first terminal performing the method shown in fig. 4, as shown in fig. 9, the first terminal may further include an input device 83, a power supply module 84, and a display 85 on the basis of the processor 80 and the memory 81. The power supply module may be a solar power supply module, a battery power supply module, or the like, and may be used to supply power to the first terminal; the input device can be a keyboard, a pen input device and the like, and can be used for inputting the resource quantity for resource allocation by a user; the display can be used for displaying two-dimensional codes, electric quantity and the like.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal and method may be implemented in other manners. For example, the apparatus/terminal embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each method embodiment described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (5)

1. A resource allocation system, the resource allocation system comprising: the system comprises a first terminal, a second terminal and a resource management terminal;
the first terminal acquires resource allocation information, wherein the resource allocation information comprises the number of resources;
the first terminal responds to the resource allocation information to acquire a first real-time;
the first terminal acquires a first hash table sequence, and performs hash table sequencing on the first hash table sequence according to the first real-time to obtain a second hash table sequence;
the first terminal reads the equipment identification code of the first terminal and determines a first hash value associated with the equipment identification code according to the equipment identification code and the second hash table sequence; the equipment identification code, the first hash value and the resource quantity are used for resource allocation by a resource management terminal;
The second terminal acquires the equipment identification code, the first hash value and the resource quantity;
the second terminal reads the associated first account information and sends the terminal information of the second terminal, the equipment identification code, the first hash value and the resource quantity to the resource management terminal;
the resource management terminal determines a first account pointed by the first account information, and allocates resources to the first account according to the equipment identification code, the first hash value and the number of resources;
the sending the terminal information of the second terminal, the device identification code, the first hash value and the resource amount to the resource management terminal includes: generating a resource allocation request carrying the first account information, the equipment identification code, the first hash value and the resource quantity, and sending the resource allocation request to the resource management terminal; correspondingly, the allocating the resources to the first account according to the equipment identification code, the first hash value and the resource quantity includes: when the resource allocation request is received, acquiring a second real-time; ordering the hash tables contained in the third hash table sequence according to the second real-time to obtain a fourth hash table sequence; calculating a second hash value associated with the equipment identification code according to the equipment identification code and the fourth hash table sequence; and if the first hash value is the same as the second hash value, determining a second account associated with the first terminal, and distributing resources to the first account from the resources contained in the second account according to the quantity of the resources.
2. The resource allocation system of claim 1, wherein the first hash table sequence comprises a predetermined number of hash tables; each hash table is associated with a number, and the numbers are different;
the hash table sorting of the first hash table sequence according to the first real-time to obtain a second hash table sequence includes:
acquiring a preset pseudo-random number generator;
the first real-time is used as a random seed of the pseudo-random number generator, a random number is generated, the number of the random numbers is the same as the preset number, and the values of the random numbers are different;
and determining the sequence of each hash table contained in the first hash table sequence according to the mapping relation between the random number and the number, and carrying out hash table sequencing on the first hash table sequence according to the sequence to obtain the second hash table sequence.
3. A resource allocation method, applied to a resource management terminal, the method comprising:
receiving a resource allocation request sent by a second terminal, wherein the resource allocation request carries terminal information of the second terminal, first account information associated with the second terminal, a first hash value, a device identification code of the first terminal and the number of resources, wherein the first account information is read by the second terminal, and the device identification code, the first hash value and the number of resources are acquired by the second terminal from the first terminal; the process of obtaining the device identification code, the first hash value and the resource number by the first terminal includes: after resource allocation information is acquired, a first real-time is acquired in response to the resource allocation information, a first hash table sequence is acquired, hash table ordering is carried out on the first hash table sequence according to the first real-time, a second hash table sequence is acquired, a self equipment identification code is read, a first hash value associated with the equipment identification code is determined according to the equipment identification code and the second hash table sequence, and the resource allocation information contains the number of resources;
When the resource allocation request is received, acquiring a second real-time;
ordering the hash tables contained in the third hash table sequence according to the second real-time to obtain a fourth hash table sequence;
determining a second hash value associated with the equipment identification code according to the equipment identification code and the fourth hash table sequence;
determining a first account pointed by the first account information;
and if the first hash value is the same as the second hash value, determining a second account associated with the first terminal, and distributing resources to the first account from the resources contained in the second account according to the quantity of the resources.
4. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to claim 3 when executing the computer program.
5. A computer readable storage medium storing a computer program, which when executed by a processor performs the steps of the method according to claim 3.
CN202010982203.0A 2020-09-17 2020-09-17 Resource allocation system, method, terminal and storage medium Active CN112214312B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010982203.0A CN112214312B (en) 2020-09-17 2020-09-17 Resource allocation system, method, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010982203.0A CN112214312B (en) 2020-09-17 2020-09-17 Resource allocation system, method, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN112214312A CN112214312A (en) 2021-01-12
CN112214312B true CN112214312B (en) 2024-03-26

Family

ID=74049996

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010982203.0A Active CN112214312B (en) 2020-09-17 2020-09-17 Resource allocation system, method, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN112214312B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018076291A1 (en) * 2016-10-28 2018-05-03 美的智慧家居科技有限公司 Method and system for generating permission token, and device
CN110457128A (en) * 2019-07-11 2019-11-15 阿里巴巴集团控股有限公司 Method for allocating tasks, device and system
CN110599323A (en) * 2019-09-24 2019-12-20 腾讯科技(深圳)有限公司 Resource processing method and processing equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018076291A1 (en) * 2016-10-28 2018-05-03 美的智慧家居科技有限公司 Method and system for generating permission token, and device
CN110457128A (en) * 2019-07-11 2019-11-15 阿里巴巴集团控股有限公司 Method for allocating tasks, device and system
CN110599323A (en) * 2019-09-24 2019-12-20 腾讯科技(深圳)有限公司 Resource processing method and processing equipment

Also Published As

Publication number Publication date
CN112214312A (en) 2021-01-12

Similar Documents

Publication Publication Date Title
CN105099688B (en) A kind of operating method of electronic account, the methods of exhibiting and device for paying the page
CN110599323B (en) Resource processing method and processing equipment
CN112819466B (en) Digital certificate processing method and device, terminal equipment and storage medium
CN113472720B (en) Digital certificate key processing method, device, terminal equipment and storage medium
CN111738725A (en) Cross-border resource transfer authenticity auditing method and device and electronic equipment
CN109948882B (en) Task processing method based on block data structure and related equipment
CN110322612B (en) Business data processing method and device, computing equipment and storage medium
CN111179066A (en) Batch processing method and device of service data, server and storage medium
CN110909808A (en) Method, system and device for anti-counterfeiting verification
CN111062717A (en) Data transfer processing method and device and computer readable storage medium
CN109583931A (en) Transaction data processing method, device, electronic equipment and readable storage medium storing program for executing
CN110659899B (en) Offline payment method, device and equipment
CN108280024B (en) Flow distribution strategy testing method and device and electronic equipment
CN112214312B (en) Resource allocation system, method, terminal and storage medium
CN112182394A (en) Product recommendation method and device, electronic equipment and storage medium
CN111640022A (en) Counter transaction authorization method, device and system
US11950173B2 (en) Method of determining shared service index based on shared service of communication credential
CN110348983A (en) Transaction Information management method and device, electronic equipment and non-transient storage media
CN115858368A (en) Cross-border payment oriented data generation method, system, equipment and storage medium
CN110086761B (en) Method and equipment for providing resources
CN111901299A (en) Application authentication method and device, electronic equipment and storage medium
CN111683070A (en) Data transmission method and device based on identity encryption and storage medium
CN111612440A (en) Digital currency circulation method, device, server and readable storage medium
CN114220222B (en) Offline prepaid electric quantity recharging method and system
CN115641200A (en) Credit card transaction information processing method and device, electronic equipment and medium

Legal Events

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