WO2021068585A1 - 资源处理方法、装置、电子设备及介质 - Google Patents

资源处理方法、装置、电子设备及介质 Download PDF

Info

Publication number
WO2021068585A1
WO2021068585A1 PCT/CN2020/102303 CN2020102303W WO2021068585A1 WO 2021068585 A1 WO2021068585 A1 WO 2021068585A1 CN 2020102303 W CN2020102303 W CN 2020102303W WO 2021068585 A1 WO2021068585 A1 WO 2021068585A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
resource
target
amount
resources
Prior art date
Application number
PCT/CN2020/102303
Other languages
English (en)
French (fr)
Inventor
汪正
Original Assignee
支付宝(杭州)信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021068585A1 publication Critical patent/WO2021068585A1/zh

Links

Images

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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/503Resource availability

Definitions

  • the embodiments of this specification relate to the field of computer technology, and in particular to a resource processing method, device, electronic device, and medium.
  • the resource management platform can combine multiple resources of the same type to form a combined resource for use by objects that require the combined resource, such as a combination of storage resources, a combination of traffic resources, or other combined resources. In this way, users can obtain combined resources from the resource management platform as needed. In this process, how to efficiently determine the acquisition amount of each resource in the combined resources acquired by the user is particularly important.
  • the embodiments of this specification provide a resource processing method, device, electronic equipment, and medium.
  • an embodiment of this specification provides a resource processing method, including: receiving a resource acquisition request initiated by a user through a client, the resource acquisition request including the user's target acquisition amount; and determining according to the resource acquisition request
  • the target combination resource includes a plurality of sub-resources, and each sub-resource corresponds to an available amount; if the target acquisition amount is less than the available amount of the target combination resource, it is based on the target acquisition amount and each sub-resource.
  • the available amount of each sub-resource and the reference amount of the target combined resource determine more than one target sub-resource from the target combined resource, and split the target acquisition amount into the acquisition amount for each of the target sub-resources , Wherein the available amount and reference amount of the target combined resource are determined according to the available amount of each sub-resource; according to the acquisition amount of each of the target sub-resources, the user is allocated the target combined resource.
  • Target sub-resource determine more than one target sub-resource from the target combined resource, and split the target acquisition amount into the acquisition amount for each of the target sub-resources , wherein the available amount and reference amount of the target combined resource are determined according to the available amount of each sub-resource; according to the acquisition amount of each of the target sub-resources, the user is allocated the target combined resource.
  • Target sub-resource determine more than one target sub-resource from the target combined resource, and split the target acquisition amount into the acquisition amount for each of the target sub-resources , wherein the available amount and reference
  • an embodiment of this specification provides a resource processing device, including: a receiving module, configured to receive a resource acquisition request initiated by a user through a client, the resource acquisition request including the user's target acquisition amount; first The determining module is configured to determine a target combined resource according to the resource acquisition request, the target combined resource includes a plurality of sub-resources, and each sub-resource corresponds to an available amount; the second determining module is configured to determine if the target acquisition amount is less than all the sub-resources.
  • the available amount of the target combined resource determine more than one target sub-resource from the target combined resource, and set
  • the target acquisition amount is split into the acquisition amount for each of the target sub-resources, wherein the available amount and the reference amount of the target combined resource are determined according to the available amount of each sub-resource; an allocation module is configured to Allocating the target sub-resource in the target combined resource to the user according to the acquisition amount of each of the target sub-resources.
  • an embodiment of the present specification provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
  • the processor implements the above-mentioned first The steps of the resource processing method provided by the aspect.
  • the embodiments of this specification provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, it implements the steps of the resource processing method provided in the first aspect.
  • the target combined resource is determined according to the resource acquisition request. If the target acquisition amount of the user in the resource acquisition request is less than the available amount of the target combined resource, then The target acquisition amount, the available amount of each sub-resource, and the benchmark amount of the target combination resource, determine more than one target sub-resource from the target combination resource, and split the target acquisition amount into the acquisition amount for each target sub-resource to achieve When the user has resource acquisition requirements for the target combination resource, determine the target sub-resource in the target combination resource and determine the acquisition amount of each target sub-resource, so as to allocate the target combination resource to the user according to the acquisition amount of each target sub-resource The target child resource in.
  • the server can automatically combine the target for the user. Determining target sub-resources in resources and determining the amount of acquisition of each target sub-resource is beneficial to reduce user operations and improve the user's acquisition efficiency of combined resources.
  • the benchmark amount of the combined resource to determine the target sub-resource in the target combined resource and determine the amount of acquisition of each target sub-resource, it is beneficial to improve the efficiency of determining the target sub-resource and the amount of acquisition, and reduce the determination of the target sub-resource As well as the time required to obtain the amount, and reduce the occupation of system resources.
  • Figure 1 is a schematic diagram of an operating environment suitable for the embodiments of this specification
  • FIG. 3 is an exemplary flowchart of step S204 provided in the first aspect of the embodiment of this specification.
  • FIG. 4 is a flowchart of a fund processing method provided by the first aspect of the embodiments of this specification.
  • FIG. 5 is a block diagram of a resource processing device provided by the second aspect of the embodiments of this specification.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by the third aspect of the embodiments of this specification.
  • FIG. 1 is a schematic diagram of an operating environment suitable for the embodiments of this specification.
  • one or more user terminals 100 may be connected to one or more servers 300 (only one is shown in FIG. 1) through a network 200 for data communication or interaction.
  • the user terminal 100 may be a personal computer (Personal Computer, PC), a notebook computer, a tablet computer, a smart phone, an e-reader, an in-vehicle device, a web TV, or a wearable device, and other smart devices with a network connection function.
  • PC Personal Computer
  • PC Personal Computer
  • notebook computer Portable Computer
  • tablet computer tablet computer
  • smart phone an e-reader
  • an in-vehicle device a web TV
  • a wearable device and other smart devices with a network connection function.
  • a client is installed in the user terminal 100, and the client may be a browser or a third-party application software, corresponding to a server (Server), and provides services for the user, such as a combined resource processing service.
  • the user can initiate a resource acquisition request to the server through the client installed in the user terminal, thereby triggering the server to execute the resource processing method provided in the embodiment of this specification to determine the acquisition amount of each resource in the combined resources acquired by the user.
  • the combined resource can be a combined traffic resource.
  • users can transfer excess network traffic to the resource management platform for management, so that this part of the traffic resources can be shared with other users in need through the resource management platform in exchange for certain benefits.
  • the resource management platform can group the managed traffic resources according to actual needs to form multiple combined traffic resources, and update the available amount of each combined traffic resource in real time. For example, in order to facilitate management, you can group by region or by the quota of shared traffic resources.
  • the combined resource may also be a combined storage resource.
  • users can provide redundant storage resources of their own storage devices to the resource management platform for management, so that this part of the storage resources can be shared with other users in need through the resource management platform in exchange for certain benefits.
  • the resource management platform can group the managed storage resources according to actual needs to form multiple combined storage resources, and update the available amount of each combined storage resource in real time. For example, in order to facilitate management, you can group by region or by the size of shared storage resources.
  • the portfolio resource can also be a fund of funds.
  • a fund company can combine multiple funds to form a fund of fund products for sale, which is conducive to the balance of risks and returns for users.
  • funds can also be a combination of other financial resources such as stocks, bonds or other financial derivative products.
  • Figure 2 shows a flowchart of a combined resource processing method provided by an embodiment of this specification.
  • This embodiment describes the processing flow of a server.
  • it can be a server of a resource management platform, or it can be It is the server of the third-party consignment platform designated by the resource management platform.
  • the method may at least include the following steps S200 to S206.
  • Step S200 Receive a resource acquisition request initiated by a user through a client, where the resource acquisition request includes a target acquisition amount of the user.
  • the user can initiate a resource acquisition request to the server through the client for the combined resource that needs to be acquired, and the client sends the resource acquisition request to the server through the network.
  • the resource acquisition request carries the target acquisition amount.
  • the server After receiving the resource acquisition request sent by the user, the server provides the user with a corresponding combined resource according to the target acquisition amount in the request. For example, the user can input the target acquisition amount of the combined resource to be acquired in the client, and trigger a button set on the client to trigger the resource acquisition request.
  • the client can input the required target acquisition amount, that is, the required traffic quota, and then initiate a resource acquisition request to the server. For example, if the user needs 500M traffic, enter 500M in the client.
  • the client can input the required target acquisition amount, that is, the required storage space size, and then initiate a resource acquisition request to the server. For example, if the user needs 1G of storage space, enter 1G in the client.
  • Step S202 Determine a target combined resource according to the resource acquisition request, where the target combined resource includes multiple sub-resources, and each sub-resource corresponds to an available amount.
  • a resource information library pre-configured in the server can be stored in the resource information library.
  • the available amount of each combined resource managed is stored in the resource information library.
  • each combined resource includes multiple sub-resources, and each sub-resource corresponds to the user's available amount.
  • the available amount of the combined resource is the sum of the available amounts of each sub-resource contained in the combined resource. .
  • the combined traffic resource C includes sub-flow resource c1, sub-flow resource c2, sub-flow resource c3, and sub-flow resource c4.
  • the current available amount of sub-traffic resource c1 is M1
  • the current available amount of sub-traffic resource c2 is M2
  • the current available amount of sub-traffic resource c3 is M3
  • the current available amount of sub-traffic resource c4 is M4, then the combined traffic resource
  • the available amount of A is M1+M2+M3+M4.
  • the target acquisition amount in the resource acquisition request is inconsistent with the available amount of all combined resources in the resource information database.
  • the above-mentioned implementation process of determining the target combination resource according to the resource acquisition request may include: extracting the user's target acquisition amount from the resource acquisition request; searching for a combination resource whose available amount is greater than the target acquisition amount in the resource information database, from the found In the combined resources, a combined resource is determined as the target combined resource. For example, you can select any combination resource from the searched combination resources as the target combination resource, or you can use the combination resource with the smallest difference between the available amount and the target acquisition amount as the target combination resource among the searched combination resources. . At this time, the target acquisition amount is less than the available amount of target combined resources.
  • the available amount of the target combined resource is determined according to the available amount of each sub-resource in the target combined resource. In an embodiment, the available amount of the target combined resource is the cumulative sum of the available amounts of the sub-resources in the target combined resource.
  • a combined resource can be selected from the combined resources with the same available amount to provide to the user, and there is no need to re-determine the user pair The amount of acquisition of each sub-resource in the combined resource.
  • the available amount of combined resources stored in the resource information database can be displayed on the client as a waiting option. If the user enters the target acquisition amount by selecting the waiting option, the server receives the resource acquisition request Then select a combined resource from the combined resources with corresponding available amount and provide it to the user. If none of the pending options displayed on the client meets the user’s needs, the user can enter an acquisition amount in the client as the target acquisition amount. At this time, the target The obtained amount is less than the available amount of the target combined resource determined by the server, and the following step S204 is executed.
  • Step S204 If the target acquisition amount is less than the available amount of the target combination resource, then based on the target acquisition amount, the available amount of each sub-resource, and the reference amount of the target combination resource, the target combination More than one target sub-resource is determined in the resource, and the target acquisition amount is divided into the acquisition amount for each target sub-resource.
  • Step S206 Allocate the target sub-resource in the target combined resource to the user according to the acquisition amount of each of the target sub-resources.
  • the target sub-resource in the target combined resource may be allocated to the user according to the acquisition amount of each target sub-resource.
  • the scenario of combining traffic resources as an example. Assume that the user's target acquisition volume is 500M, the target sub-traffic resource c1 determined according to the above step S204 is 200M, the target sub-traffic resource c2 is 160M, and the target sub-traffic resource c2 is 160M.
  • the acquisition volume of the sub-traffic resource c3 is 140M, 200M is allocated from the target sub-traffic resource c1 to the user, 160M is allocated from the target sub-traffic resource c2 to the user, and 140M is allocated from the target sub-traffic resource c3 to the user.
  • the acquisition volume of the target sub-storage resource d1 determined according to the above step S204 is 300M storage space
  • the acquisition volume of the target sub-storage resource d2 224M storage space, 280M storage space for the target sub-storage resource d3, 220M storage space for the target sub-storage resource d4
  • 300M storage space is allocated to the user from the target sub-storage resource d1, from the target sub-storage resource d1
  • the storage resource d2 allocates 224M storage space to the user, allocates 280M storage space to the user from the target sub-storage resource d3, and allocates 220M storage space to the user from the target sub-storage resource d4.
  • the data to be stored can be separately stored in the storage space allocated for the user through the resource management platform.
  • the available amount of resources provided by the resource provider can be displayed. For example, taking the scenario of combining traffic resources as an example, suppose the user who provides the traffic sub-resource provides 1G traffic to the resource management platform for traffic sharing, then the available amount of the provided resource can be displayed on the client that provides the traffic sub-resource, such as 1G.
  • the target sub-resource in the target combination resource may also include: feeding back the acquisition amount of each target sub-resource in the target combination resource to providing the target sub-resource
  • the client of the resource displays on the client, and displays the amount of allocated resources on the client, that is, the amount of acquisition allocated to the user who initiated the resource acquisition request, and the displayed resource of the target sub-resource is available
  • the amount is updated, that is, the current available amount of resources after being allocated according to the determined acquisition amount is displayed, so that the resource provider can understand the sharing situation of the provided traffic in time.
  • the available amount of the sub-resource provided by the client is 1G
  • the server uses the sub-resource as the target sub-resource to allocate 200M traffic to the user who initiated the resource acquisition request, and the current available amount of the resource is 824M.
  • the reference amount of the target combined resource is determined according to the available amount of each sub-resource in the target combined resource.
  • the benchmark amount of the target combined resource can be used to characterize the average available amount of all sub-resources in the current target combined resource.
  • the rules for determining the benchmark quantity can be configured in advance based on actual experience. For example, multiple ranges of available quantities that are adjacent to each other can be set in advance, and multiple benchmark quantities can be configured based on experience to combine the current target with each sub-resource.
  • the available amount of resources is matched with the above-mentioned multiple available amount ranges, the available amount range of each sub-resource is determined, and the corresponding relationship between the number of sub-resources in each available amount range configured in advance and the reference amount is used to determine the current target combined resource Benchmark amount.
  • the average value of the available amounts of all sub-resources in the target combined resource may be used as the current reference amount of the target combined resource.
  • the above-mentioned target combination resource is based on the target acquisition amount, the available amount of each sub-resource, and the reference amount of the target combination resource.
  • the implementation process of determining more than one target sub-resource in, and splitting the target acquisition amount into the acquisition amount for each of the target sub-resources may include the following steps S300 to S304.
  • Step S300 Determine all sub-resources whose available amount is greater than the reference amount in the target combined resource as current candidate sub-resources, and determine whether the cumulative sum of the reference difference values of the current candidate sub-resources is greater than or equal to the target Acquisition volume.
  • the reference difference is the difference between the available amount of the current candidate sub-resource and the reference amount.
  • the target combined resource includes M sub-resources in total
  • the available amount of n sub-resources in the M sub-resources is greater than the current reference amount of the target combined resource
  • all the n sub-resources are determined as the current candidate sub-resources. They are represented by V i. Assuming that the number of current candidate sub-resources is denoted as n, then i takes 1 to n.
  • V i sub-resource may be an amount expressed as a i
  • the i-th reference current difference is expressed as the Candidate Sub resources: a i -s, which in turn can be obtained the n
  • Step S302 if yes, determine the one or more target sub-resources from all the current candidate sub-resources, and split the target acquisition amount into the acquisition amount for each of the target sub-resources according to a first preset rule .
  • Step S304 if not, determine the one or more target sub-resources from the target combined resource, and split the target acquisition amount into the acquisition amount for each of the target sub-resources according to a second preset rule.
  • the target acquisition amount is expressed as R
  • R when the cumulative sum When it is greater than or equal to R, it means that the part of the available amount of the current candidate sub-resources that exceeds the reference amount can meet the user's acquisition needs, and more than one target sub-resource can be determined from all the current candidate sub-resources.
  • R When adding up When it is less than R, it means that the part of the available amount of the current candidate sub-resources that exceeds the reference amount cannot meet the user's acquisition needs, and a part of the target acquisition amount needs to be acquired from other sub-resources of the target combined resource.
  • the remaining available amount of each sub-resource in the target combined resource can be balanced, which facilitates the management of the combined resource by the resource management platform, and avoids certain sub-resources in the same combined resource.
  • the available amount of is too high, and the available amount of some sub-resources is too low. It can be understood that the remaining available amount of each sub-resource is the difference between the available amount and the acquired amount of the sub-resource.
  • the acquisition amount is zero for the part of the sub-resources that is not the target sub-resource, that is, no That part of the sub-resources.
  • the one or more target sub-resources are determined from all the current candidate sub-resources, and the target acquisition amount is divided into acquisitions for each of the target sub-resources according to a first preset rule
  • the quantity implementation process may include steps F1 to F4.
  • Step F1 Obtain the remaining average value of all the current candidate sub-resources, where the remaining average value is the difference between the accumulated sum and the target acquisition amount divided by the number of the current candidate sub-resources;
  • Step F2 Determine whether the reference difference of each current candidate sub-resource is greater than or equal to the remaining average value
  • Step F3 If yes, use each of the current candidate sub-resources as the target sub-resource, and for each of the target sub-resources, based on the difference between the reference difference of the target sub-resource and the remaining mean value The difference is the acquisition amount of the target sub-resource.
  • the accumulated sum refers to the sum of the reference difference values of all current candidate sub-resources, and the remaining average value is used to represent the average value of the remaining amount whose accumulated sum exceeds the target acquisition amount.
  • more than one target sub-resource is determined from all the current candidate sub-resources, and the target acquisition amount is split into each target sub-resource according to the first preset rule.
  • the implementation process of resource acquisition also includes:
  • Step F4 If there is a reference difference of the current candidate sub-resource that is less than the remaining average value, re-determine all the sub-resources with the reference difference greater than or equal to the remaining average value in the target combined resource as the current candidate Sub-resources, and repeat the above steps of obtaining the remaining average value of all the current candidate sub-resources, and judging whether the reference difference of each current candidate sub-resource is greater than or equal to the remaining average value, until each current candidate sub-resource The baseline difference of resources is greater than or equal to the remaining average.
  • the remaining mean is represented by m, and there are n current candidate sub-resources in the current target combination resource, then among them, Indicates the remaining amount where the sum of the baseline differences of all current candidate sub-resources exceeds the target acquisition amount.
  • each current candidate sub-resource is compared with the remaining mean m. If a i -s is greater than or equal to m, then each current candidate sub-resource is regarded as the target sub-resource. n target sub-resources, and the acquisition amount of each target sub-resource is determined as a i -sm. This can ensure that after the target sub-resource is obtained according to the acquisition amount, the remaining available amount of the target sub-resource is equal, which is beneficial to further ensure that after the user obtains the target combined resource of the target acquisition amount, the remaining available amount of each sub-resource in the target combined resource can be Achieve balance.
  • the current candidate sub-resource needs to be updated, the sub-resource with a reference difference greater than or equal to m is re-determined as the current candidate sub-resource, and the number of current candidate sub-resources n to update.
  • the target sub-resource and the target sub-resource can be determined according to step F3. The amount of acquisition.
  • the remaining average value is updated as the current candidate sub-resource is updated. This is beneficial to ensure that after acquiring the target sub-resource according to the acquisition amount, the remaining available amount of the sub-resources whose original available amount is greater than the reference amount in the target combined resource achieves a general balance, which is beneficial to further ensure that the user obtains the target combined resource of the target acquisition amount.
  • the remaining available amount of each sub-resource in the target combined resource can be balanced.
  • the implementation process of obtaining the acquisition amount of the target sub-resource based on the difference between the benchmark difference of the target sub-resource and the remaining average value may include : For each of the target sub-resources, the difference between the reference difference of the target sub-resource and the remaining average value is used as a candidate; the cumulative sum of the candidate amounts of the target sub-resource is obtained and the target acquisition If the difference value does not meet the preset condition, the compensation amount is determined according to the difference value, and the compensation amount is determined according to the candidate amount of each target sub-resource and the compensation amount. The amount of acquisition of the target sub-resource.
  • the candidate quantity of each target sub-resource is taken as the acquisition quantity of the target sub-resource.
  • the difference between the cumulative sum of the candidate amount of each target sub-resource and the target acquisition amount may be used as the difference value between the two.
  • the difference between the cumulative sum of the candidate amount of each target sub-resource and the target acquisition amount may be taken as the difference between the two.
  • the preset conditions can be set according to the needs of actual application scenarios. For example, taking the scenario of combining traffic resources as an example, an error threshold is preset, such as 0.01M. When the difference value is less than the error threshold, it is determined that the difference value meets the preset condition, otherwise, it is determined that the difference value does not meet the preset condition. Set conditions and need to perform compensation operations.
  • the preset condition can also be set to satisfy the difference value of zero, that is, the cumulative sum of the candidate quantity of each target sub-resource is consistent with the target acquisition amount. If the difference value is not zero, it means that the two are inconsistent and the judgment is not satisfied. The preset condition, if the difference value is zero, it is determined that the preset condition is satisfied.
  • determining the compensation amount according to the difference value, and determining the acquisition amount of each target sub-resource according to the candidate amount of each target sub-resource and the compensation amount may include: The difference between the cumulative sum of the candidate quantity of each target sub-resource and the target acquisition amount is used as the compensation amount, a target sub-resource is randomly selected from the determined target sub-resources as the compensation sub-resource, and the compensation sub-resource The sum of the candidate amount and the compensation amount is used as the acquisition amount of the compensation sub-resource, and for each target sub-resource except the compensation sub-resource in the determined target sub-resources, the candidate amount of the target sub-resource is regarded as the target sub-resource. The amount of resources acquired.
  • the determined target sub-resources include: target sub-resource V1, target sub-resource V2, target sub-resource V3, target sub-resource V4, and target sub-resource V5, and the determined candidate quantities are r1, r2, and r3 respectively. , R4 and r5.
  • the compensation sub-resource randomly selected from V1, V2, V3, V4, and V5 is the target sub-resource V2, Then the acquisition amount of the target sub-resource V2 is r2+[R-(r1+r2+r3+r4+r5)], the acquisition amount of the target sub-resource V1 is r1, the acquisition amount of the target sub-resource V3 is r3, and the target sub-resource V4 The acquisition amount of is r4, and the acquisition amount of the target sub-resource V5 is r5.
  • the implementation of obtaining the acquisition amount of the target sub-resource based on the difference between the benchmark difference of the target sub-resource and the remaining average value may include: for each of the target sub-resources, the difference between the reference difference value of the target sub-resource and the remaining average value is used as the acquisition amount of the target sub-resource.
  • determining more than one target sub-resource from the target combination resource, and splitting the target acquisition amount into the acquisition amount for each target sub-resource according to the second preset rule may include: The current candidate sub-resources are all used as the first sub-resource, and the benchmark difference of each first sub-resource is used as the first acquisition amount of the first sub-resource; the remaining acquisition amount is obtained based on the value of each sub-resource in the target combination resource.
  • Priority, remaining acquisition amount, and current available amount of each sub-resource determine the second sub-resource and the second acquisition amount of the second sub-resource from the target combined resource, where the remaining acquisition amount is the baseline difference of the current candidate sub-resource The difference between the cumulative sum and the target acquisition amount; the first sub-resource and the second sub-resource are combined to obtain more than one target sub-resource, and each target sub-resource is obtained according to the first acquisition amount and the second acquisition amount The amount of resources acquired.
  • the current available amount is the remaining available amount in the available amount of the sub-resource excluding the first acquisition amount of the sub-resource.
  • the current available amount is the available amount of the sub-resource.
  • the current candidate sub-resources include: sub-resource V1, sub-resource V7, and sub-resource V9, then sub-resource V1, sub-resource V7, and sub-resource V9 are all regarded as the first sub-resource, assuming that the available amount of sub-resource V1 is a1,
  • the current available amounts of the sub-resources V1, V7, and V9 are in order: a1-t1, a7-t7, and a9-t9.
  • the current available amount is still the original available amount, that is, the available amount determined in step S202.
  • the remaining acquisition amount is: R-(t1+t7+t9).
  • each first sub-resource and each second sub-resource are regarded as the target sub-resource, where each first sub-resource
  • the first acquisition amount of is the acquisition amount of the corresponding target sub-resource
  • the second acquisition amount of each second sub-resource is the acquisition amount of the corresponding target sub-resource. If there is an overlap between the first sub-resource and the second sub-resource, the first acquisition amount of the overlapping first sub-resource and the second acquisition amount of the second sub-resource need to be added together as the acquisition amount of the target sub-resource .
  • the first sub-resource includes sub-resource V1, sub-resource V7, and sub-resource V9, and the corresponding first acquisition amounts are t1, t7, and t9 in turn.
  • the second sub-resource includes sub-resource V1, sub-resource V2, and sub-resource V3, and the corresponding second sub-resource includes sub-resource V1, sub-resource V2, and sub-resource V3.
  • the acquisition amount is p1, p2, and p3 in order, then sub-resource V1, sub-resource V2, sub-resource V3, sub-resource V7, and sub-resource V9 are all determined as target sub-resources, where the acquisition-amount of sub-resource V1 is t1+p1,
  • the acquisition amount of sub-resource V2 is p2
  • the acquisition amount of sub-resource V3 is p3
  • the acquisition amount of sub-resource V7 is t7
  • the acquisition amount of sub-resource V9 is t9.
  • the priority of each sub-resource in the target combined resource is set according to actual application scenarios.
  • the priority of each sub-flow resource in the target combined flow resource can be determined according to the amount of resources historically shared by the provider of each sub-flow resource, such as historical sharing The higher the priority of the sub-resource provided by the resource provider with more traffic.
  • the priority of sub-resources provided by resource providers with more historical shared storage space can also be set to be higher. This is conducive to achieving a general balance of the remaining available amount of each sub-resource in the target combined resource, while providing more benefits to users who share more resources, and increasing the enthusiasm of resource providers to share resources.
  • the second sub-resource and the second sub-resource are determined from the target combined resource based on the priority of each sub-resource in the target combined resource, the remaining acquisition amount, and the current available amount of each sub-resource
  • the implementation process of the second acquisition amount may include: sorting all sub-resources in the target combination resource in descending order of priority, determining the first-ranked sub-resource as the current second sub-resource; judging the current second sub-resource Whether the current available amount of the second sub-resource is greater than or equal to the current remaining acquisition amount; if so, the current remaining acquisition amount is regarded as the second acquisition amount of the current second sub-resource; if not, the current available amount of the current second sub-resource is regarded as the current
  • the second acquisition amount of the second sub-resource update the current remaining acquisition amount, and determine the next sub-resource as the current second sub-resource, repeat the execution to determine whether the current available amount of the current second sub-resource is greater than the current remaining acquisition
  • the current available amount of the current second sub-resource is the available amount determined in step S202 minus the amount determined as the first sub-resource If the current second sub-resource is not the first sub-resource, the current available amount of the current second sub-resource is the available amount determined in step S202.
  • the target combination resource includes sub-resources V1 to sub-resources V10, a total of 10 sub-resources, the priority of these 10 sub-resources from high to low is: V1, V2, V3, ..., V10. Then first determine V1 as the current second sub-resource. As in the above example, V1 is also used as the first sub-resource, and the first acquisition amount of V1 is t1.
  • the current remaining acquisition amount Q is: R-(t1+ t7+t9), if a1-t1 is less than Q, use a1-t1 as the second acquisition amount of the current second sub-resource V1, and update the current remaining acquisition amount to: R-(t1+t7+t9)-(a1 -t1), and determine the next-ranked sub-resource V2 as the current second sub-resource, and continue to iterate until the current second sub-resource is assumed to be V3.
  • the current available amount a3 is greater than the current remaining acquisition amount Q": R-( t1+t7+t9)-(a1-t1)-a2, the current remaining acquisition amount Q" is taken as the current second acquisition amount of the second sub-resource V3.
  • all sub-resources in the target combined resource can also be sorted in order of priority from high to low, and the sub-resource ranked first is determined as the current first.
  • Two sub-resources if the current available amount of the current second sub-resource is greater than or equal to the current remaining acquisition amount, the current remaining acquisition amount is taken as the second acquisition amount of the current second sub-resource; if the current available amount of the current second sub-resource Less than the current remaining acquisition amount, 1/2 of the current available amount of the current second sub-resource is taken as the second acquisition amount of the second sub-resource, and the next sub-resource is determined as the current second sub-resource, and the current second sub-resource is determined as the current second sub-resource.
  • 1/3 of the current available amount of the second sub-resource is used as the second acquisition amount of the second sub-resource, and so on, as the priority becomes lower and lower, the proportion of the second acquisition amount becomes lower and lower.
  • the resource processing method provided by the embodiment of this specification does not require the user to select the target sub-resource to be obtained in the target combined resource and the amount of each target sub-resource to be obtained when the user needs to obtain the combined resource, only the required target needs to be input
  • the server can automatically determine the target sub-resources from the target combined resources for the user, and determine the amount of acquisition of each target sub-resource, which is beneficial to reduce user operations and improve the user's acquisition efficiency of combined resources.
  • the benchmark amount of the combined resource to determine the target sub-resource in the target combined resource and determine the amount of acquisition of each target sub-resource, it is beneficial to improve the efficiency of determining the target sub-resource and the amount of acquisition, and reduce the determination of the target sub-resource As well as the time required to obtain the amount, and reduce the occupation of system resources.
  • the method for determining the amount of acquisition provided by the embodiment of this specification can realize the partial sharing of each sub-resource in the combined resource, which is convenient for the resource provider to share the resource to the user in need as soon as possible, reducing waiting time and improving user experience.
  • the method of randomly splitting the target acquisition amount into each sub-resource in the target combination resource it is beneficial to realize that after the user acquires the target combination resource of the target acquisition amount, the remaining sub-resources in the target combination resource are available.
  • the amount can be balanced, which is convenient for the resource management platform to manage the combined resources, avoiding the situation that the available amount of some sub-resources in the same combined resource is too high, and the available amount of some sub-resources is too low, so as to realize the resource provider’s
  • the benefits are balanced, and the number of complaints from resource providers is reduced, which is conducive to improving the user experience of resource providers.
  • the following embodiments of this specification use combined resources as the combined fund
  • the resource acquisition request is the fund redemption request
  • the benchmark amount is the redemption benchmark quota.
  • the amount of resources obtained is the redemption share of the sub-fund as an example, and the technical solutions provided in the embodiments of this specification are described in detail.
  • Fig. 4 shows a schematic flow chart of a fund processing method provided by an embodiment of this specification, including the following steps S400 to S406.
  • Step S400 Receive a fund redemption request initiated by the user through the client, and the fund redemption request includes the target redemption share to be redeemed by the user.
  • the user can initiate a fund redemption request to the server through the client to redeem the fund of funds he holds.
  • the fund of funds to be redeemed by the user is taken as the target fund of funds.
  • the fund redemption request of the target fund of funds is taken as the target fund of funds.
  • the process by which the user sells the fund units held by the user at the published price and recovers the cash is the fund redemption, and the partial redemption is part of the user's total share of the target portfolio fund held by the user
  • the shares are redeemed.
  • the total share of the target fund of funds held by the user is 8000
  • the target redemption share to be redeemed by the user is 3000.
  • the total share held by the user is the sum of the share held by the user for each sub-fund.
  • Step S402 Determine the target portfolio fund according to the fund redemption request.
  • the target portfolio fund includes multiple sub-funds, and each sub-fund corresponds to the user's available quota.
  • the server records the fund of funds purchased by each user, and records the available quota of each sub-fund in the fund of funds held by the user, that is, the server stores the transaction information of the fund of funds and the funds of the fund of funds.
  • Transaction information includes the identity of the user who purchased the fund of funds, the identity of the fund of funds, the identity of the sub-funds contained in the fund of funds, the available quota of each sub-fund in the fund of funds held by the user, and the correspondence between these four Relationship information.
  • each user holds a target portfolio fund
  • the fund redemption request may also include the user identification.
  • the implementation process of determining the target fund of funds according to the fund redemption request may include: matching the user identification in the fund redemption request with the user identification information in the pre-stored transaction information, determining the target fund of funds, and multiple sub-funds contained in the target fund of funds The available quota of each sub-fund in the fund. It is understandable that the available quota of the aforementioned sub-fund refers to the available quota of the user.
  • each user can hold multiple target portfolio funds
  • the fund redemption request can also include the user ID and the target combination ID, where the target combination ID is the target combination to be redeemed by the user The logo of the fund.
  • the implementation process of determining the target combination fund according to the fund redemption request may include: searching for the combination fund corresponding to the user ID and the target combination ID in the fund redemption request in the pre-stored transaction information, as the target combination fund, and obtaining the searched fund The available quota of each sub-fund among the multiple sub-funds included in the target portfolio fund.
  • the user's fund of funds and the total share of the user's holding of the fund of funds can be displayed on the client.
  • the user can click the preset redemption button or enter the required target redemption. Back to share.
  • the server receives the fund redemption request, and the target redemption shares are consistent with the total shares of the target portfolio fund held by the user, there is no need to perform the following step S404 to redeem all the available quotas of each sub-fund in the target portfolio fund. If the target redemption unit is less than the total unit of the target fund of funds held by the user, since the net value of different sub-funds in the target fund of funds is different, the fund company needs to determine the redemption unit of each sub-fund to be redeemed and the net value of the fund.
  • the redemption funds of the sub-fund are different if the determined redemption target sub-funds are different or the redemption units of the determined target sub-funds are different. Further, it is necessary to split the target redemption shares by performing the following step S404, and determine the target sub-funds that need to be redeemed this time in the target combination fund and the redemption shares of each target sub-fund.
  • step S404 if the target redemption unit is less than the total unit of the target fund of funds held by the user, then one is determined from the target fund of funds based on the target redemption unit, the available quota of each sub-fund and the redemption benchmark quota of the target fund of funds.
  • the above target sub-funds, and the target redemption units are split into redemption units for each target sub-fund.
  • step S406 the target sub-fund held by the user is redeemed according to the redemption share of each target sub-fund.
  • the target sub-fund held by the user can be redeemed according to the redemption unit of each target sub-fund. For example, you can determine the redemption funds corresponding to the target sub-fund according to the current net value of the fund and the redemption unit of each target sub-fund, and then send the total amount of redemption funds of all the target sub-funds in the target portfolio fund To the user account, or, the redemption funds of each target sub-fund in the target portfolio fund can be sent to the user account separately.
  • the total shares of the fund of funds held by the user and the fund of funds can be obtained on the client side.
  • the available quota of each sub-fund is displayed in order to facilitate users to grasp the fund holding status in time after logging in.
  • redeeming the target sub-fund held by the user according to the redemption share of each target sub-fund it may also include: redeeming each sub-fund in the target portfolio fund The shares are fed back to the client, displayed on the client, and the total shares of the target fund of funds displayed on the client and the available quota of each sub-fund in the fund of funds are updated. That is, for each target sub-fund, the redemption is displayed The current available quota.
  • it may further include: feeding back the redemption unit of each sub-fund in the target portfolio fund To the client, display on the client, so that the user can confirm whether to redeem according to the redemption share; detect whether the user triggers the preset confirmation button, if so, the client sends a confirmation redemption instruction to the server, when the server is receiving When the redemption instruction is confirmed, the above-mentioned steps of redeeming the target sub-fund held by the user according to the redemption share of each target sub-fund are executed.
  • the redemption unit for the part of the sub-funds that is not the target sub-fund is zero, that is, it will not be redeemed. That part of the sub-funds will be redeemed; if all the sub-funds in the target portfolio fund are determined to be the target sub-funds, the corresponding target sub-funds will be redeemed in accordance with the determined redemption units.
  • the redemption benchmark quota of the target portfolio fund is used to represent the average redeemable quota of all sub-funds in the target portfolio fund.
  • the redemption benchmark amount of the target fund of funds is determined according to the available amount of each sub-fund in the target fund of funds. Specifically, the rules for determining the redemption benchmark quota can be configured in advance based on actual experience.
  • multiple available quota ranges that are adjacent to each other can be set in advance, and multiple redemption benchmark quotas can be configured based on experience to combine the current goals
  • the available quota of each sub-fund in the fund is matched with the above-mentioned multiple available quota ranges, the available quota range of each sub-fund is determined, and the corresponding relationship between the number of sub-funds in each available quota range configured in advance and the redemption benchmark quota is determined
  • the current benchmark redemption limit of the target fund of funds For another example, the average value of the available quotas of all sub-funds in the target fund of funds may be used as the current redemption benchmark quota of the target fund of funds.
  • step S404 based on the target redemption unit, the available quota of each sub-fund, and the redemption benchmark quota of the target fund of funds, more than one target fund of funds is determined from the target fund of funds .
  • the implementation process of splitting the target redemption unit into redemption units for each of the target sub-funds may include: determining the sub-funds whose available quota is greater than the redemption benchmark quota in the target portfolio fund as the current candidate Sub-fund, and determine whether the cumulative sum of the benchmark difference of the current candidate sub-fund is greater than the target redemption unit, where the benchmark difference is the difference between the available quota of the current candidate sub-fund and the redemption benchmark quota; if so, from Determine more than one target sub-fund from all current candidate sub-funds, and split the target redemption unit into redemption units for each target sub-fund according to the first preset rule; if not, determine more than one from the target portfolio fund Target sub-funds, and split the target redemption units into redemption units for each target sub-fund according to the
  • the foregoing determines more than one target sub-fund from all current candidate sub-funds, and splits the target redemption unit into an amount for each of the target sub-funds according to the first preset rule.
  • the implementation process of redemption shares can include: obtaining the remaining average of all current candidate sub-funds, where the remaining average is the difference between the cumulative sum of the benchmark differences of the current candidate sub-resources and the target redemption share, divided by the current The number of candidate sub-funds; determine whether the benchmark difference of each current candidate sub-fund is greater than or equal to the remaining average; if so, each current candidate sub-fund is regarded as the target sub-fund, and for each target sub-fund, Based on the difference between the benchmark difference of the target sub-fund and the remaining average value, the redemption unit of the target sub-fund is obtained.
  • the implementation process of obtaining the redemption unit of the target sub-fund based on the difference between the benchmark difference of the target sub-fund and the remaining average value may include: For each target sub-fund, the difference between the benchmark difference of the target sub-fund and the remaining average value is used as the candidate amount; obtain the difference between the cumulative sum of the candidate amount of the target sub-fund and the target redemption unit; if If the difference value does not meet the preset condition, the compensation amount is determined according to the difference value, and the redemption unit for each target sub-fund is determined according to the candidate amount and the compensation amount of each target sub-fund.
  • the above-mentioned difference value is the tail difference of the redemption shares.
  • the specific implementation process refer to the above-mentioned embodiment for each target sub-resource, based on the difference between the target sub-resource's baseline difference and the remaining average value. , The implementation process of obtaining the target sub-resource is not repeated here.
  • the foregoing determines more than one target sub-fund from the target combination fund, and splits the target redemption unit into redemption for each target sub-fund according to a second preset rule
  • the unit implementation process may include: taking each current candidate sub-fund as the first sub-fund, and using the benchmark difference of each first sub-fund as the first redemption unit of the first sub-fund; obtaining the remaining redemption Units, and based on the priority of each sub-fund in the target portfolio fund, the remaining redemption units and the current available quota of each sub-fund, determine the second sub-fund and the second redemption of the second sub-fund from the target portfolio fund Units, where the remaining redemption units are the difference between the cumulative sum of the benchmark differences of the current candidate sub-funds and the target redemption units; the first sub-fund and the second sub-fund are combined to obtain more than one target sub-fund , And obtain the redemption shares of each target sub-fund according to the first redemption share and the second redemption share.
  • the second sub-fund and the second sub-fund are determined from the target portfolio fund based on the priority of each sub-fund in the target portfolio fund, the remaining redemption units, and the current available quota of each sub-fund.
  • the implementation process of the second redemption unit may include: sorting all the sub-funds in the target portfolio fund in descending order of priority, and determining the first-ranked sub-fund as the current second sub-fund; Whether the current available quota of the second sub-fund is greater than or equal to the current remaining redemption unit; if so, the current remaining redemption unit is regarded as the second redemption unit of the current second sub-fund; if not, the current second sub-fund’s current
  • the available quota is used as the second redemption unit of the current second sub-fund, the current remaining redemption units are updated, the next sub-fund is determined as the current second sub-fund, and the current second sub-fund is repeatedly executed to determine the current available quota of the second sub-fund Whether it is greater than the current remaining redemption unit step, until the current available
  • the priority of each sub-fund in the target portfolio fund can be determined according to the income of each sub-fund. The higher the return, the lower the priority, the lower the return, the higher the priority, and it will be redeemed first. .
  • the fund processing method provided in the embodiment of this specification does not require the user to select the redemption share of each sub-fund in the target fund of funds when the user needs to redeem part of the target fund of funds, but only needs to enter the target redeeming he wants to redeem.
  • the server can automatically determine the target sub-funds to be redeemed from the target fund of funds for the user, and determine the redemption shares of each target sub-fund, which is conducive to reducing the user's operation and does not require the user to consider the redemption of the fund. Which sub-fund and how many shares in the fund, improve the redemption efficiency of users to the fund of funds.
  • the redemption benchmark quota of the fund of funds determines the target sub-funds to be redeemed in the target fund of funds and determine the redemption unit of each target sub-fund, which is conducive to improving the efficiency of determining the target sub-fund and redemption units , Reduce the time required to determine the target sub-fund and redeem shares, and reduce the occupation of system resources.
  • the shares of the sub-funds held can be roughly equal to avoid the situation that users hold too much remaining shares of certain sub-funds in the same fund of funds, and the remaining shares of some sub-funds are too low, so as to ensure that users hold portfolios
  • the risk and return of the fund are balanced to meet the redemption needs of users, effectively avoid user complaints caused by dissatisfaction with the determined target sub-funds and redemption shares, improve user experience, and reduce the resource occupation caused by the system processing this part of user complaints.
  • the embodiment of this specification also provides a resource processing device.
  • the resource processing device 50 includes a receiving module 51, a first determining module 52, a second determining module 53 and an allocation module 54.
  • the receiving module 51 is configured to receive a resource acquisition request initiated by a user through the client, where the resource acquisition request includes the target acquisition amount of the user;
  • the first determining module 52 is configured to determine a target combined resource according to the resource acquisition request, the target combined resource includes multiple sub-resources, and each sub-resource corresponds to an available amount;
  • the second determining module 53 is configured to, if the target acquisition amount is less than the available amount of the target combined resource, based on the target acquisition amount, the available amount of each sub-resource, and the reference amount of the target combined resource, Determine more than one target sub-resource from the target combination resource, and split the target acquisition amount into the acquisition amount for each of the target sub-resources, wherein the available amount and the reference amount of the target combination resource are both Determined according to the available amount of each sub-resource;
  • the allocation module 54 is configured to allocate the target sub-resource in the target combined resource to the user according to the acquisition amount of each of the target sub-resources.
  • the foregoing second determining module 53 includes a determining unit 530, a first determining unit 531, and a second determining unit 532.
  • the judging unit 530 is configured to determine all the sub-resources whose available amount is greater than the reference amount in the target combined resource as the current candidate sub-resource, and determine whether the cumulative sum of the reference difference of the current candidate sub-resource is greater than or equal to The target acquisition amount, wherein the reference difference is the difference between the available amount of the current candidate sub-resource and the reference amount;
  • the first determining unit 531 is configured to, if the determining unit 530 determines that the cumulative sum of the reference differences of the current candidate sub-resources is greater than or equal to the target acquisition amount, determine the one from all the current candidate sub-resources The above target sub-resources, and split the target acquisition amount into the acquisition amount for each of the target sub-resources according to the first preset rule;
  • the second determining unit 532 is configured to determine the one or more target sub-resources from the target combined resource if the determining unit 530 determines that the cumulative sum of the reference difference values of the current candidate sub-resources is less than the target acquisition amount , And split the target acquisition amount into the acquisition amount for each target sub-resource according to a second preset rule.
  • the foregoing first determining unit 531 includes an acquiring subunit 541, a determining subunit 542, and a first determining subunit 543.
  • the obtaining subunit 541 is configured to obtain the remaining average value of all the current candidate sub-resources, where the remaining average value is the difference between the accumulated sum and the target acquisition amount divided by the current candidate sub-resource Quantity
  • the judging subunit 542 is configured to judge whether the reference difference value of each current candidate sub-resource is greater than or equal to the remaining average value
  • the first determining sub-unit 543 is configured to, if the reference difference of each current candidate sub-resource is greater than or equal to the remaining average value, use each of the current candidate sub-resources as the target sub-resource, and For each target sub-resource, the acquisition amount of the target sub-resource is obtained based on the difference between the reference difference of the target sub-resource and the remaining average value.
  • the above-mentioned first determining unit 531 further includes: a second determining subunit 544, configured to: if the reference difference of the current candidate sub-resources is less than the remaining average value, re-set all the current candidate sub-resources.
  • the sub-resources whose reference difference is greater than or equal to the remaining average value are determined to be current candidate sub-resources, and the method of obtaining the remaining average values of all the current candidate sub-resources is repeated to determine each of the sub-resources.
  • the above-mentioned first determining unit 531 further includes: a compensation subunit, configured to, for each of the target sub-resources, determine the difference between the reference difference of the target sub-resource and the remaining average value.
  • the difference value of the candidate quantity of the target sub-resource is obtained as the candidate quantity; the difference value between the cumulative sum of the candidate quantity of the target sub-resource and the target acquisition quantity is obtained; if the difference value does not meet the preset condition, the compensation is determined according to the difference value And determine the acquisition amount for each target sub-resource according to the candidate amount of each target sub-resource and the compensation amount.
  • the above-mentioned second determining unit 532 includes: a third determining sub-unit 551, configured to use each current candidate sub-resource as a first sub-resource, and set each first sub-resource As the first acquisition amount of the first sub-resource, the fourth determining sub-unit 552 is used to acquire the remaining acquisition amount based on the priority of each sub-resource in the target combination resource and the remaining acquisition Determining the second sub-resource and the second acquisition amount of the second sub-resource from the target combined resource, wherein the remaining acquisition amount is the current candidate sub-resource The difference between the cumulative sum of the baseline difference of the resource and the target acquisition amount; a merging sub-unit 553, configured to merge the first sub-resource and the second sub-resource to obtain the one or more targets Sub-resources, and obtain the acquisition amount of each target sub-resource according to the first acquisition amount and the second acquisition amount.
  • an embodiment of this specification also provides an electronic device, as shown in FIG. 6, including a memory 604, one or more processors 602, and storage A computer program that is on the memory 604 and can run on the processor 602, and the processor 602 implements the steps of any implementation manner of the resource processing method provided in the first aspect when the processor 602 executes the program.
  • the bus architecture (represented by a bus 600), the bus 600 can include any number of interconnected buses and bridges, and the bus 600 will include one or more processors represented by the processor 602 and a memory 604 representing The various circuits of the memory are linked together.
  • the bus 600 can also link various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are all well-known in the art, and therefore, no further description is provided herein.
  • the bus interface 605 provides an interface between the bus 600 and the receiver 601 and the transmitter 603.
  • the receiver 601 and the transmitter 603 may be the same element, that is, a transceiver, which provides a unit for communicating with various other devices on the transmission medium.
  • the processor 602 is responsible for managing the bus 600 and general processing, and the memory 604 may be used to store data used by the processor 602 when performing operations.
  • FIG. 6 is only for illustration, and the electronic device provided in the embodiment of this specification may also include more or less components than that shown in FIG. 6, or have a different configuration from that shown in FIG. .
  • Each component shown in FIG. 6 can be implemented by hardware, software, or a combination thereof.
  • the embodiment of this specification also provides a computer-readable storage medium on which a computer program is stored, which is realized when the program is executed by a processor.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本说明书实施例提供了一种资源处理方法、装置、电子设备及介质,通过接收用户发起的资源获取请求,若资源获取请求中用户的目标获取量小于目标组合资源的可用量,则根据目标获取量、每个子资源的可用量以及目标组合资源的基准量,从目标组合资源中确定一个以上目标子资源,并将目标获取量拆分为对每个目标子资源的获取量,实现在用户有对目标组合资源的资源获取需求时,对目标组合资源中目标子资源的确定以及每个目标子资源的获取量的确定。

