Resource allocation method, apparatus and device

CN115248729BActive Publication Date: 2026-10-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110453363.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-26
Publication Date
2026-10-27
Estimated Expiration
2041-04-26

AI Technical Summary

Technical Problem

[0003]然而,上述技术方案在采集每台物理机的物理指纹信息的情况下,需要获得物理机集群的管理员权限,若没有管理员权限,就无法采集物理指纹信息,无法生成许可证文件

Benefits of technology

[0033]本申请通过服务端接收客户端的资源申请请求,基于授权映射信息和客户端的目标标识信息,对客户端进行身份验证,可以大大简化客户端的身份验证过程,进而简化资源分配过程,提高资源分配效率。通过服务端基于目标服务对应的剩余资源量和所述第一资源分配量,对客户端申请的资源分配量进行授权,可实现目标服务的资源分配。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115248729B_ABST
    Figure CN115248729B_ABST
Patent Text Reader

Abstract

The application discloses a resource allocation method, device and equipment. The method comprises the following steps: receiving a first resource application request corresponding to a target service sent by a client, wherein the first resource application request comprises target identification information corresponding to the client and a first resource allocation quantity; performing identity authentication on the client based on authorization mapping information and the target identification information, wherein the authorization mapping information represents a mapping relationship between at least one identification information and a corresponding license file; and in the case that the identity authentication of the client is passed, sending first resource allocation information corresponding to the first resource allocation quantity to the client based on a residual resource quantity corresponding to the target service and the first resource allocation quantity. The technical scheme provided by the embodiment of the application can at least realize resource allocation of the target service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to resource allocation methods, apparatus and equipment. Background Technology

[0002] To achieve private deployment of the product, the current technical solution is as follows: collect the physical fingerprint information of each physical machine in the physical machine cluster, generate a license file based on the physical fingerprint information and product information of each physical machine, and configure the license file in the product deployed on each physical machine to achieve private deployment of the product.

[0003] However, the above technical solution requires administrator privileges for the physical machine cluster to collect the physical fingerprint information of each physical machine. Without administrator privileges, physical fingerprint information cannot be collected, and license files cannot be generated. Furthermore, if a physical machine is added, removed, or goes offline, the physical fingerprint information of each physical machine in the cluster needs to be collected again to update the license file, increasing the difficulty and workload of product deployment and maintenance, and reducing the efficiency of product deployment. Moreover, the above technical solution can only authorize the product but cannot limit the QPS (Query Per Second) of the physical machine cluster using the product, and cannot achieve resource allocation. Summary of the Invention

[0004] This application provides a resource allocation method, apparatus, equipment, and computer storage medium, which can at least realize resource allocation for the target service, greatly simplify the resource allocation process, and improve the resource allocation efficiency of the target service.

[0005] In a first aspect, this application provides a resource allocation method, the method comprising:

[0006] The client sends a first resource request corresponding to the target service to the server. The first resource request includes the target identification information corresponding to the client and the first resource allocation amount.

[0007] The server authenticates the client based on the first mapping information and the target identification information; wherein, the first mapping information includes a mapping relationship between at least one identification information and a corresponding license file; wherein, the at least one identification information includes the target identification information;

[0008] If the client authentication is successful, the server sends the first resource allocation information corresponding to the first resource allocation amount to the client based on the remaining resource amount corresponding to the target service and the first resource allocation amount.

[0009] The second aspect provides a resource allocation method, the method comprising:

[0010] Receive a first resource request request sent by the client corresponding to the target service. The first resource request request includes the target identification information and the first resource allocation amount corresponding to the client.

[0011] The client is authenticated based on the authorization mapping information and the target identification information; wherein the authorization mapping information represents the mapping relationship between at least one identification information and the corresponding license file; wherein the at least one identification information includes the target identification information;

[0012] If the client authentication is successful, based on the remaining resources corresponding to the target service and the first resource allocation amount, the first resource allocation information corresponding to the first resource allocation amount is sent to the client.

[0013] The third aspect provides a resource allocation method, the method comprising:

[0014] A first resource request corresponding to the target service is sent to the server. The first resource request includes target identification information and a first resource allocation amount corresponding to the client, so that the server can authenticate the client based on the authorization mapping information and the target identification information. The authorization mapping information represents the mapping relationship between at least one identification information and the corresponding license file. The at least one identification information includes the target identification information.

[0015] Receive the first resource allocation information corresponding to the first resource allocation amount sent by the server based on the remaining resource amount corresponding to the target service and the first resource allocation amount when the client's authentication is successful;

[0016] Request the target service based on the first resource allocation.

[0017] The fourth aspect provides a resource allocation device, the device comprising:

[0018] The first sending module is used for the client to send a first resource request corresponding to the target service to the server. The first resource request includes the target identification information and the first resource allocation amount corresponding to the client.

[0019] An authentication module is used by the server to authenticate the client based on first mapping information and target identification information; wherein the first mapping information includes a mapping relationship between at least one identification information and a corresponding license file; wherein the at least one identification information includes the target identification information;

[0020] The second sending module is used to send, when the client authentication is successful, the server sends the first resource allocation information corresponding to the first resource allocation amount to the client based on the remaining resource amount corresponding to the target service and the first resource allocation amount.

[0021] The fifth aspect provides a resource allocation device, the device comprising:

[0022] The receiving module is used to receive a first resource request corresponding to a target service sent by a client. The first resource request includes target identification information corresponding to the client and a first resource allocation amount.

[0023] An authentication module is used to authenticate the client based on authorization mapping information and the target identification information; wherein the authorization mapping information represents the mapping relationship between at least one identification information and a corresponding license file; wherein the at least one identification information includes the target identification information;

[0024] The sending module is configured to, upon successful client authentication, send first resource allocation information corresponding to the first resource allocation amount to the client based on the remaining resource amount corresponding to the target service and the first resource allocation amount.

[0025] A sixth aspect provides a resource allocation apparatus, the apparatus comprising:

[0026] A first sending module is configured to send a first resource request corresponding to a target service to a server. The first resource request includes target identification information and a first resource allocation amount corresponding to the client, so that the server can authenticate the client based on authorization mapping information and the target identification information. The authorization mapping information represents the mapping relationship between at least one identification information and a corresponding license file. The at least one identification information includes the target identification information.

[0027] The receiving module is configured to receive first resource allocation information corresponding to the first resource allocation amount sent by the server based on the remaining resource amount corresponding to the target service and the first resource allocation amount when the client authentication is successful;

[0028] The request module is used to request the target service based on the first resource allocation amount.

[0029] A seventh aspect provides a resource allocation device, the device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the resource allocation method as described above.

[0030] On the other hand, a resource allocation system is provided, comprising at least one client and one server. The client is used to implement the resource allocation method as described in the second aspect; the server is used to implement the resource allocation method as described in the third aspect.

[0031] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the resource allocation method described above.

[0032] The resource allocation method, apparatus, equipment, and computer-readable storage medium provided in this application have the following technical advantages:

[0033] This application receives resource request requests from clients via a server, and authenticates the client based on authorization mapping information and the client's target identifier information. This greatly simplifies the client authentication process, thereby simplifying the resource allocation process and improving resource allocation efficiency. By authorizing the resource allocation requested by the client based on the remaining resources corresponding to the target service and the first resource allocation amount, resource allocation for the target service can be achieved. Attached Figure Description

[0034] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a schematic diagram of the framework of a resource allocation system provided in an embodiment of this application;

[0036] Figure 2 This is a schematic diagram of the framework of another resource allocation system provided in the embodiments of this application;

[0037] Figure 3 This is a flowchart illustrating a resource allocation method provided in an embodiment of this application;

[0038] Figure 4 This is a schematic diagram of a client authentication process provided in an embodiment of this application;

[0039] Figure 5 This is a schematic diagram of an operational efficiency control process provided in an embodiment of this application;

[0040] Figure 6This is a flowchart illustrating an authentication process provided in an embodiment of this application;

