Knowledge base cluster scheduling method and device, equipment, storage medium and program product
By gradually upgrading the target algorithm of the knowledge base cluster and the scheduling method of the knowledge base cluster, the problem of vector database incompatibility after the algorithm upgrade is solved, the stability and continuity of the service are achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202411362198.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-21
AI Technical Summary
In the knowledge base, the vector data in the original vector database after the algorithm is upgraded is incompatible, resulting in the query accuracy being affected. The existing solution is to regenerate the entire vector database, affecting service stability and continuity, and have a poor user experience.
Provides a knowledge base cluster scheduling method that gradually upgrades the target algorithm of the knowledge base cluster by receiving upgrade instructions for the target algorithm when the version numbers of the target algorithm before and after the upgrade are different, and continues to upgrade other knowledge bases after the vector database update is completed. The cluster schedules the knowledge base cluster based on the upgrade related information to respond to business requests.
By gradually upgrading the target algorithm and knowledge base cluster, we ensure that we can still respond to business requests during the vector database update process, ensure the stability and continuity of services, and improve user experience.
Smart Images

Figure CN119336460A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and in particular to a knowledge base cluster scheduling method, device, equipment, storage medium and program product. Background Art
[0002] With the rapid development of computer technology, the use of knowledge bases has gradually increased.
[0003] In the use of knowledge bases, the Retrieval Augmented Generation (RAG) technology is usually used. For RAG-based knowledge bases, algorithms are used to generate vector databases. When there is a query request, relevant content is first queried from the vector database, and then the required content is queried by combining the algorithm and the large model.
[0004] If the algorithm is upgraded, the vector data in the original vector database is generated using the algorithm before the upgrade, and the algorithm before the upgrade is incompatible with the upgraded algorithm, which will affect the query accuracy. To solve this problem, the conventional approach is to regenerate the entire vector database, that is, to use the new algorithm to regenerate vector data from all historical knowledge, and achieve a synchronous upgrade of the algorithm and vector database. However, in the process of regenerating the vector database using the new algorithm, the service needs to be stopped, and the service will not be continued until the vector database is regenerated, which affects the stability and continuity of the service and the user experience is poor. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a knowledge base cluster scheduling method, device, equipment, storage medium and program product to ensure the stability and continuity of services and improve user experience. The specific technical solution is as follows:
[0006] In a first aspect, a knowledge base cluster scheduling method is provided, comprising:
[0007] Receive upgrade instructions for the target algorithm;
[0008] In the case where the version numbers of the target algorithms before and after the upgrade are different, the target algorithm applied by the first knowledge base cluster of at least two knowledge base clusters is upgraded so that the first knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, and updates the vector database;
[0009] After the vector database is updated, upgrading the target algorithms applied to the other knowledge base clusters among the at least two knowledge base clusters except the first knowledge base cluster;
[0010] In case of a business request, scheduling of the knowledge base cluster is performed based on the upgrade association information to respond to the business request;
[0011] The upgrade association information includes the version number of the target algorithm applied by each knowledge base cluster, and the version number of the target algorithm corresponding to each knowledge and used to generate vector data from the corresponding knowledge.
[0012] Optionally, the method further comprises:
[0013] In the case where the version numbers of the target algorithms before and after the upgrade are the same, the target algorithm applied by each of the at least two knowledge base clusters is upgraded simultaneously.
[0014] Optionally, when the service request includes a query request for target content, the scheduling of the knowledge base cluster based on the upgrade association information includes:
[0015] Determine whether the version numbers of the target algorithms applied by different knowledge base clusters are the same;
[0016] In the case where the version numbers of the target algorithms applied by different knowledge base clusters are different, determining, according to the upgrade association information and the query request, a first version number of the target algorithm used to generate vector data from the knowledge required for the target content;
[0017] Determine, according to the upgrade association information, a second knowledge base cluster that applies a target algorithm having the first version number;
[0018] The second knowledge base cluster is scheduled to respond to the query request based on the vector database.
[0019] Optionally, the method further comprises:
[0020] In the case that the version numbers of the target algorithms applied by different knowledge base clusters are the same, determining the third knowledge base cluster currently polled according to the first polling rule;
[0021] The third knowledge base cluster is scheduled to respond to the query request based on the vector database.
[0022] Optionally, when the business request includes an upload request for target knowledge, the scheduling of the knowledge base cluster based on the upgrade association information includes:
[0023] Determine whether the version numbers of the target algorithms applied by different knowledge base clusters are the same;
[0024] In the case that the version numbers of the target algorithms applied by different knowledge base clusters are different, determining a fourth knowledge base cluster according to the upgrade association information, wherein the upgrade time of the target algorithm applied by the fourth knowledge base cluster is closest to the current time;
[0025] The fourth knowledge base cluster is scheduled to apply a target algorithm to generate vector data from the target knowledge and write the vector data into the vector database.
[0026] Optionally, the method further comprises:
[0027] In the case that the version numbers of the target algorithms applied by different knowledge base clusters are the same, determining the fifth knowledge base cluster currently polled according to the second polling rule;
[0028] The fifth knowledge base cluster is scheduled to apply a target algorithm to generate vector data from the target knowledge and write the vector data into the vector database.
[0029] In a second aspect, a knowledge base cluster scheduling device is provided, comprising:
[0030] A receiving module, used for receiving an upgrade instruction for a target algorithm;
[0031] A first upgrading module is used to upgrade the target algorithm applied by the first knowledge base cluster of at least two knowledge base clusters when the version numbers of the target algorithms before and after the upgrading are different, so that the first knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, and updates the vector database;
[0032] A second upgrading module is used to upgrade the target algorithm applied to other knowledge base clusters of the at least two knowledge base clusters except the first knowledge base cluster after the vector database is updated;
[0033] A scheduling module, used to schedule the knowledge base cluster based on the upgrade association information in response to a business request;
[0034] The upgrade association information includes the version number of the target algorithm applied by each knowledge base cluster, and the version number of the target algorithm corresponding to each knowledge and used to generate vector data from the corresponding knowledge.
[0035] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0036] Memory, used to store computer programs;
[0037] The processor is used to implement the steps of the knowledge base cluster scheduling method described in the first aspect when executing the program stored in the memory.
[0038] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the program is executed by a processor, the steps of the knowledge base cluster scheduling method described in the first aspect are implemented.
[0039] In a fifth aspect, a computer program product is provided, which includes computer instructions, which are stored in a computer-readable storage medium and are suitable for being read and executed by a processor, so that an electronic device having the processor performs the steps of the knowledge base cluster scheduling method described in the first aspect.
[0040] By applying the technical solution provided in the embodiment of the present application, after receiving an upgrade instruction for a target algorithm, if the version numbers of the target algorithms before and after the upgrade are different, first select a knowledge base cluster to upgrade the target algorithm it applies, so that the knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, and updates the vector database. After the vector database is updated, the target algorithms applied by other knowledge base clusters are upgraded. In the case of business requests, the knowledge base clusters can be scheduled based on the upgrade-related information to respond to the corresponding business requests. Through this upgrade method and the scheduling of multiple knowledge base clusters, business requests can be responded to during the upgrade of the target algorithm or the update of the vector database, which can ensure the stability and continuity of the service and help improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0042] Figure 1 This is a schematic diagram of the structure of the knowledge base cluster scheduling system in the embodiment of the present application;
[0043] Figure 2 This is a flow chart of an implementation of a knowledge base cluster scheduling method in an embodiment of the present application;
[0044] Figure 3 A scheduling flow chart of content query in an embodiment of the present application;
[0045] Figure 4 This is a scheduling flow chart for knowledge upload in an embodiment of the present application;
[0046] Figure 5 This is a schematic diagram of the structure of a knowledge base cluster scheduling device in an embodiment of the present application;
[0047] Figure 6 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0049] The core of this application is to provide a knowledge base cluster scheduling method, which can be applied to knowledge base related scenarios, such as artificial intelligence, big data processing, knowledge base management, knowledge base scheduling, novel chat assistant, etc.
[0050] In a possible implementation, the embodiment of the present application may be executed by a scheduling server, and the scheduling server is connected to at least two knowledge base clusters. Figure 1 As shown, the scheduling server is connected to the knowledge base cluster 1 and the knowledge base cluster 2 respectively. Different knowledge base clusters can correspond to the same knowledge base and vector database. The knowledge base cluster applies the target algorithm to process the knowledge in the knowledge base, generates vector data, and forms a vector database.
[0051] After receiving the upgrade instruction for the target algorithm, the scheduling server first selects a knowledge base cluster to upgrade the target algorithm it applies if the version numbers of the target algorithms before and after the upgrade are different, so that the knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, updates the vector database, and then upgrades the target algorithms applied by other knowledge base clusters after the vector database is updated. In the case of business requests, the knowledge base cluster can be scheduled based on the upgrade-related information, such as Figure 1 As shown, in response to the corresponding business request.
[0052] Through this upgrade method and the scheduling of multiple knowledge base clusters, business requests can be responded to during the process of updating the vector database or during the process of updating the vector database, which can ensure the stability and continuity of the service and help improve the user experience.
[0053] It should be noted that the above description is based on an example in which the scheduling server is an independent server, but it is understandable that in actual applications, the scheduling server can also be replaced by a scheduling server cluster, or a distributed cluster composed of multiple scheduling servers. Figure 1 In the example, the scheduling server can also be replaced by a scheduling platform composed of multiple scheduling servers.
[0054] It should be noted that the target algorithm in the embodiment of the present application can be understood as a software development kit (SDK), which includes two functions. One function is used to process knowledge, including splitting the knowledge content and some other processing, generating vector data, and writing it into the vector database. The other function works during query, that is, after querying the relevant data from the vector database, it is further processed by another function of the target algorithm, and then combined with the large model to finally obtain the query result. These two functions are implemented in the same target algorithm SDK and have an associated relationship.
[0055] See also Figure 2 As shown, it is an implementation flow chart of a knowledge base cluster scheduling method provided in an embodiment of the present application, and the method may include the following steps:
[0056] S210: Receive an upgrade instruction for a target algorithm.
[0057] In the embodiment of the present application, the knowledge in the knowledge base can generate vector data after being processed by the target algorithm to form a vector database. When there is a query request, relevant data can be queried from the vector database first, and then the required content can be queried by combining the target algorithm and the large model.
[0058] Based on the algorithm optimization consideration, the target algorithm can be upgraded. After receiving the upgrade instruction for the target algorithm, the subsequent steps can be continued.
[0059] S220: When the version numbers of the target algorithms before and after the upgrade are different, the target algorithm applied by the first knowledge base cluster in at least two knowledge base clusters is upgraded so that the first knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, and updates the vector database.
[0060] After receiving the upgrade instruction for the target algorithm, the upgrade of the target algorithm applied to the knowledge base cluster can be triggered.
[0061] You can first determine whether the version numbers of the target algorithms before and after the upgrade are the same. If the version numbers of the target algorithms before and after the upgrade are the same, it can be considered that the upgraded target algorithm is compatible with the target algorithm before the upgrade, and upgrading the target algorithm will not affect the query of data in the vector database. If the version numbers of the target algorithms before and after the upgrade are different, it can be considered that the upgraded target algorithm is incompatible with the target algorithm before the upgrade, and upgrading the target algorithm will affect the query of data in the vector database.
[0062] The version number of the target algorithm can be used to intuitively determine whether the target algorithms before and after the upgrade are compatible, and whether the target algorithms applied in different knowledge base clusters are the same.
[0063] It should be noted that the target algorithms before and after the upgrade are incompatible, which can be understood as the vector data generation logic of the first function of the target algorithm before the upgrade is incompatible with the query logic of the second function of the target algorithm after the upgrade. The second function of the target algorithm after the upgrade cannot accurately query the vector data generated by the first function of the target algorithm before the upgrade. Conversely, the target algorithms before and after the upgrade are compatible, which can be understood as the vector data generation logic of the first function of the target algorithm before the upgrade is compatible with the query logic of the second function of the target algorithm after the upgrade. The vector data generated by the first function of the target algorithm before the upgrade can be queried using the second function of the target algorithm after the upgrade.
[0064] In the case where the version numbers of the target algorithms before and after the upgrade are different, the target algorithm applied by the first knowledge base cluster among the at least two knowledge base clusters can be upgraded first. The first knowledge base cluster is any one of the at least two knowledge base clusters. After upgrading the target algorithm applied by the first knowledge base cluster, the first knowledge base cluster can apply the upgraded target algorithm to regenerate vector data from the knowledge in the knowledge base and update the vector database. Before the vector database is updated, the target algorithms applied by other knowledge base clusters except the first knowledge base cluster will not be upgraded.
[0065] In the process of the first knowledge base cluster regenerating vector data from the knowledge in the knowledge base, some vector data in the vector database are obtained by processing the knowledge using the upgraded target algorithm, and some vector data are obtained by processing the knowledge using the target algorithm before the upgrade. After the vector database is updated, that is, all the knowledge in the knowledge base is regenerated into vector data using the upgraded target algorithm, all the vector data in the vector database are obtained by processing the knowledge using the upgraded target algorithm.
[0066] S230: After the vector database is updated, the target algorithms applied to the other knowledge base clusters except the first knowledge base cluster in the at least two knowledge base clusters are upgraded.
[0067] After the vector database is updated, all vector data in the vector database are obtained by processing knowledge using the upgraded target algorithm. In this case, the target algorithms applied to the other knowledge base clusters except the first knowledge base cluster in at least two knowledge base clusters can be upgraded.
[0068] For example, at least two knowledge base clusters include knowledge base cluster 1 and knowledge base cluster 2. After the target algorithm applied to knowledge base cluster 1 is upgraded and knowledge base cluster 1 applies the upgraded target algorithm, the knowledge in the knowledge base is regenerated into vector data. After the vector database is updated, the target algorithm applied to knowledge base cluster 2 is upgraded.
[0069] If there are multiple other knowledge base clusters besides the first knowledge base cluster, the target algorithms applied by the multiple other knowledge base clusters can be upgraded simultaneously, or the target algorithms applied by each other knowledge base cluster can be upgraded in sequence.
[0070] After the target algorithms of other knowledge base cluster applications are upgraded, the version numbers of the target algorithms of each knowledge base cluster application, including the first knowledge base cluster, are the same, thus achieving a smooth upgrade of the target algorithms of the knowledge base cluster applications.
[0071] S240: When there is a business request, the knowledge base cluster is scheduled based on the upgrade association information to respond to the business request.
[0072] The upgrade association information includes the version number of the target algorithm applied by each knowledge base cluster and the version number of the target algorithm corresponding to each knowledge for generating vector data from the corresponding knowledge.
[0073] In an embodiment of the present application, the upgrade association information can be determined based on the version number of the target algorithm applied by the knowledge base cluster and the version number of the target algorithm corresponding to the vector data in the vector database. The upgrade association information may include the version number of the target algorithm applied by each knowledge base cluster and the version number of the target algorithm corresponding to each knowledge for generating vector data from the corresponding knowledge. The knowledge in the knowledge base, or documents, have corresponding labels, which can be recorded as knowledge IDs. The knowledge ID of each knowledge has a corresponding relationship with the version number of the target algorithm used to generate vector data for the knowledge.
[0074] After the vector database is updated, or during the vector database update process, if there is a business request, the knowledge base cluster can be scheduled based on the upgrade association information to continuously respond to the business request.
[0075] By applying the method provided in the embodiment of the present application, after receiving an upgrade instruction for a target algorithm, if the version numbers of the target algorithms before and after the upgrade are different, first select a knowledge base cluster to upgrade the target algorithm it applies, so that the knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, and updates the vector database. After the vector database is updated, the target algorithms applied by other knowledge base clusters are upgraded. In the case of business requests, the knowledge base clusters can be scheduled based on the upgrade-related information to respond to the corresponding business requests. Through this upgrade method and the scheduling of multiple knowledge base clusters, business requests can be responded to during the upgrade of the target algorithm or the update of the vector database, which can ensure the stability and continuity of the service and help improve the user experience.
[0076] In some embodiments of the present application, the method may further include the following steps:
[0077] In the case where the version numbers of the target algorithms before and after the upgrade are the same, the target algorithms applied to each knowledge base cluster in at least two knowledge base clusters are upgraded simultaneously.
[0078] In the embodiment of the present application, if the version numbers of the target algorithms before and after the upgrade are the same, it can be considered that the upgraded target algorithm is compatible with the target algorithm before the upgrade and will not affect the query of data in the vector database. Therefore, if the version numbers of the target algorithms before and after the upgrade are the same, the target algorithms applied by each knowledge base cluster in at least two knowledge base clusters can be upgraded at the same time to improve the upgrade efficiency.
[0079] Of course, the target algorithm applied to each knowledge base cluster can also be upgraded in turn.
[0080] After the target algorithm applied to each knowledge base cluster is upgraded, there is no need to apply the upgraded target algorithm to regenerate vector data from the knowledge in the knowledge base, which helps save resources.
[0081] In some embodiments of the present application, when the service request includes a query request for target content, step S240 performs scheduling of the knowledge base cluster based on the upgrade association information, including:
[0082] Determine whether the version numbers of the target algorithms applied by different knowledge base clusters are the same;
[0083] In the case where the version numbers of the target algorithms applied by different knowledge base clusters are different, determining, according to the upgrade association information and the query request, a first version number of the target algorithm used to generate vector data from the knowledge required for the target content;
[0084] Determine, according to the upgrade association information, a second knowledge base cluster for applying a target algorithm having a first version number;
[0085] The second knowledge base cluster is scheduled to respond to the query request based on the vector database.
[0086] For the convenience of description, the above steps are combined for explanation.
[0087] In the embodiment of the present application, the service request may include a query request for target content.
[0088] After the vector database is updated, if the target algorithm applied to each knowledge base cluster is also upgraded, the version number of the target algorithm applied to each knowledge base cluster is the same. If the upgrade of the target algorithm applied to each knowledge base cluster has not been completed, the version numbers of the target algorithms applied to different knowledge base clusters are different.
[0089] During the vector database update process, only the target algorithm of the first knowledge base cluster application is upgraded, and the target algorithms of other knowledge base cluster applications have not been upgraded. In this case, the version number of the target algorithm of the first knowledge base cluster application is different from the version number of the target algorithms of other knowledge base cluster applications.
[0090] When there is a query request for target content, it can be determined first whether the version numbers of target algorithms applied by different knowledge base clusters are the same.
[0091] In the case where the version numbers of the target algorithms applied by different knowledge base clusters are different, the first version number of the target algorithm used to generate vector data from the knowledge required for the target content can be determined based on the upgrade association information and the query request. For example, based on the query request, it is determined that the knowledge required for the target content includes knowledge A, and based on the upgrade association information, the version number of the target algorithm used to generate vector data from knowledge A corresponding to knowledge A is determined, such as version number X.
[0092] Further, the second knowledge base cluster applying the target algorithm with the first version number can be determined based on the upgrade association information. For example, in the above example, the determined first version number is version number X. Based on the upgrade association relationship, the second knowledge base cluster applying the target algorithm with version number X can be determined.
[0093] The second knowledge base cluster is scheduled to apply a target algorithm with a first version number to query the vector data in the vector database and respond to the query request.
[0094] The second knowledge base cluster may be one of at least two knowledge base clusters, the version number of the target algorithm applied by the second knowledge base cluster is the first version number, and the version numbers of the target algorithms applied by other knowledge base clusters are different from the first version number.
[0095] When the version numbers of the target algorithms applied in different knowledge base clusters are different, first determine the first version number of the target algorithm used to generate vector data from the knowledge required for the target content, then determine the second knowledge base cluster that has the target algorithm with the first version number applied, and schedule the second knowledge base cluster to ensure that the query request can be responded to correctly.
[0096] In some embodiments of the present application, the method may further include the following steps:
[0097] In the case that the version numbers of the target algorithms applied by different knowledge base clusters are the same, determining the third knowledge base cluster currently polled according to the first polling rule;
[0098] The third knowledge base cluster is scheduled to respond to the query request based on the vector database.
[0099] For the convenience of description, the above steps are combined for explanation.
[0100] In an embodiment of the present application, when there is a query request for target content, it is first determined whether the version numbers of the target algorithms applied by different knowledge base clusters are the same. If the version numbers of the target algorithms applied by different knowledge base clusters are the same, it is considered that any knowledge base cluster can be scheduled to respond to the query request.
[0101] The first polling rule may be preset. The first polling rule may be a rule related to order, such as when at least two knowledge base clusters include knowledge base cluster 1, knowledge base cluster 2, and knowledge base cluster 3, the first polling rule is to perform polling in the order of knowledge base cluster 1 → knowledge base cluster 2 → knowledge base cluster 3 → knowledge base cluster 1. Alternatively, the first polling rule may be a rule related to number of times, such as performing polling according to a rule that each knowledge base cluster is continuously scheduled three times.
[0102] When the version numbers of target algorithms applied by different knowledge base clusters are the same, the third knowledge base cluster currently polled can be determined according to the first polling rule, and then the third knowledge base cluster is scheduled to respond to the query request based on the vector database.
[0103] In this way, each knowledge base cluster is scheduled by polling, which helps to balance the load of each knowledge base cluster.
[0104] The third knowledge base cluster is one of the at least two knowledge base clusters and is the knowledge base cluster currently polled.
[0105] like Figure 3 As shown in the figure, the scheduling process of content query is as follows:
[0106] Receiving a query request for target content;
[0107] Determine whether the version numbers of the target algorithms applied by different knowledge base clusters are the same;
[0108] If the version numbers of the target algorithms applied by different knowledge base clusters are the same, round-robin scheduling is performed;
[0109] If the version numbers of the target algorithms applied by different knowledge base clusters are different, determining a first version number of the target algorithm used to generate vector data from the knowledge required for the target content;
[0110] A knowledge base cluster that applies a target algorithm having a first version number is scheduled to respond to the query request.
[0111] In some embodiments of the present application, when the business request includes an upload request for target knowledge, step S240 performs scheduling of the knowledge base cluster based on the upgrade association information, which may include the following steps:
[0112] Determine whether the version numbers of the target algorithms applied by different knowledge base clusters are the same;
[0113] In the case that the version numbers of the target algorithms applied by different knowledge base clusters are different, determining, according to the upgrade association information, a fourth knowledge base cluster, the upgrade time of the target algorithm applied by the fourth knowledge base cluster being closest to the current time;
[0114] The fourth knowledge base cluster is scheduled to apply the target algorithm to generate vector data from the target knowledge and write it into the vector database.
[0115] For the convenience of description, the above steps are combined for explanation.
[0116] As described above, after the vector database is updated, if the target algorithm applied to each knowledge base cluster is also upgraded, the version number of the target algorithm applied to each knowledge base cluster is the same. If the upgrade of the target algorithm applied to each knowledge base cluster has not been completed, the version numbers of the target algorithms applied to different knowledge base clusters are different.
[0117] During the vector database update process, only the target algorithm of the first knowledge base cluster application is upgraded, and the target algorithms of other knowledge base cluster applications have not been upgraded. In this case, the version number of the target algorithm of the first knowledge base cluster application is different from the version number of the target algorithms of other knowledge base cluster applications.
[0118] In the case of an upload request for target knowledge, it may be first determined whether the version numbers of target algorithms applied by different knowledge base clusters are the same.
[0119] When the version numbers of target algorithms applied by different knowledge base clusters are different, the fourth knowledge base cluster can be determined first according to the upgrade association information. The upgrade time of the target algorithm applied by the fourth knowledge base cluster is closest to the current time, which can be understood as the version number of the target algorithm applied by the fourth knowledge base cluster is the latest, or the fourth knowledge base cluster is the knowledge base cluster that has completed the target algorithm upgrade the latest.
[0120] After the fourth knowledge base cluster is determined, the fourth knowledge base cluster can be scheduled to use the target algorithm to generate vector data for the target knowledge and write it into the vector database. In this way, for new knowledge, the latest upgraded target algorithm is applied to process it and generate corresponding vector data.
[0121] The fourth database cluster is one of the at least two database clusters, and the upgrade time of the target algorithm applied by the fourth database cluster is closest to the current time.
[0122] When different knowledge base clusters apply different version numbers of target algorithms, the knowledge base cluster whose target algorithm upgrade time is closest to the current time is scheduled to respond to the upload request. This ensures that new knowledge can be processed using the most recently upgraded target algorithm.
[0123] In some embodiments of the present application, the method may further include the following steps:
[0124] In the case that the version numbers of the target algorithms applied by different knowledge base clusters are the same, determining the fifth knowledge base cluster currently polled according to the second polling rule;
[0125] The fifth knowledge base cluster is scheduled to apply the target algorithm to generate vector data from the target knowledge and write it into the vector database.
[0126] For the convenience of description, the above steps are combined for explanation.
[0127] In an embodiment of the present application, when there is an upload request for target knowledge, it is determined whether the version numbers of the target algorithms applied by different knowledge base clusters are the same. If the version numbers of the target algorithms applied by different knowledge base clusters are the same, it is considered that any knowledge base cluster can be scheduled to respond to the upload request.
[0128] The second polling rule may be preset. The second polling rule may be a rule related to the order, such as when at least two knowledge base clusters include knowledge base cluster 1, knowledge base cluster 2, and knowledge base cluster 3, the second polling rule is to perform polling in the order of knowledge base cluster 1 → knowledge base cluster 2 → knowledge base cluster 3 → knowledge base cluster 1. Alternatively, the second polling rule may be a rule related to the number of times, such as performing polling according to the rule that each knowledge base cluster is continuously scheduled three times.
[0129] The second polling rule may be the same as or different from the first polling rule.
[0130] When the version numbers of the target algorithms applied by different knowledge base clusters are the same, the fifth knowledge base cluster currently polled is determined according to the second polling rule, and then the fifth knowledge base cluster is scheduled to use the target algorithm to generate vector data for the target knowledge and write it into the vector database.
[0131] In this way, each knowledge base cluster is scheduled by polling, which helps to balance the load of each knowledge base cluster.
[0132] The fifth knowledge base cluster is one of the at least two knowledge base clusters and is the knowledge base cluster currently polled.
[0133] like Figure 4 As shown in the figure, the scheduling process of knowledge upload is as follows:
[0134] receiving an upload request for target knowledge;
[0135] Determine whether the version numbers of the target algorithms applied by different knowledge base clusters are the same;
[0136] If the version numbers of the target algorithms applied by different knowledge base clusters are the same, round-robin scheduling is performed;
[0137] If the version numbers of the target algorithms applied by different knowledge base clusters are different, the knowledge base cluster that has completed the target algorithm upgrade most recently is scheduled to respond to the upload request.
[0138] The embodiment of the present application deploys at least two knowledge base clusters. When the target algorithm is not upgraded, upload requests and query requests can be polled and scheduled to respond to each knowledge base cluster.
[0139] When the target algorithm is upgraded, the target algorithm of one of the knowledge base clusters will be selected for upgrade first, and the vector database of the knowledge in the knowledge base will be regenerated after the upgrade. After the vector database is updated, the target algorithms of other knowledge base clusters will be upgraded. During the upgrade, it is assumed that the target algorithm of knowledge base cluster 1 is upgraded first, and the target algorithm of knowledge base cluster 2 is upgraded later. After the target algorithm of knowledge base cluster 1 is upgraded, all user requests for newly uploaded knowledge will be dispatched to knowledge base cluster 1 for processing. For requests for query content, it will be determined whether the knowledge to be queried is a new version or an old version. If it is a new version, it will be dispatched to knowledge base cluster 1, and if it is an old version, it will be dispatched to knowledge base cluster 2. In this way, the algorithm upgrade can be completed without stopping the service, ensuring the stability and continuity of the service and improving the user experience.
[0140] Corresponding to the above method embodiment, the embodiment of the present application further provides a knowledge base cluster scheduling device. The knowledge base cluster scheduling device described below and the knowledge base cluster scheduling method described above can refer to each other.
[0141] See also Figure 5 As shown, the knowledge base cluster scheduling device 500 may include the following modules:
[0142] A receiving module 510 is used to receive an upgrade instruction for a target algorithm;
[0143] A first upgrading module 520 is used to upgrade the target algorithm applied by the first knowledge base cluster of at least two knowledge base clusters when the version numbers of the target algorithms before and after the upgrading are different, so that the first knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, and updates the vector database;
[0144] A second upgrading module 530 is used to upgrade the target algorithm applied to the other knowledge base clusters except the first knowledge base cluster in the at least two knowledge base clusters after the vector database is updated;
[0145] The scheduling module 540 is used to schedule the knowledge base cluster based on the upgrade association information to respond to the business request when there is a business request;
[0146] The upgrade association information includes the version number of the target algorithm applied by each knowledge base cluster and the version number of the target algorithm corresponding to each knowledge for generating vector data from the corresponding knowledge.
[0147] Using the device provided in the embodiment of the present application, after receiving an upgrade instruction for a target algorithm, if the version numbers of the target algorithms before and after the upgrade are different, first select a knowledge base cluster to upgrade the target algorithm it applies, so that the knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, and updates the vector database. After the vector database is updated, the target algorithms applied by other knowledge base clusters are upgraded. In the case of a business request, the knowledge base cluster can be scheduled based on the upgrade-related information to respond to the corresponding business request. Through this upgrade method and the scheduling of multiple knowledge base clusters, business requests can be responded to during the upgrade of the target algorithm or the update of the vector database, which can ensure the stability and continuity of the service and help improve the user experience.
[0148] In some embodiments of the present application, the knowledge base cluster scheduling device 500 further includes a third upgrading module, which is used to:
[0149] In the case where the version numbers of the target algorithms before and after the upgrade are the same, the target algorithms applied to each knowledge base cluster in at least two knowledge base clusters are upgraded simultaneously.
[0150] In some embodiments of the present application, when the service request includes a query request for target content, the scheduling module 540 is specifically configured to:
[0151] Determine whether the version numbers of the target algorithms applied by different knowledge base clusters are the same;
[0152] In the case where the version numbers of the target algorithms applied by different knowledge base clusters are different, determining, according to the upgrade association information and the query request, a first version number of the target algorithm used to generate vector data from the knowledge required for the target content;
[0153] Determine, according to the upgrade association information, a second knowledge base cluster for applying a target algorithm having a first version number;
[0154] The second knowledge base cluster is scheduled to respond to the query request based on the vector database.
[0155] In some embodiments of the present application, the scheduling module 540 is further configured to:
[0156] In the case that the version numbers of the target algorithms applied by different knowledge base clusters are the same, determining the third knowledge base cluster currently polled according to the first polling rule;
[0157] The third knowledge base cluster is scheduled to respond to the query request based on the vector database.
[0158] In some embodiments of the present application, when the business request includes an upload request for target knowledge, the scheduling module 540 is specifically configured to:
[0159] Determine whether the version numbers of the target algorithms applied by different knowledge base clusters are the same;
[0160] In the case that the version numbers of the target algorithms applied by different knowledge base clusters are different, determining, according to the upgrade association information, a fourth knowledge base cluster, the upgrade time of the target algorithm applied by the fourth knowledge base cluster being closest to the current time;
[0161] The fourth knowledge base cluster is scheduled to apply the target algorithm to generate vector data from the target knowledge and write it into the vector database.
[0162] In some embodiments of the present application, the scheduling module 540 is further configured to:
[0163] In the case that the version numbers of the target algorithms applied by different knowledge base clusters are the same, determining the fifth knowledge base cluster currently polled according to the second polling rule;
[0164] The fifth knowledge base cluster is scheduled to apply the target algorithm to generate vector data from the target knowledge and write it into the vector database.
[0165] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0166] The present application also provides an electronic device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.
[0167] Memory 603, used for storing computer programs;
[0168] The processor 601 is used to execute the program stored in the memory 603 to implement the following steps:
[0169] Receive upgrade instructions for the target algorithm;
[0170] In the case where the version numbers of the target algorithms before and after the upgrade are different, the target algorithm applied by the first knowledge base cluster of the at least two knowledge base clusters is upgraded so that the first knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, and updates the vector database;
[0171] After the vector database is updated, the target algorithm applied to the other knowledge base clusters except the first knowledge base cluster in the at least two knowledge base clusters is upgraded;
[0172] In case of business requests, the knowledge base cluster is scheduled based on the upgrade-related information to respond to the business requests;
[0173] The upgrade association information includes the version number of the target algorithm applied by each knowledge base cluster and the version number of the target algorithm corresponding to each knowledge for generating vector data from the corresponding knowledge.
[0174] The communication bus 604 mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 604 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0175] The communication interface 602 is used for communication between the terminal and other devices.
[0176] The memory 603 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory 603 may also be at least one storage device located away from the aforementioned processor.
[0177] The above-mentioned processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0178] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the instructions are executed on a computer, the computer executes the steps of the knowledge base cluster scheduling method in any of the above embodiments.
[0179] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of any one of the knowledge base cluster scheduling methods in the above embodiments.
[0180] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0181] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0182] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0183] The above are only preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the protection scope of the present application.
Claims
1. A knowledge base cluster scheduling method, characterized in that: include: Receive upgrade instructions for the target algorithm; In the case where the version numbers of the target algorithms before and after the upgrade are different, the target algorithm applied by the first knowledge base cluster of at least two knowledge base clusters is upgraded so that the first knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, and updates the vector database; After the vector database is updated, upgrading the target algorithms applied to the other knowledge base clusters among the at least two knowledge base clusters except the first knowledge base cluster; In case of a business request, scheduling of the knowledge base cluster is performed based on the upgrade association information to respond to the business request; The upgrade association information includes the version number of the target algorithm applied by each knowledge base cluster, and the version number of the target algorithm corresponding to each knowledge and used to generate vector data from the corresponding knowledge.
2. The method according to claim 1, characterized in that The method further comprises: In the case where the version numbers of the target algorithms before and after the upgrade are the same, the target algorithm applied by each of the at least two knowledge base clusters is upgraded simultaneously.
3. The method according to claim 1 or 2, characterized in that: In the case where the service request includes a query request for target content, the scheduling of the knowledge base cluster based on the upgrade association information includes: Determine whether the version numbers of the target algorithms applied by different knowledge base clusters are the same; In the case where the version numbers of the target algorithms applied by different knowledge base clusters are different, determining, according to the upgrade association information and the query request, a first version number of the target algorithm used to generate vector data from the knowledge required for the target content; Determine, according to the upgrade association information, a second knowledge base cluster that applies a target algorithm having the first version number; The second knowledge base cluster is scheduled to respond to the query request based on the vector database.
4. The method according to claim 3, characterized in that The method further comprises: In the case that the version numbers of the target algorithms applied by different knowledge base clusters are the same, determining the third knowledge base cluster currently polled according to the first polling rule; The third knowledge base cluster is scheduled to respond to the query request based on the vector database.
5. The method according to claim 1 or 2, characterized in that: In the case where the business request includes an upload request for target knowledge, the scheduling of the knowledge base cluster based on the upgrade association information includes: Determine whether the version numbers of the target algorithms applied by different knowledge base clusters are the same; In the case that the version numbers of the target algorithms applied by different knowledge base clusters are different, determining a fourth knowledge base cluster according to the upgrade association information, wherein the upgrade time of the target algorithm applied by the fourth knowledge base cluster is closest to the current time; The fourth knowledge base cluster is scheduled to apply a target algorithm to generate vector data from the target knowledge and write the vector data into the vector database.
6. The method according to claim 5, characterized in that The method further comprises: In the case that the version numbers of the target algorithms applied by different knowledge base clusters are the same, determining the fifth knowledge base cluster currently polled according to the second polling rule; The fifth knowledge base cluster is scheduled to apply a target algorithm to generate vector data from the target knowledge and write the vector data into the vector database.
7. A knowledge base cluster scheduling device, characterized in that: include: A receiving module, used for receiving an upgrade instruction for a target algorithm; A first upgrading module is used to upgrade the target algorithm applied by the first knowledge base cluster of at least two knowledge base clusters when the version numbers of the target algorithms before and after the upgrading are different, so that the first knowledge base cluster applies the upgraded target algorithm, regenerates vector data from the knowledge in the knowledge base, and updates the vector database; A second upgrading module is used to upgrade the target algorithm applied to other knowledge base clusters of the at least two knowledge base clusters except the first knowledge base cluster after the vector database is updated; A scheduling module, used to schedule the knowledge base cluster based on the upgrade association information in response to a business request; The upgrade association information includes the version number of the target algorithm applied by each knowledge base cluster, and the version number of the target algorithm corresponding to each knowledge and used to generate vector data from the corresponding knowledge.
8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the knowledge base cluster scheduling method as described in any one of claims 1 to 6 when executing the program stored in the memory.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the knowledge base cluster scheduling method as described in any one of claims 1 to 6 are implemented.
10. A computer program product, comprising computer instructions, which are stored in a computer-readable storage medium and are suitable for being read and executed by a processor, so that an electronic device having the processor performs the steps of the knowledge base cluster scheduling method as described in any one of claims 1 to 6.