CN116938836A - Resource processing method and device and computer equipment - Google Patents

Resource processing method and device and computer equipment Download PDF

Info

Publication number
CN116938836A
CN116938836A CN202310779278.2A CN202310779278A CN116938836A CN 116938836 A CN116938836 A CN 116938836A CN 202310779278 A CN202310779278 A CN 202310779278A CN 116938836 A CN116938836 A CN 116938836A
Authority
CN
China
Prior art keywords
resource
elements
terminal
sequence
request
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.)
Pending
Application number
CN202310779278.2A
Other languages
Chinese (zh)
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.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202310779278.2A priority Critical patent/CN116938836A/en
Publication of CN116938836A publication Critical patent/CN116938836A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/78Architectures of resource allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • G06Q20/0652Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash e-cash with decreasing value according to a parameter, e.g. time

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application relates to the technical field of big data, and particularly discloses a resource processing method. The method comprises the following steps: receiving a resource allocation request sent by a first terminal, wherein the resource allocation request comprises the total amount of resources and the number of second terminals; generating a resource notification message, and sending the resource notification message to the second terminal; receiving a resource acquisition request of the second terminal, wherein the resource acquisition request comprises the current request time; and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and acquiring the resource quantity of the second terminal according to the sum of the elements in the matched elements and the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal. By adopting the method, the resource quantity can be reasonably distributed, and the enthusiasm of users is improved.

Description