[0041] Figure 7 This is a schematic diagram illustrating a change in resource allocation request provided in an embodiment of this application;

[0042] Figure 8 This is a schematic diagram of the framework of another resource allocation system provided in the embodiments of this application;

[0043] Figure 9 This is a schematic diagram illustrating an application scenario of a resource allocation method provided in an embodiment of this application;

[0044] Figure 10 This is a flowchart illustrating another resource allocation method provided in an embodiment of this application;

[0045] Figure 11 This is a flowchart illustrating another resource allocation method provided in an embodiment of this application;

[0046] Figure 12 This is a schematic diagram of the structure of a resource allocation device provided in an embodiment of this application;

[0047] Figure 13 This is a schematic diagram of another resource allocation device provided in an embodiment of this application;

[0048] Figure 14 This is a schematic diagram of another resource allocation device provided in an embodiment of this application;

[0049] Figure 15 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

[0050] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0051] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0052] The resource allocation system involved in this application embodiment can be a distributed system formed by connecting clients and multiple nodes (any form of computing device in the network, such as servers and user terminals) through network communication.

[0053] Taking a distributed system as an example, see blockchain system. Figure 1 , Figure 1 This is an optional structural diagram of the distributed system 100 provided in this application embodiment applied to a blockchain system. It consists of multiple nodes (any form of computing device in the network, such as servers or user terminals) and clients, forming a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). In the distributed system, any machine, such as a server or terminal, can join and become a node. A node includes a hardware layer, a middleware layer, an operating system layer, and an application layer.

[0054] See Figure 1 The functions of each node in the blockchain system shown include:

[0055] 1) Routing: A basic function of nodes used to support communication between nodes.

[0056] In addition to routing capabilities, nodes can also have the following functions:

[0057] 2) Applications are deployed in the blockchain to implement specific business needs. They record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system. When other nodes successfully verify the source and integrity of the record data, they add the record data to a temporary block.

[0058] For example, the business logic implemented by the application includes:

[0059] 2.1) A wallet is used to provide the function of conducting electronic currency transactions, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system; after other nodes successfully verify the transaction, they store the transaction record data in the temporary block of the blockchain as a response to acknowledge the validity of the transaction; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address;

[0060] 2.2) Shared ledger, used to provide functions such as storage, query and modification of ledger data. It sends the record data of the operation on the ledger data to other nodes in the blockchain system. After the other nodes verify the validity, as a response to acknowledge the validity of the ledger data, they store the record data in a temporary block. They can also send confirmation to the node that initiated the operation.

[0061] 2.3) Smart contracts are computerized protocols that can execute the terms of a contract. They are implemented through code deployed on a shared ledger that executes when certain conditions are met. Based on actual business needs, the code is used to complete automated transactions, such as querying the logistics status of goods purchased by a buyer and transferring the buyer's electronic money to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions; they can also execute contracts for processing received information.

[0062] 3) A blockchain consists of a series of blocks that are sequentially generated. Once a new block is added to the blockchain, it will not be removed. The blocks contain the data submitted by the nodes in the blockchain system.

[0063] The following describes a resource allocation method according to this application. This specification provides the method operation steps as shown in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one of many possible execution orders and does not represent the only execution order. In actual system or server products, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).

[0064] Please see Figure 2 , Figure 2 This is a schematic diagram of another resource allocation system provided in an embodiment of this application, such as... Figure 2As shown, the system may include a client 01 and a server 02. In this embodiment, the client 01 can request a target service based on the first resource allocation amount after receiving first authorization information corresponding to the first resource allocation amount sent by the server 02. Optionally, the client 01 may include physical devices such as smartphones, desktop computers, tablets, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices. It may also include software running on the aforementioned physical devices, such as applications and websites.

[0065] In this embodiment, server 02 can receive a first resource allocation request sent by client 01, and authorize the first resource allocation amount requested by client 01 based on authorization mapping information and the first resource allocation request. Optionally, server 02 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0066] The aforementioned client 01 and server 02 can be connected directly or indirectly via wired or wireless communication, and this application does not impose any restrictions on this. Furthermore, it should be noted that the aforementioned... Figure 1 The corresponding system architecture is merely one example of a data query system architecture provided in this specification. In practical applications, other system architectures may also be included. For example, program processing may also be implemented on the server side.

[0067] In a specific embodiment, such as Figure 3 As shown, this application provides a resource allocation method applied to a resource allocation system, the resource allocation system including at least one client and one server; the method includes:

[0068] S301: The client sends a first resource request corresponding to the target service to the server. The first resource request includes the target identification information corresponding to the client and the first resource allocation amount.

[0069] In this embodiment of the application, the client can be any client used to apply for resources for the target service.

[0070] In this embodiment of the application, the server can be a server used to manage resources for the target service.

[0071] In this embodiment, the target service can be any type of proprietary service, which may include services provided by any proprietary deployed product. This proprietary deployed product may include, but is not limited to, applications or components capable of implementing specific functions. For example, an OCR (Optical Character Recognition) application or an OCR component integrated into other applications. These other applications are different from the OCR application. Accordingly, the target service can be an OCR service.

[0072] Specifically, the client can be an authentication client integrated into the product, used to request resources for the target service. The server can be an authentication server deployed separately on a server, used to manage the resources for the target service.

[0073] In this embodiment, the first resource allocation amount can be the amount of resources required by the client for the target service. Specifically, the first resource allocation amount can be determined based on actual application needs and can be pre-configured in the client. Specifically, the unit of measurement for the resources of the target service can be QPS (Query Per Second).

[0074] In this embodiment of the application, the first resource request may be a request from the client to the server for resources of the target service with a resource quantity equal to the first resource allocation quantity.

[0075] In this embodiment of the application, the target identification information can be the client ID (Identity Document), and the target identification information is unique.

[0076] In an optional embodiment, the target identification information can be in the format of "machine information + timestamp + thread ID + random number". Here, machine information can be the ID of the physical machine where the client resides, timestamp can be a digital signature of the physical machine ID, thread ID can be the ID of the thread used by the client to send the first resource request, and random number can be generated based on a random algorithm.

[0077] In practical applications, the client sends a first resource request to the server based on the user's product function call command, in order to obtain the resources of the target service allocated by the server according to the first resource allocation amount.

[0078] Taking the target service as an OCR service as an example, the client generates a first resource request based on the user's product function call instruction, according to the pre-configured first resource allocation amount and target identification information, and sends the first resource request to the server.

[0079] In an optional embodiment, if the server manages resources for at least one service, the first resource request may further include a service identifier of the target service, so that the server allocates resources for the target service to the client based on the service identifier of the target service.

[0080] In this embodiment of the application, by sending a first resource request corresponding to the target service to the server through the client, the resource request for the target service can be realized when the physical machine where the client is located needs to consume the resources of the target service, which facilitates the allocation of resources for the target service.

[0081] S303: The server authenticates the client based on the authorization mapping information and the target identification information; wherein, the authorization mapping information represents the mapping relationship between at least one identification information and the corresponding license file; wherein, the at least one identification information includes the target identification information.

[0082] In this embodiment of the application, the at least one identification information can be the identification information of at least one client in the cluster to which the client belongs, used to distinguish different clients and has uniqueness.

[0083] In this embodiment of the application, the license document may include the physical fingerprint information and product information of the physical machine where the client is located.

[0084] It is understood that the server has the authorization mapping information pre-set.

[0085] In practical applications, to obtain the client's license file, the operating system of the physical machine hosting the client is equipped with a physical fingerprint collection tool. Responding to the physical machine administrator's fingerprint collection command, the operating system runs the physical fingerprint collection tool to collect the physical fingerprint information of the physical machine. Responding to the physical machine administrator's sending command, the operating system sends the physical fingerprint information of the physical machine and the product information of the products deployed on the physical machine to the product management terminal (for product management). The product management terminal, responding to the administrator's license file generation command, generates the license file based on the physical fingerprint information and the product information.

