CN116737375A - Resource allocation method, device, computer equipment and storage medium - Google Patents

Resource allocation method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116737375A
CN116737375A CN202310686239.8A CN202310686239A CN116737375A CN 116737375 A CN116737375 A CN 116737375A CN 202310686239 A CN202310686239 A CN 202310686239A CN 116737375 A CN116737375 A CN 116737375A
Authority
CN
China
Prior art keywords
resource
service
data
database
service data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310686239.8A
Other languages
Chinese (zh)
Inventor
吴婷婷
陈益苏
雷斌
谢礼坤
董培权
刘子扬
林海兰
郑少聪
游铭赠
陈巧媛
刘庭伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial Bank Co Ltd
CIB Fintech Services Shanghai Co Ltd
Original Assignee
Industrial Bank Co Ltd
CIB Fintech Services Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial Bank Co Ltd, CIB Fintech Services Shanghai Co Ltd filed Critical Industrial Bank Co Ltd
Priority to CN202310686239.8A priority Critical patent/CN116737375A/en
Publication of CN116737375A publication Critical patent/CN116737375A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Accounting & Taxation (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a resource allocation method, a resource allocation device, computer equipment and a storage medium. The method comprises the following steps: receiving resource release information, and analyzing the resource release information to obtain a service identifier and a service type; according to the service identification, service data corresponding to the service identification is called from the memory database; wherein, the business data is cached to the memory database in response to the resource release information; distributing the resources released in the resource release information to at least one resource requester according to the service type and the service data; and updating the service data and the distribution data generated in the distribution process to the structured database and the unstructured database. By adopting the method, the service request can be responded quickly, and resources can be allocated to each resource requester; the distributed data with low real-time requirements is synchronized to the structured database and the unstructured database, so that the consistency of the stored data is ensured, and a multidimensional query function is provided.

Description

Resource allocation method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of big data technologies, and in particular, to a method and apparatus for allocating resources, a computer device, and a storage medium.
Background
In the conventional technology, when a plurality of resource requesters make a rob on the same resource, the resources are mainly allocated through a Database (DB) and a Cache (Cache), wherein the Cache is used for confirming whether each resource requester has a rob qualification, the DB uses a CAS instruction (computer and Swap) to update a record of resource allocation, and the data recorded in the DB is stored in a hard disk, so that frequent database reading operations can compromise machine performance and affect system efficiency.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a resource allocation method, apparatus, computer device, and storage medium, for solving the problem that in the prior art, data is stored in a hard disk, which affects system efficiency.
In a first aspect, the present application provides a resource allocation method. The method comprises the following steps:
receiving resource release information, and analyzing the resource release information to obtain a service identifier and a service type;
according to the service identification, caching service data corresponding to the service identification to a memory database, and calling the service data from the memory database;
distributing the resources released in the resource release information to at least one resource requester according to the service type and the service data;
and updating the service data and the distribution data generated in the distribution process to a structured database and an unstructured database.
In one embodiment, storing the service data to the in-memory database in response to the resource release information includes:
and when a target object corresponding to the service identifier is detected through a buried point in a service code of a downstream data layer, caching service data corresponding to the target object into the memory database.
In one embodiment, the method further comprises:
and when the fetched service data fails, re-fetching the service data from the downstream data layer, and synchronously updating the service data in the memory database.
In one embodiment, the allocating the resource published in the resource publication information to at least one resource requester according to the service type and the service data includes:
matching corresponding allocation strategies for the resource release information according to the service type;
distributing the resources distributed in the resource distribution information to at least one resource requester according to the distribution strategy based on the service data;
wherein the service data includes a resource quantity of the resource, a request time of the resource requester, a request quantity of the resource requester, and a remaining quantity of the resource.
In one embodiment, the allocating, according to the allocation policy, the resource published in the resource publication information to at least one resource requester based on the service data includes:
according to the request time, sequencing the resource requesters according to the sequence from front to back;
according to the allocation strategy, weight is allocated to each resource requester of the previous resource quantity in the sequencing position in the sequencing result;
and distributing the released resources to the corresponding resource requesters in turn according to the distributed weights.
In one embodiment, the allocating the resource published in the resource publication information to at least one resource requester according to the allocation policy further includes:
and verifying the request qualification of the first number of resource requesters, and after the verification is passed, distributing weights for the resource requesters.
In one embodiment, the method further comprises:
dividing the memory database into a plurality of storage units;
and uniformly storing the distribution data corresponding to each resource release information into each storage unit by adopting a fixed specification algorithm.
In a second aspect, the application further provides a resource allocation device. The device comprises:
the analysis module is used for receiving the resource release information and analyzing the resource release information to obtain a service identifier and a service type;
the calling module is used for caching service data corresponding to the service identifier to a memory database according to the service identifier and calling the service data from the memory database;
the distribution module is used for distributing the resources released in the resource release information to at least one resource requester according to the service type and the service data;
and the updating module is used for updating the service data and the distribution data generated in the distribution process to the structured database and the unstructured database.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the method steps of any of the first aspects when the processor executes the computer program.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method steps of any of the first aspects.
The resource allocation method, the device, the computer equipment and the storage medium have at least the following advantages:
in the application, the resources released in the resource release information are allocated in response to the resource release information, in the allocation process, the business data with higher real-time requirements are cached in the memory database, and when a plurality of resource requesters rob the same resource, the business request can be responded quickly, and the resources are allocated for each resource requester; the distributed data with low real-time requirements is synchronized to the structured database and the unstructured database, so that the consistency of the stored data is ensured, and a multidimensional query function is provided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application.
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is an application environment diagram of a resource allocation method in one embodiment;
FIG. 2 is a flow chart of a method of resource allocation in one embodiment;
FIG. 3 is a flow chart illustrating the steps of allocating resources in one embodiment;
FIG. 4 is a flowchart illustrating a resource allocation step in another embodiment;
FIG. 5 is a flow chart of a method for allocating resources according to another embodiment;
FIG. 6 is a block diagram of a resource allocation device in one embodiment;
fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
Other advantages and effects of the present application will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present application with reference to specific examples. The application may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present application. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict.
Some exemplary embodiments of the application have been described for illustrative purposes, it being understood that the application may be practiced otherwise than as specifically shown in the accompanying drawings.
The resource allocation method provided by the embodiment of the application can be applied to an application environment shown in figure 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server.
The terminal 102 may send a request instruction of the resource requester to the server 104, so that the server 104 processes the resource release information according to the request instruction, for example, the server 104 parses the received resource release information into a service identifier and a service type, caches service data corresponding to the service identifier into a memory database according to the service identifier, and retrieves the service data from the memory database; distributing the resources released in the resource release information to at least one resource requester according to the service type and the service data; and updating distribution data generated in the distribution process to a structured database and an unstructured database, wherein the structured database is used for storage, and the unstructured database is used for query. The final server 104 also feeds back the resource allocation result to the terminal 102.
According to the resource allocation method, the resources released in the resource release information are allocated in response to the resource release information, in the allocation process, the business data with higher real-time requirements are cached to the memory database, and when a plurality of resource requesters rob the same resource, the resources can be quickly responded, and the resources are allocated for the resource requesters; the distributed data with low real-time requirements is synchronized to the structured database and the unstructured database, the unstructured database is adopted to provide a retrieval function, and a multidimensional query function is provided while consistency of stored data is ensured.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In a possible embodiment, a resource allocation method is provided in an embodiment of the present application, and the method is described below as applied to the server 104 in fig. 1.
Referring to fig. 2, fig. 2 is a flow chart of a resource allocation method according to the present embodiment, which specifically includes the following steps:
step S202, receiving the resource release information, analyzing the resource release information, and obtaining the service identification and the service type.
Step S204, according to the service identification, caching the service data corresponding to the service identification to the memory database, and calling the service data from the memory database.
And step S206, distributing the resources released in the resource release information to at least one resource requester according to the service type and the service data.
And step S208, updating the service data and the distribution data generated in the distribution process to the structured database and the unstructured database.
Specifically, the resource release information is information released by the resource release party through the network, for example, the resource release party can release the resource release information in a specific application program, after logging in the application program, a user clicks a link of the resource release information, and then a request instruction can be sent to the server, and after receiving the request instruction, the server can allocate resources for the user according to the request instruction. Each resource release information has a corresponding service type and a unique service identifier according to different service scenes, and the server can track the whole flow of the resource release information through the service identifier. For example, the resource publisher publishes a red packet in an application program, the red packet has a unique identifier, and according to the setting of the red packet during publishing, the service type of the red packet can be determined, and the server acquires the clicking times of the red packet by tracking the identifier of the red packet, thereby acquiring the acquisition condition of the red packet.
Further, the service data are data generated in real time in the resource release process and the resource robbing process, the data have high real-time requirements, in order to meet the data processing speed requirements, in this embodiment, the service data are cached in the memory database, and based on the service identifier, the downstream persistence node is continuously requested and the result data are synchronized to the query node, so that the cached data are refreshed. Illustratively, the in-memory database of the present embodiment is a Redis database. Specifically, the service data mainly includes the number of resources that release the resources in the resource release information, the request time of the resource requester, the number of requests of the resource requester, the remaining number of resources, and the like. For example, in the service scenario of publishing red packets, a subscription consumption mode is adopted, and if one red packet is successfully spelled, the number of red packets in the Redis database is correspondingly reduced by one.
Meanwhile, data with low real-time requirements, such as distribution data after the robbing is finished, are asynchronously updated into a structured database and an unstructured database, wherein the structured database is mainly used for storing; the unstructured database has a storage function and also provides a multi-dimensional query function. Specifically, the allocation data mainly includes a resource retrieval state, a resource allocation result, a remaining resource recovery, and the like. For example, in the above service scenario of issuing red packets, when the number of red packets in the Redis database is 0, the red packet status in the asynchronous update issue table is taken out; when the red packet is issued and received, the service node asynchronously synchronizes service result data to the unstructured database through the MQ message queue, so that the retrieval efficiency during the red packet inquiry is ensured; and the red packet recovery is to asynchronously trigger the expired red packets in the distribution table to recover through a distributed timing task, and synchronously recover the result to an unstructured database. By adopting the mode, the steps without real-time requirements can be stripped as far as possible, the performance of the normal business process is greatly improved, and the concurrence number is improved.
Further, the service data are synchronized to the structured database and the unstructured database, and meanwhile, in the whole resource release, robbery and allocation process, the data in the Redis database, the structured database and the unstructured database are refreshed in real time based on the service identification of the resource release information so as to maintain the consistency of the data in the three databases.
It should be appreciated that the Redis database is a high performance distributed (key-value) storage system that supports master-slave synchronization, data may be synchronized from a master server to any number of slave servers, and a slave server may be a master server associated with other slave servers, which allows the Redis to perform single-level tree replication, and the inventory may intentionally write data unintentionally. As the publishing and subscribing mechanism is completely realized, when the slave database synchronizes the tree anywhere, a channel can be subscribed and the complete message publishing record of the master server can be received, thereby meeting the high-efficiency processing speed of the data and realizing the consistency of the data on the master server and the slave server. Structured databases have a unified structure in which stored data includes relational data and row data that are logically expressed and implemented by a two-dimensional table structure, strictly following data format and length specifications. The data structures of the data in the unstructured database are irregular or incomplete, have no predefined data model, and generally comprise office documents, texts, pictures, HTML, various types of reports, images, audio/video information, and the like in all formats.
In the above embodiment, by adopting the combination of the structured database, the unstructured database and the Redis database, and through real-time interactive data copy storage and operation of intermediate process data of the service, multiple copies of the service data and the distributed data can be made, and different copies provide different service functions and storage and multidimensional query functions.
According to the resource allocation method, the resources released in the resource release information are allocated in response to the resource release information, in the allocation process, the business data with higher real-time requirements are cached to the Redis database, and when a plurality of resource requesters rob the same resource, the resources can be quickly responded, and the resources are allocated for the resource requesters; the distributed data with low real-time requirements is synchronized to the structured database and the unstructured database, the unstructured database is adopted to provide a retrieval function, and a multidimensional query function is provided while consistency of stored data is ensured.
Optionally, storing the business data to the in-memory database in response to the resource publication information includes:
when a target object corresponding to the service identifier is detected through a buried point in a service code running in a downstream data layer, service data corresponding to the target object is cached in a Redis database.
Specifically, through embedding points in service codes running in a downstream data layer in advance, hot spot data in the running process of the service codes can be monitored, and the service data can be returned to the Redis database at regular time. For example, in the above service scenario of issuing the red packet, if the issuing information of the red packet is detected in one thread, the process of robbing the red packet is tracked based on the identifier of the red packet, and the service data generated in the process of robbing is cached in the Redis database, where the service data mainly includes information such as the total amount of the red packet, the number of red packets, the request time of clicking the red packet by each user, the number of requesting users, the remaining number of the red packet, and the remaining amount of the red packet. Further, the service data transmitted back at the timing is copied to a structured database and an unstructured database.
In the above embodiment, the target object may be automatically detected by embedding the point in advance, and the service data corresponding to the target object may be cached in the dis database by means of the characteristics of single thread high efficiency and atomicity of the dis database, so as to meet the processing requirement of high timeliness of the data. And meanwhile, the service data are synchronized to the structured database and the unstructured database, so that the consistency of the data is ensured.
Optionally, the resource allocation method of the embodiment of the present application further includes:
when the called service data fails, the service data is called again from the downstream data layer, and the service data in the memory database is synchronously updated.
In the above embodiment, service data is preferentially read from the Redis database, and only when the cached service data fails, the downstream data layer is accessed, so that the frequency of accessing the hard disk is reduced, and the processing efficiency is improved.
Referring to fig. 3, optionally, allocating the resources published in the resource publication information to at least one resource requester according to the service type and the service data includes:
step S302, matching corresponding allocation strategies for the resource release information according to the service type.
Step S304, distributing the resources distributed in the resource distribution information to at least one resource requester according to a distribution strategy based on the service data; the service data comprises the resource quantity of the resource, the request time of the resource requester, the request quantity of the resource requester and the residual quantity of the resource.
Specifically, the service types of the released resources are different, the allocation policies are also different, and the allocation policies are pre-stored in the structured database and the unstructured database. For example, in the service scenario of issuing the red packet, if the service type of the red packet is set to be random during the issuing of the red packet, the server queries an allocation policy corresponding to the service type from the unstructured database, and allocates an amount to each user clicking the red packet based on the allocation policy.
Referring to fig. 4, optionally, allocating, based on service data, resources published in the resource publication information to at least one resource requester according to an allocation policy includes:
step S402, according to the request time, sequencing the resource requesters in the sequence from front to back.
Step S404, according to the allocation strategy, weight is allocated to each resource requester of the previous resource quantity of the sequencing position in the sequencing result.
Step S406, distributing the distributed resources to each resource requester in turn according to the distributed weights.
Specifically, for the service scenario of issuing the red packet, the server retrieves service data generated in the resource allocation process from the Redis database in real time, and obtains information such as the total amount of the red packet, the number of the red packets, the request time of clicking the red packet by each user, the number of the requesting users, the remaining number of the red packets, the remaining amount of the red packets, and the like. According to the request time, ordering the request users according to the time sequence, for example, the number of red packets is 10, and the number of the request users is 100, then the server selects the first 10 request users according to the time sequence, and distributes weights for the 10 request users. If the traffic type of the red packet is random, the server randomly allocates weights to the 10 requesting users. In another possible example, if the number of resources is greater than the number of requests, then weights are directly assigned to each resource requester and resources are assigned according to the weights.
Optionally, the allocating the resources published in the resource publishing information to at least one resource requester according to an allocation policy further includes:
and verifying the request qualification of the first number of resource requesters, and distributing weights for the resource requesters after the verification is passed.
Specifically, for the service scenario of issuing the red packet, the server further checks the request qualification of the 10 request users, for example, checks whether a request user is registered in the application program, and if the request user is a registered user, allows the request user to get the red packet. If the request user is not registered, the request user is disqualified, and the 11 th request user is continuously checked until the request user passing the check reaches 10 persons. When the number of the request users is smaller than the number of the red packets, for example, the number of the red packets is 10, only 5 request users click on the red packet link, the request qualification of the 5 request users is checked, and if the request qualification is not registered, the request qualification is disqualified.
In the above embodiment, the corresponding service data is called from the Redis database in real time, and the resources issued by the resource issuing party are allocated to each resource requesting party according to the service data and the preset allocation policy, so that the performance of the service flow is improved.
Referring to fig. 5, optionally, the resource allocation method in the embodiment of the present application further includes:
step S502, dividing the memory database into a plurality of storage units;
step S504, adopting a fixed specification algorithm to uniformly store the allocation data corresponding to each resource release information into each storage unit.
Specifically, when a resource publisher publishes a plurality of resources, or when a plurality of resource publishes resources simultaneously, traffic is concentrated in a certain period of time and bursts, which consumes a large amount of servers and databases, and downtime accidents may occur. Therefore, the application takes the data in the structured database as the main data node, divides the flow of the database according to the fixed principle by a way of dividing units, lightens the pressure of the database and controls the radius of fault explosion, thereby reducing the probability of system paralysis and ensuring high availability.
In order to enable those skilled in the art to fully understand the present application, the following describes the steps of the resource allocation method of the present application in detail:
the application firstly buries the point in the service code running in the downstream data layer, and monitors the hot spot data in the service code running process. And when the operation of the target object is monitored, the business data corresponding to the target object is returned to the memory database at regular time. And analyzing the resource release information to obtain the service identification and the service type. According to the service identification, service data corresponding to the service identification is called from the memory database; when the called service data fails, the service data is called again from the downstream data layer, and the called service data is updated to the Redis database in real time for storage. The service data is data with high real-time requirements, and comprises the resource quantity of the resources, the request time of the resource requesting party, the request quantity of the resource requesting party and the residual quantity of the resources.
Further, the application matches the corresponding allocation strategy for the resource release information according to the service type. According to the request time, sequencing the resource requesters according to the sequence from front to back; according to the allocation strategy, weight is allocated to each resource requesting party of the previous resource quantity of the sequencing position; and distributing the released resources to each resource requester in turn according to the distributed weights. And updating distribution data generated in the distribution process to a structured database and an unstructured database, wherein the structured database is stored, and the unstructured database is used for inquiring.
Furthermore, the application also checks the request qualification of each resource requester before distributing the weight to each resource requester, and allows the resource requester to pick up the resource after the check is passed. Otherwise, sequentially checking the resource requesters with the later sequences according to the arrangement sequence.
Further, the application also divides the memory database into a plurality of storage units; and uniformly storing the business data corresponding to each resource release information into each storage unit by adopting a fixed specification algorithm.
According to the resource allocation method, the resources released in the resource release information are allocated in response to the resource release information, in the allocation process, the business data with higher real-time requirements are cached to the Redis database, and when a plurality of resource requesters rob the same resource, the resources can be quickly responded, and the resources are allocated for the resource requesters; the distributed data with low real-time requirements is synchronized to the structured database and the unstructured database, the unstructured database is adopted to provide a retrieval function, and a multidimensional query function is provided while consistency of stored data is ensured.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a resource allocation device for realizing the above-mentioned resource allocation method. The implementation of the solution provided by the apparatus is similar to the implementation described in the above method, so the specific limitation in the embodiments of one or more resource allocation apparatus provided below may refer to the limitation of the resource allocation method hereinabove, and will not be repeated here.
Referring to fig. 6, in a possible embodiment, an embodiment of the present application provides a resource allocation apparatus, including: the device comprises an analysis module, a calling module, an allocation module and an updating module, wherein:
and the analysis module is used for receiving the resource release information and analyzing the resource release information to obtain the service identification and the service type.
And the calling module is used for caching the service data corresponding to the service identifier to the memory database according to the service identifier and calling the service data from the memory database.
And the distribution module is used for distributing the resources released in the resource release information to at least one resource requester according to the service type and the service data.
And the updating module is used for updating the service data and the distribution data generated in the distribution process to the structured database and the unstructured database.
Optionally, the resource allocation device of the embodiment of the present application further includes: and a data detection module.
The data detection module is used for burying points in service codes running in a downstream data layer, and when a target object corresponding to the service identifier is detected, the service data corresponding to the target object is cached in the Redis database.
Optionally, the calling module is further configured to, when the called service data fails, re-call the service data from the downstream data layer, and transmit the re-called service data to the dis database for storage.
Optionally, the allocation module allocates the resources published in the resource publishing information to at least one resource requester according to the service type and the service data, including: matching corresponding allocation strategies for the resource release information according to the service type; distributing the resources released in the resource release information to at least one resource requester according to a distribution strategy based on the service data; the service data comprises the resource quantity of the resource, the request time of the resource requester, the request quantity of the resource requester and the residual quantity of the resource.
Optionally, the allocation module allocates the resources published in the resource publication information to at least one resource requester according to an allocation policy based on the service data, including: according to the request time, sequencing the resource requesters according to the sequence from front to back; according to the allocation strategy, weight is allocated to each resource requesting party of the previous resource quantity of the sequencing position in the sequencing result; and distributing the released resources to each resource requester in turn according to the distributed weights.
Optionally, the allocation module allocates the resources published in the resource publication information to at least one resource requester according to an allocation policy, and further includes: and verifying the request qualification of the first number of resource requesters, and distributing weights for the resource requesters after the verification is passed.
Optionally, the resource allocation device of the embodiment of the present application further includes: and a unit dividing module.
The unit division module is used for dividing the memory database into a plurality of storage units; and uniformly storing the distribution data corresponding to each resource release information into each storage unit by adopting a fixed specification algorithm.
The resource allocation device responds to the resource release information to allocate the resources released in the resource release information, in the allocation process, the business data with higher real-time requirements are cached to the Redis database, and when a plurality of resource requesters rob the same resource, the resource allocation device can respond quickly to allocate the resources for each resource requester; the distributed data with low real-time requirements is synchronized to the structured database and the unstructured database, the unstructured database is adopted to provide a retrieval function, and a multidimensional query function is provided while consistency of stored data is ensured.
The respective modules in the above-described resource allocation apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one possible embodiment, a computer device is provided, which may be a terminal, and the internal structure thereof may be as shown in fig. 7. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input means. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a resource allocation method. The display unit of the computer device is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be a key, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in FIG. 7 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In a possible embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the method steps of the resource allocation method disclosed in the above embodiments when the computer program is executed.
In a possible embodiment, a computer readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, implements the method steps of the resource allocation method disclosed in the above embodiments.
In a possible embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method steps of the resource allocation method disclosed in the above embodiments.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (10)

1. A method of resource allocation, the method comprising:
receiving resource release information, and analyzing the resource release information to obtain a service identifier and a service type;
according to the service identification, caching service data corresponding to the service identification to a memory database, and calling the service data from the memory database;
distributing the resources released in the resource release information to at least one resource requester according to the service type and the service data;
and updating the service data and distribution data generated in the distribution process to a structured database and an unstructured database.
2. The method of claim 1, wherein caching service data corresponding to the service identifier in the in-memory database according to the service identifier comprises:
and when a target object corresponding to the service identifier is detected through a buried point in a service code of a downstream data layer, caching service data corresponding to the target object into the memory database.
3. The method according to claim 2, wherein the method further comprises:
and when the fetched service data fails, re-fetching the service data from the downstream data layer, and synchronously updating the service data in the memory database.
4. The method according to claim 1, wherein the allocating the resource published in the resource publication information to at least one resource requester according to the service type and the service data includes:
matching corresponding allocation strategies for the resource release information according to the service type;
distributing the resources distributed in the resource distribution information to at least one resource requester according to the distribution strategy based on the service data;
wherein the service data includes a resource quantity of the resource, a request time of the resource requester, a request quantity of the resource requester, and a remaining quantity of the resource.
5. The method of claim 4, wherein the allocating the resources published in the resource publication information to at least one resource requester according to the allocation policy based on the service data comprises:
according to the request time, sequencing the resource requesters according to the sequence from front to back;
according to the allocation strategy, weight is allocated to each resource requester of the previous resource quantity in the sequencing position in the sequencing result;
and distributing the released resources to the corresponding resource requesters in turn according to the distributed weights.
6. The method of claim 5, wherein the allocating the resource published in the resource publication information to at least one resource requestor according to the allocation policy, further comprises:
and verifying the request qualification of the first number of resource requesters, and after the verification is passed, distributing weights for the resource requesters.
7. The method according to any one of claims 1 to 6, further comprising:
dividing the memory database into a plurality of storage units;
and uniformly storing the distribution data corresponding to each resource release information into each storage unit by adopting a fixed specification algorithm.
8. A resource allocation apparatus, the apparatus comprising:
the analysis module is used for receiving the resource release information and analyzing the resource release information to obtain a service identifier and a service type;
the calling module is used for caching service data corresponding to the service identifier to a memory database according to the service identifier and calling the service data from the memory database;
the distribution module is used for distributing the resources released in the resource release information to at least one resource requester according to the service type and the service data;
and the updating module is used for updating the service data and the distribution data generated in the distribution process to the structured database and the unstructured database.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202310686239.8A 2023-06-09 2023-06-09 Resource allocation method, device, computer equipment and storage medium Pending CN116737375A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310686239.8A CN116737375A (en) 2023-06-09 2023-06-09 Resource allocation method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310686239.8A CN116737375A (en) 2023-06-09 2023-06-09 Resource allocation method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116737375A true CN116737375A (en) 2023-09-12

Family

ID=87916268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310686239.8A Pending CN116737375A (en) 2023-06-09 2023-06-09 Resource allocation method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116737375A (en)

Similar Documents

Publication Publication Date Title
US8788458B2 (en) Data caching for mobile applications
US9659038B2 (en) Efficient snapshot read of a database in a distributed storage system
CN112084258A (en) Data synchronization method and device
CN112000287B (en) IO request processing device, method, equipment and readable storage medium
US10579597B1 (en) Data-tiering service with multiple cold tier quality of service levels
CN110784498B (en) Personalized data disaster tolerance method and device
CN110196843B (en) File distribution method based on container cluster and container cluster
CN108540510B (en) Cloud host creation method and device and cloud service system
CN113010549A (en) Data processing method based on remote multi-active system, related equipment and storage medium
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
CN110740155A (en) Request processing method and device in distributed system
US11429311B1 (en) Method and system for managing requests in a distributed system
CN103905512A (en) Data processing method and equipment
US9432238B2 (en) Communicating large amounts of data over a network with improved efficiency
CN110196680A (en) Data processing method, device and storage medium
CN116991800A (en) File acquisition system, method, device, computer equipment and storage medium
US20130318192A1 (en) Composite graph cache management
CN116339626A (en) Data processing method, device, computer equipment and storage medium
CN116737375A (en) Resource allocation method, device, computer equipment and storage medium
CN113672640A (en) Data query method and device, computer equipment and storage medium
CN112559568A (en) Virtual article determination method and device and computer readable storage medium
TW201403362A (en) Managing large data sets through page based information tracking in multi-master environments
US11816088B2 (en) Method and system for managing cross data source data access requests
CN114610740B (en) Data version management method and device of medical data platform
CN112804335B (en) Data processing method, data processing device, computer readable storage medium and processor

Legal Events

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