Resource processing method and device and computer equipment
Technical Field
The present application relates to the field of big data technology, and in particular, to a resource processing method, apparatus, computer device, storage medium, and computer program product.
Background
In the age of the rapid development of communication tools, many new communication modes, such as robbery-fighting packets, are presented. The user can perform the operation of sending the red packet or receiving the red packet on the device, and can select the object to perform the operation of sending the red packet, wherein the selected object can be one or a plurality of objects. In the case where there are a plurality of selected objects, the amount of the red pack needs to be allocated.
In the related art, the red packets can be distributed in a random distribution mode, namely, the average value of the current amount and the number of people is calculated, and the red packets are distributed according to the multiple of the average value. However, there are some people who extract the amount of the red packet far more than others, and the participant who first extracts the red packet may obtain the amount of the red packet less than the later participants, and the amount of the red packet cannot be reasonably allocated.
Disclosure of Invention
Based on this, it is necessary to provide a resource processing method, according to the above technical problem, the number of elements in the fibonacci sequence can be determined according to the number of the second terminals, and the matched elements are obtained through the sequence values of the current request time in all the request times, so as to obtain the resource amount by calculation. The resource quantity is reasonably distributed, and the enthusiasm of users is improved.
The technical scheme of the application obtains, stores, uses, processes and the like the data, which all meet the relevant regulations of national laws and regulations.
In a first aspect, the present application provides a resource processing method. The method comprises the following steps:
receiving a resource allocation request sent by a first terminal, wherein the resource allocation request comprises the total amount of resources and the number of second terminals;
generating a resource notification message, and sending the resource notification message to the second terminal;
receiving a resource acquisition request of the second terminal, wherein the resource acquisition request comprises the current request time;
and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and acquiring the resource quantity of the second terminal according to the sum of the elements in the matched elements and the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
In a second aspect, the present application further provides a resource processing method, where the method includes:
transmitting a resource allocation request to a server, wherein the resource allocation request comprises the total amount of resources and the number of second terminals; the resource allocation request is used for the server to generate a resource notification message and send the resource notification message to the second terminal;
The resource notification message is used for sending a resource acquisition request to the server by the second terminal, wherein the resource acquisition request comprises the current request time; the current request time is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is acquired according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
And acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
In a third aspect, the present application further provides a resource processing method, where the method includes:
acquiring a resource notification message generated by a server according to a resource allocation request sent by a first terminal, wherein the resource allocation request comprises the total amount of resources and the number of second terminals;
sending a resource acquisition request to a server, wherein the resource acquisition request comprises the current request time; the resource acquisition request is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is obtained according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
In a fourth aspect, the present application also provides a resource processing apparatus, the apparatus comprising:
the receiving module is used for receiving a resource allocation request sent by the first terminal, wherein the resource allocation request comprises the total amount of resources and the number of the second terminals;
the generation module is used for generating a resource notification message and sending the resource notification message to the second terminal;
the time judging module is used for receiving a resource acquisition request of the second terminal, wherein the resource acquisition request comprises the current request time;
and the determining module is used for acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all the request times, and acquiring the resource quantity of the second terminal according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
In a fifth aspect, the present application also provides a resource processing apparatus, the apparatus comprising:
the sending module is used for sending a resource allocation request to the server, wherein the resource allocation request comprises the total amount of resources and the number of second terminals; the resource allocation request is used for the server to generate a resource notification message and send the resource notification message to the second terminal;
The computing module is used for the resource notification message to be used for the second terminal to send a resource acquisition request to the server, wherein the resource acquisition request comprises the current request time; the current request time is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is acquired according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
And acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
In a sixth aspect, the present application further provides a resource processing apparatus, the apparatus comprising:
the acquisition module is used for acquiring a resource notification message generated by the server according to a resource allocation request sent by the first terminal, wherein the resource allocation request comprises the total amount of resources and the number of second terminals;
the matching module is used for sending a resource acquisition request to the server, wherein the resource acquisition request comprises the current request time; the resource acquisition request is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is obtained according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
In a seventh aspect, the present disclosure also provides a computer apparatus. The computer device comprises a memory storing a computer program and a processor implementing the steps of the resource processing method when the processor executes the computer program.
In a fourth aspect, the present disclosure also provides a computer-readable storage medium. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of a resource processing method.
In a fifth aspect, the present disclosure also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of the resource processing method.
The resource processing method at least comprises the following beneficial effects:
according to the embodiment scheme provided by the disclosure, the total amount of resources and the number of receivers can be determined according to the resource allocation request of the sender, and the resource acquisition request is sent after the receiver receives the resource notification message, wherein the sequence number can be obtained according to the current request time in the resource acquisition request, and the resource amount of the second terminal is calculated by obtaining the matched elements in the fibonacci sequence according to the sequence number. The resource quantity is reasonably distributed, and the enthusiasm of the user participation is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments or the conventional techniques of the present disclosure, the drawings required for the descriptions of the embodiments or the conventional techniques will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present disclosure, and other drawings may be obtained according to the drawings without inventive effort to those of ordinary skill in the art.
FIG. 1 is an application environment diagram of a resource processing method in one embodiment;
FIG. 2 is a flow diagram of a method of resource processing in one embodiment;
FIG. 3 is a flow diagram of a method of resource processing in one embodiment;
FIG. 4 is a flow diagram of a method of resource processing in one embodiment;
FIG. 5 is a block diagram of a resource processing device in one embodiment;
FIG. 6 is a block diagram of a resource processing device in one embodiment;
FIG. 7 is a block diagram of a resource processing device in one embodiment;
FIG. 8 is an internal block diagram of a computer device in one embodiment;
Fig. 9 is an internal structural diagram of a server in one embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, it is not excluded that additional identical or equivalent elements may be present in a process, method, article, or apparatus that comprises a described element. For example, if first, second, etc. words are used to indicate a name, but not any particular order.
The embodiment of the disclosure provides a resource processing method, which can be applied to an application environment as shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In some embodiments of the present disclosure, as shown in fig. 2, a resource processing method is provided, and the method is applied to the server in fig. 1 to process the total amount of resources. It will be appreciated that the method may be applied to a server, and may also be applied to a system comprising a terminal and a server, and implemented by interaction of the terminal and the server. In a specific embodiment, the method may include the steps of:
S202: and receiving a resource allocation request sent by the first terminal, wherein the resource allocation request comprises the total amount of resources and the number of the second terminals.
The first terminal may be a sender of the resource allocation request, the second terminal may be a receiver of the received resource, and the first terminal and the second terminal may be one or more. In the embodiment of receiving and transmitting the red packet, the first terminal is a red packet sender, and the second terminal is a red packet receiver. The resource allocation request may specify an identifier of the second terminal, send the resource to the specified object, and obtain an invalidation notification if the second terminal that does not match the identifier obtains the resource.
S204: generating a resource notification message, and sending the resource notification message to the second terminal.
The server acquires the resource allocation request of the first terminal and sends the generated resource notification message to the second terminal. The resource notification message may include sending a resource acquisition notification to the second terminal and/or setting a reminder message for acquiring the resource when the reminder user clicks the trigger unit.
S206: and receiving a resource acquisition request of the second terminal, wherein the resource acquisition request comprises the current request time.
After the second terminal receives the resource notification message, the user clicks the triggering unit to acquire the resource, and sends a resource acquisition request to the server, wherein the resource acquisition request can include the current request time, the identifier of the second terminal and the like, and is used for judging whether the second terminal can acquire the resource.
S208: and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and acquiring the resource quantity of the second terminal according to the sum of the elements in the matched elements and the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
The fibonacci sequence may be expressed as F (0) = 0,F (1) =1, F (n) =f (n-1) +f (n-2), i.e. the elements of this sequence start from the third term, each equal to the sum of the first two terms, and may be expressed as 1,1,2,3,5,8, … …. After receiving the resource notification message, the plurality of second terminals send a resource acquisition request to the server, and the server determines the sequence number of the second terminals according to the current request time in the resource acquisition request, wherein the sequence number corresponds to the current request time of the second terminals, and if a certain current request time is the 2 nd value in all the request times, the sequence number is 2.
The elements in the fibonacci sequence are also sequentially arranged according to the sequence, the matched elements in the fibonacci sequence are obtained according to the sequence values of the current request time in all the request time, and the duty ratio of the matched elements in the fibonacci sequence can be obtained according to the sum of the matched elements in the fibonacci sequence, which is equivalent to the duty ratio of the resource quantity which can be obtained by the second terminal in the total resource quantity.
The fibonacci sequence is an endless sequence, the number of elements in the fibonacci sequence can be determined according to the number of the second terminals in the resource allocation request, and the number of the elements in the fibonacci sequence is matched with the number of the second terminals.
In the above method for processing resources, the total amount of resources and the number of receivers may be determined according to the resource allocation request of the sender, and the receiver sends the resource acquisition request after receiving the resource notification message, where the number of sequences may be obtained according to the current request time in the resource acquisition request, and the resource amount of the second terminal may be calculated by obtaining the matched elements in the fibonacci number according to the number of sequences. The resource quantity is reasonably distributed, and the enthusiasm of the user participation is improved.
In some embodiments of the present disclosure, after receiving the resource acquisition request of the second terminal, the method further includes:
And acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In some embodiments, the size of the red packet may be used to determine the order of the users, some users may delay the click time in order to obtain the intermediate order, a time threshold may be set, and if the click time of the user is within the time threshold, the resource amount may be obtained.
In some embodiments of the present disclosure, the obtaining the matched elements in the fibonacci sequence from the sequence values of the current request time in all request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
The fibonacci number sequence may be expressed as F (0) = 0,F (1) =1, F (n) =f (n-1) +f (n-2), with the elements in the number sequence arranged in order from small to large. The sequence values of the current request time in all the request times are arranged in order from small to large. The sequence values correspond to elements in the fibonacci sequence in order from large to small.
For example, for a total of 6 users, the elements in the fibonacci number sequence are 1,2,3,4,8, 13, to ensure that the resource size is related to the order of the user's clicks, the first element in the fibonacci number sequence is not used for calculation because it is repeated with the second element. The first user has a sequence value of 1, which corresponds to the elements in the fibonacci sequence in order from large to small, and a sequence value of 1, which is the smallest, corresponds to the largest element 13.
In some embodiments of the disclosure, the obtaining the resource amount of the second terminal from the sum of the matched elements, elements in a fibonacci sequence, and the total amount of resources includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
For example, the current resource allocation amount is 100 yuan, and 6 participants are set. The first user obtains a red packet with the amount of fibonacci (1,2,3,4,8, 13) divided by the last number 13 by (1+2+3+5+8+13) 100 yuan, i.e., 13/32 x 100, and takes two digits after the decimal point. The second user obtains the amount of the red packet as the sum of the 2 nd number of the fibonacci number series divided by the current fibonacci number series. The second user obtains a red packet in the amount of 8/32 x 100, which is the last number 8 of fibonacci (1,2,3,4,8, 13) divided by (1+2+3+5+8+13) x 100, and takes two digits after the decimal point.
If two identical request times exist in the request time received by the server, the sequence value can be determined according to the time sequence of the user registration, the user with early registration is ranked at the front, and the user with late registration is ranked at the rear.
The present application also provides a resource processing method, and fig. 3 is a flow chart of the resource processing method in an embodiment, where the method may be applied to a first terminal, and includes:
s302: transmitting a resource allocation request to a server, wherein the resource allocation request comprises the total amount of resources and the number of second terminals; the resource allocation request is used for the server to generate a resource notification message and send the resource notification message to the second terminal;
s304: the resource notification message is used for sending a resource acquisition request to the server by the second terminal, wherein the resource acquisition request comprises the current request time; the current request time is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is acquired according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
The present application also provides a resource processing method, and fig. 4 is a flow chart of the resource processing method in an embodiment, where the method may be applied to a second terminal, and includes:
s402: acquiring a resource notification message generated by a server according to a resource allocation request sent by a first terminal, wherein the resource allocation request comprises the total amount of resources and the number of second terminals;
s404: sending a resource acquisition request to a server, wherein the resource acquisition request comprises the current request time; the resource acquisition request is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is obtained according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiments of the present disclosure also provide a resource processing device for implementing the above-mentioned resource processing method. The implementation scheme of the solution to the problem provided by the device is similar to that described in the above method, so the specific limitation in the embodiments of the resource processing device provided below may refer to the limitation of the resource processing method hereinabove, and will not be repeated here.
The apparatus may comprise a system (including a distributed system), software (applications), modules, components, servers, clients, etc. that employ the methods described in the embodiments of the present specification in combination with the necessary apparatus to implement the hardware. Based on the same innovative concepts, embodiments of the present disclosure provide for devices in one or more embodiments as described in the following examples. Because the implementation scheme and the method for solving the problem by the device are similar, the implementation of the device in the embodiment of the present disclosure may refer to the implementation of the foregoing method, and the repetition is not repeated. As used below, the term "unit" or "module" may be a combination of software and/or hardware that implements the intended function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
In one embodiment, as shown in fig. 5, a resource processing apparatus 500 is provided, which may be the aforementioned server, or a module, component, device, unit, etc. integrated with the server. The apparatus 500 may include:
the application also provides a resource processing device, which comprises:
a receiving module 502, configured to receive a resource allocation request sent by a first terminal, where the resource allocation request includes a total amount of resources and a number of second terminals;
a generating module 504, configured to generate a resource notification message, and send the resource notification message to the second terminal;
a time judging module 506, configured to receive a resource acquisition request of the second terminal, where the resource acquisition request includes a current request time;
and the determining module 508 is configured to obtain matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and obtain the resource amount of the second terminal according to the sum of the matched elements and elements in the fibonacci sequence and the total resource amount, where the number of elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
The present application also provides a resource processing device, fig. 6 is a block diagram of a resource processing device in an embodiment, where the device 600 includes:
a sending module 602, configured to send a resource allocation request to a server, where the resource allocation request includes a total amount of resources and a number of second terminals; the resource allocation request is used for the server to generate a resource notification message and send the resource notification message to the second terminal;
a calculating module 604, configured to send, by the second terminal, a resource acquisition request to the server, where the resource acquisition request includes a current request time; the current request time is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is acquired according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
And acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
The present application also provides a resource processing device, fig. 7 is a block diagram of a resource processing device in an embodiment, where the device 700 includes:
An obtaining module 702, configured to obtain a resource notification message generated by a server according to a resource allocation request sent by a first terminal, where the resource allocation request includes a total amount of resources and a number of second terminals;
a matching module 704, configured to send a resource acquisition request to a server, where the resource acquisition request includes a current request time; the resource acquisition request is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is obtained according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
In one embodiment, after receiving the resource acquisition request of the second terminal, the method further includes:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
In one embodiment, the obtaining the matched elements in the fibonacci sequence according to the sequence values of the current request time in all the request times includes:
The elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
In one embodiment, the obtaining the resource amount of the second terminal according to the sum of the elements in the matched element and fibonacci sequence and the total resource amount includes:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
The various modules described above for the resource processing device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 8. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing resources. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a resource processing method.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure thereof may be as shown in fig. 9. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a resource handling method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the structures shown in fig. 8, 9 are block diagrams of only portions of structures associated with the disclosed aspects and are not limiting of the computer apparatus on which the disclosed aspects may be implemented, and that a particular computer apparatus may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, implements the method of any of the embodiments of the present disclosure.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method described in any of the embodiments of the present disclosure.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided by the present disclosure may include at least one of non-volatile and volatile memory, among others. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided by the present disclosure may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors involved in the embodiments provided by the present disclosure may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic, quantum computing-based data processing logic, etc., without limitation thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples have expressed only a few embodiments of the present disclosure, which are described in more detail and detail, but are not to be construed as limiting the scope of the present disclosure. It should be noted that variations and modifications can be made by those skilled in the art without departing from the spirit of the disclosure, which are within the scope of the disclosure. Accordingly, the scope of the present disclosure should be determined from the following claims.

