Method and apparatus for allocating resources, program product, storage medium

CN122988136APending Publication Date: 2026-10-27中国建设银行股份有限公司湖北省分行
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611070041.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0005]本申请实施例提供了一种资源的分配方法和装置、程序产品、存储介质,以至少解决相关技术中使用资源分配方式进行资源分配时出现的资源错分的问题

Benefits of technology

[0009]根据本申请实施例的又一个方面,提供一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述任一项方法实施例中的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122988136A_ABST
    Figure CN122988136A_ABST
Patent Text Reader

Abstract

The application discloses a resource allocation method and device, a program product and a storage medium, wherein the method comprises the following steps: in the case that a target instruction is received, the target instruction is analyzed to obtain a first allocation mode indicated by the target instruction; an initial knowledge graph is updated based on the first allocation mode to obtain a first knowledge graph; whether a target allocation mode exists in the first knowledge graph is determined based on a first node and a first edge included in the first knowledge graph; in the case that the target allocation mode does not exist, target resources are allocated according to each allocation mode included in the first knowledge graph to determine a target allocation mode of the target resources and a target allocation proportion of the target resources allocated to each target allocation mode. Through the application, the problem of resource misallocation when resources are allocated by using an allocation mode in the related art is solved, and the effects of avoiding resource misallocation and ensuring the accuracy and consistency of resource allocation are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically, to a resource allocation method and apparatus, a program product, and a storage medium. Background Technology

[0002] Resource allocation methods are widely used in fields such as financial payment and settlement, cloud computing resource scheduling, and logistics and warehousing management. Their core lies in accurately distributing resources (such as funds, computing power, goods, or service capabilities) to various target recipients according to specific rules. In existing resource allocation technical solutions, the system typically pre-configures a set of fixed allocation rules and, upon receiving an allocation instruction, matches these static rules one by one to calculate the allocation result.

[0003] However, when faced with complex multi-level and multi-participant allocation scenarios, the resource allocation methods in related technologies may result in resource misallocation.

[0004] There is currently no effective solution to the above problems in the relevant technologies. Summary of the Invention

[0005] This application provides a resource allocation method and apparatus, a program product, and a storage medium to at least solve the problem of resource misallocation that occurs when resource allocation is performed using resource allocation methods in related technologies.

[0006] According to one aspect of the embodiments of this application, a resource allocation method is provided, comprising: upon receiving a target instruction, parsing the target instruction to obtain a first allocation method indicated by the target instruction, wherein the first allocation method is used to determine resource allocators and allocation ratios for allocating resources to each of the allocators; updating an initial knowledge graph based on the first allocation method to obtain a first knowledge graph, wherein the initial knowledge graph is constructed based on historical allocation methods, and the initial knowledge graph includes initial nodes and initial edges, wherein the initial nodes are used to represent allocators included in the historical allocation methods and the allocated resources. Initial edges are used to connect the aforementioned initial nodes that have a relationship; based on the first nodes and first edges included in the aforementioned first knowledge graph, it is determined whether there is a target allocation method in the aforementioned first knowledge graph, wherein the aforementioned target allocation method includes at least one of the following: an allocation method that does not match a preset allocation method, an allocation method that conflicts with a second allocation method included in the aforementioned first knowledge graph; if there is no aforementioned target allocation method, the target resources are allocated according to each allocation method included in the aforementioned first knowledge graph, so as to determine the target allocator of the aforementioned target resources and the target allocation ratio of allocating the aforementioned target resources to each of the aforementioned target allocators.

[0007] According to another aspect of the embodiments of this application, a resource allocation apparatus is also provided, comprising: a parsing module, configured to parse a target instruction upon receiving a target instruction to obtain a first allocation method indicated by the target instruction, wherein the first allocation method is used to determine resource allocators and allocation ratios for allocating resources to each of the allocators; and an updating module, configured to update an initial knowledge graph based on the first allocation method to obtain a first knowledge graph, wherein the initial knowledge graph is constructed based on historical allocation methods, and the initial knowledge graph includes initial nodes and initial edges, wherein the initial nodes represent allocators included in the historical allocation methods and the allocated resources. The initial edge is used to connect the initial nodes that have a relationship; the determining module is used to determine whether there is a target allocation method in the first knowledge graph based on the first node and the first edge included in the first knowledge graph, wherein the target allocation method includes at least one of the following: an allocation method that does not match a preset allocation method, or an allocation method that conflicts with a second allocation method included in the first knowledge graph; the allocation module is used to allocate the target resources according to each allocation method included in the first knowledge graph when there is no target allocation method, so as to determine the target allocator of the target resources and the target allocation ratio of allocating the target resources to each of the target allocators.

[0008] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed by a processor.

[0009] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including 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 the processor executes the computer instructions, causing the computer device to perform the steps in any of the method embodiments described above.

[0010] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to perform the steps of any of the above method embodiments through the computer program.

[0011] This application first transforms the resource allocation instruction to be executed (i.e., the target instruction) into nodes and edges in a knowledge graph and updates them in real time. Then, utilizing the semantic relationships and logical structures inherent in the nodes and edges of the first knowledge graph, deep reasoning and consistency checks are performed on the various allocation methods included in the first knowledge graph before actual resource allocation. This detects allocation methods that do not match the preset allocation methods and conflicting target resource allocation methods. Therefore, the correctness of the resource allocation method can be determined before its formal use, and the formal resource allocation operation is only executed when the target allocation method does not exist. This solves the problem of resource misallocation that occurs when using resource allocation methods in related technologies, achieving the effect of avoiding resource misallocation and ensuring the accuracy and consistency of resource allocation. Attached Figure Description

[0012] Figure 1 This is a schematic diagram illustrating an application scenario of a resource allocation method according to an embodiment of this application;

[0013] Figure 2 This is a flowchart illustrating a resource allocation method according to an embodiment of this application;

[0014] Figure 3 This is a schematic diagram of the structure of a resource allocation system according to an embodiment of this application;

[0015] Figure 4 This is a flowchart illustrating a method for allocating target resources according to an embodiment of this application;

[0016] Figure 5 This is a structural block diagram of a resource allocation device according to an embodiment of this application;

[0017] Figure 6 This is a computer system architecture block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0018] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application. Furthermore, in the absence of conflict, the various embodiments and features in the embodiments of the present application can be arbitrarily combined with each other in principle.

[0019] 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 apparatus 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 apparatus.

[0020] According to one aspect of the embodiments of this application, a resource allocation method is provided. Optionally, in this embodiment, the above-described resource allocation method may be applied to, but is not limited to, methods such as... Figure 1 The hardware environment shown includes terminal device 102 and server 104. Server 104 can be connected to terminal device 102 via a network and can be used to provide services (e.g., application services, etc.) to terminal device 102 or clients installed on terminal device 102. A database can be set up on server 104 or independently of server 104 to provide data storage services for server 104.

[0021] The aforementioned network may include, but is not limited to, at least one of the following: wired network and wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network (WAN), metropolitan area network (MAN), and local area network (LAN). The aforementioned wireless network may include, but is not limited to, at least one of the following: Wireless Fidelity (WIFI) and Bluetooth. Terminal device 102 may be, but is not limited to, a personal computer (PC), mobile phone, tablet computer, etc. Server 104 may be, but is not limited to, a cloud server, server cluster, or other server types.

[0022] The resource allocation method of this application embodiment can be executed by server 104, terminal device 102, or jointly by server 104 and terminal device 102. Alternatively, the resource allocation method of this application embodiment can be executed by a client installed on terminal device 102.

[0023] Taking the resource allocation method in this embodiment executed by terminal device 102 as an example, Figure 2 This is a flowchart illustrating a resource allocation method according to an embodiment of this application, such as... Figure 2 As shown, the process of this method may include the following steps:

[0024] Step S202: Upon receiving a target instruction, the target instruction is parsed to obtain a first allocation method indicated by the target instruction, wherein the first allocation method is used to determine the allocator of resources and the allocation ratio of resources to each of the allocators.

[0025] Optionally, the resource allocation method provided in this embodiment can be widely applied to fields such as financial payment clearing, cloud computing resource scheduling, logistics supply chain management, and automated operation and maintenance of information technology (IT) services. For example, in the scenario of multi-level clearing of non-tax revenue, the method provided in this embodiment can be used to automatically verify whether the allocation ratio of fiscal subsidy funds among the finance bureau, agents, service providers, and merchants complies with preset policies and historical compliance logic, preventing misallocation of funds; in the scenario of cloud host resource scheduling, the method provided in this embodiment can be used to ensure that when computing resources (such as graphics processing unit (GPU) / central processing unit (CPU) instances) are allocated to tenants, they do not conflict with existing resource quota policies or business priorities, avoiding overselling or resource idleness; in the scenario of logistics order splitting, the method provided in this embodiment can be used to determine whether the allocation of packages to specific warehouses or transportation routes complies with regional coverage rules and historical routing habits, thereby improving the accuracy of resource allocation and system consistency.

[0026] Optionally, in this embodiment, the target instruction refers to a control signal or business request that triggers the addition, modification, or update of the allocation method. It is a data carrier that includes the intention to change the resource allocation strategy. When the system receives such an instruction, it means that the user or upstream business system wants to adjust the resource allocation logic. The information carried in the instruction (such as the new list of allocators, the changed allocation ratio, the added constraints, etc.) will be parsed into the first allocation method and used to update the existing initial knowledge graph to reflect the latest resource allocation strategy status. The target instruction includes, but is not limited to, a clearing rule adjustment instruction in a financial payment scenario, a resource quota change request in a cloud computing scenario, or a routing rule update instruction in a logistics scenario.

[0027] Optionally, the first allocation method in this embodiment refers to the specific resource allocation strategy or rule set parsed from the target instruction, which is used to define the logical path of resource flow, including but not limited to the specific list of allocator identities, the weight coefficient of each allocator, the allocation ratio value, the allocation priority order, and the business conditions that trigger the allocation method (such as time window, resource type restrictions, etc.).

