Resource scheduling method and device, nonvolatile storage medium and electronic equipment
By extracting entities and relationships in scheduling tasks, and using knowledge graphs and AI algorithms to automatically generate resource scheduling strategies, it solves the problems of long response time and low efficiency when manually scheduling resources, and achieves accurate and rapid resource scheduling.
Patent Information
- Application Number
- CN202410823592.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-10-11
AI Technical Summary
There are problems with long response time and low efficiency when manually scheduling resources. It is especially difficult to achieve accurate and fast scheduling when the application scenarios of different projects are complex.
By receiving the scheduling task text, extracting entities and relationships, using knowledge graphs and artificial intelligence algorithms to automatically generate resource scheduling strategies, and optimizing scheduling decisions based on historical scheduling information and value functions.
It improves the efficiency and response speed of resource scheduling, solves the problem of low manual scheduling efficiency, and achieves accurate and rapid resource scheduling in multiple scenarios.
Smart Images

Figure CN118761579A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a resource scheduling method and device, a non-volatile storage medium, and an electronic device. Background Art
[0002] In the related art, resource scheduling is performed manually according to the resource requirements of different projects. When different projects correspond to different application scenarios, resource scheduling has the characteristics of complex scenarios. However, manual resource scheduling has the problems of long scheduling response time, slow resource mobilization speed, and low resource allocation efficiency due to human operational errors.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a resource scheduling method and device, a non-volatile storage medium, and an electronic device to at least solve the technical problems of long resource scheduling response time and low scheduling efficiency caused by manual resource scheduling.
[0005] According to one aspect of an embodiment of the present application, a resource scheduling method is provided, comprising: receiving a scheduling task text for indicating resource requirements, the scheduling task text comprising at least: the required resource type, the required resource quantity, and the destination address of the required resource; extracting multiple entities and multiple relationships from the scheduling task text, wherein the relationship is used to indicate the association relationship between the subject and the object in the scheduling task text; querying entities and relationships in multiple knowledge graphs generated according to historical resource scheduling information, and extracting a first resource scheduling strategy from at least one knowledge graph when multiple entities and multiple relationships exist in at least one knowledge graph at the same time; and inputting the scheduling task text and auxiliary information for indicating the scheduling target into a resource scheduling model when no entity or relationship exists in the knowledge graph to obtain a second resource scheduling strategy for achieving the scheduling target.
[0006] Optionally, before extracting multiple entities and multiple relationships from the scheduling task text, the method includes: performing word segmentation processing on the scheduling task text to obtain multiple first-category short text sequences, wherein the length of each first-category short text sequence is less than the length of the scheduling task text, and the first-category short text sequences include: phrases, characters; deleting the first-category short text sequences that are the same as preset stop words in the multiple first-category short text sequences, and marking the remaining multiple first-category short text sequences according to attribute information, wherein the attribute information is used to indicate the role type of each first-category short text sequence in the scheduling task text, and the role types include at least: subject, predicate, and object.
[0007] Optionally, the historical resource scheduling information includes: multiple historical scheduling task texts received before the current moment, and a historical resource scheduling policy text corresponding to each historical scheduling task text; multiple knowledge graphs are stored in the adapter model, and entities and relationships are queried in the multiple knowledge graphs generated based on the historical resource scheduling information, including: querying entities and relationships in the adapter model, wherein the adapter model is obtained by the following method: grouping multiple historical scheduling task texts and multiple historical resource scheduling policy texts to obtain multiple combinations, wherein each combination includes: a historical scheduling task text, and a historical resource scheduling policy text corresponding to the historical scheduling task text; adjusting the machine learning model according to the multiple combinations to generate an adapter model for implementing resource scheduling.
[0008] Optionally, the machine learning model includes multiple hidden layers, and the machine learning model is adjusted according to multiple combinations, including: generating a knowledge graph corresponding to each combination, and storing each knowledge graph in an adapter, wherein each adapter includes multiple adapter layers; and inserting each adapter layer between any two hidden layers.
[0009] Optionally, the knowledge graph corresponding to each combination is generated by the following method: performing word segmentation processing on the historical scheduling task text to obtain a second-category short text sequence, and performing word segmentation processing on the historical resource scheduling strategy text to obtain a third-category short text sequence, wherein the length of the second-category short text sequence is less than the length of the historical scheduling task text, and the length of the third-category short text sequence is less than the length of the historical resource scheduling strategy text; generating a knowledge graph based on the second-category short text sequence and the third-category short text sequence, wherein the data representing the subject and the object in the second-category short text sequence and the third-category short text sequence are nodes in the knowledge graph, and the data representing the association relationship between the subject and the object shown in the second-category short text sequence and the third-category short text sequence are edges in the knowledge graph.
[0010] Optionally, extracting a first resource scheduling strategy from at least one knowledge graph includes: converting information in the knowledge graph containing multiple entities and multiple relationships at the same time into text information containing a starting address of provided resources, a type of provided resources, and a quantity of provided resources, and outputting the text information as a first resource scheduling strategy.
[0011] Optionally, the auxiliary information includes: resource scheduling duration; the resource scheduling model determines the second resource scheduling strategy in the following manner: inputting the resource scheduling duration, required resource type, required resource quantity and destination address as input information into the value function to obtain the output result of the value function, wherein the output result includes: multiple third resource scheduling strategies, and multiple function values, wherein each third resource scheduling strategy corresponds to a function value, and each function value is used to indicate the achievement result of the scheduling target.
[0012] Optionally, the resource scheduling model is trained by the following method: using historical resource scheduling information as training data, iteratively training the classification model through the training data and the value function until the number of iterations reaches a preset number of iterations; using test data to determine the accuracy of the classification model after iterative training; when the accuracy is greater than or equal to the preset accuracy, outputting the classification model after iterative training as a resource scheduling model; when the accuracy is less than the preset accuracy, continuing to train the classification model.
[0013] According to another aspect of an embodiment of the present application, a resource scheduling device is also provided, including: a receiving module, used to receive a scheduling task text used to indicate resource requirements, the scheduling task text includes at least: required resource type, required resource quantity, and destination address of the required resources; an extraction module, used to extract multiple entities and multiple relationships from the scheduling task text, wherein the relationship is used to indicate the association relationship between the subject and the object in the scheduling task text; a query module, used to query entities and relationships in multiple knowledge graphs generated according to historical resource scheduling information, and extract a first resource scheduling strategy from at least one knowledge graph when multiple entities and multiple relationships exist in at least one knowledge graph at the same time; a processing module, when there is no entity or relationship in the knowledge graph, inputs the scheduling task text and auxiliary information used to indicate the scheduling target into a resource scheduling model to obtain a second resource scheduling strategy for achieving the scheduling target.
[0014] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, in which a computer program is stored, wherein the resource scheduling method described above is executed by running the computer program on a device where the non-volatile storage medium is located.
[0015] According to another aspect of an embodiment of the present application, there is further provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned resource scheduling method through the computer program.
[0016] According to another aspect of an embodiment of the present application, a computer program product is also provided, including computer instructions, which implement the steps of the above-mentioned resource scheduling method when executed by a processor.
[0017] In an embodiment of the present application, a scheduling task text for indicating resource requirements is received, and the scheduling task text includes at least: the required resource type, the required resource quantity, and the destination address of the required resources; multiple entities and multiple relationships are extracted from the scheduling task text, wherein the relationship is used to indicate the association relationship between the subject and the object in the scheduling task text; entities and relationships are queried in multiple knowledge graphs generated according to historical resource scheduling information, and a first resource scheduling strategy is extracted from at least one knowledge graph when multiple entities and multiple relationships exist in at least one knowledge graph at the same time; when no entity or relationship exists in the knowledge graph, the scheduling task text and auxiliary information for indicating the scheduling target are input into the resource scheduling model to obtain a second resource scheduling strategy for achieving the scheduling target, and the resource scheduling strategy is output for the input scheduling task through the knowledge graph generated based on the historical scheduling information or the artificial intelligence algorithm based on the value function, so as to achieve the purpose of automatically generating the resource scheduling strategy, thereby achieving the technical effect of improving the efficiency of resource scheduling, and further solving the technical problems of long resource scheduling response time and low scheduling efficiency caused by manual resource scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 It is a hardware structure block diagram of a computer terminal for implementing a resource scheduling method according to an embodiment of the present application;
[0020] Figure 2 is a flowchart of a method for scheduling resources according to an embodiment of the present application;
[0021] Figure 3 It is a structural diagram of a resource scheduling device according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0025] Entity: The entities in the embodiments of the present application include the head entity and the tail entity in the knowledge graph. The entities in the knowledge graph are used to represent various things, concepts, people, places, etc., such as people, places, organizations, events, products, concepts, etc.
[0026] "Relationship": The "relationship" in the embodiment of the present application is the "relationship" in the knowledge graph, which is used to describe the connection and connection between entities, such as "has", "is located in", "is", "contains", etc.
[0027] In the related art, resources are manually scheduled. When the same scheduling is performed for resources of different projects in different scenarios, the application scenarios of resources are complicated. At this time, when resources are manually scheduled, there are problems such as long scheduling response time, slow resource collection speed, and low resource allocation efficiency. Therefore, the manual scheduling of resources cannot meet the requirements of accurate and fast resource scheduling in multiple scenarios. In order to solve this problem, a relevant solution is provided in the embodiments of the present application, which is described in detail below.
[0028] According to an embodiment of the present application, a method embodiment of a resource scheduling method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a resource scheduling method. Figure 1As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0030] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0031] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the resource scheduling method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned resource scheduling method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0032] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0033] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0034] The embodiment of the present application provides a resource scheduling method capable of running in the above-mentioned operating environment. Figure 2 is a flowchart of the steps of the resource scheduling method provided in the embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0035] Step S202, receiving a scheduling task text for indicating resource requirements, the scheduling task text at least including: required resource type, required resource quantity, and destination address of the required resources.
[0036] The method provided in the embodiment of the present application implements resource scheduling based on two methods: knowledge graph and artificial intelligence (AI) algorithm, providing double protection for resource scheduling; in the method provided in the embodiment of the present application, each specific task is scheduled as input to the knowledge graph and the AI algorithm. Therefore, in step S202, each time resource scheduling is performed, text information recording the specific scheduling task (i.e., scheduling task text) is received, wherein the scheduling task text records relevant information about the resources required to implement the task (i.e., resource requirements), for example, the type of resources required to implement the task (i.e., the required resource type), such as food, fuel, and transportation tools; the quantity of each type of resource required to implement the task (i.e., the required resource quantity), such as 1 million jin, 1,000 cubic meters, 20, and 10 vehicles; and the address to which the called resources will be delivered (i.e., the destination address of the required resources).
[0037] Step S204: extract multiple entities and multiple relationships from the scheduling task text, wherein the relationship is used to indicate the association relationship between the subject and the object in the scheduling task text.
[0038] Since the received text information used to record the scheduling of specific tasks (i.e., the scheduling task text) is text-type information, in step S204, it is first necessary to convert it into computer-readable data. Specifically, natural language processing can be performed on the scheduling task text, and the words / terms that serve as subjects and objects in the text information can be converted into entities, and the words / terms used to connect the subjects and objects in the text information can be converted into "relationships" to obtain entities and "relationships" that can be recognized by the knowledge graph.
[0039] Optionally, before extracting multiple entities and multiple relationships from the scheduling task text, the method includes: performing word segmentation processing on the scheduling task text to obtain multiple first-category short text sequences, wherein the length of each first-category short text sequence is less than the length of the scheduling task text, and the first-category short text sequences include: phrases, characters; deleting the first-category short text sequences that are the same as preset stop words in the multiple first-category short text sequences, and marking the remaining multiple first-category short text sequences according to attribute information, wherein the attribute information is used to indicate the role type of each first-category short text sequence in the scheduling task text, and the role types include at least: subject, predicate, and object.
[0040] From the perspective of natural language processing, a knowledge graph extracts semantic and structured data (entities and "relationships") from text. In this embodiment, before performing natural language processing on the text information (i.e., the scheduling task text) and extracting entities and "relationships", the following steps are included. First, it is necessary to perform word segmentation on the received text information (i.e., the scheduling task text), splitting the text information in the form of a long sentence (i.e., the scheduling task text) into multiple characters, words, and short sentences (wherein, the characters, words, and short sentences are all the first short text sequences). The length of the multiple text data (i.e., the first short text sequences) obtained by splitting is less than the text information (i.e., the scheduling task text) to which they belong. Next, query for preset stop words in the multiple text data (i.e., the first short text sequences) obtained by splitting, such as data that has no impact on the text meaning, like "de", "le", etc.; if there is text data (i.e., the first short text sequence) corresponding to the preset stop words in the multiple text data (i.e., the first short text sequences) obtained by splitting, then delete it, completing the word segmentation and processing operations. Further, after deleting the text data (i.e., the first short text sequences) corresponding to the preset stop words, use the attribute information of each text data (i.e., the first short text sequence) as the identification information, and mark each text data (i.e., the first short text sequence) with the corresponding identification information, wherein the attribute information is used to indicate whether the role type of the text represented by each text data (i.e., the first short text sequence) in the scheduling task text before splitting is the subject, predicate, object, etc. Since the entities in the knowledge graph are usually generated from the text that is the subject and object in the text, and the "relationships" in the knowledge graph are usually generated from the text that represents the relationship between the subject and object in the text, therefore, marking the attribute information for each text data (i.e., the first short text sequence) obtained by splitting facilitates the extraction of entities and "relationships" from the text data (i.e., the first short text sequences).
[0041] Step S206, query for entities and relationships in the multiple knowledge graphs generated based on the historical resource scheduling information. In the case where there are multiple entities and multiple relationships in at least one knowledge graph, extract the first resource scheduling strategy from at least one knowledge graph.
[0042] The method provided in this embodiment realizes resource scheduling based on the dual guarantee of knowledge graph and AI algorithm, that is, there are two methods for realizing resource scheduling in the method provided in the embodiment of this application, among which the first method can be adopted: first adopt knowledge graph for scheduling, and then judge whether to enable AI algorithm for resource scheduling according to the result of resource scheduling by knowledge graph; or the second method can be adopted: first adopt AI algorithm for resource scheduling, and then judge whether to enable knowledge graph for resource scheduling according to the result of resource scheduling by AI algorithm; in the embodiment of this application, the first method is adopted for illustration, therefore, in step S206, first match the relevant information of resources required to realize the task (i.e., resource demand) in the knowledge graph, that is, query the entities and "relationships" generated according to the scheduling task text in the knowledge graph generated according to the historical scheduling information, wherein the multiple knowledge graphs generated according to the historical scheduling information are stored in the adapter model (K-ADAPTER). If it can be found in the knowledge graph, it means that a resource scheduling strategy has been output for a scheduling task that is the same as the input scheduling task text. The resource scheduling strategy has been recorded in the knowledge graph, and the previously output resource scheduling strategy can be extracted from the knowledge graph as the strategy for implementing this scheduling task (i.e., the first resource scheduling strategy).
[0043] Optionally, the historical resource scheduling information includes: multiple historical scheduling task texts received before the current moment, and a historical resource scheduling policy text corresponding to each historical scheduling task text; multiple knowledge graphs are stored in the adapter model, and entities and relationships are queried in the multiple knowledge graphs generated based on the historical resource scheduling information, including: querying entities and relationships in the adapter model, wherein the adapter model is obtained by the following method: grouping multiple historical scheduling task texts and multiple historical resource scheduling policy texts to obtain multiple combinations, wherein each combination includes: a historical scheduling task text, and a historical resource scheduling policy text corresponding to the historical scheduling task text; adjusting the machine learning model according to the multiple combinations to generate an adapter model for implementing resource scheduling.
[0044] The historical resource scheduling information includes text information received before the current moment (i.e., historical scheduling task text), and the (historical) scheduling strategy text output by the device / system / model for executing the resource scheduling method provided in the embodiment of the present application for each historical scheduling task text; the knowledge graph used to support resource scheduling in the implementation of the present application is generated based on the above historical resource scheduling information. In this embodiment, the multiple knowledge graphs generated based on the above historical resource scheduling information are structured as entities and "relationships" and stored in the adapter model, wherein the entities and "relationships" obtained by disassembling a knowledge graph are stored in a layer of the adapter model; therefore, querying entities and "relationships" in the knowledge graph in step S206 is actually querying entities and "relationships" through the adapter model, because the knowledge graph is an adapter model, which is a machine learning model adjusted using the above historical resource scheduling information. The method for adjusting the machine learning model using historical resource scheduling information is as follows: first, each historical scheduling task text and its corresponding (historical) scheduling strategy text are classified into a group, and then, the machine learning model is adjusted using multiple combinations generated by classifying the historical scheduling information in the above manner.
[0045] According to an optional embodiment of the present application, the machine learning model includes multiple hidden layers, and the machine learning model is adjusted according to multiple combinations, including: generating a knowledge graph corresponding to each combination, and storing each knowledge graph in an adapter, wherein each adapter includes multiple adapter layers; and inserting each adapter layer between any two hidden layers.
[0046] In this embodiment, in order to integrate (store) the knowledge graph into the adapter model, the data for generating the knowledge graph (i.e., historical scheduling information) is used to adjust the machine learning model. Specifically, the adapter structure corresponding to the knowledge graph is inserted into the machine learning model without changing other parameters of the machine learning model. Each knowledge graph is decomposed into entities and "relationships" and stored in an adapter. Each adapter contains multiple adapter layers. Since a machine learning model contains multiple hidden layers (transformers), multiple input layers, and multiple output layers, there are many ways to adjust the machine learning model. In this embodiment, the machine learning model is adjusted by inserting an adapter layer between any two hidden layers (transformers). The adapter model (K-ADAPTER) adjusted by the above method retains the original model parameters of the machine learning model, while the adapter structure is outside the machine learning model and can be inserted and extracted; its input is the hidden layer output structure of the middle layer of the machine learning model, which allows each adapter to integrate different external knowledge in different tasks and ensure that the parameters of the original machine learning model are frozen and not updated; therefore, when integrating a certain knowledge graph, only the corresponding adapter is updated, which can ensure that the output results (first resource strategy) corresponding to the generated different knowledge graphs are not confused with each other; it should be noted that the final output result of the K-ADAPTER model is the concatenation of the hidden layer output result of the last layer of the adapter model and the output structure of the last adapter layer.
[0047] According to another optional embodiment of the present application, the knowledge graph corresponding to each combination is generated by the following method: performing word segmentation processing on the historical scheduling task text to obtain a second-category short text sequence, and performing word segmentation processing on the historical resource scheduling strategy text to obtain a third-category short text sequence, wherein the length of the second-category short text sequence is less than the length of the historical scheduling task text, and the length of the third-category short text sequence is less than the length of the historical resource scheduling strategy text; generating a knowledge graph based on the second-category short text sequence and the third-category short text sequence, wherein the data representing the subject and the object in the second-category short text sequence and the third-category short text sequence are nodes in the knowledge graph, and the data representing the association relationship between the subject and the object shown in the second-category short text sequence and the third-category short text sequence are edges in the knowledge graph.
[0048] Each combination generated based on the historical scheduling information contains a historical scheduling task text and a historical scheduling policy text corresponding to the historical scheduling task text. Therefore, when generating the knowledge graph corresponding to each combination, it is necessary to perform natural language processing on the historical scheduling task text and its corresponding historical scheduling policy text at the same time. It should be noted that since there is a corresponding relationship between the historical scheduling task text and the historical scheduling policy text in the combination, the historical scheduling task text and the historical scheduling policy text are connected through a logical relationship in the generated knowledge graph, that is, the knowledge graph corresponding to each combination connects all nodes through an edge. In this embodiment, when generating the knowledge graph corresponding to each combination, the historical scheduling task text is firstly segmented to obtain the task short text (i.e., the second category short text sequence), and the historical scheduling strategy text is segmented to obtain the strategy short text (i.e., the third category short text sequence); next, the text representing stop words in the task short text (i.e., the second category short text sequence) and the strategy short text (i.e., the third category short text sequence) is deleted; the data representing the subject and object in the task short text (i.e., the second category short text sequence) and the strategy short text (i.e., the third category short text sequence) are used as nodes, and the data indicating the "relationship" between the task short text (i.e., the second category short text sequence) and the strategy short text (i.e., the third category short text sequence) are used as edges to generate a knowledge graph.
[0049] According to some optional embodiments of the present application, a first resource scheduling strategy is extracted from at least one knowledge graph, including: converting information in the knowledge graph containing multiple entities and multiple relationships at the same time into text information containing the starting address of provided resources, the type of provided resources, and the quantity of provided resources, and outputting the text information as the first resource scheduling strategy.
[0050] As mentioned in the above embodiment, each knowledge graph is jointly generated based on the historical scheduling task text and the historical scheduling strategy text, that is, the knowledge graph includes both scheduling tasks and scheduling strategies. If the entities and "relationships" generated based on the newly received scheduling task text can be queried in the knowledge graph, it means that there must be a strategy in the knowledge graph that can implement the scheduling task. In this embodiment, the knowledge graph that includes both the entity and "relationship" extracted in step S204 is determined to be the target knowledge graph containing the (first) resource scheduling strategy, and the part of the target knowledge graph generated based on the historical scheduling strategy text is extracted as the (first) resource scheduling strategy for implementing the scheduling task, wherein the generated (first / second / third) resource scheduling strategies all include the address of the provided resources (i.e., the starting address), the type of provided resources, and the number of provided resources. The (first / second / third) resource scheduling strategy is used to indicate which one / more addresses are selected as the starting address for providing resources, what type of resources are called by each starting address, and the number of each type of resource called from multiple addresses that can provide the resources required to implement the scheduling task; it should be noted that when all types of resources are provided from the same address, the starting address is one; when all types of resources are provided together through multiple different addresses, the starting address is multiple; when the number of resources that can be provided by one starting address is insufficient, multiple addresses can provide the same type of resources.
[0051] Step S208, when there is no entity or relationship in the knowledge graph, the scheduling task text and auxiliary information used to indicate the scheduling target are input into the resource scheduling model to obtain a second resource scheduling strategy for achieving the scheduling target.
[0052] If the entities and "relationships" generated in step S204 cannot be found in the knowledge graph, it means that the scheduling task identical to the input scheduling task text has not been processed before. At this time, the resource scheduling model that outputs the resource scheduling strategy by executing the AI algorithm is called, and the scheduling task text received in step S202 and the auxiliary information obtained are processed by the resource scheduling model to output the (second) resource scheduling strategy, wherein the auxiliary information is information generated according to the scheduling goal, and the scheduling goal is the effect to be achieved when executing the scheduling task indicated by the scheduling task text, such as maximum efficiency, minimum cost, etc.
[0053] According to an optional embodiment of the present application, the auxiliary information includes: resource scheduling duration; the resource scheduling model determines the second resource scheduling strategy in the following manner: the resource scheduling duration, the required resource type, the required resource quantity and the destination address are input as input information into the value function to obtain the output result of the value function, wherein the output result includes: multiple third resource scheduling strategies, and multiple function values, wherein each third resource scheduling strategy corresponds to a function value, and each function value is used to indicate the achievement result of the scheduling target.
[0054] If the entities and "relationships" generated according to the received scheduling task text cannot be found in the knowledge graph generated based on the historical scheduling information, it means that the device / system / model that executes the resource scheduling method provided in the embodiment of the present application has not processed the resource scheduling task with the same scheduling text as the scheduling task text indicated by the newly received scheduling task text, then the artificial intelligence (AI) algorithm is enabled to implement resource scheduling. The AI algorithm defines the scheduling objectives (such as minimizing scheduling costs, maximizing scheduling efficiency, etc.), determines the key variables that affect the strategy of military materials and equipment (such as the type, quantity, quality, etc. of materials), and determines the constraints of scheduling (such as time constraints, budget constraints, etc.), and selects the best resource scheduling strategy according to the value function. In this embodiment, the enabled artificial intelligence algorithm (AI) determines the (second) resource scheduling strategy to be output based on the value function, wherein the value function outputs a result according to the provided conditions, and the result output by the value function is used to evaluate the effect of achieving a preset target by a certain strategy under the provided conditions; therefore, when the AI algorithm is started, auxiliary information for indicating the scheduling target is obtained, such as the resource scheduling duration, and the scheduling task text (required resource type, required resource quantity and destination address) is used as the provided conditions, and the auxiliary information (resource scheduling duration) is used as the preset target of the value function (also the scheduling target), and the output result of the value function is obtained, wherein the output result of the value function can be a function value; when the scheduling target is the resource scheduling duration, the larger the function value, the worse the realization result of the scheduling target. There are many ways to implement the scheduling task. Therefore, when the AI algorithm is used to schedule resources, the AI algorithm calculates the results of implementing the scheduling task using different resource scheduling methods (i.e., the third resource scheduling strategy) based on the value function, and obtains multiple function values, and the most suitable resource scheduling method is selected according to the function values corresponding to different resource scheduling methods (i.e., the third resource scheduling strategy). For example, when the scheduling target is the resource scheduling duration, the resource scheduling method corresponding to the minimum function value (i.e., the third resource scheduling strategy) is selected as the most appropriate resource scheduling method; and when the scheduling target is the resource scheduling speed, the resource scheduling method corresponding to the minimum function value (i.e., the third resource scheduling strategy) is selected as the most appropriate resource scheduling method.
[0055] According to some other optional embodiments of the present application, the resource scheduling model is trained by the following method: using historical resource scheduling information as training data, iteratively training the classification model through the training data and the value function until the number of iterations reaches a preset number of iterations; using test data to determine the accuracy of the classification model after iterative training; when the accuracy is greater than or equal to the preset accuracy, outputting the classification model after iterative training as a resource scheduling model; when the accuracy is less than the preset accuracy, continuing to train the classification model.
[0056] In some embodiments, the resource scheduling model implementing the AI algorithm is to train the classification model (such as decision tree, support vector machine, logistic regression, etc.) using the value function, and the training method of reinforcement learning (Q-Learning) is used in the training process. Therefore, in the training process, the resource scheduling model can evaluate the value of different strategies according to the strategy results (function value). At the same time, the risk assessment index is considered to understand the potential results of each strategy under different risk levels. According to the evaluation results and actual needs, the strategy is adjusted; in the process of strategy adjustment, the goal can be re-formulated, the constraints (restrictions) can be modified, or the model parameters can be corrected. The strategy is adjusted iteratively to achieve the output of the best resource scheduling strategy effect. In addition, in the training process, the accuracy of the trained classification model is tested by test data to determine whether it reaches the preset accuracy (for example, 80%) to determine whether the classification model has been trained and whether it can be used as a resource scheduling model. In addition, when the resource scheduling model is put into use, if the test shows that its accuracy is less than the preset accuracy, it is necessary to use manual methods to schedule resources. For example, if the accuracy of the AI model (i.e., the resource scheduling model) is lower than 80%, manual intervention is performed and manual resource scheduling is switched.
[0057] Through the above steps, it is possible to provide dual guarantees for scheduling through knowledge graphs and AI algorithms to achieve resource scheduling. Among them, when performing intelligent scheduling of resources based on knowledge graphs, the knowledge graph is established by performing label extraction and semantic understanding on historical scheduling data. The knowledge graph provides demand analysis and scheduling intelligent reasoning, and outputs the optimal solution for resource scheduling. When performing intelligent scheduling of resources based on AI algorithms: Introducing AI algorithm models such as decision trees, support vector machines, and logistic regression, it is possible to complete integrated intelligent scheduling of resources without the support of knowledge graphs, and achieve the technical effect of precise scheduling.
[0058] Figure 3 is a structural diagram of a resource scheduling device provided according to an embodiment of the present application, such as Figure 3As shown, the resource scheduling device includes: a receiving module 30, which is used to receive a scheduling task text for indicating resource requirements, and the scheduling task text includes at least: the required resource type, the required resource quantity, and the destination address of the required resource; an extraction module 32, which is used to extract multiple entities and multiple relationships from the scheduling task text, wherein the relationship is used to indicate the association relationship between the subject and the object in the scheduling task text; a query module 34, which is used to query entities and relationships in multiple knowledge graphs generated according to historical resource scheduling information, and extract a first resource scheduling strategy from at least one knowledge graph when multiple entities and multiple relationships exist in at least one knowledge graph at the same time; a processing module 36, which inputs the scheduling task text and auxiliary information for indicating the scheduling target into the resource scheduling model when there are no entities or relationships in the knowledge graph, and obtains a second resource scheduling strategy for achieving the scheduling target.
[0059] It should be noted that Figure 3 The preferred implementation of the illustrated embodiment can be found in Figure 2 The relevant description of the illustrated embodiment will not be repeated here.
[0060] An embodiment of the present application further provides a non-volatile storage medium, in which a computer program is stored, wherein the above resource scheduling method is executed by running the computer program on a device where the non-volatile storage medium is located.
[0061] The above-mentioned non-volatile storage medium is used to store a program that performs the following functions: receiving a scheduling task text used to indicate resource requirements, the scheduling task text at least including: the required resource type, the required resource quantity, and the destination address of the required resources; extracting multiple entities and multiple relationships from the scheduling task text, wherein the relationship is used to indicate the association relationship between the subject and the object in the scheduling task text; querying entities and relationships in multiple knowledge graphs generated based on historical resource scheduling information, and when multiple entities and multiple relationships exist in at least one knowledge graph at the same time, extracting a first resource scheduling strategy from at least one knowledge graph; when there are no entities or relationships in the knowledge graph, inputting the scheduling task text and auxiliary information used to indicate the scheduling target into a resource scheduling model to obtain a second resource scheduling strategy for achieving the scheduling target.
[0062] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above resource scheduling method through the computer program.
[0063] The processor in the above-mentioned electronic device is used to run a program that performs the following functions: receiving a scheduling task text used to indicate resource requirements, the scheduling task text at least including: the required resource type, the required resource quantity, and the destination address of the required resources; extracting multiple entities and multiple relationships from the scheduling task text, wherein the relationship is used to indicate the association relationship between the subject and the object in the scheduling task text; querying entities and relationships in multiple knowledge graphs generated based on historical resource scheduling information, and when multiple entities and multiple relationships exist in at least one knowledge graph at the same time, extracting a first resource scheduling strategy from at least one knowledge graph; when no entity or relationship exists in the knowledge graph, inputting the scheduling task text and auxiliary information used to indicate the scheduling target into the resource scheduling model to obtain a second resource scheduling strategy for achieving the scheduling target.
[0064] According to another aspect of an embodiment of the present application, a computer program product is also provided, including computer instructions, which implement the steps of the above-mentioned resource scheduling method when executed by a processor.
[0065] It should be noted that the various modules in the above-mentioned resource scheduling device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
[0066] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0067] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0068] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0069] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0070] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0071] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0072] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A resource scheduling method, It is characterized in that include: Receiving a scheduling task text for indicating resource requirements, the scheduling task text at least including: a required resource type, a required resource quantity, and a destination address of the required resource; Extracting a plurality of entities and a plurality of relations from the scheduling task text, wherein the relations are used to indicate an association relationship between a subject and an object in the scheduling task text; Querying the entity and the relationship in a plurality of knowledge graphs generated according to the historical resource scheduling information, and extracting a first resource scheduling strategy from at least one of the knowledge graphs when a plurality of the entities and a plurality of the relationships exist simultaneously in at least one of the knowledge graphs; In the case where the entity or the relationship does not exist in the knowledge graph, the scheduling task text and the auxiliary information for indicating the scheduling target are input into the resource scheduling model to obtain a second resource scheduling strategy for achieving the scheduling target.
2. The method according to claim 1, It is characterized in that Before extracting multiple entities and multiple relations from the scheduling task text, including: Performing word segmentation processing on the scheduling task text to obtain a plurality of first-category short text sequences, wherein the length of each of the first-category short text sequences is less than the length of the scheduling task text, and the first-category short text sequences include: phrases and words; The first-category short text sequences that are identical to the preset stop words in multiple first-category short text sequences are deleted, and the remaining multiple first-category short text sequences are labeled according to attribute information, wherein the attribute information is used to indicate the role type of each first-category short text sequence in the scheduling task text, and the role type includes at least: subject, predicate, and object.
3. The method according to claim 1, It is characterized in that The historical resource scheduling information includes: a plurality of historical scheduling task texts received before the current moment, and a historical resource scheduling strategy text corresponding to each of the historical scheduling task texts; The plurality of knowledge graphs are stored in an adapter model, and querying the entity and the relationship in the plurality of knowledge graphs generated according to the historical resource scheduling information includes: The entity and the relationship are queried in the adapter model, wherein the adapter model is obtained by: Grouping a plurality of the historical scheduling task texts and a plurality of the historical resource scheduling strategy texts to obtain a plurality of combinations, wherein each combination includes: a historical scheduling task text and a historical resource scheduling strategy text corresponding to the historical scheduling task text; The machine learning model is adjusted according to the multiple combinations to generate the adapter model for implementing resource scheduling.
4. The method according to claim 3, It is characterized in that The machine learning model includes a plurality of hidden layers, and the machine learning model is adjusted according to the plurality of combinations, including: Generate the knowledge graph corresponding to each combination, and store each knowledge graph in an adapter, wherein each adapter includes multiple adapter layers; Each adapter layer is inserted between any two of the hidden layers.
5. The method according to claim 3, It is characterized in that The knowledge graph corresponding to each combination is generated by the following method: Performing word segmentation processing on the historical scheduling task text to obtain a second type of short text sequence, and performing word segmentation processing on the historical resource scheduling strategy text to obtain a third type of short text sequence, wherein the length of the second type of short text sequence is less than the length of the historical scheduling task text, and the length of the third type of short text sequence is less than the length of the historical resource scheduling strategy text; The knowledge graph is generated according to the second category short text sequence and the third category short text sequence, wherein the data representing the subject and the object in the second category short text sequence and the third category short text sequence are nodes in the knowledge graph, and the data representing the association relationship between the subject and the object in the second category short text sequence and the third category short text sequence are edges in the knowledge graph.
6. The method according to claim 1, It is characterized in that Extracting a first resource scheduling strategy from at least one of the knowledge graphs includes: The information in the knowledge graph containing multiple entities and multiple relationships is converted into text information containing the starting address of the provided resources, the type of resources provided, and the quantity of resources provided, and the text information is output as the first resource scheduling strategy.
7. The method according to claim 1, It is characterized in that The auxiliary information includes: resource scheduling duration; The resource scheduling model determines the second resource scheduling strategy in the following manner: The resource scheduling duration, the required resource type, the required resource quantity and the destination address are input as input information into the value function to obtain the output result of the value function, wherein the output result includes: multiple third resource scheduling strategies, and multiple function values, wherein each of the third resource scheduling strategies corresponds to one function value, and each function value is used to indicate the achievement result of the scheduling target.
8. The method according to claim 7, It is characterized in that The resource scheduling model is trained by the following method: Using the historical resource scheduling information as training data, and iteratively training the classification model through the training data and the value function until the number of iterations reaches a preset number of iterations; Determine the accuracy of the classification model after iterative training using test data; When the accuracy rate is greater than or equal to a preset accuracy rate, outputting the classification model after iterative training as the resource scheduling model; When the accuracy rate is less than the preset accuracy rate, continue to train the classification model.
9. A resource scheduling device, It is characterized in that include: A receiving module, used to receive a scheduling task text for indicating resource requirements, wherein the scheduling task text at least includes: a required resource type, a required resource quantity, and a destination address of the required resource; An extraction module, used to extract multiple entities and multiple relationships from the scheduling task text, wherein the relationship is used to indicate the association relationship between the subject and the object in the scheduling task text; A query module, configured to query the entity and the relationship in a plurality of knowledge graphs generated according to the historical resource scheduling information, and extract a first resource scheduling strategy from at least one of the knowledge graphs when a plurality of the entities and a plurality of the relationships exist simultaneously in at least one of the knowledge graphs; The processing module inputs the scheduling task text and the auxiliary information for indicating the scheduling target into the resource scheduling model to obtain a second resource scheduling strategy for achieving the scheduling target when the entity or the relationship does not exist in the knowledge graph.
10. A non-volatile storage medium, It is characterized in that The non-volatile storage medium stores a computer program, wherein the resource scheduling method according to any one of claims 1 to 7 is executed by running the computer program on the device where the non-volatile storage medium is located.
11. An electronic device comprising a memory and a processor, It is characterized in that The memory stores a computer program, and the processor is configured to execute the resource scheduling method according to any one of claims 1 to 7 through the computer program.
12. A computer program product comprising computer instructions, It is characterized in that When the computer instructions are executed by a processor, the steps of the resource scheduling method described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Task processing method and device based on intelligent agent and electronic equipment
CN119166834A
Generative AI-based digital examination collaborative scheduling method and system
CN120562781A