Description

资源处理方法、装置、电子设备及介质 技术领域
本说明书实施例涉及计算机技术领域,尤其涉及一种资源处理方法、装置、电子设备及介质。
背景技术
在计算机领域中,存在各种各样的资源例如存储资源、流量资源等,这些资源能够被需要该资源的对象利用,来实现资源的功能。为了提高资源的可用性,资源管理平台可以将同一类型的多个资源组合起来构成组合资源,以供需要该组合资源的对象使用,例如存储资源的组合、流量资源的组合或其他组合资源等。这样用户就可以根据需要从资源管理平台获取组合资源。在此过程中,如何高效地确定用户获取的组合资源中每个资源的获取量尤为重要。
发明内容
本说明书实施例提供了一种资源处理方法、装置、电子设备及介质。
第一方面,本说明书实施例提供了一种资源处理方法,包括:接收用户通过客户端发起的资源获取请求,所述资源获取请求包括所述用户的目标获取量;根据所述资源获取请求确定目标组合资源,所述目标组合资源包括多个子资源,每个子资源均对应有可用量;若所述目标获取量小于所述目标组合资源的可用量,则基于所述目标获取量、所述每个子资源的可用量以及所述目标组合资源的基准量,从所述目标组合资源中确定一个以上目标子资源,并将所述目标获取量拆分为对每个所述目标子资源的获取量,其中,所述目标组合资源的可用量和基准量均根据所述每个子资源的可用量确定;根据每个所述目标子资源的获取量为所述用户分配所述目标组合资源中的该目标子资源。
第二方面,本说明书实施例提供了一种资源处理装置,包括:接收模块,用于接收用户通过客户端发起的资源获取请求,所述资源获取请求包括所述用户的目标获取量;第一确定模块,用于根据所述资源获取请求确定目标组合资源,所述目标组合资源包括多个子资源,每个子资源均对应有可用量;第二确定模块,用于若所述目标获取量小于所述目标组合资源的可用量,则基于所述目标获取量、所述每个子资源的可用量以及所述目标组合资源的基准量,从所述目标组合资源中确定一个以上目标子资源,并将所述 目标获取量拆分为对每个所述目标子资源的获取量,其中,所述目标组合资源的可用量和基准量均根据所述每个子资源的可用量确定;分配模块,用于根据每个所述目标子资源的获取量为所述用户分配所述目标组合资源中的该目标子资源。
第三方面,本说明书实施例提供了一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述第一方面提供的资源处理方法的步骤。
第四方面,本说明书实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述第一方面提供的资源处理方法的步骤。
本说明书一个实施例提供的资源处理方法,通过接收用户发起的资源获取请求,根据资源获取请求确定目标组合资源,若资源获取请求中用户的目标获取量小于该目标组合资源的可用量,则根据目标获取量、每个子资源的可用量以及目标组合资源的基准量,从目标组合资源中确定一个以上目标子资源,并将目标获取量拆分为对每个目标子资源的获取量,实现在用户有对目标组合资源的资源获取需求时,对目标组合资源中目标子资源的确定以及每个目标子资源的获取量的确定,从而根据每个目标子资源的获取量为用户分配目标组合资源中的该目标子资源。这样,在用户需要获取组合资源时,无需用户自行选择目标组合资源中的目标子资源以及每个目标子资源的获取量,只需要输入需要的目标获取量,服务器就可以自动为用户从目标组合资源中确定目标子资源,以及确定对每个目标子资源的获取量,有利于减少用户的操作,提高用户对组合资源的获取效率。并且,通过配置组合资源的基准量,来确定目标组合资源中的目标子资源以及确定每个目标子资源的获取量,有利于提高目标子资源以及获取量的确定效率,减小确定目标子资源以及获取量需要消耗的时间,并减少系统资源的占用。
附图说明
图1为一种适用于本说明书实施例的一种运行环境示意图;
图2为本说明书实施例第一方面提供的一种资源处理方法的流程图;
图3为本说明书实施例第一方面提供的步骤S204的一种示例性流程图;
图4为本说明书实施例第一方面提供的一种基金处理方法的流程图;
图5为本说明书实施例第二方面提供的一种资源处理装置的模块框图;
图6为本说明书实施例第三方面提供的一种电子设备的结构示意图。
具体实施方式
请参见图1,为适用于本说明书实施例的一种运行环境示意图。如图1所示,一个或多个用户终端100可通过网络200与一个或多个服务器300(图1中仅示出一个)相连,以进行数据通信或交互。其中,用户终端100可以是个人电脑(Personal Computer,PC)、笔记本电脑、平板电脑、智能手机、电子阅读器、车载设备、网络电视或可穿戴设备等具有网络连接功能的智能设备。
用户终端100中安装有客户端,该客户端可以是浏览器,也可以是第三方应用软件,与服务器(Server)端相对应,为用户提供服务,如组合资源处理服务。用户可以通过用户终端中安装的客户端向服务器发起资源获取请求,从而触发服务器执行本说明书实施例提供的资源处理方法,以确定用户获取的组合资源中每个资源的获取量。
举例来讲,组合资源可以是组合流量资源。在一种应用场景中,用户可以将多余网络流量给资源管理平台进行管理,以通过资源管理平台将这部分流量资源分享给其他需要的用户,换取一定的收益。考虑到每个用户提供的共享流量有限,资源管理平台可以根据实际需要对所管理的流量资源分组,形成多个组合流量资源,并对每个组合流量资源的可用量进行实时更新。例如,为了方便管理,可以按地域或者是按照共享流量资源的额度进行分组。
或者,组合资源也可以是组合存储资源。在一种应用场景中,用户可以将自身存储设备的多余存储资源提供给资源管理平台进行管理,以通过资源管理平台将这部分存储资源分享给其他需要的用户,换取一定的收益。考虑到每个用户提供的存储资源有限,资源管理平台可以根据实际需要对所管理的存储资源分组,形成多个组合存储资源,并对每个组合存储资源的可用量进行实时更新。例如,为了方便管理,可以按地域或者是按照共享存储资源的大小进行分组。
又或者,组合资源也可以是组合基金。在一种应用场景中,基金公司可以将多支基金进行组合形成组合基金产品进行销售,这样有利于用户的风险和收益均衡。当然,除了基金以外,也可以是其他理财类资源的组合如股票、债券或其他金融衍生产品等。
需要说明的是,除了以上所列举的这些组合资源以外,还可以是其他适用的组合资源,此处不作限制。
为了更好的理解本说明书实施例提供的技术方案,下面通过附图以及具体实施例对本说明书实施例的技术方案做详细的说明,应当理解本说明书实施例以及实施例中的具 体特征是对本说明书实施例技术方案的详细的说明,而不是对本说明书技术方案的限定,在不冲突的情况下,本说明书实施例以及实施例中的技术特征可以相互组合。本说明书实施例中,术语“一个以上”表示一个或大于一个的情况;术语“多个”表示“两个以上”,即包括两个或大于两个的情况。需要说明的是,本说明书实施例中,描述的两个值之前的差值均为两个值中较大的值减去较小的值,如A与B之间的差值,且A小于B,则得到差值的方式为B-A。
第一方面,图2示出了本说明书实施例提供的一种组合资源处理方法的流程图,本实施例描述的是服务器的处理流程,例如,可以是资源管理平台的服务器,或者,也可以是资源管理平台指定的第三方代销平台的服务器。请参阅图2,所述方法至少可以包括以下步骤S200-步骤S206。
步骤S200,接收用户通过客户端发起的资源获取请求,所述资源获取请求包括所述用户的目标获取量。
用户可以通过客户端针对需要获取的组合资源向服务器端发起资源获取请求,客户端通过网络将资源获取请求发送给服务器。资源获取请求中携带有目标获取量,服务器在接收到用户发送的资源获取请求后,则根据请求中的目标获取量向该用户提供相应的组合资源。例如,用户可以在客户端中输入要获取的组合资源的目标获取量,并触发客户端上设置的用于触发资源获取请求的按钮。
以组合流量资源的场景为例,若某用户具有流量获取需求,可以通过客户端输入所需要的目标获取量即所需要的流量额度,进而向服务器发起资源获取请求。例如,用户需要500M流量,则在客户端中输入500M。
以组合存储资源的场景为例,若某用户具有存储空间获取需求,可以通过客户端输入所需要的目标获取量即所需要的存储空间大小,进而向服务器发起资源获取请求。例如,用户需要1G的存储空间,则在客户端中输入1G。
步骤S202,根据所述资源获取请求确定目标组合资源,所述目标组合资源包括多个子资源,每个子资源均对应有可用量。
以上述组合流量资源的场景或组合存储资源的场景为例,可以根据所管理的组合资源,在服务器中预先配置的资源信息库,资源信息库中存储有所管理的每个组合资源的可用量、每个子资源的可用量、每个组合资源与相应可用量的对应关系信息、每个子资源与相应可用量的对应关系信息、以及组合资源与子资源的对应关系信息。并实时更新 资源信息库中每个组合资源的可用量以及每个子资源的可用量。
需要说明的是,本实施例中,每个组合资源均包括多个子资源,每个子资源均对应有用户的可用量,组合资源的可用量为该组合资源包含的每个子资源的可用量之和。以组合流量资源的场景为例,假设组合流量资源C包括子流量资源c1、子流量资源c2、子流量资源c3和子流量资源c4。假设子流量资源c1的当前可用量为M1,子流量资源c2的当前可用量为M2,子流量资源c3的当前可用量为M3,子流量资源c4的当前可用量为M4,则该组合流量资源A的可用量为M1+M2+M3+M4。
在本说明书实施例中,资源获取请求中的目标获取量与资源信息库中所有组合资源的可用量均不一致。上述根据所述资源获取请求确定目标组合资源的实施过程可以包括:从资源获取请求中提取出用户的目标获取量;在资源信息库中查找可用量大于目标获取量的组合资源,从查找到的组合资源中确定一个组合资源作为目标组合资源。例如,可以从查找到的组合资源中任意选取一个组合资源作为目标组合资源,或者,可以将查找到的组合资源中,可用量与目标获取量之间的差值最小的组合资源作为目标组合资源。此时,目标获取量小于目标组合资源的可用量。目标组合资源的可用量根据该目标组合资源中每个子资源的可用量确定。在一种实施方式中,目标组合资源的可用量为目标组合资源中子资源的可用量的累加和。
可以理解的是,若目标获取量与资源信息库中某一个或多个组合资源的可用量一致,则可以从可用量一致的组合资源中选取一个组合资源提供给用户,而且不用重新确定用户对该组合资源中各子资源的获取量。
举例来讲,在一种应用场景中,可以在客户端显示资源信息库中存储的组合资源的可用量,作为待选项,若用户通过选择待选项输入目标获取量,则服务器接收到资源获取请求后从具有相应可用量的组合资源中选取一个组合资源提供给用户,若客户端显示的待选项均不满足用户需求,用户可以在客户端中输入一个获取量作为目标获取量,此时,目标获取量小于服务器确定的目标组合资源的可用量,执行以下步骤S204。
步骤S204,若所述目标获取量小于所述目标组合资源的可用量,则基于所述目标获取量、所述每个子资源的可用量以及所述目标组合资源的基准量,从所述目标组合资源中确定一个以上目标子资源,并将所述目标获取量拆分为对每个所述目标子资源的获取量。
步骤S206,根据每个所述目标子资源的获取量为所述用户分配所述目标组合资源中 的该目标子资源。
在本说明书一实施例中,在确定每个目标子资源的获取量后,可以按照每个目标子资源的获取量为用户分配目标组合资源中的该目标子资源。以组合流量资源的场景为例,假设用户的目标获取量为500M,根据上述步骤S204确定的对目标子流量资源c1的获取量为200M、对目标子流量资源c2的获取量为160M、对目标子流量资源c3的获取量为140M,则从目标子流量资源c1为用户分配200M流量,从目标子流量资源c2为用户分配160M流量,以及从目标子流量资源c3为用户分配140M流量。
再以组合存储资源的场景为例,假设用户的目标获取量为1G存储空间,根据上述步骤S204确定的对目标子存储资源d1的获取量为300M存储空间、对目标子存储资源d2的获取量为224M存储空间、对目标子存储资源d3的获取量为280M存储空间、对目标子存储资源d4的获取量为220M存储空间,则从目标子存储资源d1为用户分配300M存储空间,从目标子存储资源d2为用户分配224M存储空间,从目标子存储资源d3为用户分配280M存储空间,以及从目标子存储资源d4为用户分配220M存储空间。这样用户在使用所获取的这1G存储空间时,则可以通过资源管理平台将所要存储的数据分别存储到为该用户分配的存储空间中。
在本说明书一实施例中,对于提供组合资源中的子资源的每个客户端,可以显示资源提供方所提供的资源可用量。例如,以组合流量资源的场景为例,假设提供流量子资源的用户提供了1G流量给资源管理平台进行流量分享,则可以在提供该流量子资源的客户端显示所提供的资源可用量,如1G。
此时,在按照每个目标子资源的获取量为用户分配目标组合资源中的该目标子资源之后,还可以包括:将目标组合资源中每个目标子资源的获取量反馈给提供该目标子资源的客户端,在该客户端进行显示,并对该客户端上显示分配出去的资源量即分配给上述发起资源获取请求的用户的获取量,并对所显示的该目标子资源的资源可用量进行更新,即显示按照所确定的获取量分配后当前资源可用量,以便于资源提供方及时了解所提供的流量的分享情况。例如,该客户端提供的子资源的可用量为1G,服务器将该子资源作为目标子资源为发起资源获取请求的用户分配了200M流量后,当前资源可用量为824M。
上述步骤S204中,目标组合资源的基准量根据该目标组合资源中每个子资源的可用量确定。需要说明的是,目标组合资源的基准量可以用于表征当前目标组合资源中所有子资源的平均可用量。具体来讲,可以预先根据实际经验对基准量的确定规则进行配 置,例如,可以预先设置多个相互依次邻接的可用量范围,并根据经验配置多个基准量,将当前目标组合资源中每个子资源的可用量与上述多个可用量范围进行匹配,确定每个子资源所在的可用量范围,根据预先配置的各可用量范围内子资源的数量与基准量的对应关系,确定当前该目标组合资源的基准量。又例如,可以将目标组合资源中所有子资源的可用量的平均值作为当前该目标组合资源的基准量。
具体来讲,在本说明书一实施例中,如图3所示,上述基于所述目标获取量、所述每个子资源的可用量以及所述目标组合资源的基准量,从所述目标组合资源中确定一个以上目标子资源,并将所述目标获取量拆分为对每个所述目标子资源的获取量的实施过程可以包括以下步骤S300至步骤S304。
步骤S300,将所述目标组合资源中可用量大于所述基准量的子资源均确定为当前候选子资源,并判断所述当前候选子资源的基准差值的累加和是否大于或等于所述目标获取量。
其中,基准差值为当前候选子资源的可用量与基准量之间的差值。举例来讲,假设目标组合资源共包括M个子资源,这M个子资源中有n个子资源的可用量大于当前该目标组合资源的基准量,则将这n个子资源均确定为当前候选子资源,分别表示为V i。假设当前候选子资源的数量表示为n,则i取1到n。假设当前该目标组合资源的基准量为s,子资源V i的可用量表示为a i,则第i个当前候选子资源的基准差值表示为:a i-s,进而可以得到这n个当前候选子资源的基准差值的累加和:
Figure PCTCN2020102303-appb-000001
步骤S302,若是,从所有所述当前候选子资源中确定所述一个以上目标子资源,并按照第一预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量。
步骤S304,若否,从所述目标组合资源中确定所述一个以上目标子资源,并按照第二预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量。
假设目标获取量表示为R,当累加和
Figure PCTCN2020102303-appb-000002
大于或等于R时,表示这些当前候选子资源的可用量中超出基准量的部分已经可以满足用户的获取需求,就可以从所有当前候选子资源中确定一个以上目标子资源。当累加和
Figure PCTCN2020102303-appb-000003
小于R时,表示这些当前候选子资源的可用量中超出基准量的部分无法满足用户的获取需求,则目标获取量中的一部分需要从目标组合资源的其他子资源中获取。
这样有利于实现用户获取目标获取量的目标组合资源后,目标组合资源中各子资源的剩余可用量能够实现均衡,方便资源管理平台对组合资源的管理,避免出现同一组合资源中某些子资源的可用量过高,而某些子资源的可用量过低的情况。可以理解的是,每个子资源的剩余可用量为该子资源的可用量与获取量之间的差值。需要说明的是,若目标组合资源中一部分子资源被确定为目标子资源,而另一部分子资源不是目标子资源,对于不是目标子资源的那部分子资源,获取量为零,即不会获取那部分子资源。
在上述步骤S302中,从所有所述当前候选子资源中确定所述一个以上目标子资源,并按照第一预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量的实施过程可以包括步骤F1至F4。
步骤F1:获取所有所述当前候选子资源的剩余均值,其中,所述剩余均值为所述累加和与所述目标获取量之间的差值除以所述当前候选子资源的数量;
步骤F2:判断所述每个当前候选子资源的基准差值是否均大于或等于所述剩余均值;
步骤F3:若是,则将所述每个当前候选子资源均作为所述目标子资源,并针对每个所述目标子资源,基于该目标子资源的基准差值与所述剩余均值之间的差值,得到该目标子资源的获取量。
其中,累加和是指所有当前候选子资源的基准差值之和,剩余均值用于表征上述累加和超过目标获取量的剩余量的均值。
另外,在本说明书一实施例中,上述从所有所述当前候选子资源中确定一个以上目标子资源,并按照第一预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量的实施过程还包括:
步骤F4:若存在所述当前候选子资源的基准差值小于所述剩余均值,则重新将所述目标组合资源中所述基准差值大于或等于所述剩余均值的子资源均确定为当前候选子资源,并重复执行上述获取所有所述当前候选子资源的剩余均值,判断所述每个当前候选子资源的基准差值是否均大于或等于所述剩余均值的步骤,直至每个当前候选子资源的基准差值均大于或等于剩余均值。
举例来讲,假设剩余均值用m表示,当前目标组合资源中共有n个当前候选子资源,则
Figure PCTCN2020102303-appb-000004
其中,
Figure PCTCN2020102303-appb-000005
表示所有当前候选子资源的基准差值之和超过目标获取量的剩余量。
进而,将每个当前候选子资源的基准差值a i-s与剩余均值m进行比较,若a i-s均大于或等于m,则将每个当前候选子资源均作为目标子资源,共n个目标子资源,并将每个目标子资源的获取量确定为a i-s-m。这样能够保证按照该获取量获取目标子资源后,目标子资源的剩余可用量相等,有利于进一步保证用户获取目标获取量的目标组合资源后,该目标组合资源中各子资源的剩余可用量能够实现均衡。
若存在当前候选子资源的基准差值小于m,则需要对当前候选子资源进行更新,将基准差值大于或等于m的子资源重新确定为当前候选子资源,并对当前候选子资源的数量n进行更新。基于重新确定的当前候选子资源,重新从上述步骤F1开始迭代,直至每个当前候选子资源的基准差值均大于或等于剩余均值,进而就可以按照步骤F3确定目标子资源以及对目标子资源的获取量。
在上述迭代过程中,剩余均值随着当前候选子资源的更新而更新。这样有利于保证按照该获取量获取目标子资源后,目标组合资源中原本可用量大于基准量的子资源的剩余可用量实现大体均衡,有利于进一步保证用户获取目标获取量的目标组合资源后,该目标组合资源中各子资源的剩余可用量能够实现均衡。
在本说明书一实施例中,考虑到计算过程中存在取平均值的过程,由于系统预先设置的对小数保留规则的限制,每个目标子资源的候选量的之和与目标获取量之间可能存在不一致的情况。为了尽量达到用户的需求,上述针对每个所述目标子资源,基于该目标子资源的基准差值与所述剩余均值之间的差值,得到该目标子资源的获取量的实施过程可以包括:针对每个所述目标子资源,将该目标子资源的基准差值与所述剩余均值之间的差值作为候选量;获取所述目标子资源的候选量的累加和与所述目标获取量之间的差异值;若所述差异值不满足预设条件,则根据所述差异值确定补偿量,并根据每个所述目标子资源的候选量以及所述补偿量,确定对每个所述目标子资源的获取量。
当然,若所述差异值满足预设条件,则将每个所述目标子资源的候选量作为该目标子资源的获取量。
在上述获取量确定过程中,可以将每个所述目标子资源的候选量的累加和与所述目标获取量之间的差值作为二者的差异值。或者,也可以每个所述目标子资源的候选量的累加和与所述目标获取量之间的差值,在目标获取量中的占比作为二者的差异值。预设条件可以根据实际应用场景的需要设置。例如,以组合流量资源的场景为例,预先设置一个误差阈值,如0.01M,当差异值小于该误差阈值时,则判定该差异值满足预设条件,反之,则判定该差异值不满足预设条件,需要对进行补偿操作。又例如,预设条件也可 以设置为满足差异值为零,即每个目标子资源的候选量的累加和与目标获取量一致,若差异值不为零,则表示二者不一致,判定不满足预设条件,若差异值为零,则判定满足预设条件。
具体来讲,根据所述差异值确定补偿量,并根据每个所述目标子资源的候选量以及所述补偿量,确定对每个所述目标子资源的获取量的实施过程可以包括:将每个目标子资源的候选量的累加和与所述目标获取量之间的差值作为补偿量,从所确定的目标子资源中随机选择一个目标子资源作为补偿子资源,将补偿子资源的候选量与补偿量之和作为该补偿子资源的获取量,针对所确定的目标子资源中除补偿子资源以外的其他每个目标子资源,将该目标子资源的候选量作为对该目标子资源的获取量。
举例来讲,所确定的目标子资源包括:目标子资源V1、目标子资源V2、目标子资源V3、目标子资源V4以及目标子资源V5,所确定的候选量依次分别为r1、r2、r3、r4以及r5。若r1+r2+r3+r4+r5与目标获取量R之间的差异值不满足预设条件,则从V1、V2、V3、V4以及V5中随机选取的补偿子资源为目标子资源V2,则目标子资源V2的获取量为r2+[R-(r1+r2+r3+r4+r5)],目标子资源V1的获取量为r1,目标子资源V3的获取量为r3,目标子资源V4的获取量为r4,目标子资源V5的获取量为r5。
当然,在本说明书其他实施例中,上述针对每个所述目标子资源,基于该目标子资源的基准差值与所述剩余均值之间的差值,得到该目标子资源的获取量的实施过程可以包括:针对每个所述目标子资源,将该目标子资源的基准差值与所述剩余均值之间的差值作为该目标子资源的获取量。
在上述步骤S304中,从目标组合资源中确定一个以上目标子资源,并按照第二预设规则将目标获取量拆分为对每个目标子资源的获取量的实施过程可以包括:将每个当前候选子资源均作为第一子资源,将每个第一子资源的基准差值,作为该第一子资源的第一获取量;获取剩余获取量,并基于目标组合资源中每个子资源的优先级、剩余获取量以及每个子资源的当前可用量,从目标组合资源中确定第二子资源以及第二子资源的第二获取量,其中,剩余获取量为当前候选子资源的基准差值的累加和与目标获取量之间的差值;将第一子资源与第二子资源进行合并,得到一个以上目标子资源,并根据第一获取量以及第二获取量,得到每个目标子资源的获取量。
需要说明的是,对于目标组合资源中已被确认为第一子资源的子资源,当前可用量为该子资源的可用量中除该子资源的第一获取量以外的剩余可用量,对于未被确认为第一子资源的其他子资源,当前可用量即为该子资源的可用量。
举例来讲,当前候选子资源包括:子资源V1、子资源V7和子资源V9,则将子资源V1、子资源V7和子资源V9均作为第一子资源,假设子资源V1的可用量为a1,基准差值为t1(t1=a1-s);子资源V7的可用量为a7,基准差值为t7(t7=a7-s);子资源V9的可用量为a9,基准差值为t9(t9=a9-s),则子资源V1的第一获取量为t1,子资源V7的第一获取量为t7和子资源V9的第一获取量为t9。此时,子资源V1、V7和V9的当前可用量依次为:a1-t1、a7-t7、a9-t9。而对于目标组合资源中除第一资源以外的其他子资源,当前可用量仍为原来的可用量,即上述步骤S202中确定的可用量。而剩余获取量为:R-(t1+t7+t9)。
可以理解的是,若第一子资源与第二子资源之间不存在重合,则将每个第一子资源以及每个第二子资源均作为目标子资源,其中,每个第一子资源的第一获取量即为相应目标子资源的获取量,每个第二子资源的第二获取量即为相应目标子资源的获取量。若第一子资源与第二子资源之间存在重合,则需要将重合的第一子资源的第一获取量和第二子资源的第二获取量相加,作为该目标子资源的获取量。例如,第一子资源包括子资源V1、子资源V7和子资源V9,相应第一获取量依次为t1、t7和t9,第二子资源包括子资源V1、子资源V2和子资源V3,相应第二获取量依次为p1、p2和p3,则将子资源V1、子资源V2、子资源V3、子资源V7和子资源V9均确定为目标子资源,其中,子资源V1的获取量为t1+p1,子资源V2的获取量为p2,子资源V3的获取量为p3,子资源V7的获取量为t7,子资源V9的获取量为t9。
本实施例中,目标组合资源中每个子资源的优先级根据实际应用场景设置。例如,在组合流量资源的场景中,目标组合流量资源中各子流量资源的优先级可以根据各子流量资源的提供方历史分享的资源量,来确定各子流量资源的优先级,如历史分享流量越多的资源提供方提供的子资源的优先级越高。同理,在组合存储资源的场景中,也可以设置为历史分享存储空间越多的资源提供方提供的子资源的优先级越高。这样有利于在实现目标组合资源中各子资源的剩余可用量达到大体均衡的同时,给分享资源更多的用户提供更多的收益,提高资源提供方分享资源的积极性。
具体来讲,在一种实施方式中,基于目标组合资源中每个子资源的优先级、剩余获取量以及每个子资源的当前可用量,从目标组合资源中确定第二子资源以及第二子资源的第二获取量的实施过程可以包括:将目标组合资源中所有子资源按照优先级由高到低的顺序排序,将排在第一位的子资源确定为当前第二子资源;判断当前第二子资源的当前可用量是否大于或等于当前剩余获取量;若是,将当前剩余获取量作为当前第二子资 源的第二获取量;若否,将当前第二子资源的当前可用量作为当前第二子资源的第二获取量,更新当前剩余获取量,并将排在下一位的子资源确定为当前第二子资源,重复执行判断当前第二子资源的当前可用量是否大于当前剩余获取量的步骤,直至当前第二子资源的当前可用量大于或等于当前剩余获取量。
需要说明的是,在上述过程中,若当前第二子资源同时也是第一子资源,则当前第二子资源的当前可用量为上述步骤S202确定的可用量减去作为第一子资源时确定的第一获取量;若当前第二子资源并不是第一子资源,则当前第二子资源的当前可用量即为上述步骤S202所确定的可用量。
举例来讲,假设目标组合资源包括子资源V1至子资源V10,共10个子资源,这10个子资源的优先级由高到低的顺序依次为:V1、V2、V3、…、V10。则先将V1确定为当前第二子资源。如在上述示例中,V1同时也被作为第一子资源,且V1的第一获取量为t1,当V1的当前可用量为a1-t1,当前剩余获取量为Q为:R-(t1+t7+t9),若a1-t1小于Q,则将a1-t1作为当前第二子资源V1的第二获取量,将当前剩余获取量更新为:R-(t1+t7+t9)-(a1-t1),并将排在下一位的子资源V2确定为当前第二子资源,继续迭代,直至当前第二子资源假设为V3的当前可用量a3大于当前剩余获取量Q″:R-(t1+t7+t9)-(a1-t1)-a2,则将当前剩余获取量Q″作为当前第二子资源V3的第二获取量。
当然,在本说明书其他实施例中,除了上述实施方式以外,也可以将目标组合资源中所有子资源按照优先级由高到低的顺序排序,将排在第一位的子资源确定为当前第二子资源,若当前第二子资源的当前可用量大于或等于当前剩余获取量,则将当前剩余获取量作为当前第二子资源的第二获取量;若当前第二子资源的当前可用量小于当前剩余获取量,则将当前第二子资源的当前可用量的1/2作为该第二子资源的第二获取量,并将下一个子资源确定为当前第二子资源,将当前第二子资源的当前可用量的1/3作为该第二子资源的第二获取量,以此类推,随着优先级越来越低,第二获取量的取用占比越来越低,如1/4、1/5、1/6等,直至当前第二子资源的当前可用量大于或等于当前剩余获取量。需要说明的是,若目标组合资源中所有子资源遍历完后,当前剩余获取量仍然大于0,则可以重新再由优先级排在第一位的子资源开始遍历,重复上述第二获取量确定过程。
本说明书实施例提供的资源处理方法,在用户需要获取组合资源时,无需用户自行选择目标组合资源中所要获取的目标子资源以及对每个目标子资源的获取量,只需要输入所需要的目标获取量,服务器就可以自动为用户从目标组合资源中确定目标子资源, 以及确定对每个目标子资源的获取量,有利于减少用户的操作,提高用户对组合资源的获取效率。并且,通过配置组合资源的基准量,来确定目标组合资源中的目标子资源以及确定每个目标子资源的获取量,有利于提高目标子资源以及获取量的确定效率,减小确定目标子资源以及获取量需要消耗的时间,并减少系统资源的占用。
另外,本说明书实施例提供的获取量确定方式能够实现组合资源中各子资源的部分分享,方便资源提供方尽快将资源分享给需要的用户,减少等待时间,提高用户体验。而且,相比于随机将目标获取量拆分给目标组合资源中的各子资源的方式,有利于实现在用户获取目标获取量的目标组合资源后,使得目标组合资源中各子资源的剩余可用量能够达到均衡,方便资源管理平台对组合资源的管理,避免出现同一组合资源中某些子资源的可用量过高,而某些子资源的可用量过低的情况,从而实现资源提供方的利益均衡,减少资源提供方的投诉量,有利于提高资源提供方的用户体验。
以上为本说明书实施例提供的资源处理方法,为了能够更加清楚详细地说明,下面本说明书实施例以组合资源为组合基金,资源获取请求为基金赎回请求,基准量为赎回基准额度,子资源的获取量为子基金的赎回份额为例,对本说明书实施例提供的技术方案进行详细阐述。
图4示出了本说明书实施例提供的一种基金处理方法的流程示意图,包括以下步骤S400至步骤S406。
步骤S400,接收用户通过客户端发起的基金赎回请求,基金赎回请求包括该用户要赎回的目标赎回份额。
用户在购买组合基金后,可以通过客户端向服务器发起基金赎回请求,以对所持有的组合基金进行赎回。本实施例中,将用户要赎回的组合基金作为目标组合基金。举例来讲,可以在客户端中针对目标组合基金输入想要赎回的目标赎回份额即用户需要赎回的总份额,并通过点击用于触发基金赎回请求的按钮,向服务器发起针对于该目标组合基金的基金赎回请求。
可以理解的是,用户将手中持有的基金单位按公布的价格卖出并收回现金的过程,即为基金赎回,部分赎回则为用户对所持有目标组合基金的总份额中的一部分份额进行赎回。例如,用户持有目标组合基金的总份额为8000,用户要赎回的目标赎回份额为3000。其中,用户持有的总份额为用户持有每个子基金的份额之和。
步骤S402,根据基金赎回请求确定目标组合基金,目标组合基金包括多个子基金, 每个子基金均对应有该用户的可用额度。
在本说明书一实施例中,服务器中记录有每个用户购买的组合基金,并记录有该用户持有组合基金中每个子基金的可用额度,即服务器存储有组合基金的交易信息,组合基金的交易信息包括购买该组合基金的用户标识、该组合基金的标识、该组合基金包含的子基金的标识、该用户持有该组合基金中每个子基金的可用额度、以及这四者之间的对应关系信息。
在一种可选的实施方式中,每个用户持有一个目标组合基金,基金赎回请求还可以包括用户标识。根据基金赎回请求确定目标组合基金的实施过程可以包括:将基金赎回请求中的用户标识以及预先存储的交易信息中的用户标识信息匹配,确定目标组合基金,以及目标组合基金包含的多个子基金中每个子基金的可用额度。可以理解的是,上述子基金的可用额度是指该用户的可用额度。
在另一种可选的实施方式中,每个用户可以持有多个目标组合基金,基金赎回请求还可以包括用户标识以及目标组合标识,其中,目标组合标识为用户要赎回的目标组合基金的标识。根据基金赎回请求确定目标组合基金的实施过程可以包括:在预先存储的交易信息中查找与基金赎回请求中的用户标识以及目标组合标识对应的组合基金,作为目标组合基金,并获取所查找到的目标组合基金包含的多个子基金中,每个子基金的可用额度。
需要说明的是,在一种应用场景中,可以在客户端显示用户持有的组合基金以及用户持有该组合基金的总份额,用户可以点击预先设置的全部赎回按钮或输入需要的目标赎回份额。服务器在接收到该基金赎回请求后,目标赎回份额与用户持有目标组合基金的总份额一致,则无需执行以下步骤S404,将目标组合基金中的每个子基金的可用额度全部赎回。若目标赎回份额小于用户持有目标组合基金的总份额,由于目标组合基金中不同子基金的基金净值不同,基金公司需要分别根据要赎回的每个子基金的赎回份额以及基金净值来确定该子基金的赎回资金,确定赎回的目标子基金不同或者是所确定的各目标子基金的赎回份额不同,则赎回资金也就不同。进一步地,需要通过执行以下步骤S404对目标赎回份额进行拆分,确定目标组合基金中本次需要进行赎回的目标子基金以及每个目标子基金的赎回份额。
步骤S404,若目标赎回份额小于该用户持有目标组合基金的总份额,则基于目标赎回份额、每个子基金的可用额度以及目标组合基金的赎回基准额度,从目标组合基金中确定一个以上目标子基金,并将目标赎回份额拆分为对每个目标子基金的赎回份额。
步骤S406,按照每个目标子基金的赎回份额对该用户持有的该目标子基金进行赎回。
在确定每个目标子基金的赎回份额后,就可以按照每个目标子基金的赎回份额对用户持有的该目标子基金进行赎回。举例来讲,可以按照每个目标子基金的当前基金净值以及赎回份额,确定该目标子基金对应的赎回资金,进而,将该目标组合基金中所有目标子基金的赎回资金的总额发送给用户账户,或者,可以将该目标组合基金中每个目标子基金的赎回资金分别发送给用户账户。
在本说明书一实施例中,为了便于用户了解所持有的组合基金的总份额以及组合基金中每个子基金的可用额度,可以在客户端对用户所持有的组合基金的总份额以及组合基金中每个子基金的可用额度进行显示,以便于用户在登录后能够及时掌握基金持有情况。
此时,在一种实施方式中,在按照每个目标子基金的赎回份额对用户持有的该目标子基金进行赎回之后,还可以包括:将目标组合基金中每个子基金的赎回份额反馈给客户端,在客户端进行显示,并对客户端上显示的目标组合基金的总份额以及组合基金中每个子基金的可用额度进行更新,即针对每个目标子基金,显示赎回后的当前可用额度。
在另一种实施方式中,在按照每个目标子基金的赎回份额对用户持有的该目标子基金进行赎回之前,还可以包括:将目标组合基金中每个子基金的赎回份额反馈给客户端,在客户端进行显示,以便于用户确认是否按照该赎回份额进行赎回;检测用户是否触发预设的确认按钮,若是,客户端向服务器发送确认赎回指令,当服务器在接收到确认赎回指令时,则执行上述按照每个目标子基金的赎回份额对用户持有的该目标子基金进行赎回的步骤。
需要说明的是,若目标组合基金中一部分子基金被确定为目标子基金,而另一部分子基金不是目标子基金,对于不是目标子基金的那部分子基金,赎回份额为零,即不会那部分子基金进行赎回;若目标组合基金中所有子基金均确定为目标子基金,则分别按照所确定的赎回份额对相应目标子基金进行赎回。
上述步骤S404中,目标组合基金的赎回基准额度用于表征目标组合基金中所有子基金的平均可赎回额度。目标组合基金的赎回基准额度根据该目标组合基金中每个子基金的可用额度确定。具体来讲,可以预先根据实际经验对赎回基准额度的确定规则进行配置,例如,可以预先设置多个相互依次邻接的可用额度范围,并根据经验配置多个赎回基准额度,将当前目标组合基金中每个子基金的可用额度与上述多个可用额度范围进 行匹配,确定每个子基金所在的可用额度范围,根据预先配置的各可用额度范围内子基金的数量与赎回基准额度的对应关系,确定当前该目标组合基金的赎回基准额度。又例如,可以将目标组合基金中所有子基金的可用额度的平均值作为当前该目标组合基金的赎回基准额度。
具体来讲,上述步骤S404中,基于所述目标赎回份额、所述每个子基金的可用额度以及所述目标组合基金的赎回基准额度,从所述目标组合基金中确定一个以上目标子基金,并将所述目标赎回份额拆分为对每个所述目标子基金的赎回份额的实施过程可以包括:将目标组合基金中可用额度大于赎回基准额度的子基金均确定为当前候选子基金,并判断当前候选子基金的基准差值的累加和是否大于目标赎回份额,其中,基准差值为当前候选子基金的可用额度与赎回基准额度之间的差值;若是,从所有当前候选子基金中确定一个以上目标子基金,并按照第一预设规则将目标赎回份额拆分为对每个目标子基金的赎回份额;若否,从目标组合基金中确定一个以上目标子基金,并按照第二预设规则将目标赎回份额拆分为对每个目标子基金的赎回份额。具体实施过程可以参照上述实施例中步骤S204的相应实施过程,此处不再赘述。
作为一种可选的实施方式,上述从所有当前候选子基金中确定一个以上目标子基金,并按照第一预设规则将所述目标赎回份额拆分为对每个所述目标子基金的赎回份额的实施过程可以包括:获取所有当前候选子基金的剩余均值,其中,剩余均值为上述当前候选子资源的基准差值的累加和与目标赎回份额之间的差值,除以当前候选子基金的数量;判断每个当前候选子基金的基准差值是否均大于或等于该剩余均值;若是,则将每个当前候选子基金均作为目标子基金,并针对每个目标子基金,基于该目标子基金的基准差值与剩余均值之间的差值,得到该目标子基金的赎回份额。
进一步地,若存在当前候选子基金的基准差值小于所述剩余均值,则重新将目标组合基金中基准差值大于或等于所述剩余均值的子基金均确定为当前候选子基金,并重复执行上述获取所有当前候选子基金的剩余均值,判断每个当前候选子基金的基准差值是否均大于或等于剩余均值的步骤,直至每个当前候选子基金的基准差值均大于或等于剩余均值。
作为一种可选的实施方式,上述针对每个目标子基金,基于该目标子基金的基准差值与剩余均值之间的差值,得到该目标子基金的赎回份额的实施过程可以包括:针对每个目标子基金,将该目标子基金的基准差值与剩余均值之间的差值作为候选量;获取目标子基金的候选量的累加和与目标赎回份额之间的差异值;若差异值不满足预设条件, 则根据差异值确定补偿量,并根据每个目标子基金的候选量以及补偿量,确定对每个目标子基金的赎回份额。
可以理解的是,上述差异值即为赎回份额的尾差,具体实施过程可以参照上述实施例中针对每个目标子资源,基于该目标子资源的基准差值与剩余均值之间的差值,得到该目标子资源的获取的实施过程,此处不再赘述。
作为一种可选的实施方式,上述从所述目标组合基金中确定一个以上目标子基金,并按照第二预设规则将所述目标赎回份额拆分为对每个目标子基金的赎回份额的实施过程可以包括:将每个当前候选子基金均作为第一子基金,将每个第一子基金的基准差值,作为该第一子基金的第一赎回份额;获取剩余赎回份额,并基于目标组合基金中每个子基金的优先级、剩余赎回份额以及每个子基金的当前可用额度,从目标组合基金中确定第二子基金以及所述第二子基金的第二赎回份额,其中,剩余赎回份额为当前候选子基金的基准差值的累加和与目标赎回份额之间的差值;将第一子基金与第二子基金进行合并,得到一个以上目标子基金,并根据第一赎回份额以及第二赎回份额,得到每个述目标子基金的赎回份额。
具体实施过程可以参照上述实施例中,按照第二预设规则将目标获取量拆分为对每个目标子资源的获取量的实施过程,此处不再赘述。
作为一种可选的实施方式,上述基于目标组合基金中每个子基金的优先级、剩余赎回份额以及每个子基金的当前可用额度,从目标组合基金中确定第二子基金以及第二子基金的第二赎回份额的实施过程可以包括:将目标组合基金中所有子基金按照优先级由高到低的顺序排序,将排在第一位的子基金确定为当前第二子基金;判断当前第二子基金的当前可用额度是否大于或等于当前剩余赎回份额;若是,将当前剩余赎回份额作为当前第二子基金的第二赎回份额;若否,将当前第二子基金的当前可用额度作为当前第二子基金的第二赎回份额,更新当前剩余赎回份额,并将排在下一位的子基金确定为当前第二子基金,重复执行判断当前第二子基金的可用额度是否大于当前剩余赎回份额的步骤,直至当前第二子基金的当前可用额度大于或等于当前剩余赎回份额。
本实施例中,目标组合基金中每个子基金的优先级可以根据每个子基金的收益确定,收益越高的子基金优先级越低,收益越低的子基金优先级越高,优先被赎回。
本说明书实施例提供的基金处理方法,在用户需要对目标组合基金进行部分赎回时,无需用户自行选择对目标组合基金中每个子基金的赎回份额,只需要输入想要赎 回的目标赎回份额,服务器就可以自动为用户从目标组合基金中确定要赎回的目标子基金,以及确定每个目标子基金的赎回份额,有利于减少用户的操作,无需用户考虑该赎回组合基金中的哪个子基金以及多少份额,提高了用户对组合基金的赎回效率。并且,通过配置组合基金的赎回基准额度,来确定目标组合基金中要赎回的目标子基金以及确定每个目标子基金的赎回份额,有利于提高目标子基金以及赎回份额的确定效率,减小确定目标子基金以及赎回份额需要消耗的时间,并减少系统资源的占用。
另外,相比于随机将目标赎回份额拆分给目标组合基金中每个子基金的方式,有利于在用户完成目标组合资源的部分赎回后,使得目标组合基金中各子基金的剩余份额达到均衡,即所持各子基金份额能够大体平均,避免出现用户持有同一组合基金中某些子基金的剩余份额过高,而某些子基金的剩余份额过低的情况,从而保证用户持有组合基金的风险和收益均衡,满足用户的赎回需求,有效避免用户对所确定的目标子基金以及赎回份额不满导致的投诉,提高用户体验,减少系统处理这部分用户投诉导致的资源占用。
第二方面,基于与前述第一方面实施例提供的资源处理方法同样的发明构思,本说明书实施例还提供了一种资源处理装置。如图5所示,该资源处理装置50包括接收模块51、第一确定模块52、第二确定模块53以及分配模块54。
接收模块51,用于接收用户通过客户端发起的资源获取请求,所述资源获取请求包括所述用户的目标获取量;
第一确定模块52,用于根据所述资源获取请求确定目标组合资源,所述目标组合资源包括多个子资源,每个子资源均对应有可用量;
第二确定模块53,用于若所述目标获取量小于所述目标组合资源的可用量,则基于所述目标获取量、所述每个子资源的可用量以及所述目标组合资源的基准量,从所述目标组合资源中确定一个以上目标子资源,并将所述目标获取量拆分为对每个所述目标子资源的获取量,其中,所述目标组合资源的可用量和基准量均根据所述每个子资源的可用量确定;
分配模块54,用于根据每个所述目标子资源的获取量为所述用户分配所述目标组合资源中的该目标子资源。
在一种可选的实施例中,上述第二确定模块53包括判断单元530、第一确定单元531以及第二确定单元532。
判断单元530,用于将所述目标组合资源中可用量大于所述基准量的子资源均确定为当前候选子资源,并判断所述当前候选子资源的基准差值的累加和是否大于或等于所述目标获取量,其中,所述基准差值为所述当前候选子资源的可用量与所述基准量之间的差值;
第一确定单元531,用于若所述判断单元530判定所述当前候选子资源的基准差值的累加和大于或等于所述目标获取量,从所有所述当前候选子资源中确定所述一个以上目标子资源,并按照第一预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量;
第二确定单元532,用于若所述判断单元530判定所述当前候选子资源的基准差值的累加和小于所述目标获取量,从所述目标组合资源中确定所述一个以上目标子资源,并按照第二预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量。
在一种可选的实施例中,上述第一确定单元531包括获取子单元541、判断子单元542以及第一确定子单元543。
获取子单元541,用于获取所有所述当前候选子资源的剩余均值,其中,所述剩余均值为所述累加和与所述目标获取量之间的差值除以所述当前候选子资源的数量;
判断子单元542,用于判断所述每个当前候选子资源的基准差值是否均大于或等于所述剩余均值;
第一确定子单元543,用于若所述每个当前候选子资源的基准差值均大于或等于所述剩余均值,则将所述每个当前候选子资源均作为所述目标子资源,并针对每个所述目标子资源,基于该目标子资源的基准差值与所述剩余均值之间的差值,得到该目标子资源的获取量。
在一种可选的实施例中,上述第一确定单元531还包括:第二确定子单元544,用于若存在所述当前候选子资源的基准差值小于所述剩余均值,则重新将所述目标组合资源中所述基准差值大于或等于所述剩余均值的子资源均确定为当前候选子资源,并重复执行所述获取所有所述当前候选子资源的剩余均值,判断所述每个当前候选子资源的基准差值是否均大于或等于所述剩余均值的步骤,直至每个当前候选子资源的基准差值均大于或等于剩余均值。
在一种可选的实施例中,上述第一确定单元531还包括:补偿子单元,用于针对每个所述目标子资源,将该目标子资源的基准差值与所述剩余均值之间的差值作为候 选量;获取所述目标子资源的候选量的累加和与所述目标获取量之间的差异值;若所述差异值不满足预设条件,则根据所述差异值确定补偿量,并根据每个所述目标子资源的候选量以及所述补偿量,确定对每个所述目标子资源的获取量。
在一种可选的实施例中,上述第二确定单元532包括:第三确定子单元551,用于将所述每个当前候选子资源均作为第一子资源,将每个第一子资源的基准差值,作为该第一子资源的第一获取量;第四确定子单元552,用于获取剩余获取量,并基于所述目标组合资源中每个子资源的优先级、所述剩余获取量以及所述每个子资源的当前可用量,从所述目标组合资源中确定第二子资源以及所述第二子资源的第二获取量,其中,所述剩余获取量为所述当前候选子资源的基准差值的累加和与所述目标获取量之间的差值;合并子单元553,用于将所述第一子资源与所述第二子资源进行合并,得到所述一个以上目标子资源,并根据所述第一获取量以及所述第二获取量,得到每个所述目标子资源的获取量。
需要说明的是,本说明书实施例所提供的资源处理装置50,其中各个模块执行操作的具体方式已经在上述第一方面提供的方法实施例中进行了详细描述,具体实施过程可以参照上述第一方面提供的方法实施例,此处将不做详细阐述说明。
第三方面,基于与前述实施例提供的资源处理方法同样的发明构思,本说明书实施例还提供了一种电子设备,如图6所示,包括存储器604、一个或多个处理器602及存储在存储器604上并可在处理器602上运行的计算机程序,处理器602执行该程序时实现前文第一方面提供的资源处理方法的任一实施方式的步骤。
其中,在图6中,总线架构(用总线600来代表),总线600可以包括任意数量的互联的总线和桥,总线600将包括由处理器602代表的一个或多个处理器和存储器604代表的存储器的各种电路链接在一起。总线600还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口605在总线600和接收器601和发送器603之间提供接口。接收器601和发送器603可以是同一个元件,即收发机,提供用于在传输介质上与各种其他装置通信的单元。处理器602负责管理总线600和通常的处理,而存储器604可以被用于存储处理器602在执行操作时所使用的数据。
可以理解的是,图6所示的结构仅为示意,本说明书实施例提供的电子设备还可包括比图6中所示更多或者更少的组件,或者具有与图6所示不同的配置。图6中所示的各组件可以采用硬件、软件或其组合实现。
第四方面,基于与前述实施例中提供的资源处理方法同样的发明构思,本说明书实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现前文第一方面提供的资源处理方法的任一实施方式的步骤。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
本说明书是参照根据本说明书实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的设备。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令设备的制造品,该指令设备实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本说明书的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本说明书范围的所有变更和修改。
显然,本领域的技术人员可以对本说明书进行各种改动和变型而不脱离本说明书的精神和范围。这样,倘若本说明书的这些修改和变型属于本说明书权利要求及其等同技术的范围之内,则本说明书也意图包含这些改动和变型在内。