[0028] Optionally, the resources in this embodiment refer to objects that need to be transferred, scheduled or consumed, including but not limited to financial assets (such as funds, points), computing resources (such as the number of CPU cores, memory capacity, GPU computing power, storage blocks), physical entities (such as goods packages, raw materials, vehicles), or service resources (such as the number of application programming interface (API) calls, bandwidth traffic, expert work order processing capabilities).

[0029] Optionally, in this embodiment, the allocator refers to the entity participating in the receipt and processing of resources, including the ultimate holder or executor of the resources. The allocator includes, but is not limited to, financial institution accounts, cloud tenant instances, logistics and warehousing nodes, transportation fleets, software processes, user accounts, or third-party service providers.

[0030] Step S204: Update the initial knowledge graph based on the first allocation method to obtain the first knowledge graph. The initial knowledge graph is constructed based on the historical allocation method. The initial knowledge graph includes initial nodes and initial edges. The initial nodes are used to represent the allocators and allocated resources included in the historical allocation method. The initial edges are used to connect the initial nodes that have a relationship.

[0031] Optionally, in this embodiment, the initial knowledge graph refers to a graph constructed based on historical allocation methods, used to represent the resources, allocators, and their allocation relationships involved in resource allocation, as well as the allocation conditions that trigger different allocation methods. The initial knowledge graph stores historical allocation methods to support subsequent conflict detection and consistency verification.

[0032] Optionally, the initial node in this embodiment refers to the semantic unit in the initial knowledge graph used to represent specific elements in the historical allocation scenario. It is the basic data block that constitutes the knowledge graph, including but not limited to entity nodes representing a specific allocator (such as a bank or a cloud region), concept nodes representing a specific resource type (such as special funds or GPU instances), and attribute nodes representing allocation attributes (such as proportion or priority).

[0033] Optionally, in this embodiment, the initial edge refers to the line in the initial knowledge graph used to connect two initial nodes and represent the semantic association or logical relationship between them. It is used to reflect the dependency, flow or constraint in the resource allocation process, including but not limited to the flow edge representing the flow of funds, the management edge representing the hierarchical relationship, the conflict edge representing the mutually exclusive relationship, and the logical edge representing the condition constraint.

[0034] Optionally, in this embodiment, the first knowledge graph refers to the knowledge graph containing the latest allocation logic formed after the first allocation method indicated by the current target instruction is injected into the initial knowledge graph, reflecting the system's complete understanding of the allocation method at the current moment. The first knowledge graph includes, but is not limited to, initial nodes that retain historical semantic relationships and edges that add the relationship between the current allocator and the resource.

[0035] Step S206: Based on the first node and first edge included in the first knowledge graph, determine whether there is a target allocation method in the first knowledge graph, wherein the target allocation method includes at least one of the following: an allocation method that does not match the preset allocation method, or an allocation method that conflicts with the second allocation method included in the first knowledge graph;

[0036] Optionally, in this embodiment, the first node and the first edge refer to the nodes and edges included in the first knowledge graph, which are the specific data structures on which the system performs conflict detection.

[0037] Optionally, the target allocation method in this embodiment refers to the abnormal allocation state or conflict situation that exists in the first knowledge graph and may lead to resource allocation errors or violations. It is the object that the system needs to intercept or alarm, including but not limited to mismatched methods that violate preset compliance policies (such as exceeding the ratio limit or violating the flow direction), or conflict methods that contradict the historical stable allocation logic (second allocation method) (such as resource competition or logical conflict).

[0038] Optionally, the preset allocation method in this embodiment refers to the resource allocation compliance requirements, business specifications, or constraints predefined by the system, used to measure the legality of the current allocation method, including but not limited to restrictions on fund flows stipulated by laws and regulations, internal risk control thresholds of enterprises, maximum quota restrictions on resource use, and industry-standard best practice rules.

[0039] Optionally, the second allocation method in this embodiment refers to a resource allocation method that exists in the first knowledge graph and represents historical validity or long-term stability, used to compare with the current allocation method to discover potential conflicts.

[0040] Step S208: In the absence of the above-mentioned target allocation method, the target resources are allocated according to the various allocation methods included in the first knowledge graph to determine the target allocator of the target resources and the target allocation ratio of allocating the target resources to each of the above-mentioned target allocators.

[0041] Optionally, the target resource in this embodiment refers to a specific resource instance that is currently being allocated. It is the direct object of the allocation action, including but not limited to a transaction amount to be cleared, a computing task to be scheduled, and a batch of goods to be sorted.

[0042] Optionally, in this embodiment, the target allocator refers to the entity that is finally determined to receive the target resource after the conflict detection is confirmed to be correct. It is the final execution result of the resource allocation process, including but not limited to the account confirmed as the payee in the financial scenario, the server confirmed as the resource host in the cloud scenario, and the branch confirmed as the delivery address in the logistics scenario.

[0043] Optionally, the target allocation ratio in this embodiment refers to the specific numerical or weighted allocation result of allocating the target resources to each target allocator. It is the final quantitative indicator of resource allocation, including but not limited to the percentage of funds obtained by each recipient, the number of CPU cores allocated to each tenant, and the percentage of goods allocated to each warehouse.

[0044] Figure 3 This is a schematic diagram of a resource allocation system according to an embodiment of this application. The method provided in the above embodiment can be applied in the financial field. Figure 3 The system shown. For example... Figure 3As shown, the system includes an access layer responsible for interfacing with external systems, providing payment gateways, API interfaces, and data collection and processing functions; a rule engine layer for building and maintaining the knowledge graph, managing and executing rules (i.e., the aforementioned allocation method); a clearing processing layer responsible for the specific execution of multi-level fund clearing; and a support layer providing basic service support. Specifically, the access layer performs standardized access checks on received transaction data, including format compliance checks (checking the completeness and format specifications of necessary fields such as transaction serial number, amount, account number, and timestamp), business logic checks (such as whether the transaction amount is greater than zero and within the upper and lower limits set by the system), and security compliance checks (verifying and preventing tampering of transaction data packets). The rule engine layer can dynamically construct the knowledge graph and reason about conflicts between rules based on the indicator graph. The fund clearing processing layer includes a multi-level clearing engine (supporting unlimited levels of revenue sharing, including platforms, agents, service providers, and merchants), a fund clearing execution module (using the Try-Confirm-Cancel Distributed Transaction Pattern (TCC) to ensure atomicity and supporting automatic retries and manual intervention), and a real-time anomaly monitoring module to monitor anomalies generated during the fund clearing process. The support layer provides basic technical support such as distributed caching (Redis cluster), big data platforms (Hadoop / Spark), and blockchain notarization, and uses national cryptographic algorithms (SM4 / SM2) for data encryption. When actually using the above system to execute resource allocation methods, the system predefines three types of behaviors that trigger initial knowledge graph updates: rule creation events (triggered when a user or system adds an allocation method, used to convert the new rule into a knowledge graph node), rule modification events (triggered when modifying an existing allocation method, used to update the corresponding nodes and relationships in the knowledge graph), and rule deletion events (triggered when deleting an allocation method, used to remove or update graph nodes to prevent execution errors). Upon system startup, the aforementioned event types are automatically registered with the event bus, and corresponding event channels are established. Event interceptors are then deployed in the rule management interface and API interface layer. When a user performs rule creation, modification, or deletion operations, the interceptor captures the operation details in real time, cleans and standardizes the raw event data (unifying field formats and completing default values), and generates a globally unique identifier and precise timestamp for each event, establishing a complete event tracing chain. Processed events are published to a distributed message queue. The system sets differentiated routing strategies based on event type and business priority: rule deletion events are routed to the high-priority queue, rule modification events to the medium-priority queue, and rule creation events to the medium-priority queue, triggering graph injection and relationship establishment for new nodes. The knowledge graph construction service acts as an event consumer, subscribing to events from corresponding topics and processing them in priority order.If it is determined that there is no target allocation method in the newly constructed knowledge graph, the clearing processing layer performs a formal fund clearing operation to realize the allocation of funds as a resource.

[0045] This embodiment first transforms the resource allocation instruction to be executed (i.e., the target instruction) into nodes and edges in a knowledge graph and updates them in real time. Then, utilizing the semantic relationships and logical structures inherent in the nodes and edges of the first knowledge graph, deep reasoning and consistency checks are performed on the various allocation methods included in the first knowledge graph before actual resource allocation. This detects allocation methods that do not match the preset allocation methods and conflicting target resource allocation methods. Therefore, the correctness of the resource allocation method can be determined before its formal use, and the formal resource allocation operation is only executed when the target allocation method does not exist. This solves the problem of resource misallocation that occurs when using resource allocation methods in related technologies, achieving the effect of avoiding resource misallocation and ensuring the accuracy and consistency of resource allocation.

[0046] In an exemplary embodiment, determining whether a target allocation method exists in the first knowledge graph based on the first node and first edge included in the first knowledge graph includes: querying a first conditional subgraph included in the first knowledge graph to determine whether a third allocation method exists in the first knowledge graph, wherein the first conditional subgraph is used to indicate the usage conditions of each allocation method included in the first knowledge graph, and the usage conditions of each of the three allocation methods satisfy a preset relationship with the usage conditions of the first allocation method, wherein the preset relationship includes one of the following: an intersection relationship, a mutual exclusion relationship; and, if it is determined that a third allocation method exists, calculating a first similarity for each of the third allocation methods, wherein the first similarity... Similarity is used to represent the degree of similarity between the usage conditions of the third allocation method and the usage conditions of the first allocation method; the third allocation method with a first similarity greater than a first threshold is determined as the fourth allocation method; based on the first action subgraph included in the first knowledge graph, it is determined whether there is a fifth allocation method among the fourth allocation methods, wherein the first action subgraph is used to indicate the resource type, allocator, and allocation ratio allocated under each allocation method included in the first knowledge graph, and the fifth allocation method allocates the same resource as the first allocation method; based on whether the fifth allocation method and the first allocation method are allowed to be executed simultaneously, it is determined whether there is a target allocation method in the first knowledge graph.