[0086] Accordingly, in a cluster scenario, after obtaining the license file corresponding to the client's cluster using the above method, the product management terminal establishes a mapping relationship between the identification information of the client's cluster and the corresponding license file, obtaining authorization mapping information, and stores the authorization mapping information in the authorization mapping module of the server. Specifically, the recording format of the authorization mapping information can be "identification information + license file".

[0087] In an optional embodiment, such as Figure 4As shown, in a cluster scenario, to authenticate the client, the server performs authentication based on authorization mapping information and the target identifier information, including:

[0088] S401: The server determines whether a license file corresponding to the target identifier information exists locally based on the authorization mapping information.

[0089] In practical applications, the server reads authorization mapping information from the authorization mapping module. Based on the authorization mapping information, it can query whether target identification information exists locally. If target identification information is found, it can determine whether a license file corresponding to the target identification information exists locally.

[0090] S403: If a license file corresponding to the target identification information exists locally, the client authentication is confirmed to be successful.

[0091] In an optional embodiment, the server's authentication of the client based on the authorization mapping information and the target identifier information further includes:

[0092] If no license file corresponding to the target identification information exists locally, it is determined that the client authentication has failed.

[0093] In this embodiment of the application, pre-setting the authorization mapping information on the server has the following two advantages:

[0094] (1) If the physical fingerprint information of a physical machine changes, there is no need to re-collect the physical fingerprint information of each physical machine in the physical machine cluster to update the license file corresponding to the physical machine. The server can still authenticate the client on the physical machine based on the authorization mapping information.

[0095] (2) In the case of expanding (adding physical machines) or shrinking (removing physical machines) the physical machine cluster, the server only needs to add or delete the mapping relationship between the corresponding identification information and the corresponding license file in the authorization mapping information to adapt to the application scenario of expanding or shrinking the physical machine cluster. There is no need to re-collect the physical fingerprint information of each physical machine in the physical machine cluster to update the license file.

[0096] Considering the two advantages mentioned above, the identity verification scheme provided in this application embodiment can significantly reduce the difficulty and workload of product and service operation and maintenance, and save operation and maintenance resources. Furthermore, the identity verification scheme provided in this application embodiment is applicable to a wide range of authentication scenarios.

[0097] S305: If the client authentication is successful, the server sends the first resource allocation information corresponding to the first resource allocation amount to the client based on the remaining resource amount corresponding to the target service and the first resource allocation amount.

[0098] In this embodiment of the application, the remaining resources corresponding to the target service can be the amount of resources that the server has not allocated to the target service of the cluster to which the client belongs within a preset period.

[0099] In practical applications, the connection between the client and the server can be a heartbeat connection. Based on this heartbeat connection, the client can send resource request requests to the server at preset intervals to request resource allocation for a target service within that preset period. It can be understood that the length of the preset period is equal to the time interval of the heartbeat connection, which can be 1 second.

[0100] In practical applications, when users or organizations purchase privately deployed products and deploy them on physical machine clusters, the client clusters corresponding to these physical machine clusters need to share the resources of the target service provided by the product. However, within a preset period, the total amount of target service resources shared by the client clusters is limited.

[0101] In addition, at least one client in the cluster to which the client belongs can send a resource request to the server within a preset period.

[0102] In one optional embodiment, at least one client in the client's cluster can send resource request requests to the server in parallel. Correspondingly, upon receiving a resource request from the client's cluster, the server can process at least one resource request request serially, with the processing priority determined based on the corresponding identification information of the client's cluster. While this method increases the server's load, it improves the resource request efficiency of the client's cluster.

[0103] In one optional embodiment, the client's cluster can send resource request requests to the server serially. Correspondingly, the server can process at least one resource request request based on the chronological order of the received requests. While this method has lower resource allocation efficiency, it reduces the server's load.

[0104] It is understandable that regardless of whether the client chooses to send resource request requests to its cluster in a serial or parallel manner, the server processes the resource request requests sent by the client's cluster in a serial manner.

[0105] Considering that when the server receives the first resource request sent by the client, the remaining resources corresponding to the target service within the preset period are insufficient to be allocated to the client.

[0106] In a specific embodiment, such as Figure 5 As shown, in order to determine the remaining resource quantity corresponding to the target service, the server sends first resource allocation information corresponding to the first resource allocation quantity to the client based on the remaining resource quantity corresponding to the target service and the first resource allocation quantity, including:

[0107] S501: The server obtains the amount of available resources in the cluster corresponding to the target service within a preset period.

[0108] In this embodiment, the available resources in the cluster can be the total amount of resources that the cluster to which the client belongs can apply for the target service within a preset period. Generally, the available resources in the cluster are determined based on the amount paid by the organization when purchasing the product, and are a fixed value.

[0109] In this embodiment of the application, the amount of available resources in the cluster can be stored in a license file, and correspondingly, the license file may also include the amount of available resources in the cluster.

[0110] Taking the target service as an example, the available resources for the OCR service in the cluster can be 200 QPS.

[0111] S503: The server obtains the total resource consumption of the cluster to which the client belongs within a preset period.

[0112] In practical applications, after the server allocates the resources of the target service to the client's cluster according to the resource allocation requested by the client's cluster, it determines the resource allocation amount as the resource consumption of the client's cluster and records the resource consumption of the client's cluster. Specifically, the server establishes a mapping relationship between the identification information corresponding to the client's cluster and the resource consumption, obtains allocation mapping information, caches the allocation mapping information within a preset period in the allocation mapping module, and updates the state of the allocation mapping module to the initial state (data clearing) at the end of the preset period.

[0113] In this embodiment, the server reads allocation mapping information from its local allocation mapping module, sums the resource consumption data in the allocation mapping information, and obtains the total resource consumption corresponding to the cluster to which the client belongs. Specifically, the allocation mapping information can be stored in the form of "identification information + resource consumption".

[0114] S505: The server determines the remaining resource quantity based on the available resource quantity in the cluster and the total resource consumption.

[0115] In this embodiment of the application, the difference between the available resources in the cluster and the total resource consumption is determined as the remaining resources.

[0116] Taking the target service as an OCR service as an example, if the available resources in the cluster are 200 QPS and the total resource consumption is 180 QPS, then the remaining resources are 20 QPS.

[0117] S507: If the remaining resource quantity is greater than or equal to the first resource allocation quantity, the server sends the first resource allocation information corresponding to the first resource allocation quantity to the client.

[0118] Taking the target service as an OCR service as an example, if the first resource allocation is 20 QPS and the remaining resource is 20 QPS, then the server can determine that it can allocate 20 QPS of the target service's resources to the client and send the first resource allocation information to the client.

[0119] In an optional embodiment, if the remaining resource amount is greater than or equal to the first resource allocation amount, the server does not send the first resource allocation information, or sends resource allocation failure information.

[0120] Taking the target service as an OCR service as an example, if the first resource allocation is 30 QPS and the remaining resource is 20 QPS, the server can determine that the 20 QPS of resources of the target service cannot be allocated to the client and send an allocation failure message to the client.

[0121] In an optional embodiment, such as Figure 6 As shown, after the server sends the first resource allocation information corresponding to the first resource allocation amount to the client, the above method further includes:

[0122] S601: The client requests the target service based on the first resource allocation amount.

[0123] Taking the target service as an example, if the first resource allocation is 20 QPS, the client can access the function interface of the OCR application or OCR component 20 times within a preset period (1 second) to request the target service.

[0124] In an optional embodiment, the above method further includes:

[0125] Monitor the resource consumption of the target service requested.

[0126] When the resource consumption of the target service meets the preset conditions or the preset period ends, a second resource request corresponding to the target service is sent to the server. The second resource request includes the target identification information and the second resource allocation amount.

[0127] In this embodiment of the application, the second resource request can be a resource request sent by the client after sending the first resource request to the server.

[0128] In this embodiment of the application, the second resource allocation amount can be the amount of resources of the target service requested by the client from the server when the client sends a second resource request to the server.