Claims (15)

1. A method of resource processing, the method comprising:
receiving a resource allocation request sent by a first terminal, wherein the resource allocation request comprises the total amount of resources and the number of second terminals;
generating a resource notification message, and sending the resource notification message to the second terminal;
receiving a resource acquisition request of the second terminal, wherein the resource acquisition request comprises the current request time;
And acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and acquiring the resource quantity of the second terminal according to the sum of the elements in the matched elements and the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
2. The method of claim 1, wherein after receiving the resource acquisition request of the second terminal, further comprising:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
3. The method of claim 1, wherein the obtaining matching elements in a fibonacci sequence from the sequence values of the current request time over all request times comprises:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
and acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
4. The method of claim 1, wherein the deriving the amount of resources of the second terminal from the sum of the elements in the matched element, fibonacci sequence, and the total amount of resources comprises:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
5. A method of resource processing, the method comprising:
transmitting a resource allocation request to a server, wherein the resource allocation request comprises the total amount of resources and the number of second terminals; the resource allocation request is used for the server to generate a resource notification message and send the resource notification message to the second terminal;
the resource notification message is used for sending a resource acquisition request to the server by the second terminal, wherein the resource acquisition request comprises the current request time; the current request time is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is acquired according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
6. A method of resource processing, the method comprising:
acquiring a resource notification message generated by a server according to a resource allocation request sent by a first terminal, wherein the resource allocation request comprises the total amount of resources and the number of second terminals;
sending a resource acquisition request to a server, wherein the resource acquisition request comprises the current request time; the resource acquisition request is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is obtained according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
7. A resource processing apparatus, the apparatus comprising:
the receiving module is used for receiving a resource allocation request sent by the first terminal, wherein the resource allocation request comprises the total amount of resources and the number of the second terminals;
the generation module is used for generating a resource notification message and sending the resource notification message to the second terminal;
The time judging module is used for receiving a resource acquisition request of the second terminal, wherein the resource acquisition request comprises the current request time;
and the determining module is used for acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all the request times, and acquiring the resource quantity of the second terminal according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
8. The apparatus of claim 7, wherein after receiving the resource acquisition request of the second terminal, further comprising:
and acquiring the current request time, and acquiring matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times when the current request time is smaller than a time threshold.
9. The apparatus of claim 7, wherein the obtaining matching elements in a fibonacci sequence from the sequence values of the current request time over all request times comprises:
the elements in the fibonacci sequence are arranged in a sequence from small to large;
And acquiring sequence values of the current request time in all the request times, wherein the sequence values correspond to elements in the order from big to small, and acquiring matched elements in a fibonacci sequence according to the sequence values.
10. The apparatus of claim 7, wherein the deriving the amount of resources of the second terminal from the sum of the elements in the matched element, fibonacci sequence, and the total amount of resources comprises:
and calculating the duty ratio of the sum of the elements in the fibonacci number sequence of the matched elements, and acquiring the resource quantity of the second terminal in the resource total quantity according to the duty ratio.
11. A resource processing apparatus, the apparatus comprising:
the sending module is used for sending a resource allocation request to the server, wherein the resource allocation request comprises the total amount of resources and the number of second terminals; the resource allocation request is used for the server to generate a resource notification message and send the resource notification message to the second terminal;
the computing module is used for the resource notification message to be used for the second terminal to send a resource acquisition request to the server, wherein the resource acquisition request comprises the current request time; the current request time is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is acquired according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
12. A resource processing apparatus, the apparatus comprising:
the acquisition module is used for acquiring a resource notification message generated by the server according to a resource allocation request sent by the first terminal, wherein the resource allocation request comprises the total amount of resources and the number of second terminals;
the matching module is used for sending a resource acquisition request to the server, wherein the resource acquisition request comprises the current request time; the resource acquisition request is used for the server to acquire matched elements in a fibonacci sequence according to the sequence values of the current request time in all request times, and the resource quantity of the second terminal is obtained according to the sum of the matched elements and the elements in the fibonacci sequence and the total resource quantity, wherein the number of the elements in the fibonacci sequence is determined according to the number of the second terminal.
13. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
14. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
15. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202310779278.2A 2023-06-28 2023-06-28 Resource processing method and device and computer equipment Pending CN116938836A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310779278.2A CN116938836A (en) 2023-06-28 2023-06-28 Resource processing method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310779278.2A CN116938836A (en) 2023-06-28 2023-06-28 Resource processing method and device and computer equipment