[0047] Optionally, the first condition subgraph in this embodiment refers to a directed graph structure extracted from the first knowledge graph and specifically used to characterize the usage conditions corresponding to each historical allocation method, providing the basis for the use of different resource allocation methods. It is composed of condition attribute nodes (such as transaction type, amount range, time window, and geographical restriction), condition relationship edges (such as parallel, mutually exclusive, and inclusive), and condition value nodes.

[0048] Optionally, the third allocation method in this embodiment is an allocation method included in the first knowledge graph. The system determines whether further action layer conflict detection is needed by identifying potential overlap or conflict between the third and first allocation methods at the condition level.

[0049] Optionally, the preset relationships in this embodiment are used to measure the logical correlation between the usage conditions of the first allocation method and the usage conditions of the historical allocation method (which may be the third allocation method), and to filter out candidate allocation methods that may generate concurrent execution risks. The preset relationships include, but are not limited to, intersection relationships (i.e., the value ranges of two conditions overlap, which may lead to the triggering of two allocation conditions for the same resource at the same time), mutual exclusion relationships (i.e., two conditions cannot be true at the same time, usually used for elimination or confirmation of uniqueness), inclusion relationships (one condition is a subset of another condition), and equivalence relationships. By judging whether the conditions satisfy these preset relationships, the system can quickly locate potential conflict rule pairs that need to be analyzed in depth.

[0050] Optionally, in this embodiment, the first similarity refers to a numerical index that quantifies the similarity between the usage conditions of the current new allocation method and the usage conditions of the candidate historical allocation methods. It is used to evaluate the closeness of the two in the triggering context. The higher the similarity, the more likely the two are to be triggered simultaneously in the same business scenario, thereby increasing the risk of conflict. Its calculation method includes, but is not limited to, text similarity based on edit distance or weighted scoring based on attribute matching degree. When the similarity exceeds the preset first threshold, it indicates that the triggering conditions of the two are highly overlapping, and it is necessary to further check whether their execution actions conflict.

[0051] Optionally, the fourth allocation method in this embodiment refers to the historical allocation method that has been retained after condition similarity screening and has high overlap with the first allocation method in terms of usage conditions or potential concurrency risks, and is used to enter the next step of action layer conflict detection, including but not limited to those old allocation methods that are highly similar to the first allocation method in terms of transaction type, amount range or business scenario.

[0052] Optionally, the first action subgraph in this embodiment refers to a substructure extracted from the first knowledge graph and specifically used to characterize the specific operational behaviors executed after each allocation method is triggered. Its core function is to describe the final flow and disposal results of resources, including but not limited to a subgraph composed of action type nodes (such as fund allocation, status change, resource release), target entity nodes (such as recipient account, target server), resource attribute nodes (such as allocation ratio, specific quantity, resource type) and action constraint edges.

[0053] Optionally, the fifth allocation method in this embodiment refers to a specific historical allocation behavior that exists in the fourth allocation method and targets the same target resource as the first allocation method at the action level. Its determination criterion is whether the operation is performed on the same resource instance or the same resource pool, including but not limited to performing specific allocation actions on the same transaction, the same virtual machine, or the same batch of goods.

[0054] Optionally, the target allocation method in this embodiment is an abnormal allocation state that is ultimately determined to have risks, violations, or logical conflicts, which is an allocation scheme that the system needs to intercept, alarm, or request manual intervention for.

[0055] Optionally, in this embodiment, whether simultaneous execution is allowed refers to determining whether two allocation methods (i.e., the first allocation method and the fifth allocation method) pointing to the same resource can coexist and be executed correctly at the same time or in the same transaction context, based on business logic, resource constraints, or system predefined strategies.

[0056] This embodiment first utilizes conditional subgraphs and preset relationships to quickly locate potentially related historical allocation methods. Then, it precisely filters out the fourth allocation method with high concurrency risk by quantifying similarity. Finally, it verifies resource contention or action mutual exclusion based on action subgraphs. This ensures that only allocation methods with real logical conflicts are intercepted in complex dynamic environments, reduces the time required to determine the target allocation method, and improves the security and execution efficiency of subsequent formal resource allocation.

[0057] In an exemplary embodiment, determining whether the target allocation method exists in the first knowledge graph based on whether simultaneous execution of the fifth allocation method and the first allocation method is allowed includes: if it is determined that the fifth allocation method includes a sixth allocation method that conflicts with the resources allocated under the first allocation method, then the existence of the target allocation method is determined, and the sixth allocation method is determined as the target allocation method. The resource conflict includes at least one of the following: the total amount of resources allocated under the sixth allocation method and the total amount of resources allocated under the first allocation method exceeds a preset total resource threshold; or the total amount of resources allocated under the sixth allocation method and the total amount of resources allocated under the first allocation method exceeds the available resource reserve for the same type of resources. If it is determined that the fifth allocation method includes a seventh allocation method that is mutually exclusive with the action type executed under the first allocation method, then the existence of the target allocation method is determined, and the seventh allocation method is determined as the target allocation method.

[0058] Optionally, the sixth allocation method in this embodiment refers to a historical allocation method that exists in the set of fifth allocation methods and directly competes with or exceeds the first allocation method in terms of resource quantity or amount. The sum of the requests of the first allocation method and the sixth allocation method for the same resource pool or the same resource instance exceeds the security boundary set by the system. This includes, but is not limited to, different proportional allocation rules for the same transaction funds, different tenant allocation requests for the same cloud server instance, or different warehousing allocation schemes for the same batch of logistics goods. When the simultaneous execution of these methods leads to resource over-issuance or overdraft, it constitutes the sixth allocation method.

[0059] Optionally, resource conflict in this embodiment refers to a logical contradiction state in which the total resource demand exceeds the total resource supply or the system's capacity limit due to the simultaneous execution of multiple allocation methods. It is a key basis for determining whether a target allocation method exists, including but not limited to allocation ratios at the financial level exceeding 100%, total CPU / memory demand at the computing resource level exceeding the physical machine limit, or allocation quantity at the inventory level exceeding the actual inventory quantity.

[0060] Optionally, the preset total resource threshold in this embodiment refers to a predefined hard indicator that limits the maximum scale of resource allocation. This threshold defines the legal upper limit of resource allocation, including but not limited to the maximum single transaction limit stipulated by laws and regulations, the single payment limit set by enterprise risk control, or the maximum number of concurrent processing operations stipulated by business logic. When the sum of the resources from the first allocation method and the sixth allocation method exceeds this threshold, regardless of whether the current resources are sufficient, it is considered a violation or high-risk operation and must be intercepted. For example, if the first allocation method requires allocating 100% of the total resources to container A, and another allocation method requires allocating 20% ​​of the total resources to container A, and both allocation methods are effective simultaneously, the total allocation ratio is 120%, exceeding the 100% upper limit of the total resources. Therefore, the system determines this as a direct conflict.

[0061] Optionally, in this embodiment, the available resource balance under the same type of resources refers to the remaining allocable quantity of a specific type of resource in the system at the current moment. This is a dynamically changing value, depending on the initial total amount minus the allocated amount and the locked amount. For example, the remaining unallocated balance in the current fund pool, the remaining number of available GPU instances in the cloud host, or the remaining number of empty pallets in the warehouse. When the resource occupation caused by the allocation strategy exceeds this real-time balance, it indicates that the system will be unable to fulfill its obligations, thus constituting a resource conflict. For example, if the current available resource amount of container A (fund pool) is 1000 yuan, and the first allocation method requests an allocation of 800 yuan, and another allocation method requests an allocation of 800 yuan, although the allocation ratio of a single allocation method is compliant, the total concurrent request amount of 1600 yuan is greater than the available resource amount of 1000 yuan, and the system determines it to be a resource contention conflict.

[0062] Optionally, the seventh allocation method in this embodiment refers to a historical allocation method that exists in the fifth allocation method set and has logical mutual exclusion or semantic contradiction with the first allocation method at the level of operation behavior or state change. Its core feature is that if the two are executed at the same time, it will lead to inconsistency of resource state or collapse of system logic, including but not limited to freezing and transferring operations for the same account, conflict between read-only and write permissions for the same file, or closing and reopening state changes for the same work order.

[0063] Optionally, in this embodiment, mutual exclusion of action types refers to the relationship that two or more resource allocation actions are defined in business rules or system underlying logic as not being able to be executed simultaneously on the same resource object at the same time. This mutual exclusion is usually determined by business specifications or technical implementation mechanisms, such as the mutual exclusion of reporting a loss and normal deduction in a financial system, the mutual exclusion of stopping and starting an instance in cloud computing, or the mutual exclusion of exclusive locks and shared locks in a database. Once the first allocation method and the seventh allocation method are detected to involve such mutually exclusive actions, the system determines that there is a target allocation method.

[0064] This embodiment introduces resource total threshold verification, available resource balance verification, and action type mutual exclusion verification during the conflict detection phase to accurately identify potential conflicts from two core dimensions: resource contention and logical contradictions. This determines whether a target allocation method exists from the perspective of business logic and resource status, further ensuring that the risk of allocation failure or data inconsistency caused by resource contention or status contradictions is fundamentally eliminated.

[0065] In an exemplary embodiment, when it is determined that the third allocation method exists, calculating the first similarity of each of the third allocation methods includes: performing the following calculation operation for each of the third allocation methods to obtain the first similarity of each of the third allocation methods: dividing the usage conditions of the third allocation method into multiple sub-conditions according to the condition attributes; determining the matching degree between each of the sub-conditions and the sub-conditions of the corresponding attributes in the usage conditions of the first allocation method to obtain multiple first matching degrees; calculating the first similarity using preset weights and the multiple first matching degrees, wherein the preset weights of the sub-conditions of different condition attributes are different.

[0066] Optionally, the usage conditions in this embodiment refer to the preconditions or constraint set that trigger the specific allocation method to take effect. These conditions are used to define the business scope and time window to which the allocation method applies, including but not limited to transaction type, amount range, timestamp, geographical location, user identity tag, risk level assessment results, etc. These conditions together constitute a logical judgment expression. Only when the actual business data satisfies the expression will the corresponding allocation method be activated and executed.

