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

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

Info

Publication number
CN111522830B
CN111522830B CN202010342194.9A CN202010342194A CN111522830B CN 111522830 B CN111522830 B CN 111522830B CN 202010342194 A CN202010342194 A CN 202010342194A CN 111522830 B CN111522830 B CN 111522830B
Authority
CN
China
Prior art keywords
account
resource allocation
state
records
record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010342194.9A
Other languages
Chinese (zh)
Other versions
CN111522830A (en
Inventor
孙坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Kunying Technology Co ltd
Original Assignee
Zhejiang Kunying Technology 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 Zhejiang Kunying Technology Co ltd filed Critical Zhejiang Kunying Technology Co ltd
Priority to CN202010342194.9A priority Critical patent/CN111522830B/en
Publication of CN111522830A publication Critical patent/CN111522830A/en
Application granted granted Critical
Publication of CN111522830B publication Critical patent/CN111522830B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2336Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
    • G06F16/2343Locking methods, e.g. distributed locking or locking implementation details
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to a resource allocation method, a computer device and a storage medium. The method comprises the following steps: receiving resource allocation requests which are simultaneously sent by at least two user terminals and related to the same account identifier; and monitors the status of the monitor lock for the account record corresponding to the account identification. If the monitor lock states of the account records are all unlocking states, the ownership of the account records is distributed to the target user side, the resource distribution information of the target user side is sent to the resource distribution server to which the account records belong, and the resource distribution server changes the monitor lock states of the account records from the unlocking states to the locking states. The resource allocation method realizes the process of accessing the same account record by a plurality of user terminals, and the monitor lock is adopted to monitor the state of the account record, so that the ownership of the account record can be allocated to the target user terminal when the monitor lock of the account record is in an unlocking state, thereby improving the allocation accuracy of resources.

Description

Resource allocation method, computer device, and storage medium
Technical Field
The present disclosure relates to the field of mobile internet technologies, and in particular, to a resource allocation method, a computer device, and a storage medium.
Background
With the rapid development of mobile internet technology, it is becoming more and more common to realize allocation of various resources through computer devices. The resources may include, for example, account values, points, electronic cash rolls, etc.
In the prior art, after a user of an allocated resource triggers the allocation of the resource through a certain operation, when the computer equipment obtains a trigger operation instruction of the user of the allocated resource, the corresponding resource is transferred from the account of the resource owner to the account of the user of the allocated resource. For example, when the allocated resource user sends a payment request, the computer device transfers the value resource corresponding to the payment to the target payment user account of the allocated resource user according to the payment request.
However, the above-mentioned resource allocation method has a problem of an allocation error when at least two allocated resource users initiate a resource allocation request at the same time.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a resource allocation method, a computer device, and a storage medium that can effectively improve the accuracy of resource allocation.
In a first aspect, a method for allocating resources, the method comprising:
receiving resource allocation requests sent by at least two user terminals simultaneously; the resource allocation request comprises account identification and resource allocation information; the account identifiers contained in the resource allocation requests are the same;
Monitoring the states of monitor locks of at least two account records corresponding to the account identifications;
if the states of the monitor locks of the at least two account records are unlocking states, distributing ownership rights of the at least two account records to a target user side of the at least two user sides;
the resource allocation information of the target user side is respectively sent to the resource allocation servers to which the at least two account records belong; the resource allocation information of the target user side is used for indicating the resource allocation server to update the account record and add the log record, and changing the monitor lock state of the account record from the unlocking state to the locking state.
In one embodiment, the assigning ownership of the at least two account records to a target user side of the at least two user sides includes:
according to the priority order of receiving the user terminals, determining the user terminal with the highest priority as a target user terminal in the at least two user terminals;
and distributing ownership rights of the at least two account records to the target user side.
In one embodiment, the monitoring the status of the monitor lock of at least two account records corresponding to the account identification includes:
Reading state information of a monitor lock of an account record corresponding to the account identifier from a database of a resource allocation server to which the at least two account records belong respectively;
and determining the state of each monitor lock according to the state information of each monitor lock.
In one embodiment, after the sending the resource allocation information of the target user side to the resource allocation servers to which the at least two account records belong, the method further includes:
receiving an update response message sent by the resource allocation server; the update response message is used for indicating that the resource allocation server has executed to complete the update work;
and after receiving the update response message, sending a storage instruction to the resource allocation server, wherein the storage instruction is used for instructing the resource allocation server to store updated account records and added log records in the database.
In one embodiment, after the sending the storage instruction to the resource allocation server, the method further includes:
reading the updated account record and the added log record from a database of the resource allocation server;
And sending the read updated account record and the added log record to the target user side.
In a second aspect, a method for allocating resources, the method comprising:
receiving an account identifier sent by a resource management server;
searching state information of monitor locks of at least two account records corresponding to the account identification in a database;
transmitting the state information of the monitor lock to the resource management server;
receiving resource allocation information of a target user sent by a resource management server; the target user terminal is a user terminal with ownership of updating account records;
and respectively updating the at least two account records and the incremental log records according to the resource allocation information, and changing the state of each monitor lock from an unlocking state to a locking state.
In one of the embodiments of the present invention,
after the account record is updated and the log record is added according to the resource allocation information, the method further comprises the following steps:
sending an update response message; the update response message is used for indicating that the resource allocation server has executed to complete the update work;
receiving a storage instruction sent by the management server;
And storing updated account records and added log records in a database according to the storage instruction.
In one embodiment, after the storing the updated account record and the added log record in the database according to the storing instruction, the method further includes:
changing the state of the monitor lock of the at least two account records from the locked state to the unlocked state;
and/or, sending the resource corresponding to the updated account record to the target user side.
In a third aspect, a resource allocation apparatus, the apparatus comprising:
the first receiving module is used for receiving resource allocation requests sent by at least two user terminals simultaneously; the resource allocation request comprises account identification and resource allocation information; the account identifiers contained in the resource allocation requests are the same;
the monitoring module is used for monitoring the state of the monitor lock of the account record corresponding to the account identifier;
the distribution module is used for distributing ownership of the account record to one target user side of the at least two user sides when the state of the monitor lock is an unlocking state;
the first updating module is used for sending the resource allocation information of the target user side to a resource allocation server, and the resource allocation information of the target user side is used for indicating the resource allocation server to update the account record and the addition log record; and changing the monitor lock state from the unlocked state to the locked state.
In a fourth aspect, a resource allocation apparatus, the apparatus comprising:
the second receiving module is used for receiving the account identifier sent by the management server;
the sending module is used for searching the state information of the monitor lock of the account record corresponding to the account identifier in the database;
the third receiving module is used for receiving the resource allocation information of the target user terminal sent by the management server; the target user terminal is a user terminal with ownership of updating account records;
and the second updating module is used for updating the account record and the addition log record according to the resource allocation information and changing the state of the monitor lock from an unlocking state to a locking state.
In a fifth aspect, a computer device includes a memory storing a computer program and a processor implementing the resource allocation method according to any embodiment of the first aspect when the processor executes the computer program.
In a sixth aspect, a computer readable storage medium has stored thereon a computer program, which when executed by a processor implements the resource allocation method according to any embodiment of the first aspect.
The application provides a resource allocation method, a computer device and a storage medium, comprising the following steps: the resource management server receives resource allocation requests which are simultaneously sent by at least two user terminals and related to the same account identifier; and monitor the status of the monitor lock of at least two account records corresponding to the account identification. If the monitor lock states of the at least two account records are unlocking states, the ownership of the at least two account records is distributed to a target user side of the at least two user sides, and the resource distribution information of the target user side is respectively sent to the resource distribution servers to which the at least two account records belong. And then, the resource allocation information of the target user side is respectively sent to the resource allocation servers to which at least two account records belong, and the resource allocation servers change the monitor lock state of the account records from the unlock state to the lock state. The resource allocation method realizes that a plurality of user terminals access the same account record, so as to reallocate resources, wherein the monitor lock is adopted to monitor the states of the plurality of account records identified by the same account, and when the monitor lock of the account record is in an unlocking state, the ownership of the account record can be allocated to the target user terminal, so that the resource allocation server can update the resources on the account record, and reallocation of the updated resources is realized. Particularly, when one account identifier corresponds to a plurality of account records, the resource allocation server can update and allocate the account records only when monitor locks of the plurality of account records are in an unlocking state at the same time, so that the method can avoid cross update errors when a plurality of user terminals update a plurality of account records corresponding to the same account identifier at the same time, thereby improving the accuracy of updating the account records, and then improving the accuracy of allocating the account resources on the accurate account records to the target user terminals.
Drawings
FIG. 1 is a schematic diagram of a resource allocation application system according to one embodiment;
FIG. 2 is a flow chart of a method for resource allocation according to one embodiment;
FIG. 3 is a flow chart of another implementation of S103 in the embodiment of FIG. 2;
FIG. 4 is a flow chart of another implementation of S102 in the embodiment of FIG. 2;
FIG. 5 is a flow chart of a method for resource allocation according to one embodiment;
FIG. 6 is a flow chart of a method of resource allocation according to one embodiment;
FIG. 7 is a flow chart of a method of resource allocation according to one embodiment;
FIG. 8 is a flow chart of a method for resource allocation according to one embodiment;
fig. 9 is a schematic structural diagram of a resource allocation device according to an embodiment;
fig. 10 is a schematic structural diagram of a resource allocation device according to an embodiment;
fig. 11 is a schematic diagram of an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The resource allocation method provided by the application can be applied to a resource allocation application system shown in fig. 1, wherein a terminal is connected with a resource management server through a network, and the resource management server is connected with at least one resource allocation server through the network. The above terminal may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the resource management server and the resource allocation server may be implemented by separate servers or a server cluster composed of a plurality of servers.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
The following will specifically describe the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems by means of examples and with reference to the accompanying drawings. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 2 is a flowchart of a method for allocating resources according to an embodiment, where an execution subject of the method is the resource management server in fig. 1, and the method relates to a specific process that the resource management server allocates resources to a user terminal according to a request of the user. As shown in fig. 2, the method specifically includes the following steps:
s101, receiving resource allocation requests sent by at least two user terminals simultaneously; the resource allocation request comprises account identification and resource allocation information; the account identification contained in each resource allocation request is the same.
The resource allocation request is used for indicating the resource management server to update account resources corresponding to the account identifiers, and allocating the updated account resources to the user side making the resource allocation request. The account identifier is used to characterize the account resource held by the user, and may be represented by a number, letter, serial number, text, etc., which is not limited to this embodiment. The resource allocation information indicates resource content that the user needs to update for a certain account, and for example, the resource allocation information may be changed content of all resource information related to the user account, such as deposit amount of a certain account of the user, amount consumed by the user in one consumption, account name of the user, and the like. The resource allocation information provided by different clients may be the same or different. For example, both client a and client B have 100 entries stored on a certain account. For another example, the client a has deposited 100 yuan on a certain account, and the client B has paid 100 yuan on a certain account.
In this embodiment, if at least two user terminals need to update account resources or reallocate account resources for the same account, the at least two user terminals send a resource allocation request to a resource management resource server, and after receiving the resource allocation request sent by the at least two user terminals, the resource management resource server may execute the operation of updating and allocating account resources, and modify and allocate the account resources corresponding to the at least two user terminals. It should be noted that, when the resource management resource server receives the resource allocation requests sent by at least two clients, the account identifier on the resource allocation requests can be extracted from the resource allocation requests so as to use the account identifier to query the account resources to be updated and allocated later, and the resource allocation information on the resource allocation requests can be extracted from the resource allocation requests so as to update the account resources of each client according to the resource allocation information provided by different clients later. Specifically, in this embodiment, account identifiers included in the resource allocation requests of at least two user ends are the same, that is, it is stated that at least two user ends need to update resources on the same account at the same time.
S102, monitoring states of monitor locks of at least two account records corresponding to the account identifications.
The account record is used for recording resource information corresponding to a certain account, and can be represented in a list form, and specifically comprises an account identifier and the corresponding resource information. The monitor lock may also be referred to as a transaction lock for locking an account record to prohibit access to the account record by any server or user side, or for unlocking a user record to allow access to the account record by any server or user side. The states of the monitor lock include an unlocked state and a locked state, the unlocked state is used for indicating any server or user side to prohibit access to the account record to which the monitor lock belongs, and the locked state is used for indicating any server or user side to access the account record to which the monitor lock belongs.
In this embodiment, when the resource management server receives resource allocation requests sent by at least two user sides simultaneously, an account identifier may be extracted from each resource allocation request, then an account record corresponding to the account identifier is found according to the account identifier, if the corresponding account record includes at least two account records, the states of monitor locks of the at least two account records are monitored respectively, so that corresponding account resources are updated on respective account records according to the states of each monitor lock, and then updated account resources are allocated to the user sides.
S103, if the states of the monitor locks of the at least two account records are unlocking states, assigning ownership of the at least two account records to one target user side of the at least two user sides.
Wherein the target client represents a client that is allowed to update the account record. In this embodiment, when the resource management server monitors the states of the monitor locks of at least two account records corresponding to the account identifier, it may be monitored that the state of the monitor lock of one account record of the at least two account records is an unlocked state, the state of the monitor lock of one account record is a locked state, or it may be monitored that the states of the monitor lock of at least two account records are both locked states, or it may be monitored that the states of the monitor lock of at least two account records are both unlocked states. When the resource management server monitors that the monitor lock states of at least two account records are unlocking states, the resource management server can distribute ownership of the at least two account records to one target user side of the at least two user sides, so that the target user side can update and/or distribute resources on each account record. When the status of the monitor lock of at least two account records is other status, for example, the status of the monitor lock of one account record is unlocking status, the status of the monitor of another account record is locking status, under this application, the resource management server will not assign ownership of any account record to any user side. Only when the states of monitors of all account records are in unlocking states, the resource management service can distribute ownership of each account record to a target user side so as to avoid the problem of cross errors when a plurality of user sides access a plurality of account records simultaneously.
S104, respectively sending the resource allocation information of the target user side to the resource allocation servers to which the at least two account records belong, wherein the resource allocation information of the target user side is used for indicating the resource allocation servers to update the account records and increase the log records, and changing the monitor lock state of the account records from the unlocking state to the locking state.
In this embodiment, when the resource management server allocates ownership of the account records to the target user side, the resource allocation information of the target user side may be further sent to the resource allocation servers to which at least two account records belong, so that the resource allocation servers may update the account records thereon and increase the corresponding log records according to the resource allocation information. It should be noted that, the resource allocation server to which at least two account records belong may be one resource allocation server or may be a plurality of resource servers. And the operations of updating the account records can be executed in parallel or sequentially, so long as the operations of updating the account records can be completed.
The resource allocation method provided by the embodiment comprises the following steps: the resource management server receives resource allocation requests which are simultaneously sent by at least two user terminals and related to the same account identifier; and monitor the status of the monitor lock of at least two account records corresponding to the account identification. If the monitor lock states of the at least two account records are unlocking states, the ownership of the at least two account records is distributed to a target user side of the at least two user sides, and the resource distribution information of the target user side is respectively sent to the resource distribution servers to which the at least two account records belong. And then, the resource allocation information of the target user side is respectively sent to the resource allocation servers to which at least two account records belong, and the resource allocation servers change the monitor lock state of the account records from the unlock state to the lock state. The resource allocation method realizes that a plurality of user terminals access the same account record, so as to reallocate resources, wherein the monitor lock is adopted to monitor the states of the plurality of account records identified by the same account, and when the monitor lock of the account record is in an unlocking state, the ownership of the account record can be allocated to the target user terminal, so that the resource allocation server can update the resources on the account record, and reallocation of the updated resources is realized. Particularly, when one account identifier corresponds to a plurality of account records, the resource allocation server can update and allocate the account records only when monitor locks of the plurality of account records are in an unlocking state at the same time, so that the method can avoid cross update errors when a plurality of user terminals update a plurality of account records corresponding to the same account identifier at the same time, thereby improving the accuracy of updating the account records, and then improving the accuracy of allocating the account resources on the accurate account records to the target user terminals.
Fig. 3 is a flowchart of another implementation manner of S103 in the embodiment of fig. 2, where, as shown in fig. 3, S103 "assigns ownership of at least two account records to one target client of at least two clients", including:
s201, according to the priority order of the receiving user terminals, determining the user terminal with the highest priority as a target user terminal in at least two user terminals.
When the resource management server receives the resource allocation requests sent by at least two user terminals simultaneously, the priority of each user terminal can be checked first, and then the user terminal with the highest priority is determined as the target user terminal. The priority of the user terminal may be defined by the resource management server in advance, and the priority of each user terminal may be specifically determined according to the hardware configuration of the user terminal or the system level installed thereon, and the embodiment is not limited thereto.
S202, ownership of at least two account records is distributed to a target user side.
When the resource management server determines the target user side and obtains the ownership rights of the account records corresponding to the target user side, the ownership rights of at least two account records can be further distributed to the target user side, so that the target user side can update the account records or distribute corresponding account resources.
FIG. 4 is a flowchart of another implementation of S102 in the embodiment of FIG. 2. As shown in FIG. 4, the step of "monitoring the monitor lock status of at least two account records corresponding to the account identifier" of S102 includes:
s301, respectively reading state information of monitor locks of account records corresponding to the account identifiers from databases of resource allocation servers to which the at least two account records belong.
Wherein the status information of the monitor lock indicates a status of the monitor lock. In this embodiment, the account records of the user are stored in the database of the resource allocation server in advance, and if the account identifier of the user corresponds to a plurality of user records, the plurality of user records may be stored in different databases of the same resource allocation server in advance or in databases of different resource allocation servers. When the resource management server needs to monitor the state of the monitor lock of the account record corresponding to the account identifier of the user, specifically, the state information of the monitor lock of the account record may be read from the database of the resource allocation server to which the account record belongs, and if the account identifier corresponds to a plurality of account records, the state information of the monitor lock of each account record is read from the database to which each account record belongs, so that the resource management server may determine the state of each monitor lock according to the state information of each monitor lock afterwards.
S302, determining the state of each monitor lock according to the state information of each monitor lock.
When the resource management server reads the state information of the monitor lock of each account record, the state of the monitor lock of each account record can be directly determined according to the state information of the monitor lock of each account record, and whether each account record is in an unlocking state is judged, so that the user side can access each account record later.
In some scenarios, after the resource management server sends the resource allocation information of the target user side to the resource allocation servers to which the at least two account records belong, the resource management server may further instruct the resource allocation server to store the resource information on the updated account records in the database, and on the basis of the embodiment shown in fig. 2, as shown in fig. 5, the step of S104 "sending the resource allocation information of the target user side to the resource allocation servers to which the at least two account records belong" further includes the following steps:
s401, receiving an update response message sent by a resource allocation server; the update response message is used to indicate that the resource allocation server has performed the completion of the update work.
The update response message is a notification message sent by the resource allocation server for the resource management server, and is used for notifying the resource management server that the related resource information of the account record on the resource management server is updated according to the requirement of the user. In this embodiment, after the resource allocation server updates the resource information on the account record, an update response message may be fed back to the resource management server to inform the resource management server that the resource on the account record has been updated, and then an access operation related to the account record may be performed.
And S402, after receiving the update response message, sending a storage instruction to the resource allocation server, wherein the storage instruction is used for indicating the resource allocation server to store updated account records and increased log records in a database.
When the resource management server receives the update response message sent by the resource allocation server, the storage instruction can be sent to the resource allocation server to instruct the resource allocation server to store the updated account record in the database thereon, so as to allocate the resource information thereon according to the updated account record. In addition, the corresponding log records are required to be added, so that the user can check later.
In some scenarios, after the resource management server sends the storage instruction to the resource allocation server, the resource management server may further allocate resource information corresponding to the updated account record to the target user side, and on the basis of the embodiment shown in fig. 5, as shown in fig. 6, the step S402 of "sending the storage instruction to the resource allocation server" further includes the following steps:
s501, reading updated account records and added log records from a database of a resource allocation server.
In practical applications, when the resource allocation server updates the account record and adds the corresponding log record, the resource management server may also read the updated account record and the added log record from the database of the resource allocation server, so as to be used when allocating resources later.
S502, the read updated account record and the added log record are sent to a target user side.
After the resource management server reads the updated account record and the added log record, the resource management server can send the resource information corresponding to the read account record to the target user side, and can also send the added log record to the target user side, so that the user side can inquire the resource information corresponding to the account identifier and the newly added log record.
The above-mentioned fig. 2-6 are steps of a method implemented at the resource management server side, and the implementation procedure at the resource allocation server side is described below by taking fig. 7-11 as an example.
Fig. 7 is a flowchart of a method for allocating resources, where an execution subject of the method is the resource allocation server in fig. 1, and the method involves information interaction between the resource allocation server and the resource management server, so as to implement a specific process of updating account records. As shown in fig. 7, the method specifically includes the following steps:
s601, receiving an account identifier sent by a resource management server.
When the resource management server receives the resource allocation request sent by at least two clients at the same time based on the step of S101, an account identifier may be extracted from the resource allocation request and sent to a resource allocation server connected thereto, where the resource allocation server receives the account identifier, so as to query the account record related thereto and the status information of the monitor lock of the account record according to the account identifier.
S602, searching state information of monitor locks of at least two account records corresponding to the account identification in a database.
When the resource allocation server receives the account identifier, the state information of the monitor lock of the account record corresponding to the account identifier can be further searched in a local database according to the account identifier, and if a plurality of account records exist, the state information of the monitor lock of the plurality of account records is searched.
S603, sending the state information of each monitor lock to a resource management server.
After the resource allocation server finds the state information of the monitor lock of the account record corresponding to the account identifier, the state information of the monitor lock can be sent to the resource management server, so that the resource management server determines the state of the account record according to the state information of the monitor lock to determine whether the account record can be modified.
S604, receiving resource allocation information of a target user terminal sent by a resource management server; the target user terminal is a user terminal with ownership of updating account records.
After the resource management server allocates ownership rights of at least two account records to the target user terminal based on the step S103, the resource management server may further send resource allocation information of the target user terminal to the resource allocation server, and the resource allocation server receives the resource allocation information, so as to update the locally stored account records according to the resource allocation information.
S605, respectively updating at least two account records and an incremental log record according to the resource allocation information, and changing the state of each monitor lock from an unlocking state to a locking state.
When the resource allocation server receives the resource allocation information of the target user terminal, all the locally stored account records corresponding to the target user terminal can be further modified according to the update content indicated by the resource allocation information so as to update all the account records corresponding to the target user terminal. In the updating process, the resource distribution server changes the state of the monitor lock of each account record from an unlocking state to a locking state so as to prevent other user terminals from accessing in the updating process of the account records, thereby causing the problems of chaotic updating, locking and the like. Correspondingly, after updating the account records, correspondingly adding log records for each account record so as to be used when the user inquires later.
The application provides a resource allocation method, a device, a computer device and a storage medium, which comprise the following steps: the resource allocation server receives the account identification sent by the resource management server, searches the state information of the monitor locks of at least two account records corresponding to the account identification in the database, sends the state information of each monitor lock to the resource management server, receives the resource allocation information of the target user terminal sent by the resource management server, respectively updates at least two account records and an added log record according to the resource allocation information, and changes the state of each monitor lock from an unlocking state to a locking state. In the resource allocation process, the state of the monitor lock of the updated account record is changed from the unlocking state to the locking state in the process of updating the account record by the resource allocation server, so that other user terminals except the target user terminal cannot access the account record, update errors caused by access conflicts are avoided, and the accuracy of resource allocation information when the resource of the updated account record is allocated to the target user terminal by the resource allocation server is further improved.
In some scenarios, after the resource allocation server updates the account record and increases the log record according to the resource allocation information, the resource management server may also be informed of the completion of updating the account record by feeding back this dynamic to the resource management server. On the basis of the embodiment shown in fig. 7, as shown in fig. 8, the step S605 of updating at least two account records and adding log records according to the resource allocation information, respectively, further includes the following steps:
s701, sending an update response message; the update response message is used to indicate that the resource allocation server has performed the completion of the update work.
And after the resource allocation server updates the local account record, sending an update response message to the resource management server to inform the resource management server that the update work is finished.
S702, receiving a storage instruction sent by a resource management server.
After receiving the update response message sent by the resource allocation server, the resource management server may further send a storage instruction to the resource allocation server to instruct the resource allocation server to save the updated account record and the corresponding log record.
S703, storing updated account records and added log records in a database according to the storage instruction.
When the resource allocation server receives the storage instruction sent by the resource management server, the account record and the added log record updated before can be stored in a local database for later use.
In some scenarios, after the resource allocation server saves the updated account record and the added log record in the database according to the storage instructions, the state of the monitor lock of the updated account record may also be changed so as to release the monitor lock, so that other clients may modify the account record. On the basis of the embodiment shown in fig. 8, the step S703 "stores updated account records and added log records in the database according to the storage instruction" further includes the following steps: the state of the monitor lock of at least two account records is changed from a locked state to an unlocked state.
The embodiment relates to a process of releasing monitor locks of account records by a resource allocation server, which specifically comprises the following steps: after the resource allocation server saves the updated account record and the added log record, the state of the monitor lock of the account record can be changed from the locked state to the unlocked state. It should be noted that when the account record is a plurality of account records, there is a problem that the update speed of each account record is inconsistent generally, and under the application, when the resource allocation server releases the monitor lock of each account record, the monitor lock needs to be released simultaneously, so as to avoid incomplete information received by the user end when resources on the updated account records are allocated to each user end, and improve the accuracy of inquiring the resources on the account records by the user end.
In some scenarios, after the resource allocation server stores the updated account record and the added log record in the database according to the storage instruction, the resource allocation server may further allocate the resource corresponding to the updated account record to the user side, where the step S703 "stores the updated account record and the added log record in the database according to the storage instruction" further includes the following steps: and sending the resources corresponding to the updated account record to the target user side.
The embodiment relates to a process that a resource allocation server allocates resources to a target user side according to an updated account record, specifically including: after the resource allocation server stores the updated account record, resources corresponding to the account record can be reallocated to the target user end so as to send updated resource information to the target user end, so that the target user end can view the updated account information at any time.
It should be understood that, although the steps in the flowcharts of fig. 2-8 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as 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 fig. 2-8 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily occur in sequence.
In one embodiment, as shown in fig. 9, there is provided a resource allocation apparatus including: the first receiving module 11, the monitoring module 12, the distributing module 13 and the first updating module 14, wherein:
a first receiving module 11, configured to receive resource allocation requests sent by at least two user terminals simultaneously; the resource allocation request comprises account identification and resource allocation information; the account identifiers contained in the resource allocation requests are the same;
a monitoring module 12 for monitoring a status of a monitor lock of an account record corresponding to the account identification;
the allocation module 13 is configured to allocate ownership of the account record to a target user side of the at least two user sides when the status of the monitor lock is an unlocked status;
a first updating module 14, configured to send the resource allocation information of the target user side to a resource allocation server, where the resource allocation information of the target user side is used to instruct the resource allocation server to update the account record and the incremental log record; and changing the monitor lock state from the unlocked state to the locked state.
In one embodiment, as shown in fig. 10, there is provided a resource allocation apparatus including: a second receiving module 21, a transmitting module 22, a third receiving module 23 and a second updating module 24, wherein:
A second receiving module 21, configured to receive an account identifier sent by the management server;
a sending module 22, configured to search a database for status information of a monitor lock of an account record corresponding to the account identifier;
a third receiving module 23, configured to receive resource allocation information of the target user side sent by the management server; the target user terminal is a user terminal with ownership of updating account records;
a second updating module 24, configured to update the account record and the incremental log record according to the resource allocation information, and change the state of the monitor lock from the unlocked state to the locked state.
For specific limitations of the resource allocation device, reference may be made to the above limitation of a resource allocation method, and no further description is given here. 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 embodiment, a computer device is provided, which may be a terminal, and the internal structure thereof may be as shown in fig. 11. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a resource allocation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 11 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the computer device to which the present application applies, 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 one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
receiving resource allocation requests sent by at least two user terminals simultaneously; the resource allocation request comprises account identification and resource allocation information; the account identifiers contained in the resource allocation requests are the same;
monitoring the states of monitor locks of at least two account records corresponding to the account identifications;
if the states of the monitor locks of the at least two account records are unlocking states, distributing ownership rights of the at least two account records to a target user side of the at least two user sides;
the resource allocation information of the target user side is respectively sent to the resource allocation servers to which the at least two account records belong; the resource allocation information of the target user side is used for indicating the resource allocation server to update the account record and add the log record, and changing the monitor lock state of the account record from the unlocking state to the locking state.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
receiving an account identifier sent by a resource management server;
searching state information of monitor locks of at least two account records corresponding to the account identification in a database;
transmitting the state information of the monitor lock to the resource management server;
receiving resource allocation information of a target user sent by a resource management server; the target user terminal is a user terminal with ownership of updating account records;
and respectively updating the at least two account records and the incremental log records according to the resource allocation information, and changing the state of each monitor lock from an unlocking state to a locking state.
The computer device provided in the foregoing embodiments has similar implementation principles and technical effects to those of the foregoing method embodiments, and will not be described herein in detail.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor further performs the steps of:
Receiving resource allocation requests sent by at least two user terminals simultaneously; the resource allocation request comprises account identification and resource allocation information; the account identifiers contained in the resource allocation requests are the same;
monitoring the states of monitor locks of at least two account records corresponding to the account identifications;
if the states of the monitor locks of the at least two account records are unlocking states, distributing ownership rights of the at least two account records to a target user side of the at least two user sides;
the resource allocation information of the target user side is respectively sent to the resource allocation servers to which the at least two account records belong; the resource allocation information of the target user side is used for indicating the resource allocation server to update the account record and add the log record, and changing the monitor lock state of the account record from the unlocking state to the locking state.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor further performs the steps of:
receiving an account identifier sent by a resource management server;
Searching state information of monitor locks of at least two account records corresponding to the account identification in a database;
transmitting the state information of the monitor lock to the resource management server;
receiving resource allocation information of a target user sent by a resource management server; the target user terminal is a user terminal with ownership of updating account records;
and respectively updating the at least two account records and the incremental log records according to the resource allocation information, and changing the state of each monitor lock from an unlocking state to a locking state.
The foregoing embodiment provides a computer readable storage medium, which has similar principles and technical effects to those of the foregoing method embodiment, and will not be described herein.
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, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
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 above examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the invention. 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 invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.

Claims (10)

1. A method of resource allocation, the method comprising:
receiving resource allocation requests sent by at least two user terminals simultaneously; the resource allocation request comprises account identification and resource allocation information; the account identifiers contained in the resource allocation requests are the same;
monitoring the states of monitor locks of at least two account records corresponding to the account identifications;
If the states of the monitor locks recorded by the at least two accounts are all unlocking states, determining the user side with the highest priority as a target user side in the at least two user sides according to the priority order of receiving the user sides; distributing ownership rights of the at least two account records to the target user side;
the resource allocation information of the target user side is respectively sent to the resource allocation servers to which the at least two account records belong; the resource allocation information of the target user side is used for indicating the resource allocation server to update the account record and add the log record, and changing the monitor lock state of the account record from the unlocking state to the locking state.
2. The method of claim 1, wherein the monitoring the status of the monitor lock of at least two account records corresponding to the account identification comprises:
reading state information of a monitor lock of an account record corresponding to the account identifier from a database of a resource allocation server to which the at least two account records belong respectively;
and determining the state of each monitor lock according to the state information of each monitor lock.
3. The method according to claim 2, wherein after the sending the resource allocation information of the target user side to the resource allocation servers to which the at least two account records belong, the method further comprises:
receiving an update response message sent by the resource allocation server; the update response message is used for indicating that the resource allocation server has executed to complete the update work;
and after receiving the update response message, sending a storage instruction to the resource allocation server, wherein the storage instruction is used for instructing the resource allocation server to store updated account records and added log records in the database.
4. The method of claim 3, wherein after the sending the store instruction to the resource allocation server, further comprising:
reading the updated account record and the added log record from a database of the resource allocation server;
and sending the read updated account record and the added log record to the target user side.
5. A method of resource allocation, the method comprising:
receiving an account identifier sent by a resource management server;
Searching state information of monitor locks of at least two account records corresponding to the account identification in a database;
transmitting the state information of the monitor lock to the resource management server;
receiving resource allocation information of a target user sent by a resource management server; the target user terminal is a user terminal with ownership of updating account records;
and respectively updating the at least two account records and the incremental log records according to the resource allocation information, and changing the state of each monitor lock from an unlocking state to a locking state.
6. The method of claim 5, wherein after updating the account record and adding log record according to the resource allocation information, further comprising:
sending an update response message; the update response message is used for indicating that the resource allocation server has executed to complete the update work;
receiving a storage instruction sent by the management server;
and storing updated account records and added log records in a database according to the storage instruction.
7. The method of claim 6, wherein after maintaining the updated account record and the added log record in the database according to the store instruction, further comprising:
Changing the state of the monitor lock of the at least two account records from the locked state to the unlocked state;
and/or, sending the resource corresponding to the updated account record to the target user side.
8. A resource allocation apparatus, the apparatus comprising:
the first receiving module is used for receiving resource allocation requests sent by at least two user terminals simultaneously; the resource allocation request comprises account identification and resource allocation information; the account identifiers contained in the resource allocation requests are the same;
the monitoring module is used for monitoring the state of the monitor lock of the account record corresponding to the account identifier;
the distribution module is used for determining the user terminal with the highest priority as a target user terminal in the at least two user terminals according to the priority order of receiving the user terminals if the states of the monitor locks recorded by the at least two accounts are all unlocking states; distributing ownership rights of the at least two account records to the target user side;
the first updating module is used for sending the resource allocation information of the target user side to a resource allocation server, and the resource allocation information of the target user side is used for indicating the resource allocation server to update the account record and the addition log record; and changing the monitor lock state from the unlocked state to the locked state.
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.
CN202010342194.9A 2020-04-27 2020-04-27 Resource allocation method, computer device, and storage medium Active CN111522830B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010342194.9A CN111522830B (en) 2020-04-27 2020-04-27 Resource allocation method, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010342194.9A CN111522830B (en) 2020-04-27 2020-04-27 Resource allocation method, computer device, and storage medium

Publications (2)

Publication Number Publication Date
CN111522830A CN111522830A (en) 2020-08-11
CN111522830B true CN111522830B (en) 2023-06-09

Family

ID=71902907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010342194.9A Active CN111522830B (en) 2020-04-27 2020-04-27 Resource allocation method, computer device, and storage medium

Country Status (1)

Country Link
CN (1) CN111522830B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109324877A (en) * 2018-08-15 2019-02-12 北京天元创新科技有限公司 The method and server of data access
CN110648127A (en) * 2019-08-13 2020-01-03 平安普惠企业管理有限公司 Resource transfer method, device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105469294A (en) * 2015-11-17 2016-04-06 南京唐一微数字科技有限公司 Purchase request processing method and purchase request processing device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109324877A (en) * 2018-08-15 2019-02-12 北京天元创新科技有限公司 The method and server of data access
CN110648127A (en) * 2019-08-13 2020-01-03 平安普惠企业管理有限公司 Resource transfer method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111522830A (en) 2020-08-11

Similar Documents

Publication Publication Date Title
CN111814197B (en) Data sharing method and device, server and storage medium
US11880712B1 (en) Resource tolerations and taints
US20050108394A1 (en) Grid-based computing to search a network
CN112115167B (en) Cache system hot spot data access method, device, equipment and storage medium
AU2006315960A1 (en) Automated state migration while deploying an operating system
CN112532632A (en) Resource allocation method and device for multi-level cloud platform and computer equipment
CN111885184A (en) Method and device for processing hot spot access keywords in high concurrency scene
CN113849428A (en) Shared memory permission configuration method, memory unit and system
US11429311B1 (en) Method and system for managing requests in a distributed system
JP2010272090A (en) Device, program and method for managing processing request destination
US7793051B1 (en) Global shared memory subsystem
CN111522830B (en) Resource allocation method, computer device, and storage medium
CN113065887A (en) Resource processing method, resource processing device, computer equipment and storage medium
CN103164410B (en) The method of the storage of a kind of file and operation, storage device and system
US20230336557A1 (en) Resource allocating and management in a computer network
US11711314B1 (en) Grouping resource metadata tags
CN110659303A (en) Read-write control method and device for database nodes
CN114172903B (en) Node capacity expansion method, device, equipment and medium of slm scheduling system
US8850440B2 (en) Managing the processing of processing requests in a data processing system comprising a plurality of processing environments
CN114064317A (en) Node calling method in distributed system and related device
CN114547108A (en) Data processing method, device, equipment and medium
CN110311949B (en) Resource management method of cross-cloud management platform
CN109254997B (en) Data synchronization method, system, computer device and readable storage medium
CN111638956A (en) Application running method and device and storage medium
CN111259375A (en) Processing method and device for access request applied to operating system of Internet of things

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Unit 401, Building 11, Creative Industry Park, 328 Xinghu Street, Suzhou Industrial Park, Suzhou, Jiangsu 215000

Applicant after: Yicui network technology (Suzhou) Co.,Ltd.

Address before: Unit 401, Building 11, Creative Industry Park, 328 Xinghu Street, Suzhou Industrial Park, Suzhou, Jiangsu 215000

Applicant before: BIZGO TECHNOLOGY (CHINA) Co.,Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230317

Address after: 322000 floor 1, building a, No. 288, Yangcun Road, Houjiang street, Yiwu City, Jinhua City, Zhejiang Province (self declaration)

Applicant after: Zhejiang Kunying Technology Co.,Ltd.

Address before: Unit 401, Building 11, Creative Industry Park, 328 Xinghu Street, Suzhou Industrial Park, Suzhou, Jiangsu 215000

Applicant before: Yicui network technology (Suzhou) Co.,Ltd.

GR01 Patent grant
GR01 Patent grant