[0129] In practical applications, to ensure timely replenishment of available resource allocations, clients can request a second resource allocation after exhausting their initial allocation within a preset period. Correspondingly, the aforementioned method also includes:

[0130] If the resource consumption is detected to have reached the first resource allocation amount, it is determined that the resource consumption meets the preset condition.

[0131] In practical applications, to avoid affecting the client's normal request for the target service, if the client has not exhausted the first resource allocation within a preset period and the remaining available resources are lower than a first preset threshold, it can request a second resource allocation. Accordingly, the above method also includes:

[0132] The remaining available resources are determined based on the resource consumption and the first resource allocation.

[0133] Determine whether the remaining available resources are lower than a first preset threshold;

[0134] If the remaining available resources are lower than the first preset threshold, it is determined that the resource consumption meets the preset condition.

[0135] In this embodiment, the first preset threshold can be determined based on a first preset percentage and the first resource allocation. Taking an OCR service as an example, if the first resource allocation is 20 QPS and the first preset percentage can be preset to 20%, then the first preset threshold is 4 QPS.

[0136] If the remaining available resources are 3 QPS, which is lower than the first preset threshold, then it can be determined that the resource consumption meets the preset conditions.

[0137] In this embodiment, the resource allocation amount for the target service requested by the client from the server each time can be a fixed value, which is simple and easy to implement. Accordingly, before sending the second resource request corresponding to the target service to the server, the method further includes:

[0138] The first resource allocation amount is used as the second resource allocation amount.

[0139] Specifically, the first resource allocation and the second resource allocation are both equal fixed values.

[0140] In this embodiment of the application, the client can also adaptively adjust the value of the second resource allocation based on the resource consumption of the target service, so as to reduce the waste of resources of the target service while meeting the resource consumption needs of the client.

[0141] In the above scheme, if the resource consumption of the target service meets a preset condition, it indicates that the first resource allocation requested by the client from the server is insufficient. Accordingly, to accommodate the client's greater demand for resource allocation, before sending the second resource request request corresponding to the target service to the server, the method further includes:

[0142] If the resource consumption of the requested target service meets the preset conditions, it is determined whether the first resource allocation is lower than the second preset threshold.

[0143] If the first resource allocation amount is lower than the second preset threshold, a preset multiple of the first resource allocation amount is determined as the second resource allocation amount, and the second resource allocation amount is less than or equal to the second preset threshold.

[0144] If the first resource allocation amount is equal to the second preset threshold, the first resource allocation amount is used as the second resource allocation amount.

[0145] In this embodiment of the application, the second preset threshold is a pre-set peak value of the target service resources that the client can request from the server.

[0146] In this embodiment of the application, comparing the first resource allocation amount and the peak resource amount is to determine whether the second resource allocation amount that the client needs to request from the server can continue to increase based on the first resource allocation amount.

[0147] If the first resource allocation is equal to the peak resource allocation, the client determines that the second resource allocation cannot continue to increase based on the first resource allocation, and uses the peak resource allocation (the first resource allocation in this case) as the second resource allocation.

[0148] If the first resource allocation is lower than the peak resource allocation, the client determines that the second resource allocation can continue to grow based on the first resource allocation, and sets a preset multiple of the first resource allocation as the second resource allocation. The second resource allocation must not exceed the peak resource allocation, and the preset multiple can be designed based on this. It can be understood that setting a preset multiple of the first allocation as the second resource allocation allows for exponential growth of the second resource allocation based on the first allocation.

[0149] In the above scheme, at the end of the preset period, the client requests a second resource allocation for the target service from the server, indicating that the client has sufficient remaining resources from the first resource allocation requested from the server. Accordingly, to accommodate smaller resource allocation needs from the client, before sending the second resource request request corresponding to the target service to the server, the method further includes:

[0150] At the end of the preset period, it is determined whether the first resource allocation amount is lower than the second preset threshold.

[0151] If the first resource allocation amount is equal to the second preset threshold, the first preset resource allocation amount shall be used as the second resource allocation amount;

[0152] If the first resource allocation amount is lower than the second preset threshold, the second preset resource allocation amount is used as the second resource allocation amount; wherein, the first preset resource allocation amount is lower than the second preset resource allocation amount, and the second resource allocation amount is lower than the second preset threshold.

[0153] In this embodiment of the application, by comparing the first resource allocation amount and the second preset threshold at the end of the preset period, the consumption status of the client's resource amount for the target service during the historical period can be determined.

[0154] If the first resource allocation is equal to the second preset threshold (peak resource amount), it can be determined that the client's resource consumption of the target service is relatively large in the historical period. At this time, the first preset resource allocation can be used as the second resource allocation.

[0155] If the first resource allocation amount is lower than the second preset threshold, it can be determined that the client's resource consumption for the target service is relatively small in the historical period. In this case, the second preset resource allocation amount can be used as the second resource allocation amount.

[0156] In this embodiment, the first preset resource allocation amount and the second preset resource allocation amount can be determined based on actual application requirements. Generally, the second preset resource allocation amount can be the lowest value of the resource amount that the client can request from the server for the target service, for example, it can be 10 QPS, and the first preset resource allocation amount can be set to a value between the lowest value of the resource amount and the highest value of the resource amount.

[0157] To demonstrate how the client adaptively adjusts the second resource allocation based on the resource consumption of the target service, such as... Figure 7 The diagram shown illustrates a resource allocation change according to an embodiment of this application. Taking a preset period of 1 second as an example, the resource allocation change includes three stages: a slow start stage, a stable stage, and a fast recovery stage. Wherein:

[0158] Slow Start Phase (Seconds 1-3): The initial resource allocation requested by the client from the server is at its lowest point (10 QPS). During this phase, the resource allocation requested by the client each time cannot meet its resource consumption needs, and the amount of resource allocation requested by the client increases exponentially. Specifically, the amount of resource allocation requested each time is twice the amount of the previous request. At the 3rd second, the resource allocation requested by the client reaches its peak (160 QPS).

[0159] Stable phase 3-7 seconds: During this phase, the resource allocation requested by the client each time is at the peak resource level, and the resource allocation is either fully consumed or the remaining available resource level is lower than the first threshold. The resource allocation requested by the client remains at the peak resource level.

[0160] Fast recovery phase 7-8 seconds: At the end of the 7th second, the resource allocation requested by the client is the peak resource allocation, and the resource allocation requested by the client next time will be the first preset resource allocation (40 QPS).

[0161] Slow start phase 8-9 seconds: At the end of the 8th second, the resource allocation requested by the client is 40 QPS, which is lower than the peak resource allocation. Therefore, the resource allocation requested by the client next time will be the second preset resource allocation (10 QPS).

[0162] In an optional embodiment, the client can obtain the resource consumption in the previous period and use the average value of the resource consumption in the previous period as the amount of resource allocation that needs to be requested from the server at present.

[0163] For example, if the resource consumption of the client requesting the target service in the previous period was 120 QPS, then the resource allocation requested from the server in the current period is determined to be 120 QPS.

[0164] In an optional embodiment, if the physical machine hosting the client crashes, the client goes offline (heartbeat connection with the server is lost), and the client cannot request the target service based on the first resource allocation, causing the first resource allocation to become invalid. Upon reconnection between the client and the server, the client needs to re-request the first resource allocation. The server then sends invalid resource reclamation information to the client to reclaim the invalid resource. Accordingly, the above method further includes:

[0165] If the client goes offline within a preset period, the server sends an invalid resource reclamation message to the client.

[0166] Based on the invalid resource reclamation information, the client sends the amount of invalid resources for the target service to the server;

[0167] The server updates the remaining resources and total resource consumption based on the amount of invalid resources.

[0168] In this embodiment of the application, the accuracy of resource allocation can be improved by having the server actively reclaim invalid resources from the client.