[0067] Optionally, the conditional attributes in this embodiment refer to the various independent dimensions or category labels that constitute the usage conditions. These are used to decompose complex composite conditions into atomic units that can be evaluated individually, including but not limited to transaction amount, payee type, business scenario code, effective time period, etc. Each attribute corresponds to a specific field or feature in the data, enabling the system to calculate the matching degree for different business dimensions.

[0068] Optionally, in this embodiment, a sub-condition refers to a specific value or range of values ​​assigned to a particular condition attribute, and is the smallest unit of a condition. For example, under the attribute of transaction amount, "greater than 10,000 yuan" is a sub-condition; under the attribute of transaction type, "fiscal subsidy" is another sub-condition. The system breaks down complex rules into these specific sub-conditions so that they can be compared one-to-one with the corresponding sub-conditions in the current new instruction and the matching degree can be calculated.

[0069] Optionally, the application conditions of the first allocation method in this embodiment are sometimes not explicitly limited. In such cases, the sub-conditions of the corresponding condition attribute are assumed to have the maximum scope. For example, if the application conditions of the first allocation method do not specify that the application area of ​​fiscal funds is for a specific city, the application conditions of the first allocation method are assumed to apply to the entire country.

[0070] Optionally, in this embodiment, the first matching degree refers to a numerical index that quantifies the similarity or overlap between the sub-conditions of the first allocation method and the corresponding sub-conditions in the historical allocation methods. It reflects the closeness of two conditions in a specific attribute, and its value typically ranges from 0 to 1. For example, complete consistency is 1.0, partial overlap is 0.5, and complete non-intersection is 0. This index is the basic data for subsequent calculation of the overall similarity. In actually determining the first matching degree, in addition to considering whether they are completely identical in wording, it also considers whether they are substantially identical. For example, if the usage conditions of the first allocation method limit its use to the city of XX, and the usage condition Y of another allocation method included in the first knowledge graph is an abbreviation for city XX, then the first matching degree is 1. It should be noted that this is only an example; in actual use, how to define matching or non-matching needs to be determined based on the usage scenario.

[0071] Optionally, the preset weight in this embodiment refers to the importance coefficient that the system pre-assigns to different conditional attributes, which is used to reflect the relative influence of different conditional attributes in the allocation method. For example, in a financial payment scenario, the transaction amount and the payee's account may be given higher weights (such as 0.4 and 0.3), while the remarks information may be given lower weights (such as 0.05).

[0072] This embodiment introduces a multi-dimensional weighted similarity calculation method based on conditional attribute division. It can dynamically allocate different preset weights according to the differences in the impact of each conditional attribute on the resource allocation results under different business scenarios, thereby more accurately quantifying the degree of substantial overlap between the first allocation method and the third allocation method in terms of usage conditions, and improving the flexibility and business fit of conflict detection.

[0073] In an exemplary embodiment, calculating the first similarity using preset weights and the plurality of first matching degrees includes: multiplying the preset weight of each of the sub-conditions by the corresponding first matching degree to obtain a plurality of second matching degrees; calculating the sum of the plurality of second matching degrees to obtain a third matching degree; and calculating the ratio of the third matching degree to a first value to obtain the first similarity, wherein the first value is the sum of the preset weights of the plurality of sub-conditions.

[0074] Optionally, in this embodiment, the second matching degree refers to the intermediate calculation result obtained by multiplying the preset weight of a specific condition attribute with its corresponding first matching degree. It reflects the actual contribution value of the specific attribute in the overall similarity assessment, which depends not only on the similarity between the two conditions themselves, but also on the importance of the attribute in the business logic.

[0075] Optionally, in this embodiment, the third matching degree refers to the weighted sum of the second matching degrees corresponding to multiple sub-conditions. It represents the overall weighted similarity score of the first allocation method and the historical allocation method across all condition dimensions. The higher the value, the higher the overall overlap between the two after considering the differences in the importance of different attributes.

[0076] Optionally, in this embodiment, the first value refers to the sum of the preset weights of multiple sub-conditions, that is, the normalized benchmark value of the weights of all conditional attributes, which is used to ensure that the final calculated first similarity is in a standardized range (such as between 0 and 1), and to eliminate the numerical deviation caused by the different number of conditional attributes contained in the rule or the different weight setting benchmarks; by dividing the third matching degree by the total weight (i.e., the first value).

[0077] For example, in practical use, the first similarity of each third allocation method can be calculated using the following formula:

[0078] ,in, Preset weights used to represent the sub-conditions of the i-th conditional attribute. The first matching degree of the sub-conditions of the i-th conditional attribute is used, and the overlapScore is used to represent the first similarity mentioned above. Completely identical conditions mean that the two sub-conditions are completely identical in wording or in substance. Intersecting conditions mean that the meanings represented by the two sub-conditions have an inclusion relationship (for example, for a sub-condition whose condition attribute is region, the sub-condition of the first allocation method restricts its application to the scope of XX city, while the sub-condition of the third allocation method does not restrict the applicable region, so the two sub-conditions are intersecting).

[0079] In an exemplary embodiment, updating an initial knowledge graph based on the first allocation method to obtain a first knowledge graph includes: extracting multiple initial terms and operators included in the first allocation method, and constructing a syntax tree based on the multiple initial terms and operators, wherein the syntax tree includes a condition subtree and an action subtree, the condition subtree representing the usage conditions of the first allocation method, and the action subtree representing the resource type, allocator, and allocation ratio allocated under the first allocation method; updating the initial condition subgraph and initial action subgraph included in the initial knowledge graph using the condition subgraph and the action subgraph respectively to obtain the first knowledge graph, wherein the initial condition subgraph indicates the usage conditions of each allocation method included in the initial knowledge graph, and the initial action subgraph indicates the resource type, allocator, and allocation ratio allocated under each allocation method included in the initial knowledge graph.

[0080] Optionally, the initial terms in this embodiment refer to basic business terms or entity names parsed and extracted from natural language or structured text of the first allocation method. Initial terms include, but are not limited to, specific business concepts (such as government subsidies, agents), numerical constants (such as 10000, 60%), and account identifiers, organization names, etc. Before being standardized and mapped, these terms may contain synonyms, aliases, or non-standard expressions.

[0081] Optionally, the operators in this embodiment refer to symbols or keywords used to connect initial terms, define logical relationships, or perform numerical calculations, representing the specific logic of the allocation method, including but not limited to comparison operators (such as ">", "<", "="), logical operators (such as "AND", "OR", "NOT"), arithmetic operators (such as "+", "-"), and assignment or action execution operators (such as "assign to", "set to").

[0082] Optionally, in this embodiment, the syntax tree refers to a hierarchical tree-like data structure formed by parsing the initial linearly arranged terms and operators according to the syntax rules. It intuitively displays the logical composition and nesting relationship of the rules in the form of tree nodes and edges, including but not limited to root nodes, internal nodes (representing operators or logical structures), and leaf nodes (representing terms or constants).

[0083] Optionally, in this embodiment, the condition subtree refers to a substructure in the syntax tree specifically used to represent the conditions for using the allocation method, such as the logical branch consisting of "transaction type = fiscal subsidy" and "amount > 10000". This subtree precisely describes the context in which the allocation method should be used. For example, in the financial field, a condition subtree may represent a numerical range constraint (amount > 10000, meaning only transactions with an amount greater than 10000 will be cleared), an enumeration constraint (transaction type ∈ {fiscal subsidy}, meaning only transactions of the fiscal subsidy type are eligible), or a time constraint (triggered only within a certain period of time).

[0084] Optionally, in this embodiment, the action subtree refers to a substructure in the syntax tree specifically used to represent the specific execution action of resource allocation, including key information such as target resource, recipient, allocation ratio and execution action, such as "60% allocated to special fiscal account" and "40% allocated to agent account".

[0085] Optionally, the initial condition subgraph in this embodiment refers to the subgraph structure in the initial knowledge graph used to store and index the usage conditions corresponding to the historical allocation methods. It consists of nodes representing condition attributes and edges representing logical relationships.

[0086] Optionally, the initial action subgraph in this embodiment refers to the subgraph structure in the initial knowledge graph used to store and index the execution actions and resource allocation details corresponding to the historical allocation methods. It consists of nodes and edges representing resource types, allocators, proportions, and action types.

[0087] In practical applications, the initial knowledge graph is updated to obtain the first knowledge graph through methods including, but not limited to, the following: First, the first allocation method, represented in text form, is preprocessed (special characters are removed, and unified encoding is applied). Then, a domain-specific dictionary is used for word segmentation to identify business terms (such as "financial subsidy," "agent," and "profit sharing ratio") and operators (comparison operators ">", "<", and "="; logical operators "AND", "OR", and "NOT"; and assignment operators). Next, based on a predefined rule syntax library, the sequence of lexical units is constructed into a parse tree. The parse tree clearly distinguishes the boundaries between the conditional and action parts. (For example, "when transaction type = financial subsidy AND amount > 10000" is the conditional subtree, and "60% allocated to the special fiscal account and 40% allocated to the agent account" is the action subtree. The action subtree further parses two allocation action nodes, each containing two attributes: target account and allocation ratio). It should be noted that when constructing the syntax tree, it does not simply refer to the nth character of a word in the entire rule text, but rather to the specific node position in the rule parse tree or syntax analysis structure. Essentially, it's a mapping between syntax tree nodes and the original text, pointing to both text characters and logical structures. Specifically: if an unclosed parenthesis exists in the conditional part, the error location is marked as the syntax node corresponding to the parenthesis, along with the character index range of the parenthesis in the rule text (e.g., the 15th–16th character). If the allocation ratio of the action part is not equal to 100%, the error location is marked as the corresponding allocated action node, along with the position or line number of the action in the rule text for quick user location. Secondly, corresponding correction suggestions are provided, automatically generated based on the rule syntax library, semantic constraints, and business logic validation rules, outputting executable modification prompts (e.g., for unclosed parentheses, suggesting "add a closing parenthesis at position X" or "delete redundant opening parentheses"; for the total allocation ratio not being 100%, suggesting "adjust the allocation ratios to make the sum equal to 100%"). Finally, the constructed syntax tree is used to update the initial knowledge graph to obtain the first knowledge graph.