Claims (14)

  1. 一种资源处理方法,包括:
    接收用户通过客户端发起的资源获取请求,所述资源获取请求包括所述用户的目标获取量;
    根据所述资源获取请求确定目标组合资源,所述目标组合资源包括多个子资源,每个子资源均对应有可用量;
    若所述目标获取量小于所述目标组合资源的可用量,则基于所述目标获取量、所述每个子资源的可用量以及所述目标组合资源的基准量,从所述目标组合资源中确定一个以上目标子资源,并将所述目标获取量拆分为对每个所述目标子资源的获取量,其中,所述目标组合资源的可用量和基准量均根据所述每个子资源的可用量确定;
    根据每个所述目标子资源的获取量为所述用户分配所述目标组合资源中的该目标子资源。
  2. 根据权利要求1所述的方法,所述基于所述目标获取量、所述每个子资源的可用量以及所述目标组合资源的基准量,从所述目标组合资源中确定一个以上目标子资源,并将所述目标获取量拆分为对每个所述目标子资源的获取量,包括:
    将所述目标组合资源中可用量大于所述基准量的子资源均确定为当前候选子资源,并判断所述当前候选子资源的基准差值的累加和是否大于或等于所述目标获取量,其中,所述基准差值为所述当前候选子资源的可用量与所述基准量之间的差值;
    若是,从所有所述当前候选子资源中确定所述一个以上目标子资源,并按照第一预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量;
    若否,从所述目标组合资源中确定所述一个以上目标子资源,并按照第二预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量。
  3. 根据权利要求2所述的方法,所述从所有所述当前候选子资源中确定所述一个以上目标子资源,并按照第一预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量,包括:
    获取所有所述当前候选子资源的剩余均值,其中,所述剩余均值为所述累加和与所述目标获取量之间的差值除以所述当前候选子资源的数量;
    判断所述每个当前候选子资源的基准差值是否均大于或等于所述剩余均值;
    若是,则将所述每个当前候选子资源均作为所述目标子资源,并针对每个所述目标子资源,基于该目标子资源的基准差值与所述剩余均值之间的差值,得到该目标子资源的获取量。
  4. 根据权利要求3所述的方法,所述从所有所述当前候选子资源中确定所述一个以上目标子资源,并按照第一预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量,还包括:
    若存在所述当前候选子资源的基准差值小于所述剩余均值,则重新将所述目标组合资源中所述基准差值大于或等于所述剩余均值的子资源均确定为当前候选子资源,并重复执行所述获取所有所述当前候选子资源的剩余均值,判断所述每个当前候选子资源的基准差值是否均大于或等于所述剩余均值的步骤,直至每个当前候选子资源的基准差值均大于或等于剩余均值。
  5. 根据权利要求3所述的方法,所述针对每个所述目标子资源,基于该目标子资源的基准差值与所述剩余均值之间的差值,得到该目标子资源的获取量,包括:
    针对每个所述目标子资源,将该目标子资源的基准差值与所述剩余均值之间的差值作为候选量;
    获取所述目标子资源的候选量的累加和与所述目标获取量之间的差异值;
    若所述差异值不满足预设条件,则根据所述差异值确定补偿量,并根据每个所述目标子资源的候选量以及所述补偿量,确定对每个所述目标子资源的获取量。
  6. 根据权利要求2所述的方法,所述从所述目标组合资源中确定所述一个以上目标子资源,并按照第二预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量,包括:
    将所述每个当前候选子资源均作为第一子资源,将每个第一子资源的基准差值,作为该第一子资源的第一获取量;
    获取剩余获取量,并基于所述目标组合资源中每个子资源的优先级、所述剩余获取量以及所述每个子资源的当前可用量,从所述目标组合资源中确定第二子资源以及所述第二子资源的第二获取量,其中,所述剩余获取量为所述当前候选子资源的基准差值的累加和与所述目标获取量之间的差值;
    将所述第一子资源与所述第二子资源进行合并,得到所述一个以上目标子资源,并根据所述第一获取量以及所述第二获取量,得到每个所述目标子资源的获取量。
  7. 一种资源处理装置,包括:
    接收模块,用于接收用户通过客户端发起的资源获取请求,所述资源获取请求包括所述用户的目标获取量;
    第一确定模块,用于根据所述资源获取请求确定目标组合资源,所述目标组合资源包括多个子资源,每个子资源均对应有可用量;
    第二确定模块,用于若所述目标获取量小于所述目标组合资源的可用量,则基于所述目标获取量、所述每个子资源的可用量以及所述目标组合资源的基准量,从所述目标组合资源中确定一个以上目标子资源,并将所述目标获取量拆分为对每个所述目标子资源的获取量,其中,所述目标组合资源的可用量和基准量均根据所述每个子资源的可用量确定;
    分配模块,用于根据每个所述目标子资源的获取量为所述用户分配所述目标组合资源中的该目标子资源。
  8. 根据权利要求7所述的装置,所述第二确定模块包括:
    判断单元,用于将所述目标组合资源中可用量大于所述基准量的子资源均确定为当前候选子资源,并判断所述当前候选子资源的基准差值的累加和是否大于或等于所述目标获取量,其中,所述基准差值为所述当前候选子资源的可用量与所述基准量之间的差值;
    第一确定单元,用于若所述判断单元判定所述当前候选子资源的基准差值的累加和大于或等于所述目标获取量,从所有所述当前候选子资源中确定所述一个以上目标子资源,并按照第一预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量;
    第二确定单元,用于若所述判断单元判定所述当前候选子资源的基准差值的累加和小于所述目标获取量,从所述目标组合资源中确定所述一个以上目标子资源,并按照第二预设规则将所述目标获取量拆分为对每个所述目标子资源的获取量。
  9. 根据权利要求8所述的装置,所述第一确定单元包括:
    获取子单元,用于获取所有所述当前候选子资源的剩余均值,其中,所述剩余均值为所述累加和与所述目标获取量之间的差值除以所述当前候选子资源的数量;
    判断子单元,用于判断所述每个当前候选子资源的基准差值是否均大于或等于所述剩余均值;
    第一确定子单元,用于若所述每个当前候选子资源的基准差值均大于或等于所述剩余均值,则将所述每个当前候选子资源均作为所述目标子资源,并针对每个所述目标子资源,基于该目标子资源的基准差值与所述剩余均值之间的差值,得到该目标子资源的获取量。
  10. 根据权利要求9所述的装置,所述第一确定单元还包括:
    第二确定子单元,用于若存在所述当前候选子资源的基准差值小于所述剩余均值,则重新将所述目标组合资源中所述基准差值大于或等于所述剩余均值的子资源均确定为当前候选子资源,并重复执行所述获取所有所述当前候选子资源的剩余均值,判断所 述每个当前候选子资源的基准差值是否均大于或等于所述剩余均值的步骤,直至每个当前候选子资源的基准差值均大于或等于剩余均值。
  11. 根据权利要求9所述的装置,所述第一确定单元还包括:
    补偿子单元,用于针对每个所述目标子资源,将该目标子资源的基准差值与所述剩余均值之间的差值作为候选量;获取所述目标子资源的候选量的累加和与所述目标获取量之间的差异值;若所述差异值不满足预设条件,则根据所述差异值确定补偿量,并根据每个所述目标子资源的候选量以及所述补偿量,确定对每个所述目标子资源的获取量。
  12. 根据权利要求8所述的装置,所述第二确定单元包括:
    第三确定子单元,用于将所述每个当前候选子资源均作为第一子资源,将每个第一子资源的基准差值,作为该第一子资源的第一获取量;
    第四确定子单元,用于获取剩余获取量,并基于所述目标组合资源中每个子资源的优先级、所述剩余获取量以及所述每个子资源的当前可用量,从所述目标组合资源中确定第二子资源以及所述第二子资源的第二获取量,其中,所述剩余获取量为所述当前候选子资源的基准差值的累加和与所述目标获取量之间的差值;
    合并子单元,用于将所述第一子资源与所述第二子资源进行合并,得到所述一个以上目标子资源,并根据所述第一获取量以及所述第二获取量,得到每个所述目标子资源的获取量。
  13. 一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1-6中任一项所述方法的步骤。
  14. 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现权利要求1-6中任一项所述方法的步骤。