[0169] In an optional embodiment, if the allocation and mapping module completes the aforementioned recycling and update operation at the end of a preset period, invalid resource quantities will expire, and the remaining resource quantity and total resource consumption on the server will become abnormal after the invalid resource quantities are recycled. Accordingly, the above method further includes:

[0170] The server determines whether the invalid resource quantity has expired based on the license file corresponding to the target identifier information;

[0171] In the event that invalid resources have expired, the server determines the data consistency of the target service based on the available resources, remaining resources, and total resource consumption in the cluster during the current period.

[0172] In this embodiment, the license document may further include the validity period of the resource quantity of the target service within a preset period. Specifically, the validity period can be a preset period. Accordingly, if the server reclaims the invalid resource quantity at the end of the preset period, the invalid resource quantity will expire.

[0173] In this embodiment, the server can read the validity period of the resource quantity of the target service in the license document to determine whether the invalid resource quantity has expired. If the server reclaims the invalid resource quantity outside the validity period, then the invalid resource quantity is determined to have expired.

[0174] In an optional embodiment, the license file may further include the expiration time of the resource quantity of the target service within a preset period. Accordingly, the server reads the expiration time from the license file, and if the time when the server reclaims invalid resource quantity matches the expiration time, then the invalid resource is determined to have expired.

[0175] In this embodiment of the application, if the sum of the remaining resources and the total resource consumption in the current period is equal to the available resources in the cluster, the server determines that the data of the target service is consistent.

[0176] Through the above data consistency detection scheme, the server can promptly detect and correct any abnormal remaining resources and total resource consumption within the current period, thereby improving the rigor of resource allocation.

[0177] like Figure 8 The diagram shown is a framework diagram of another resource allocation system provided in an embodiment of this application. The resource allocation system 800 includes an authentication server 801, an authentication client 802, an authentication client 803, ..., and an authentication client 80n.

[0178] The authentication server 801 includes an authorization mapping module, a remaining resource management module, a resource allocation module, an allocation mapping module, and a data consistency module. The authorization mapping module stores authorization mapping information; the resource allocation module sends resource authorization information to the authentication client 802 based on the remaining available resources and the resource allocation requested by the authentication client 802; the data consistency verification module verifies the data consistency of the target service; the remaining resource management module stores the remaining resource quantity; and the allocation mapping module caches the resource consumption of the aforementioned authentication client for the target service.

[0179] When the authentication server 801 sends the resource allocation information corresponding to the resource allocation amount of the target service to the authentication client 802, the remaining resource management module updates the remaining resource amount according to the resource allocation amount, and sends the identification information, service identifier and resource allocation amount of the authentication client 802 to the allocation mapping module. The allocation mapping module determines the resource allocation amount as the resource consumption amount of the authentication client 802 for the target service, and stores the identification information of the authentication client 802, the service identifier of the target service and the resource consumption amount accordingly.

[0180] The authorization mapping information represents the mapping relationship between each authentication client and its corresponding license, and can be stored in the form of "authentication client identification information + license file"; the allocation mapping information represents the resource consumption of each authentication client for the service, and can be stored in the form of "authentication client identification information + service identifier + resource consumption"; and the remaining resource management module can store the remaining resource quantity for at least one service in the form of "service identifier + remaining resource quantity".

[0181] Taking authentication client 802 as an example, the structure of the aforementioned authentication clients includes a resource request module and a resource caching module. The resource request module sends resource request requests, and the resource caching module caches authorized resource allocations. The resource caching module includes at least one resource caching unit, and each resource caching unit corresponds to a service identifier of at least one service. Specifically, the correspondence between the aforementioned at least one resource caching unit and the service identifier of at least one service can be represented as "service identifier + resource caching unit".

[0182] The information transmission process of the above modules includes resource allocation and data consistency verification processes:

[0183] The resource allocation process uses the authentication client 802 as an example:

[0184] 1. The resource request module of the authentication client 802 generates a resource request corresponding to the target service based on the resource allocation amount, the identification information of the authentication client 802 and the service identifier of the target service, and sends the resource request to the resource allocation module of the authentication server 801.

[0185] 2. The resource allocation module of the authentication server 801 reads the authorization mapping information in the authorization mapping module. Based on the authorization mapping information, it determines whether there is a license file on the local machine that corresponds to the identification information of the authentication client 802. If there is a license file on the local machine that corresponds to the identification information of the authentication client 802, it determines that the authentication client 802 has passed the verification.

[0186] 3. The resource allocation module of the authentication server 801 reads the remaining resource quantity corresponding to the target service from the remaining resource management module according to the service identifier of the target service. If the remaining resource quantity corresponding to the target service is higher than or equal to the resource allocation quantity, it sends the resource authorization information corresponding to the resource allocation quantity to the resource application module of the authentication client 802.

[0187] 4. The resource application module of the authentication client 802 determines the resource allocation amount as the allocated resource amount based on the resource authorization information, unlocks the resource cache unit corresponding to the service identifier of the target service, and caches the allocated resource amount in the resource cache unit.

[0188] In this embodiment, the authentication client 802 can use a locking mechanism to lock and unlock the resource cache unit corresponding to the service identifier of each service. Specifically, the locking mechanism may include, but is not limited to, read-write locks, pessimistic locks, and exclusive locks.

[0189] It is understandable that by locking and unlocking each resource cache unit at the smallest granularity, the probability of losing allocated resources can be greatly reduced, thereby improving the data consistency of the target service.

[0190] 5. The authentication client 802 requests the target service based on the amount of resources allocated in the resource cache unit.

[0191] The data consistency verification process for the target service is as follows:

[0192] 1. The authentication client is offline (heartbeat connection is broken) within the preset period and cannot request the target service based on the allocated resources.

[0193] 2. After the authentication client 802 and the authentication server 801 re-establish the heartbeat connection, the authentication server 801 sends invalid resource reclamation information to the authentication client 802 to proactively reclaim the resource allocation (invalid resource quantity) of the target service that the authentication client 802 could not request. Furthermore, on the authentication server 802 side, the allocation mapping module sends the invalid resource quantity of the target service to the remaining resource management module to update the total resource consumption and remaining resource quantity of the target service after reclamation of the resource allocation quantity.

[0194] 3. The data consistency verification module reads the expiration time from the license file from the authorization mapping module and determines whether the invalid resource quantity has expired based on the expiration time.

[0195] 4. In the case of expired invalid resources, the data consistency verification module reads the available resources in the cluster corresponding to the target service from the authorization mapping module, reads the remaining resources of the target service from the remaining resource management module, and reads the total resource consumption of the target service from the allocation mapping module. It then determines whether the sum of the total resource consumption of the target service and the remaining resources of the target service is equal to the available resources in the cluster corresponding to the target service.

[0196] 5. In the event of inequality, the data consistency verification module updates the remaining resources of the target service based on the difference between the available resources of the target service in the cluster and the total resource consumption of the target service.

[0197] The resource allocation system provided in this application embodiment can realize resource allocation for target services and data consistency verification for target services, thereby improving the accuracy and rigor of resource allocation for target services.

[0198] like Figure 9 The diagram shown illustrates an application scenario of the resource allocation method provided in this embodiment. (Refer to...) Figure 9 The physical machine is configured with the product client, and the authentication client is integrated into the product client. The server is configured with the authentication server. To demonstrate the information interaction between the product client and the authentication client, the product client and the client are shown independently in the diagram.

[0199] Specifically, the product side generates a resource authentication request based on user-triggered product usage actions and sends it to the authentication client. The authentication client, based on the resource authentication request, sends a resource request to the authentication server according to a preset period. The authentication server authenticates the authentication client based on the resource request; if authentication is successful, it authorizes the resource allocation carried in the resource request and sends the corresponding resource allocation information to the authentication client. The authentication client generates resource authentication return information based on the resource allocation information, enabling the product side to unlock multiple functional interfaces. With multiple functional interfaces unlocked, the authentication client can request the target service based on the requested (authorized) resource allocation.