[0088] In this embodiment, the parsed allocation method expressed in text form is transformed into a syntax tree structure containing condition subtrees and action subtrees, and then mapped to the condition subgraph and action subgraph in the knowledge graph for updating. This makes the condition judgment logic and resource allocation actions both interconnected and independently searchable in the graph, providing a clear data structure foundation for subsequent independent condition overlap analysis and action conflict detection.

[0089] In an exemplary embodiment, updating the initial condition subgraph and initial action subgraph included in the initial knowledge graph using the condition subtree and action subtree respectively to obtain the first knowledge graph includes: determining a first relationship between the plurality of initial terms based on the condition subtree and action subtree; determining a first term included in the plurality of initial terms, wherein the first term is a term not included in the initial knowledge graph; constructing a first node in the initial knowledge graph to represent the first term; and connecting the first node and a second node based on the first relationship to obtain the first knowledge graph, wherein the second node is used to represent a second term included in the initial knowledge graph among the plurality of initial terms.

[0090] Optionally, the first relationship in this embodiment refers to the semantic association or logical dependency relationship between various initial terms derived from the logical structure of the condition subtree and the action subtree. It reflects the inherent connection between entities in the allocation method, including but not limited to hierarchical relationships (such as new energy subsidies belonging to fiscal subsidies), fund flow relationships (such as fiscal special accounts flowing to agent accounts), condition constraint relationships (such as the amount being limited to a threshold), and action execution relationships (such as the allocation action being associated with the recipient).

[0091] Optionally, the first term in this embodiment refers to a new business concept or entity name that is parsed out in the first allocation method but does not yet exist in the initial knowledge graph. It is an object of dynamic expansion of the knowledge graph, including but not limited to newly emerging transaction types (such as carbon trading subsidies), newly connected institution names, new account types, or new business attributes.

[0092] Optionally, in this embodiment, the first node refers to a newly created node in the initial knowledge graph, used to represent the aforementioned first term.

[0093] Optionally, the second term in this embodiment refers to the standard business concept or entity name that exists in the initial knowledge graph and has been predefined by the system or accumulated historically, including but not limited to existing standard ontology nodes such as special fiscal accounts and tax bureaus.

[0094] Optionally, in this embodiment, the second node refers to an information node that already exists in the initial knowledge graph and is used to represent the aforementioned second term.

[0095] This embodiment dynamically identifies the first term in the initial terminology, automatically constructs a corresponding new node in the knowledge graph, and connects it to the second node based on the semantic relationship between the terms, thereby realizing the dynamic expansion of the knowledge graph and ensuring that the knowledge graph can reflect the latest business semantic network in real time.

[0096] In one exemplary embodiment, constructing a syntax tree based on multiple initial terms and operators includes: determining the target object type of the initial terms; searching for standard terms with the same object type as the target object type from a preset standard terminology library to obtain multiple third terms; determining the number of times characters need to be edited when modifying the initial terms to each of the third terms to obtain multiple first values; for each of the third terms, calculating a third value using the first value and a second value corresponding to the third term, wherein the second value represents the maximum string length among the third terms and the initial terms; comparing multiple third values ​​and determining the third term corresponding to the third value with the largest value as the modified initial term; and constructing the syntax tree based on the modified initial terms and operators.

[0097] Optionally, the preset standard terminology library in this embodiment refers to a pre-constructed authoritative vocabulary set containing standardized business entity names and their corresponding object types.

[0098] Optionally, the target object type in this embodiment refers to the business category or entity category to which the current initial term belongs, inferred from context information or historical records. It determines the scope of subsequent searches, including but not limited to dimensions such as transaction type, institution, account, and monetary unit. By determining the type before searching, the system can narrow the matching range, improve the accuracy and efficiency of term mapping, and ensure that the found standard terms are semantically matched.

[0099] Optionally, in this embodiment, the third term refers to a candidate standard name selected from a preset standard term library that has the same target object type as the initial term and is similar to the initial term in spelling or semantics. It is a potential standard mapping result of the initial term.

[0100] Optionally, in this embodiment, the first number refers to the minimum number of editing operations required to convert the initial term into a third term. It is typically calculated based on an edit distance algorithm, including the total number of operations involving inserting, deleting, or replacing characters, quantifying the degree of character difference between the two strings. For example, changing line X to bank XY might require 3 insertion operations, so the first number is 3. The smaller this number, the higher the similarity between the two terms at the character level.

[0101] Optionally, the second value in this embodiment refers to the maximum value of the string length between the initial term and a certain third term, which is used to normalize the edit distance, eliminate the deviation caused by the different term lengths, and ensure that terms of different lengths are comparable.

[0102] Optionally, in this embodiment, the third value refers to the similarity index or normalized difference value calculated using the first and second values, used to intuitively reflect the degree of similarity between the initial term and the third term. The larger the third value (or the smaller the difference), the more reliable the standard mapping result of the third term as the initial term. In practical use, the formula used to calculate the third value can be in the following form: The edit distance is the first value mentioned above, and the maximum string length is the second value mentioned above.

[0103] Optionally, in this embodiment, the modified initial term refers to the standard term that has been selected as the best match after the above calculations and comparisons. It replaces the original non-standard input and becomes the formal node for constructing the syntax tree.

[0104] This embodiment utilizes a similarity algorithm based on the ratio of edit distance and string length to automatically map initial terms in natural language descriptions to standardized terms in a standard terminology database. This effectively solves the problem of entity recognition ambiguity caused by inconsistent terminology naming and diverse expressions in multi-source heterogeneous data, ensuring the standardization and consistency of node semantics in the knowledge graph.

[0105] In an exemplary embodiment, determining the target object type of the initial term includes at least one of the following: matching the initial term with terms represented by standard nodes included in a preset database; if a match is successful, determining the target object type based on the attributes of the standard nodes; extracting context information of the initial term, wherein the context information includes the type of the syntax tree in which the initial term is located and other initial terms adjacent to the initial term in the first allocation method; determining the target object type based on the context information according to a preset mapping rule; if a first historical record indicates that the initial term has multiple candidate types, counting the second number of times the initial term is determined as each of the candidate types, and the third number of times each candidate type is confirmed as an object type after two confirmations, based on the first historical record; calculating the ratio of the third number to the second number for each candidate type to obtain multiple confidence levels; and determining the candidate type with the highest confidence level among the multiple confidence levels as the target object type.

[0106] Optionally, the preset database in this embodiment is a pre-built knowledge base that stores verified standard business entities and their structural information. It serves as the basic reference for terminology standardization and type determination. In the financial field, the preset database includes, but is not limited to: standard institution names, standard account types, standard transaction codes, and their corresponding attributes (such as level, permissions, and domain), as shown in Table 1. The tables stored in the preset database in the financial field may include the corresponding standard terms for different types.

[0107] Table 1:

[0108]

[0109] Optionally, in this embodiment, a standard node refers to a structured data unit in a preset database used to represent a specific standard business entity. It not only includes the term name, but also encapsulates the multidimensional attribute information of the term, including but not limited to metadata such as entity type (e.g., organization, account, product), hierarchical relationship, business tag, creation time, and maintainer.

[0110] Optionally, the target object type in this embodiment refers to the business category or entity category to which the current initial term belongs, which is finally determined by the system through matching, context analysis, or statistical inference.

[0111] Optionally, the contextual information in this embodiment refers to environmental data surrounding the initial term that can help determine its semantic attributes, including grammatical structure information and adjacent vocabulary information, including but not limited to the grammatical role of the term in the rule expression (such as as a condition value or as an action target), its position in the sentence, and other adjacent terms. Contextual information can solve the problem of polysemy of a single noun; for example, "service" is a noun in "service fee" but a verb in "provide a service," and the context helps the system accurately distinguish between them.

[0112] Optionally, the preset mapping rule in this embodiment refers to a predefined logical judgment model or lookup table used to deduce the term type based on context features. It describes the correspondence between a specific context pattern and an object type, including but not limited to "when the term appears in the structure 'transaction type=XXX', the type is transaction type" or "when the term is adjacent to a bank and is a noun, the type is institution".

[0113] Optionally, the first historical record in this embodiment refers to a log database or statistical set that the system has accumulated over a long period of time to record the historical term processing process and the results of manual review. It reflects the system's experience in handling ambiguous terms and human feedback in actual operation, including but not limited to records of a term being marked as multiple types, records of the final type after manual correction, and timestamps and operator information for each confirmation.

[0114] Optionally, in this embodiment, the second number refers to the total number of times a specific initial term is initially identified or marked as a specific candidate type by the system in historical statistics, reflecting the prevalence of the candidate type or the initial matching frequency in historical processing.

[0115] Optionally, in this embodiment, the third number refers to the number of times in historical statistics a specific initial term was initially determined to be a candidate type, and then confirmed as such after manual secondary confirmation or final system verification, reflecting the accuracy and reliability of the candidate type in historical processing.

[0116] Optionally, in this embodiment, the confidence level refers to a numerical index used to quantify the reliability of a candidate type as the true type of the initial term, obtained by calculating the ratio of the third number to the second number. It typically ranges from 0 to 1, representing the strength of historical experience in supporting the type determination.