Publications (1)

Publication Number Publication Date
CN116938836A true CN116938836A (en) 2023-10-24

Family

ID=88376553

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310779278.2A Pending CN116938836A (en) 2023-06-28 2023-06-28 Resource processing method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN116938836A (en)

Similar Documents

Publication Publication Date Title
CN105808070A (en) Method and device for setting commenting showing effect
WO2019085600A1 (en) Method and apparatus for forwarding chat information, and electronic device
CN106790350B (en) Information pushing device, server and method
CN116991800A (en) File acquisition system, method, device, computer equipment and storage medium
CN116938836A (en) Resource processing method and device and computer equipment
CN111191143A (en) Application recommendation method and device
CN116488986A (en) Event-driven message touch method, system and device and storage medium
CN111046206A (en) Head portrait list display method and device, electronic equipment and storage medium
CN106156169B (en) Discrete data processing method and device
CN114254278A (en) User account merging method and device, computer equipment and storage medium
CN110750724B (en) Data processing method, device, equipment and storage medium
CN117453759B (en) Service data processing method, device, computer equipment and storage medium
CN116794533B (en) Battery cell capacity grading method and related products
CN117041139B (en) Data packet transmission method, device, computer equipment and storage medium
CN116894499A (en) Resource reservation method, device, computer equipment and storage medium
CN116489089A (en) Flow control method and device and computer equipment
CN117033766A (en) Service processing behavior prediction method, device, computer equipment and storage medium
CN113538104A (en) Information processing method and device, electronic equipment and computer readable storage medium
CN115407974A (en) Business pushing method, device, computer equipment, storage medium and program product
CN116723362A (en) Wheat connecting interaction method, device, computer equipment and storage medium
CN117221830A (en) Message broadcasting method, device, equipment, storage medium and program product
CN114844851A (en) Information display method, information display device, computer equipment and storage medium
CN116204296A (en) Algorithm execution method, device, computer equipment and storage medium of monitoring system
CN117978866A (en) Service proxy method, device, computer equipment and storage medium
CN116910115A (en) Group query method, device, computer equipment and storage 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