[0200] Furthermore, if the physical machine crashes within a preset period, causing the authentication client to be unable to request the target service based on the resource allocation authorized by the authentication server, the requested resource allocation will be invalid. After the physical machine restarts and establishes a heartbeat connection with the authentication server, the authentication server can proactively send invalid resource reclamation information to the authentication client to actively reclaim invalid resources, and update the total resource consumption and remaining available resources of the target service stored locally on the authentication server.

[0201] In this embodiment, the authentication server actively reclaims invalid resources, which can provide accuracy and rationality in resource allocation and improve the user experience on the product side.

[0202] This application receives resource request requests from clients via a server. Based on authorization mapping information and the client's target identifier information, it authenticates the client, significantly simplifying the authentication process. Furthermore, it greatly reduces client maintenance costs and improves efficiency, especially in scenarios where the physical fingerprint information of the client's physical machine changes or the cluster expands or shrinks. This adaptable to diverse application scenarios. The server authorizes the resource allocation requested by the client based on the remaining resources corresponding to the target service and the first resource allocation amount, facilitating server-side management of resource allocation for the target service and improving its rationality and efficiency. Moreover, clients can request resource allocations for the target service from the server using different request strategies, adapting to various application needs. Finally, the server verifies the data consistency of the target service based on the available resources, total resource consumption, and remaining resources in the cluster, improving the accuracy and rigor of resource allocation for the target service.

[0203] This application also provides a resource allocation method, applied to a server, such as... Figure 10 As shown, the above method includes:

[0204] S1001: Receive a first resource request sent by the client corresponding to the target service. The first resource request includes the target identification information and the first resource allocation amount corresponding to the client.

[0205] S1003: Authentication of the client is performed based on the authorization mapping information and the target identification information; wherein, the authorization mapping information represents the mapping relationship between at least one identification information and the corresponding license file; wherein, the at least one identification information includes the target identification information.

[0206] In an optional embodiment, authenticating the client based on the authorization mapping information and the target identification information includes:

[0207] Based on the authorization mapping information, determine whether a license file corresponding to the target identifier information exists locally;

[0208] If a license file corresponding to the target identification information exists locally, the client authentication is deemed successful.

[0209] S1005: If the client authentication is successful, based on the remaining resource quantity corresponding to the target service and the first resource allocation quantity, send the first resource allocation information corresponding to the first resource allocation quantity to the client.

[0210] In an optional embodiment, sending the first resource allocation information corresponding to the first resource allocation amount to the client based on the remaining resource amount corresponding to the target service and the first resource allocation amount includes:

[0211] Obtain the amount of available resources in the cluster corresponding to the target service within a preset period;

[0212] Obtain the total resource consumption of the cluster to which the client belongs within a preset period;

[0213] The remaining resource quantity is determined based on the available resource quantity in the cluster and the total resource consumption.

[0214] If the remaining resource quantity is greater than or equal to the first resource allocation quantity, the first resource allocation information corresponding to the first resource allocation quantity is sent to the client.

[0215] This application receives resource request requests from clients via a server and authenticates the client based on authorization mapping information and the client's target identifier information. This greatly simplifies the client authentication process and significantly reduces client operation and maintenance costs and improves efficiency, especially in scenarios where the physical fingerprint information of the client's physical machine changes or the client's cluster expands or shrinks. It is adaptable to a wide range of application scenarios. Furthermore, by authorizing the resource allocation requested by the client based on the remaining resources corresponding to the target service and the first resource allocation amount, the server can manage the resource allocation for the target service, improving the rationality and efficiency of resource allocation for the target service.

[0216] This application also provides a resource allocation method, applied to a client, such as... Figure 11 As shown, the above method includes:

[0217] S1101: Send a first resource request corresponding to the target service to the server. The first resource request includes target identification information and a first resource allocation amount corresponding to the client, so that the server can authenticate the client based on the authorization mapping information and the target identification information. The authorization mapping information represents the mapping relationship between at least one identification information and the corresponding license file. The at least one identification information includes the target identification information.

[0218] S1103: Receive first resource allocation information corresponding to the first resource allocation amount sent by the server based on the remaining resource amount corresponding to the target service and the first resource allocation amount when the client authentication is successful.

[0219] In an optional embodiment, the method further includes:

[0220] Request the target service based on the first resource allocation.

[0221] In an optional embodiment, the method further includes:

[0222] Monitor the resource consumption of the requested target service;

[0223] When the resource consumption of the target service meets the preset conditions or the preset period ends, a second resource request corresponding to the target service is sent to the server. The second resource request includes the target identification information and the second resource allocation amount.

[0224] In an optional embodiment, the method further includes:

[0225] If the resource consumption is detected to have reached the first resource allocation amount, it is determined that the resource consumption meets the preset condition.

[0226] In an optional embodiment, the method further includes:

[0227] The remaining available resources are determined based on the resource consumption and the first resource allocation.

[0228] Determine whether the remaining available resources are lower than a first preset threshold;

[0229] If the remaining available resources are lower than the first preset threshold, it is determined that the resource consumption meets the preset condition.

[0230] In an optional embodiment, before sending the second resource request corresponding to the target service to the server, the method further includes:

[0231] The first resource allocation amount is used as the second resource allocation amount.

[0232] In an optional embodiment, before sending the second resource request corresponding to the target service to the server, the method further includes:

[0233] If the resource consumption of the requested target service meets the preset conditions, it is determined whether the first resource allocation is lower than the second preset threshold.

[0234] If the first resource allocation amount is lower than the second preset threshold, a preset multiple of the first resource allocation amount is determined as the second resource allocation amount, and the second resource allocation amount is less than or equal to the second preset threshold.

[0235] If the first resource allocation amount is equal to the second preset threshold, the first resource allocation amount is used as the second resource allocation amount.

[0236] In an optional embodiment, before sending the second resource request corresponding to the target service to the server, the method further includes:

[0237] At the end of the preset period, it is determined whether the first resource allocation amount is lower than the second preset threshold.

[0238] If the first resource allocation amount is equal to the second preset threshold, the first preset resource allocation amount shall be used as the second resource allocation amount;

[0239] If the first resource allocation amount is lower than the second preset threshold, the second preset resource allocation amount is used as the second resource allocation amount; wherein, the first preset resource allocation amount is lower than the second preset resource allocation amount, and the second resource allocation amount is lower than the second preset threshold.

[0240] In this embodiment, the client can adaptively adjust the amount of resource allocation requested from the server based on the resource consumption requirements of the target service, making it applicable to a wide range of application scenarios. Finally, the server can verify the data consistency of the target service based on the total resource consumption of local storage, the available resources in the cluster, and the remaining resources, thereby improving the accuracy of resource allocation for the target service.

[0241] This application also provides a resource allocation device for use in a resource allocation system, such as... Figure 12 As shown, the resource allocation system described above includes at least one client and one server. Specifically, the device includes:

[0242] The first sending module 1201 is used for the client to send a first resource request corresponding to the target service to the server. The first resource request includes the target identification information and the first resource allocation amount corresponding to the client.

[0243] The authentication module 1203 is used by the server to authenticate the client based on the authorization mapping information and the target identification information; wherein the authorization mapping information represents the mapping relationship between at least one identification information and the corresponding license file; wherein the at least one identification information includes the target identification information;

[0244] The second sending module 1205 is used to send first resource allocation information corresponding to the first resource allocation amount to the client based on the remaining resource amount corresponding to the target service and the first resource allocation amount when the client authentication is successful.

[0245] In an optional embodiment, the authentication module 1203 includes:

[0246] The first determining unit is used by the server to determine whether a license file corresponding to the target identifier information exists locally based on the authorization mapping information;

[0247] The second determining unit is used to determine that the client authentication is successful if a license file corresponding to the target identification information exists locally.

[0248] In an optional embodiment, the second transmitting module 1205 includes:

[0249] The first acquisition unit is used by the server to acquire the amount of available resources in the cluster corresponding to the target service within a preset period;

[0250] The second acquisition unit is used by the server to acquire the total resource consumption of the cluster to which the client belongs within a preset period.