[0117] The following concrete example illustrates the above implementation. In the financial field, the system pre-defines standard concepts such as account class, transaction type class, institution class, and amount class from the pre-built government-finance payment domain ontology system. When updating the initial knowledge graph based on the first allocation method to obtain the first knowledge graph, the entity names included in the first allocation method (such as "special fiscal account") are matched with ontology concept nodes. If the match is successful, its type is determined. If an entity appears in the text under specific conditions or action contexts, the system will determine the type based on the context. For example, if "fiscal subsidy" appears in the conditional clause of "transaction type=", it can be determined as a transaction type entity. For ambiguous entities (such as "service fee", which may belong to handling fee or agency service fee), the system automatically determines the type by referring to the first historical record and marks the confidence level. The confidence level can be calculated in the following way: for each entity to be mapped... In the first historical record, the entity is recorded as having been mapped to a certain ontology concept. Number of times (i.e., the second number mentioned above) Counts the number of times the mapping was successfully completed and manually confirmed or executed correctly. (i.e., the third number mentioned above), confidence level If E has no historical mapping records, the default confidence level can be set to a low value (e.g., 0.5 or 0) to indicate unreliability, while setting an upper limit threshold (e.g., 0.95) to avoid automatic error confirmation due to excessively high confidence. Since multiple methods can be used to determine the target object type of the initial term in practical applications, after determining the target object type of the initial term, as shown in Table 2, a table can be used to record the target object type, corresponding standard term, matching criteria, and confidence level. After determining the entity type (i.e., the target object type mentioned above), the system identifies the relationship between entities by parsing the action subtree and condition subtree. The action subtree explicitly describes the flow of funds or operations (for example, the system directly analyzes the action subtree "60% allocated to the fiscal special account and 40% allocated to the agent account" to obtain two action nodes: 60% of the funds are allocated to the fiscal special account and 40% of the funds are allocated to the agent account. Since the action nodes are operations on transaction funds, not other operations, the system identifies a fund allocation relationship between "fiscal special account" and "agent account"). Alternatively, the system can compare the extracted action nodes with the system's preset typical relationships to determine whether there is a relationship between entities and the type of relationship (for example, if the action subtree analysis shows that fiscal subsidies are mapped to fiscal special accounts, which is consistent with the system's preset fund allocation relationship, the system will determine that there is a fund allocation relationship between "fiscal subsidies" and "fiscal special accounts").

[0118] Table 2:

[0119]

[0120] In an exemplary embodiment, before updating the initial knowledge graph based on the first allocation method to obtain the first knowledge graph, the method further includes: extracting multiple fourth terms included in the historical allocation method, and calculating the total number of calls and the number of times each fourth term was applied in different scenarios based on the historical resource allocation records stored in the first database; calculating the importance score of each fourth term using the total number of calls, and calculating the reusability score of each fourth term using the number of times it was applied; performing a weighted summation operation on the importance score and reusability score of each fourth term to obtain the total score of the multiple fourth terms; identifying the fourth terms whose total score is greater than a second threshold as fifth terms to obtain multiple fifth terms; determining a second relationship between the multiple fifth terms based on the historical allocation method; and constructing the initial knowledge graph based on the multiple fifth terms and the second relationship.

[0121] Optionally, the fourth term in this embodiment refers to the business entity name and concept parsed and extracted from the historical allocation method (i.e., the resource allocation rules that have been executed or configured in the past).

[0122] Optionally, in this embodiment, the first database refers to a storage medium or database system specifically used to store historical resource allocation execution logs, rule change records, and business operation data. It records detailed information about each resource allocation operation, including the specific resource allocation method used, execution time, success / failure status, and associated business scenario code.

[0123] Optionally, the total number of calls in this embodiment refers to the cumulative frequency of a specific fourth term being referenced, triggered, or used as a condition, action, or parameter in historical resource allocation records. This reflects the activity level and breadth of use of the term in business operations, including but not limited to how many different historical rules a term has appeared in, or how many specific clearing transactions it has been used as a key screening condition or allocation object.

[0124] Optionally, in this embodiment, the fourth number refers to the number of different business scenarios or application environments covered by a specific fourth term in the historical resource allocation process, reflecting the term's cross-scenario versatility and reuse potential.

[0125] Optionally, in this embodiment, the importance score refers to a numerical indicator calculated based on the total number of calls to the fourth term, used to quantify the importance of the term in historical business. Typically, the call count is normalized to convert it into a score between 0 and 1 to eliminate the impact of absolute quantity differences between different terms. A higher score indicates that the term is more core and frequent in historical resource allocation, and is a key node that must be retained when building knowledge. For example, in the financial field, the importance score can be calculated using the following formula: Where R represents the participation degree of the allocation method. The current concept-related allocation method count is the total number of times the fourth term mentioned above has been invoked in the historical resource allocation process. A concept is the aforementioned fourth term (for example, "financial subsidy" has appeared 120 times in historically executed rules, and the maximum number of rules for all concepts is 150). F is used to indicate the degree of financial impact of the cumulative amount of funds involved in the term. (For example, in the historical distribution methods of "fiscal subsidies," the amount involved was 5 billion yuan, and the largest amount among all concepts was 10 billion yuan, so...) W1 and W2 represent the weights of R and F respectively, and W1 + W2 = 1.

[0126] Optionally, the reusability score in this embodiment refers to a numerical indicator calculated based on the fourth occurrence of the fourth term, used to quantify the reusability value of the term across business scenarios, and is also normalized. A higher score indicates that the term not only appears frequently but also has broad applicability. For example, in the financial field, the reusability score can be calculated using the following formula: ,in, Used to indicate the frequency of historical occurrences The concept here is the fourth term mentioned above, where S is used to represent cross-scene coverage. The current scenario number is the fourth time the fourth term is applied in different scenarios. The maximum scenario number is used to represent the total number of scenarios in which all allocation methods have been applied. W3 and W4 represent the weights of Freq and S, respectively. W3 + W4 = 1.

[0127] Optionally, the total score in this embodiment refers to the comprehensive evaluation value obtained by weighting and summing the importance score and reusability score of the fourth term according to preset weights, which fully reflects the importance of the term in business and its universal value across scenarios.

[0128] Optionally, in this embodiment, the second threshold refers to a pre-set scoring threshold used by the system to distinguish between high-value and low-value terms. Only terms with a total score higher than this threshold are considered worthy of inclusion in the core concepts of the initial knowledge graph. This threshold can be dynamically adjusted according to business needs to control the size and complexity of the knowledge graph. For example, terms with a total score > 0.85 can be directly used to construct the initial knowledge graph, terms with a total score between 0.5 and 0.85 require manual review to determine whether they can be used to construct the initial knowledge graph, and terms with a total score < 0.5 are discarded.

[0129] Optionally, the fifth term in this embodiment refers to the fourth term that has been identified as high value by the system and decided to be included in the initial knowledge graph after importance assessment, reusability assessment and threshold screening. They are the core components of the initial knowledge graph.

[0130] Optionally, the second relationship in this embodiment refers to the semantic association or connection relationship derived from the co-occurrence frequency, logical dependency or business logic of the fifth terms in the historical allocation method, which describes the relationship between different terms.

[0131] In this embodiment, based on the total number of times terms are called and the fourth time they are applied in different scenarios according to historical allocation records, and the total score is calculated by weighting to select high-value terms to construct an initial knowledge graph. This realizes the automatic optimization and simplification of the knowledge base, avoids knowledge redundancy caused by including low-frequency, one-off or low-value terms in the graph, and ensures that the initial knowledge graph stores core business concepts with high reusability and high importance that have been verified in history, thereby improving the overall quality of the knowledge graph.

[0132] The above embodiment is described below through a specific example. In the scenario of resource allocation for supply chain component procurement in a large manufacturing enterprise, the enterprise needs to allocate a fixed procurement budget (i.e., the target resource mentioned above) to different component suppliers (i.e., the allocators mentioned above). Figure 4 This is a flowchart illustrating a method for allocating target resources according to an embodiment of this application, including the following steps:

[0133] Step S402: Receive an emergency procurement order for core components of a certain engine model, and parse the order to obtain a first allocation method. Specifically, the emergency procurement order includes the total budget, a list of designated suppliers, and a preliminary allocation ratio for each supplier (i.e., the aforementioned target order). The system parses the order, extracts key elements: Supplier A (40%), Supplier B (30%), and Supplier C (30%), thus determining a preliminary first allocation method that clarifies the flow of funds and the proportions.

[0134] Step S404: Update the initial knowledge graph based on the first allocation method to obtain the first knowledge graph. The system first extracts new entity terms (such as "new model engine component" and "supplier C") from the instructions and performs disambiguation matching with a preset standard terminology library to confirm the standard node in the graph corresponding to "supplier C". Next, the system checks if there are historical allocation records related to these entities in the historical graph. If "supplier C" is a newly introduced entity, a new node is created and an association edge is established between it and the "engine core component" category; if it is an existing entity, its attributes are updated. Simultaneously, the system attaches information such as the current allocation budget amount and delivery time constraints as attributes to the relevant nodes, forming a "first knowledge graph" containing current context information. This graph not only records static supplier relationships but also integrates the dynamic procurement requirements of this time.

[0135] Step S406: Based on the first node and first edge included in the first knowledge graph, a target allocation method is identified, the execution of the allocation operation is blocked, and the purchasing manager is prompted to adjust the proportion of supplier A. The system executes a conflict pre-detection mechanism: First, condition overlap analysis is performed, and historical allocation rules related to "new model engine parts" in the graph are retrieved. One historical rule is found to stipulate that "when urgent procurement involves critical safety components, the proportion of supplier A shall not be less than 50%"; then, action conflict detection is performed, and it is found that the current proposed "40% proportion of supplier A" directly contradicts the constraint condition in the historical rule (i.e., it does not match the preset allocation method); in addition, the system also detects that supplier A and supplier B have a "capacity mutual exclusion" relationship in historical data (i.e., they cannot simultaneously accept new orders at full capacity in the same time period), but given that this is an urgent small-batch order, this conflict is determined to be negligible. Therefore, the system identifies a target allocation method that "does not match the preset allocation method" (i.e., violates the minimum proportion constraint), marks the conflict as "severe", blocks direct execution, and prompts the purchasing manager to adjust the proportion of supplier A.

[0136] Step S408: After receiving the adjusted instructions from the purchasing manager (adjusting the proportion of supplier A to 55%, supplier B to 25%, and supplier C to 20%) and re-passing the conflict pre-check, it is confirmed that there is no target allocation method.

[0137] Step S410: According to the final allocation strategy determined in the updated first knowledge graph, the target procurement budget is actually allocated. The system calls the ERP interface to generate payment instructions for suppliers A, B, and C, and ensures the atomicity of fund transfer through a distributed transaction mechanism. At the same time, corresponding purchase orders and performance records are generated in the system.