PCT/CN2020/102303 2019-10-08 2020-07-16 资源处理方法、装置、电子设备及介质 WO2021068585A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910949587.3A CN110795237B (zh) 2019-10-08 2019-10-08 资源处理方法、装置、电子设备及介质
CN201910949587.3 2019-10-08

Publications (1)

Publication Number Publication Date
WO2021068585A1 true WO2021068585A1 (zh) 2021-04-15

Family

ID=69438829

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/102303 WO2021068585A1 (zh) 2019-10-08 2020-07-16 资源处理方法、装置、电子设备及介质

Country Status (2)

Country Link
CN (1) CN110795237B (zh)
WO (1) WO2021068585A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110795237B (zh) * 2019-10-08 2021-02-09 支付宝(杭州)信息技术有限公司 资源处理方法、装置、电子设备及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8024736B1 (en) * 2005-01-28 2011-09-20 Hewlett-Packard Development Company, L.P. System for controlling a distribution of unutilized computer resources
CN107306315A (zh) * 2016-04-18 2017-10-31 华为技术有限公司 语音会议创建方法、会议服务器及系统
CN108073448A (zh) * 2016-11-15 2018-05-25 北京金山云网络技术有限公司 宿主机资源分配方法、装置、宿主机调度方法及装置
CN108228350A (zh) * 2017-12-27 2018-06-29 中国联合网络通信集团有限公司 一种资源分配方法及装置
CN109976907A (zh) * 2019-03-11 2019-07-05 百度在线网络技术(北京)有限公司 任务分配方法和系统、电子设备、计算机可读介质
CN110795237A (zh) * 2019-10-08 2020-02-14 支付宝(杭州)信息技术有限公司 资源处理方法、装置、电子设备及介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104036405B (zh) * 2013-03-06 2017-07-21 腾讯科技(深圳)有限公司 一种虚拟资源交易订单的处理方法及装置
US20180122013A1 (en) * 2015-05-11 2018-05-03 Caspian Private Equity System, method, and apparatus for managing private placement investments
CN108270829B (zh) * 2016-12-30 2021-08-03 阿里巴巴集团控股有限公司 资源分发处理方法及装置
CN107679988A (zh) * 2017-07-25 2018-02-09 上海壹账通金融科技有限公司 基金组合购买方法、系统及存储介质
CN109725844B (zh) * 2017-10-31 2022-09-06 阿里巴巴集团控股有限公司 一种磁盘分配方法、装置和存储系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8024736B1 (en) * 2005-01-28 2011-09-20 Hewlett-Packard Development Company, L.P. System for controlling a distribution of unutilized computer resources
CN107306315A (zh) * 2016-04-18 2017-10-31 华为技术有限公司 语音会议创建方法、会议服务器及系统
CN108073448A (zh) * 2016-11-15 2018-05-25 北京金山云网络技术有限公司 宿主机资源分配方法、装置、宿主机调度方法及装置
CN108228350A (zh) * 2017-12-27 2018-06-29 中国联合网络通信集团有限公司 一种资源分配方法及装置
CN109976907A (zh) * 2019-03-11 2019-07-05 百度在线网络技术(北京)有限公司 任务分配方法和系统、电子设备、计算机可读介质
CN110795237A (zh) * 2019-10-08 2020-02-14 支付宝(杭州)信息技术有限公司 资源处理方法、装置、电子设备及介质