[0251] A determining unit is used by the server to determine the remaining resource quantity based on the available resource quantity in the cluster and the total resource consumption;

[0252] The sending unit is configured to, when the remaining resource quantity is greater than or equal to the first resource allocation quantity, send the first resource allocation information corresponding to the first resource allocation quantity to the client.

[0253] In an optional embodiment, the apparatus further includes:

[0254] The request module is used by the client to request the target service based on the first resource allocation amount;

[0255] The third sending module is used to send a second resource request corresponding to the target service to the server when the resource consumption of the target service requested by the client meets the preset conditions or the preset period ends. The second resource request includes the target identification information and the second resource allocation amount.

[0256] In an optional embodiment, the third sending module includes:

[0257] The sending unit is configured to, when the resource consumption reaches the first resource allocation amount or the preset period ends, have the client use the first resource allocation amount as the second resource allocation amount and send a second resource request corresponding to the target service to the server according to the second resource allocation amount.

[0258] In an optional embodiment, the transmitting unit includes:

[0259] The first determining subunit is used by the client to determine the remaining available resources based on the resource consumption and the first resource allocation.

[0260] The first judgment subunit is used by the client to determine whether the remaining available resources are lower than a first preset threshold.

[0261] The second judgment subunit is used to determine whether the first resource allocation amount is lower than the second preset threshold when the remaining available resources amount is lower than the first preset threshold.

[0262] The second determining subunit is used to determine, when the first resource allocation amount is lower than the second preset threshold, a preset multiple of the first resource allocation amount as the second resource allocation amount by the client;

[0263] The third determining subunit is used to determine that, when the first resource allocation amount is equal to the second preset threshold, the client uses the first resource allocation amount as the second resource allocation amount.

[0264] In an optional embodiment, the transmitting unit further includes:

[0265] The third judgment subunit is used to determine whether the first resource allocation amount is lower than the second preset threshold when the remaining available resource amount is higher than or equal to the first preset threshold.

[0266] The fourth determining subunit is used to determine that when the first resource allocation amount is lower than the second preset threshold, the client uses the first resource allocation amount as the second resource allocation amount.

[0267] The fifth determining subunit is used to determine that, when the first resource allocation amount is equal to the second preset threshold, the client uses the preset resource allocation amount as the second resource allocation amount.

[0268] The apparatus in the described device embodiments and the corresponding method embodiments are based on the same inventive concept.

[0269] This application also provides a resource allocation device applied to a server; specifically, as shown in the embodiments below. Figure 13 As shown, the above-mentioned device includes:

[0270] The receiving module 1301 is used to receive a first resource request corresponding to a target service sent by a client. The first resource request includes target identification information and a first resource allocation amount corresponding to the client.

[0271] The authentication module 1303 is used to authenticate the client based on the authorization mapping information and the target identification information; wherein the authorization mapping information represents the mapping relationship between at least one identification information and the corresponding license file; wherein the at least one identification information includes the target identification information;

[0272] The sending module 1305 is configured to send first resource allocation information corresponding to the first resource allocation amount to the client based on the remaining resource amount corresponding to the target service and the first resource allocation amount when the client authentication is successful.

[0273] In an optional embodiment, the authentication module 1303 includes:

[0274] The first determining unit is configured to determine, based on the authorization mapping information, whether a license file corresponding to the target identifier information exists locally;

[0275] The second determining unit is used to determine that the client authentication is successful if a license file corresponding to the target identification information exists locally.

[0276] In an optional embodiment, the sending module 1305 includes:

[0277] The first acquisition unit is used to acquire the amount of available resources in the cluster corresponding to the target service within a preset period;

[0278] The second acquisition unit is used to acquire the total resource consumption of the cluster to which the client belongs within a preset period.

[0279] A determining unit is configured to determine the remaining resource quantity based on the available resource quantity in the cluster and the total resource consumption;

[0280] The sending unit is configured to send first resource allocation information corresponding to the first resource allocation amount to the client when the remaining resource amount is greater than or equal to the first resource allocation amount.

[0281] The apparatus in the described device embodiments and the corresponding method embodiments are based on the same inventive concept.

[0282] This application also provides a resource allocation device, applied to a client, such as... Figure 14 As shown, the above-mentioned device includes:

[0283] The first sending module 1401 is configured to send a first resource request corresponding to a target service to the server. The first resource request includes target identification information and a first resource allocation amount corresponding to the client, so that the server can authenticate the client based on the authorization mapping information and the target identification information. The authorization mapping information represents the mapping relationship between at least one identification information and a corresponding license file. The at least one identification information includes the target identification information.

[0284] The receiving module 1403 is used to receive the first resource allocation information corresponding to the first resource allocation amount sent by the server based on the remaining resource amount corresponding to the target service and the first resource allocation amount when the client authentication is successful.

[0285] In an optional embodiment, the apparatus further includes:

[0286] The request module is used to request the target service based on the first resource allocation amount.

[0287] In an optional embodiment, the apparatus further includes:

[0288] The monitoring module is used to monitor the resource consumption of requests for the target service;

[0289] When the resource consumption of the target service meets a preset condition or a preset period ends, the second sending module sends a second resource request corresponding to the target service to the server. The second resource request includes the target identification information and the second resource allocation amount.

[0290] In an optional embodiment, the apparatus further includes:

[0291] The first determining module is used to determine that the resource consumption meets the preset condition when the resource consumption is detected to reach the first resource allocation amount.

[0292] In an optional embodiment, the apparatus further includes:

[0293] The second determining module is used to determine the remaining available resources based on the resource consumption and the first resource allocation.

[0294] The first judgment module is used to determine whether the remaining available resources are lower than a first preset threshold.

[0295] The third determining module is used to determine that the resource consumption meets the preset condition when the remaining available resources are lower than the first preset threshold.

[0296] In an optional embodiment, the apparatus further includes:

[0297] The fourth determining module is used to take the first resource allocation amount as the second resource allocation amount.

[0298] In an optional embodiment, the apparatus further includes:

[0299] The second judgment module is used to determine whether the first resource allocation amount is lower than the second preset threshold when the resource consumption of the requested target service meets the preset conditions.

[0300] The fifth determining module is used to determine a preset multiple of the first resource allocation as the second resource allocation when the first resource allocation is lower than the second preset threshold, wherein the second resource allocation is less than or equal to the second preset threshold.

[0301] The sixth determining module is used to take the first resource allocation amount as the second resource allocation amount when the first resource allocation amount is equal to the second preset threshold.

[0302] In an optional embodiment, the apparatus further includes:

[0303] The third judgment module is used to determine whether the first resource allocation amount is lower than the second preset threshold at the end of the preset period;

[0304] The seventh determining module is used to take the first preset resource allocation amount as the second resource allocation amount when the first resource allocation amount is equal to the second preset threshold.

[0305] The eighth determining module is used to determine the second preset resource allocation amount as the second resource allocation amount when the first resource allocation amount is lower than the second preset threshold; wherein the first preset resource allocation amount is lower than the second preset resource allocation amount, and the second resource allocation amount is lower than the second preset threshold.

[0306] The apparatus in the device embodiment and the corresponding method embodiment are based on the same inventive concept.

[0307] This application also provides a resource allocation device, the device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the resource allocation method as described in the above method embodiments.

[0308] The devices and methods described in the device embodiments are based on the same inventive concept.

[0309] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored in the storage medium, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the resource allocation method as described in the above method embodiments.

[0310] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described above.

[0311] This application provides a resource allocation server, which includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the resource allocation method provided in the above method embodiments.

[0312] Memory can be used to store software programs and modules. The processor executes various functional applications and allocates resources by running the software programs and modules stored in the memory. Memory can primarily include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for functions, etc.; the data storage area can store data created based on the use of the device, etc. Furthermore, memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory can also include a memory controller to provide the processor with access to the memory.