[0138] Step S412: The execution result is fed back to the knowledge graph construction engine. The system calculates the success rate of this allocation, the actual delivery cycle, and the new contribution of Supplier C. Based on the feedback data, the system recalculates the "importance score" and "reusability score" of the term "Supplier C" in historical allocations. Since "Supplier C" is frequently invoked as a core supplier in this scenario and involves key components, its reusability score increases. The system automatically increases its weight in the graph and establishes a stronger dependency edge between "Supplier C" and "new engine component," thereby completing the dynamic optimization of the graph.

[0139] Through the above embodiments, in supply chain resource allocation scenarios, the system identifies potential risks of violating historical business constraints (such as minimum proportions and capacity exclusivity) in advance through graph reasoning before allocation, avoiding procurement defaults or supply chain disruptions caused by rule conflicts. Through a feedback loop of execution results, the knowledge graph can automatically evolve with business changes, improving the adaptability and accuracy of resource allocation methods.

[0140] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0141] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0142] According to another aspect of the embodiments of this application, a resource allocation apparatus is also provided, which can be used to implement the resource allocation method provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0143] Figure 5 This is a structural block diagram of a resource allocation device according to an embodiment of this application, such as... Figure 5 As shown, the device includes:

[0144] The parsing module 52 is used to parse the target instruction upon receiving the target instruction to obtain the first allocation method indicated by the target instruction, wherein the first allocation method is used to determine the allocator of the resource and the allocation ratio of the resource to each of the allocators.

[0145] The update module 54 is used to update the initial knowledge graph based on the first allocation method to obtain the first knowledge graph. The initial knowledge graph is constructed according to the historical allocation method. The initial knowledge graph includes initial nodes and initial edges. The initial nodes are used to represent the allocators and allocated resources included in the historical allocation method. The initial edges are used to connect the initial nodes that have a relationship.

[0146] The determining module 56 is used to determine whether there is a target allocation method in the first knowledge graph based on the first node and the first edge included in the first knowledge graph. The target allocation method includes at least one of the following: an allocation method that does not match the preset allocation method, or an allocation method that conflicts with the second allocation method included in the first knowledge graph.

[0147] The allocation module 58 is used to allocate target resources according to the various allocation methods included in the first knowledge graph when the above-mentioned target allocation method does not exist, so as to determine the target allocator of the target resources and the target allocation ratio of allocating the target resources to each of the above-mentioned target allocators.

[0148] It should be noted that the parsing module 52 in this embodiment can be used to perform the above step S202, the updating module 54 in this embodiment can be used to perform the above step S204, the determining module 56 in this embodiment can be used to perform the above step S206, and the allocation module 58 in this embodiment can be used to perform the above step S208.

[0149] The aforementioned device first transforms the resource allocation instruction to be executed (i.e., the target instruction) into nodes and edges in a knowledge graph and updates them in real time. Then, utilizing the semantic relationships and logical structures inherent in the nodes and edges of the first knowledge graph, deep reasoning and consistency checks are performed on all allocation methods included in the first knowledge graph before actual resource allocation. This detects allocation methods that do not match the preset allocation methods and conflicting target resource allocation methods. Consequently, the correctness of the resource allocation method can be determined before its formal use, and the formal resource allocation operation is only executed when the target allocation method does not exist. This solves the problem of resource misallocation that occurs when using resource allocation methods in related technologies, achieving the effect of avoiding resource misallocation and ensuring the accuracy and consistency of resource allocation.

[0150] In an exemplary embodiment, the determining module 56 is further configured to query a first conditional subgraph included in the first knowledge graph to determine whether a third allocation method exists in the first knowledge graph. The first conditional subgraph indicates the usage conditions of each allocation method included in the first knowledge graph, and the usage conditions of each of the three allocation methods satisfy a preset relationship with the usage conditions of the first allocation method. The preset relationship includes one of the following: an intersection relationship or a mutual exclusion relationship. If the existence of the third allocation method is determined, a first similarity is calculated for each of the third allocation methods, wherein the first similarity indicates the usage conditions of the third allocation method. The similarity between the application conditions of the application and the first allocation method is determined; the third allocation method with a first similarity greater than a first threshold is determined as the fourth allocation method; based on the first action subgraph included in the first knowledge graph, it is determined whether there is a fifth allocation method among the fourth allocation methods, wherein the first action subgraph is used to indicate the resource type, allocator and allocation ratio allocated under each allocation method included in the first knowledge graph, and the fifth allocation method allocates the same resource as the first allocation method; based on whether the fifth allocation method and the first allocation method are allowed to be executed simultaneously, it is determined whether there is a target allocation method in the first knowledge graph.

[0151] In an exemplary embodiment, the determining module 56 is further configured to, when determining that the fifth allocation method includes a sixth allocation method that conflicts with the resources allocated under the first allocation method, determine that a target allocation method exists and determine the sixth allocation method as the target allocation method, wherein the resource conflict includes at least one of the following: the total amount of resources allocated under the sixth allocation method and the total amount of resources allocated under the first allocation method exceeds a preset total resource threshold; the total amount of resources allocated under the sixth allocation method and the total amount of resources allocated under the first allocation method exceeds the available resource reserve under the same type of resources; and when determining that the fifth allocation method includes a seventh allocation method that is mutually exclusive with the action type performed under the first allocation method, determine that a target allocation method exists and determine the seventh allocation method as the target allocation method.

[0152] In an exemplary embodiment, the determining module 56 is further configured to perform the following calculation operation for each of the third allocation methods to obtain a first similarity for each of the third allocation methods: dividing the usage conditions of the third allocation method into multiple sub-conditions according to the condition attributes; determining the matching degree between each of the sub-conditions and the sub-conditions of the corresponding attributes in the usage conditions of the first allocation method to obtain multiple first matching degrees; calculating the first similarity using preset weights and the multiple first matching degrees, wherein the preset weights of the sub-conditions of different condition attributes are different.

[0153] In an exemplary embodiment, the determining module 56 is further configured to multiply the preset weight of each of the sub-conditions by the corresponding first matching degree to obtain a plurality of second matching degrees; calculate the sum of the plurality of second matching degrees to obtain a third matching degree; and calculate the ratio of the third matching degree to a first value to obtain the first similarity, wherein the first value is the sum of the preset weights of the plurality of sub-conditions.

[0154] In an exemplary embodiment, the update module 54 is further configured to extract multiple initial terms and operators included in the first allocation method, and construct a syntax tree based on the multiple initial terms and operators, wherein the syntax tree includes a condition subtree and an action subtree, wherein the condition subtree is used to represent the usage conditions of the first allocation method, and the action subtree is used to represent the resource type, allocator, and allocation ratio allocated under the first allocation method; the initial condition subgraph and the initial action subgraph included in the initial knowledge graph are updated using the condition subgraph and the action subgraph respectively to obtain the first knowledge graph, wherein the initial condition subgraph is used to indicate the usage conditions of each allocation method included in the initial knowledge graph, and the initial action subgraph is used to indicate the resource type, allocator, and allocation ratio allocated under each allocation method included in the initial knowledge graph.

[0155] In an exemplary embodiment, the update module 54 is further configured to: determine a first relationship between the plurality of initial terms based on the condition subtree and the action subtree; determine a first term included in the plurality of initial terms, wherein the first term is a term not included in the initial knowledge graph; construct a first node in the initial knowledge graph to represent the first term; and connect the first node and a second node based on the first relationship to obtain the first knowledge graph, wherein the second node is used to represent a second term included in the initial knowledge graph among the plurality of initial terms.

[0156] In an exemplary embodiment, the update module 54 is further configured to: determine the target object type of the initial term; search for standard terms with the same object type as the target object type from a preset standard terminology library to obtain a plurality of third terms; determine the number of times characters are edited when modifying the initial term to each of the third terms to obtain a plurality of first numbers; for each of the third terms, calculate a third value using the first number and second value corresponding to the third term, wherein the second value is used to represent the largest string length among the third term and the initial term; compare the plurality of third values ​​and determine the third term corresponding to the third value with the largest value as the modified initial term; and construct the syntax tree based on the modified initial term and the operators.

[0157] In an exemplary embodiment, the update module 54 is further configured to determine the target object type of the initial term by at least one of the following methods: matching the initial term with terms represented by standard nodes included in a preset database; if the matching is successful, determining the target object type based on the attributes of the standard nodes; extracting the context information of the initial term, wherein the context information includes the type of the syntax tree in which the initial term is located and other initial terms adjacent to the initial term in the first allocation method; determining the target object type based on the context information according to a preset mapping rule; if the first historical record indicates that the initial term has multiple candidate types, counting the second number of times the initial term is determined as each of the candidate types, and the third number of times each candidate type is confirmed as an object type after two confirmations, according to the first historical record; calculating the ratio of the third number to the second number for each candidate type to obtain multiple confidence levels; and determining the candidate type with the highest confidence level among the multiple confidence levels as the target object type.

[0158] In an exemplary embodiment, the update module 54 is further configured to: extract multiple fourth terms included in the historical allocation method before updating the initial knowledge graph based on the first allocation method to obtain the first knowledge graph; and, based on the historical resource allocation records stored in the first database, count the total number of calls to each fourth term in the historical resource allocation process and the number of times it is applied in different scenarios; calculate the importance score of each fourth term using the total number of calls to each fourth term, and calculate the reusability score of each fourth term using the number of times it is applied in different scenarios; perform a weighted summation operation on the importance score and reusability score of each fourth term to obtain the total score of the multiple fourth terms; identify the fourth terms whose total score is greater than a second threshold as fifth terms to obtain multiple fifth terms; determine the second relationship between the multiple fifth terms based on the historical allocation method; and construct the initial knowledge graph based on the multiple fifth terms and the second relationship.

[0159] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0160] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein the program executes the steps in any of the above method embodiments when it is run.

[0161] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.