Also Published As

Publication number Publication date
CN110795237A (zh) 2020-02-14
CN110795237B (zh) 2021-02-09

Similar Documents

Publication Publication Date Title
CN110645983B (zh) 用于无人车的路径规划方法、装置和系统
US20140122374A1 (en) Cost exploration of data sharing in the cloud
US10776373B2 (en) Facilitating elastic allocation of organization-specific queue resources in an on-demand services environment
US20170109815A1 (en) On demand auctions of cloud resources (bundles) in hybrid cloud environments
CN108280091B (zh) 一种任务请求执行方法和装置
CN111461763A (zh) 一种资源分配方法及装置
CN110830604B (zh) Dns调度方法、装置
US10417059B1 (en) Staged application programming interface
CN110020894B (zh) 信息处理方法、装置及服务器
CN110706093A (zh) 一种账务处理方法和装置
CN111427971A (zh) 用于计算机系统的业务建模方法、装置、系统和介质
CN109934427B (zh) 生成物品分配方案的方法和装置
CN111932238A (zh) 支付账户推荐方法、装置及电子设备
WO2021068585A1 (zh) 资源处理方法、装置、电子设备及介质
US20150286656A1 (en) Genomic application data storage
CN111008767B (zh) 互联网金融技术架构评估方法、装置、电子设备和介质
CN114445102A (zh) 报价数据处理方法及装置
CN111833037A (zh) 一种账户管理的方法及装置
CN109377331B (zh) 闲置物品的数据处理方法、装置、计算机设备及存储介质
CN112241319A (zh) 均衡负载的方法、电子设备和计算机程序产品
CN110033145B (zh) 财务共享作业分单方法及装置、设备和存储介质
US20210304220A1 (en) Complex sourcing system
CN110633142B (zh) 区块链的共识方法、管理节点、电子设备以及存储介质
CN111161067A (zh) 一种交易路由的确定方法和装置
CN113822516A (zh) 一种配运方的匹配方法及装置

Legal Events

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

Ref document number: 20874657

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20874657

Country of ref document: EP

Kind code of ref document: A1