[0313] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, servers, or similar computing devices. Taking running on a server as an example, Figure 15 This is a hardware structure block diagram of a server for a resource allocation method provided in an embodiment of this application. For example... Figure 15As shown, the server 1500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1510 (CPUs 1510 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 1530 for storing data, and one or more storage media 1520 (e.g., one or more mass storage devices) for storing application programs 1523 or data 1522. The memory 1530 and storage media 1520 may be temporary or persistent storage. The program stored in the storage media 1520 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 1510 may be configured to communicate with the storage media 1520 and execute the series of instruction operations in the storage media 1520 on the server 1500. Server 1500 may also include one or more power supplies 1560, one or more wired or wireless network interfaces 1550, one or more input / output interfaces 1540, and / or one or more operating systems 1521, such as Windows Server™, Mac OSX™, Unix™, Linux™, FreeBSD™, etc.

[0314] The input / output interface 1540 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 1500. In one example, the input / output interface 1540 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 1540 may be a radio frequency (RF) module for wireless communication with the Internet.

[0315] Those skilled in the art will understand that Figure 15 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 1500 may also include... Figure 15 The more or fewer components shown, or having the same Figure 15 The different configurations shown.

[0316] The embodiments of this application also provide a storage medium, which can be disposed in a server to store at least one instruction, at least one program, code set or instruction set related to implementing a resource allocation method in the method embodiments. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the resource allocation method provided in the above method embodiments.

[0317] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0318] As can be seen from the embodiments of the resource allocation method, apparatus, server, or storage medium provided in this application, the client authentication process is greatly simplified by authenticating the client based on authorization mapping information and the client's target identifier information. Furthermore, in scenarios where the physical fingerprint information of the client's physical machine changes, or when the client's cluster is expanded or scaled down, the client's operation and maintenance costs are significantly reduced, and the client's operation and maintenance efficiency is improved, making it adaptable to a wide range of application scenarios. In addition, by authorizing the resource allocation requested by the client based on the remaining resources corresponding to the target service and the first resource allocation amount, the server can manage the resource allocation of the target service, improving the rationality and efficiency of the resource allocation for the target service.

[0319] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0320] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0321] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0322] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A resource allocation method, characterized in that, Applied to a server; the method includes: The system receives a first resource request sent by a client, corresponding to a target service. The first resource request includes target identification information and a first resource allocation amount corresponding to the client. The client is a node in the blockchain system. The target service is any type of private service. The client is authenticated based on the authorization mapping information and the target identification information; wherein the authorization mapping information represents the mapping relationship between at least one identification information and the corresponding license file; wherein the at least one identification information includes the target identification information; the license file is stored locally on the server; If the client authentication is successful, the server sends first resource allocation information corresponding to the first resource allocation amount to the client based on the remaining resource amount corresponding to the target service and the first resource allocation amount; the remaining resource amount corresponding to the target service is the amount of resources that the server has not allocated to the target service of the client's cluster within a preset period. Upon receiving a second resource request corresponding to the target service sent by the client, resource allocation information corresponding to the second resource allocation amount is sent to the client; the second resource request includes the target identification information and the second resource allocation amount; the second resource request is a request sent by the client when it detects that the resource consumption of the target service meets a preset condition or when a preset period ends.

2. The method according to claim 1, characterized in that, The authentication of the client based on the authorization mapping information and the target identifier information includes: Based on the authorization mapping information, determine whether a license file corresponding to the target identifier information exists locally; If a license file corresponding to the target identification information exists locally, the client authentication is deemed successful.

3. The method according to claim 1, characterized in that, The step of sending the first resource allocation information corresponding to the first resource allocation amount to the client based on the remaining resource amount corresponding to the target service and the first resource allocation amount includes: Obtain the amount of available resources in the cluster corresponding to the target service within a preset period; Obtain the total resource consumption of the cluster to which the client belongs within a preset period; The remaining resource quantity is determined based on the available resource quantity in the cluster and the total resource consumption. If the remaining resource quantity is greater than or equal to the first resource allocation quantity, the first resource allocation information corresponding to the first resource allocation quantity is sent to the client.

4. A resource allocation method, characterized in that, The method includes: A first resource request corresponding to the target service is sent to the server. The first resource request includes target identification information corresponding to the client and a first resource allocation amount, so that the server can authenticate the client based on the authorization mapping information and the target identification information. The authorization mapping information represents the mapping relationship between at least one identification information and a corresponding license file. The at least one identification information includes the target identification information. The client is a node in the blockchain system. The target service is any kind of private service. The server locally stores the license file. The server receives first resource allocation information corresponding to the first resource allocation amount, which is sent by the server based on the remaining resource amount corresponding to the target service and the first resource allocation amount, after the client's authentication is successful; the remaining resource amount corresponding to the target service is the amount of resources that the server has not allocated to the target service of the client's cluster within a preset period. Monitor the resource consumption of the requested target service; When the resource consumption of the target service meets the preset conditions or the preset period ends, a second resource request corresponding to the target service is sent to the server. The second resource request includes the target identification information and the second resource allocation amount.

5. The method according to claim 4, characterized in that, The method further includes: Request the target service based on the first resource allocation.

6. The method according to claim 5, characterized in that, The method further includes: If the resource consumption is detected to have reached the first resource allocation amount, it is determined that the resource consumption meets the preset condition.

7. The method according to claim 5, characterized in that, The method further includes: The remaining available resources are determined based on the resource consumption and the first resource allocation. Determine whether the remaining available resources are lower than a first preset threshold; If the remaining available resources are lower than the first preset threshold, it is determined that the resource consumption meets the preset condition.

8. A resource allocation device, characterized in that, Applied to a server; the device includes: The receiving module is used to receive a first resource request request sent by a client for a target service. The first resource request request includes target identification information and a first resource allocation amount corresponding to the client. The client is a node in the blockchain system. The target service is any kind of private service. An authentication module is used to authenticate the client based on authorization mapping information and the target identification information; wherein the authorization mapping information represents the mapping relationship between at least one identification information and the corresponding license file; wherein the at least one identification information includes the target identification information; and the license file is stored locally on the server. The sending module is configured to, upon successful client authentication, send first resource allocation information corresponding to the first resource allocation amount to the client based on the remaining resource amount corresponding to the target service and the first resource allocation amount; the remaining resource amount corresponding to the target service is the amount of resources that the server has not allocated to the target service within a preset period for the cluster to which the client belongs. Upon receiving a second resource request corresponding to the target service sent by the client, resource allocation information corresponding to the second resource allocation amount is sent to the client; the second resource request includes the target identification information and the second resource allocation amount; the second resource request is a request sent by the client when it detects that the resource consumption of the target service meets a preset condition or when a preset period ends.

9. A resource allocation device, characterized in that, The device includes: A first sending module is configured to send a first resource request corresponding to a target service to a server. The first resource request includes target identification information and a first resource allocation amount corresponding to the client, so that the server can authenticate the client based on authorization mapping information and the target identification information. The authorization mapping information represents a mapping relationship between at least one identification information and a corresponding license file. The at least one identification information includes the target identification information. The client is a node in a blockchain system. The target service is any private service. The server locally stores the license file. The receiving module is configured to receive, upon successful client authentication, first resource allocation information corresponding to the first resource allocation amount sent by the server based on the remaining resource amount corresponding to the target service and the first resource allocation amount; the remaining resource amount corresponding to the target service is the amount of resources that the server has not allocated to the target service within a preset period for the cluster to which the client belongs. The request module is used to request the target service based on the first resource allocation amount; The monitoring module is used to monitor the resource consumption of requests for the target service; When the resource consumption of the target service meets a preset condition or a preset period ends, the second sending module sends a second resource request corresponding to the target service to the server. The second resource request includes the target identification information and the second resource allocation amount.

Citation Information

Patent Citations

  • Method, device and system for sharing server resources

    CN110008019A

  • Software security management method and device, terminal and server

    CN111079091A

  • Resource allocation method and device, medium and electronic device

    CN112686533A