[0162] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is configured to perform the steps of any of the method embodiments described above via the computer program. In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0163] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0164] According to another aspect of the embodiments of this application, a computer program product is also provided, which includes a computer program / instructions containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit, it performs various functions provided in the embodiments of this application. The sequence numbers of the embodiments of this application above are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0165] Figure 6 This is a computer system architecture block diagram of an electronic device according to an embodiment of this application. For example... Figure 6 As shown, the computer system includes a CPU (corresponding to...) Figure 6 The central processing unit 601 in the ROM (corresponding to Figure 6 The program is stored in the read-only memory 602 or loaded from the storage section 608 into the RAM (corresponding to the read-only memory 602). Figure 6 The system executes various appropriate actions and processes by storing programs in the random access memory (RAM) 603. The RAM 603 also stores various programs and data required for system operation. The central processing unit 601, the read-only memory 602, and the RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0166] The following components are connected to the I / O interface (corresponding to...) Figure 6 The input / output interface 605 includes an input section 606 such as a keyboard and mouse; an output section 607 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 608 including a hard disk; and a communication section 609 including network interface cards such as LAN cards and modems. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.

[0167] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit, it performs various functions defined in the system of this application.

[0168] It should be noted that, Figure 6 The computer system of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0169] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0170] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. A method for allocating resources, characterized in that, include: Upon receiving a target instruction, the target instruction is parsed to obtain a first allocation method indicated by the target instruction, wherein the first allocation method is used to determine the allocator of resources and the allocation ratio of resources to each of the allocators; The initial knowledge graph is updated based on the first allocation method to obtain the first knowledge graph. The initial knowledge graph is constructed according to the historical allocation method. The initial knowledge graph includes initial nodes and initial edges. The initial nodes are used to represent the allocators and allocated resources included in the historical allocation method. The initial edges are used to connect the initial nodes that have a relationship. Based on the first node and first edge included in the first knowledge graph, it is determined whether there is a target allocation method in the first knowledge graph, wherein the target allocation method includes at least one of the following: an allocation method that does not match the preset allocation method, or an allocation method that conflicts with the second allocation method included in the first knowledge graph; In the absence of the target allocation method, the target resources are allocated according to the various allocation methods included in the first knowledge graph to determine the target allocator of the target resources and the target allocation ratio of the target resources to each of the target allocators.

2. The method according to claim 1, characterized in that, Based on the first node and first edge included in the first knowledge graph, determine whether there is a target allocation method in the first knowledge graph, including: The first condition subgraph included in the first knowledge graph is queried to determine whether there is a third allocation method in the first knowledge graph. The first condition subgraph is used to indicate the usage conditions of each allocation method included in the first knowledge graph. The usage conditions of each of the three allocation methods and the usage conditions of the first allocation method satisfy a preset relationship. The preset relationship includes one of the following: cross relationship and mutual exclusion relationship. If the existence of the third allocation method is determined, a first similarity is calculated for each of the third allocation methods, wherein the first similarity is used to represent the degree of similarity between the usage conditions of the third allocation method and the usage conditions of the first allocation method; The third allocation method, in which the first similarity is greater than the first threshold, is determined as the fourth allocation method; Based on the first action subgraph included in the first knowledge graph, it is determined whether there is a fifth allocation method among the fourth allocation methods. The first action subgraph is used to indicate the resource type, allocator and allocation ratio allocated under each allocation method included in the first knowledge graph. The fifth allocation method allocates the same resource as the first allocation method. The existence of the target allocation method in the first knowledge graph is determined based on whether the fifth allocation method and the first allocation method are allowed to be executed simultaneously.

3. The method according to claim 2, characterized in that, Determining whether the target allocation method exists in the first knowledge graph based on whether simultaneous execution of the fifth allocation method and the first allocation method is allowed includes: If it is determined that the fifth allocation method includes a sixth allocation method that conflicts with the resources allocated under the first allocation method, then the existence of the target allocation method is determined, and the sixth allocation method is determined as the target allocation method. The resource conflict includes at least one of the following: the total amount of resources allocated under the sixth allocation method and the total amount of resources allocated under the first allocation method exceeds a preset total resource threshold; the total amount of resources allocated under the sixth allocation method and the total amount of resources allocated under the first allocation method exceeds the available resource reserve under the same type of resources. If it is determined that the fifth allocation method includes a seventh allocation method that is mutually exclusive with the action type performed under the first allocation method, then the existence of the target allocation method is determined, and the seventh allocation method is determined as the target allocation method.

4. The method according to claim 2, characterized in that, If the existence of the third allocation method is determined, a first similarity is calculated for each of the third allocation methods, including: For each of the third allocation methods, the following calculation operation is performed to obtain the first similarity of each of the third allocation methods: The conditions for using the third allocation method are divided into multiple sub-conditions according to the condition attributes; Determine the matching degree between each of the sub-conditions and the corresponding attribute sub-conditions in the usage conditions of the first allocation method to obtain multiple first matching degrees; The first similarity is calculated using preset weights and the plurality of first matching degrees, wherein the preset weights of the sub-conditions of different conditional attributes are different.

5. The method according to claim 4, characterized in that, Calculating the first similarity using preset weights and the plurality of first matching degrees includes: The preset weight of each sub-condition is multiplied by the corresponding first matching degree to obtain multiple second matching degrees; The third matching degree is obtained by summing multiple values ​​of the second matching degree. The ratio of the third matching degree to the first value is calculated to obtain the first similarity, wherein the first value is the sum of preset weights of multiple sub-conditions.

6. The method according to claim 1, characterized in that, The initial knowledge graph is updated based on the first allocation method to obtain the first knowledge graph, including: Extract multiple initial terms and operators included in the first allocation method, and construct a syntax tree based on the multiple initial terms and operators. The syntax tree includes a condition subtree and an action subtree. The condition subtree is used to represent the usage conditions of the first allocation method, and the action subtree is used to represent the resource type, allocator, and allocation ratio allocated under the first allocation method. The initial condition subgraph and the initial action subgraph included in the initial knowledge graph are updated using the condition subgraph and the action subgraph respectively to obtain the first knowledge graph. The initial condition subgraph is used to indicate the usage conditions of each allocation method included in the initial knowledge graph, and the initial action subgraph is used to indicate the resource type, allocator, and allocation ratio allocated under each allocation method included in the initial knowledge graph.

7. The method according to claim 6, characterized in that, The initial condition subgraph and initial action subgraph included in the initial knowledge graph are updated using the condition subtree and the action subtree, respectively, to obtain the first knowledge graph, including: A first relationship between the plurality of initial terms is determined based on the condition subtree and the action subtree; A first term is identified among a plurality of initial terms, wherein the first term is a term not included in the initial knowledge graph; Construct a first node in the initial knowledge graph to represent the first term; The first node and the second node are connected based on the first relationship to obtain the first knowledge graph, wherein the second node is used to represent a second term included in the initial knowledge graph among a plurality of initial terms.

8. The method according to claim 6, characterized in that, A syntax tree is constructed based on the initial terms and the operators, including: Determine the target object type of the initial term; Search a pre-defined standard terminology library for standard terms whose object type is the same as the target object type to obtain multiple third terms; The number of times the character was edited when the initial term was modified to each of the third terms was determined to obtain multiple first counts; For each of the third terms, a third value is calculated using the first frequency and the second value corresponding to the third term, wherein the second value is used to represent the maximum string length among the third term and the initial term; Compare multiple third values, and determine the third term corresponding to the third value with the largest value as the modified initial term; The syntax tree is constructed based on the modified initial terms and the operators.

9. The method according to claim 8, characterized in that, The target object type of the initial term is determined to include at least one of the following: The initial terms are matched with terms represented by standard nodes included in the preset database; if a match is successful, the target object type is determined based on the attributes of the standard nodes. Extract the context information of the initial term, wherein the context information includes the type of the syntax tree in which the initial term is located and other initial terms adjacent to the initial term in the first allocation method; determine the target object type based on the context information according to a preset mapping rule; In the case where the first historical record indicates that there are multiple candidate types for the initial term, the second number of times the initial term is determined as each candidate type is counted according to the first historical record, and the third number of times each candidate type is confirmed as an object type after two confirmations; for each candidate type, the ratio of the third number to the second number is calculated to obtain multiple confidence levels; the candidate type with the highest value among the multiple confidence levels is determined as the target object type.

10. The method according to claim 1, characterized in that, Before updating the initial knowledge graph based on the first allocation method to obtain the first knowledge graph, the method further includes: Extract multiple fourth terms included in the historical allocation method, and based on the historical resource allocation records stored in the first database, count the total number of times each fourth term was called in the historical resource allocation process and the number of times it was applied in different scenarios; An importance score for each fourth term is calculated using the total number of calls for each fourth term, and a reusability score for each fourth term is calculated using the fourth number of calls for each fourth term. A weighted summation operation is performed on the importance score and reusability score of each of the fourth terms to obtain the total score of the multiple fourth terms; The fourth term whose total score is greater than the second threshold among the multiple fourth terms is identified as the fifth term, so as to obtain multiple fifth terms; A second relationship is determined among multiple fifth terms based on the historical allocation method; The initial knowledge graph is constructed based on multiple fifth terms and the second relationship.

11. A resource allocation device, characterized in that, include: A parsing module is used to parse a target instruction upon receiving it to obtain a first allocation method indicated by the target instruction, wherein the first allocation method is used to determine the allocator of resources and the allocation ratio of resources to each of the allocators. An update module is used to update the initial knowledge graph based on the first allocation method to obtain a first knowledge graph, wherein the initial knowledge graph is constructed according to the historical allocation method, and the initial knowledge graph includes initial nodes and initial edges. The initial nodes are used to represent the allocators and allocated resources included in the historical allocation method, and the initial edges are used to connect the initial nodes that have a relationship. The determination module is used to determine whether there is a target allocation method in the first knowledge graph based on the first node and the first edge included in the first knowledge graph, wherein the target allocation method includes at least one of the following: an allocation method that does not match a preset allocation method, or an allocation method that conflicts with a second allocation method included in the first knowledge graph; The allocation module is used to allocate target resources according to the various allocation methods included in the first knowledge graph when the target allocation method does not exist, so as to determine the target allocator of the target resource and the target allocation ratio of the target resource to each target allocator.

12. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 10.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 10.