Virtual mapping method and system based on large model
Extract key information points through dialogue and vector large models, combine text and code large models to generate indicator descriptions, and use the TOPSIS method for virtual mapping, which solves the judgment difficulties, lack of professional knowledge, and multi-objective solving problems of large language models in virtual mapping. Efficient and customized service matching and indicator generation are achieved.
Patent Information
- Application Number
- CN202410858977.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-28
AI Technical Summary
When using large language models for virtual mapping, there are a large number of irrelevant services that make judgment difficult, insufficient user expertise leads to inaccurate or wrong expressions, user-defined target service indicators are omitted and lack customization, and multi-objective solving problems are difficult to solve.
Extract key information points through dialogue with users through dialogue large models, vector large models to calculate service relevance, text and code large models to generate indicator descriptions, and combine the TOPSIS method to solve the optimal solution under multiple indicators to achieve automated and customized virtualization. mapping.
It reduces the requirements for user expertise, improves the accuracy and customization of virtual mapping, realizes automated service matching and indicator generation, and solves multi-objective solving problems.
Smart Images

Figure CN118733005A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of virtual mapping, and in particular relates to a virtual mapping method and system based on a large model. Background Art
[0002] Virtual mapping is based on a dual-middle-end architecture. It forms a modular resource mapping decision logic based on the virtualization mapping mechanism technology between the resource middle-end and the application middle-end. The specific references of resources are virtualized through various mapping mechanisms, and the call mapping of virtual resources exposed in the application middle-end supports changes in business modules, reduces the complexity of real calls through logical calls, and manages the attribute relationships of resources and applications in a timely manner.
[0003] By using the virtual elastic collaborative mapping technology between resource and application middle platforms, a virtual mapping relationship between service resource addresses and service application addresses, a virtual mapping table between data resource pool data functions and data source transaction functions, and a virtual mapping between product calls and technology stack routing addresses are formed to achieve matching between the "resource middle platform" and the "application middle platform". However, how to achieve efficient and accurate virtual mapping is an important research topic at present.
[0004] Large language models (LLMs), such as open source models such as LLma, have tens of billions or even hundreds of billions of parameters. It is this huge number of parameters that makes large models excel in analytical reasoning capabilities and demonstrate extraordinary performance in areas such as text generation and code generation. Research has shown that large language models also have emergent capabilities, one of which is in-context learning. This means that large language models only need a small number of sample examples to perform effective reasoning without adjusting the model weights in the process. Given the huge potential of large language models in code understanding and various reasoning tasks, it is feasible to use their contextual reasoning capabilities to achieve virtual mapping tasks.
[0005] However, there are some challenges in using large models for virtual mapping, mainly in the following aspects:
[0006] 1. Since the resource center provides a large number of services, if all of them are input into the big model, there will be a large number of obviously irrelevant services, which will affect the judgment of the big model. Therefore, a method is needed to filter in advance to obtain some related services to improve the accuracy of the mapping.
[0007] 2. Due to insufficient professional knowledge of the user, the expression may be inaccurate or wrong, which may cause the virtual mapping service to not meet the actual needs of the user. Therefore, a method is needed to enable users who lack certain professional knowledge to accurately express the target service they need.
[0008] 3. Although the indicators of user-defined target services are determined based on the current needs of the users, good indicators require certain professional knowledge, so there are cases where the indicators of user-defined target services are missed. The indicators defined by the system cannot be determined based on the current needs of the users themselves, and are generalized and lack customization. Therefore, a large model with professional knowledge is needed to customize dynamic indicators for the current needs of the users themselves.
[0009] 4. Because each candidate service has multiple indicators, the problem becomes a multi-objective problem. At this time, a suitable method is needed to solve the multi-objective problem. Summary of the invention
[0010] The present invention provides a large model-based virtual mapping method and system, which can realize automated and customized virtual mapping while greatly reducing the requirements for user expertise.
[0011] A virtual mapping method based on a large model comprises the following steps:
[0012] (1) Use the big dialogue model to communicate with the user and extract the key information points required to complete the virtual mapping through continuous dialogue as the service description required by the user;
[0013] (2) The correlation between all services provided by the system and the service descriptions required by the user is calculated through the vector big model, so as to select the most relevant K services from all services as candidate services and put them into the candidate service pool srvPool;
[0014] (3) Input the service description required by the user into the text model to generate the indicator description LLM_Obj; input the indicator description LLM_Obj generated by the text model, the indicator description User_Obj customized by the user, and the description of a candidate service in the candidate service pool srvPool into the code model to obtain the test code;
[0015] Traverse each candidate service in the candidate service pool srvPool and obtain the test code corresponding to each candidate service; run each test code and obtain the test result LLM_Obj_Rst corresponding to LLM_Obj and the test result User_Obj_Rs corresponding to User_Obj;
[0016] Combine LLM_Obj_Rst, User_Obj_Rst and the test result Sys_Obj_Rst of the system-defined indicator Sys_Obj to obtain the indicator result set Obj of each candidate service in the candidate service pool srvPool;
[0017] (4) In the indicator result set Obj, the TOPSIS method is used to solve the optimal solution under multiple indicators, thereby completing the virtual mapping of the service.
[0018] In step (1), the key information points required to complete the virtual mapping include: the type of service, the functional requirements of the service, the budget range, the service reliability requirements, the service performance requirements, and the service security requirements. The functional requirements of the service include: the specific functions and goals that the user hopes to achieve through the service, the input of the service, and the output of the service.
[0019] In step (1), the prompt words input to the dialogue model include both instructions and examples;
[0020] The instructions are written in a role-playing manner, requiring the dialogue model to continuously extract set key information points during the dialogue with the user. When a key information point is not obtained, it is necessary to obtain it from the user by asking questions. After all key information points are obtained, the dialogue can be ended. The examples utilize the contextual reasoning ability of the dialogue model. Through examples, the dialogue model is guided to learn how to extract key point information, and to learn which information in the user's answers should be judged as key information points, and then extract and summarize them.
[0021] In step (2), before calculating the correlation, the descriptions of all services provided by the system need to be converted into the same format as the service descriptions required by the user.
[0022] The specific process of step (2) is as follows:
[0023] First, all services provided by the system and the service descriptions required by the user are converted into vectors by using a large vector model. Then, cosine similarity is used to automatically obtain the K candidate services that are most similar to the service descriptions required by the user to form a candidate service pool srvPool.
[0024] In step (3), the system-defined indicator Sys_Obj is an external factor that can be obtained without running any code, including: price, service rating, number of users, and geographic coverage.
[0025] The specific process of step (4) is as follows:
[0026] Submit the indicator description LLM_Obj generated by the text model, the user-defined indicator description User_Obj, and the system-defined indicator description Sys_Obj to the user, and the user determines the weight W of each indicator. j ;
[0027] Each Obj in the indicator result set Obj iThey all correspond to the multi-objective solution composed of large models, users and systems. i Construct a decision matrix, and then use the TOPSIS method to find the optimal solution under multiple indicators and find the service that best suits the user.
[0028] When using the TOPSIS method, the decision matrix needs to be standardized. For positive indicators, the larger the better:
[0029]
[0030] For a negative indicator, convert it to a positive indicator:
[0031]
[0032] The transformed values are then normalized:
[0033]
[0034] Then construct a weighted standardized decision matrix, which is: The next step is to determine the ideal solution and anti-ideal solution. * and anti-ideal solution A - are the maximum and minimum values of each criterion, respectively;
[0035] The next step is to calculate the distance of each solution from the ideal solution and the anti-ideal solution using Euclidean distance; where the distance from the ideal solution is:
[0036]
[0037] The distance to the anti-ideal solution is:
[0038]
[0039] Next is to calculate the relative proximity, relative proximity Indicates how close service i is to the ideal solution:
[0040]
[0041] Finally, according to the relative proximity All candidate services are ranked. The larger the value, the better the service and the closer it is to the user's needs, thereby realizing virtual mapping of services. Here, i refers to the i-th service, j refers to the j-th indicator, n refers to the total number of services, and k refers to the k-th service.
[0042] A virtual mapping system based on a large model, including an information extraction module, a service matching module, an indicator generation and testing module, and a solution module;
[0043] In the information extraction module, the dialogue model is used to conduct dialogue with the user, and the key information points required to complete the virtual mapping are extracted through continuous dialogue as the service description required by the user;
[0044] In the service matching module, the correlation between all services provided by the system and the service description required by the user is calculated through the vector big model, so as to select the most relevant K services from all services as candidate services and put them into the candidate service pool srvPool;
[0045] In the indicator generation and testing module, a set of indicators for each candidate service is generated using a text large model and a code large model;
[0046] In the solution module, the TOPSIS method is used to solve the optimal solution under multiple indicators, thereby completing the virtual mapping of the service.
[0047] A virtual mapping system based on a large model comprises a memory and one or more processors, wherein the memory stores executable codes, and when the one or more processors execute the executable codes, the virtual mapping method is implemented.
[0048] Compared with the prior art, the present invention has the following beneficial effects:
[0049] The present invention utilizes the powerful text understanding ability and parameterized internal knowledge of the big model, allowing the big model to communicate with the user to obtain accurate formatting requirements, that is, reducing the requirements of user professional knowledge, and also improving the accuracy of the required expression; in addition, the encoding ability of the vector big model is used to quickly filter the service; at the same time, the task understanding ability and rich professional knowledge of the text big model are also utilized, allowing the text big model to dynamically generate relevant indicators for each user's personal target service needs, that is, it can supplement the user's customized indicators, reduce the requirements of user professional knowledge, and also realize the dynamicization of indicators, so that each virtual mapping indicator can be customized; at the same time, the powerful text understanding ability and code generation ability of the code big model are used to quickly generate the test code of the indicator. Through the combination of these big models, the TOPSIS method is finally used to solve, and finally the automated virtual mapping is realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a flow chart of a virtual mapping method based on a large model of the present invention;
[0051] Figure 2 The figure is a schematic diagram of a virtual mapping system based on a large model according to the present invention. DETAILED DESCRIPTION
[0052] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be pointed out that the embodiments described below are intended to facilitate the understanding of the present invention and do not have any limiting effect on the present invention.
[0053] like Figure 1 As shown, a virtual mapping method based on a large model includes the following steps:
[0054] S1. Communicate with users through the dialogue model and extract the information needed to complete virtual mapping through continuous dialogue.
[0055] S11. The system sets several key information points required for mapping.
[0056] The key information points set in advance by the system include the type of service, functional requirements of the service, budget range, service reliability requirements, service performance requirements, service security requirements, etc.; the functional requirements of the service, in addition to including the specific functions and goals that users hope to achieve through the service, also include the input and output of the service.
[0057] S12. Input a prompt that combines instructions and examples into the dialogue model.
[0058] The prompt input to the dialogue model includes two aspects: instructions and examples. (1) The instructions are written in a role-playing manner, requiring the dialogue model to continuously extract the key information points set in S11 during the dialogue with the user. When a key information point is not obtained, it needs to be obtained from the user by asking questions; after all key information points are obtained, the dialogue can be ended and the end tag " <end>"With all the extracted key information points, including the label" <end>"It is convenient for the program to identify whether the conversation should be ended, if not" <end>"Tag, continue the conversation with the user, if there is a " <end>" tag, the conversation ends and the process proceeds to the next step. (2) Examples utilize the contextual reasoning capabilities of the large model. Through examples, the large model is guided to learn how to extract key information points, helping the large model to learn which information in the user's answer should be judged as key information points, and then extract and summarize them.
[0059] In this example, step S12 uses the gpt4 API interface provided by Azure OpenAI. In the specific application process, other large dialogue models can also be used.
[0060] S13. Let the dialogue model continue to communicate with the user until the dialogue model extracts all the required key information points as the service description required by the user.
[0061] S2. The correlation between all services provided by the system and the service requirements of users is calculated through the vector big model, so as to select the most relevant K services to form the candidate service pool srvPool.
[0062] S21. Convert the format of descriptions of all services provided by the system.
[0063] The descriptions of all services provided by the system are converted into the same format as KeyPoints because most of the services provided by the system are written in JSON format and contain redundant information.
[0064] S22. Calculate the correlation between all services srv provided by the system and the services required by the user, and select the most relevant K services to form a candidate service pool srvPool.
[0065] To calculate the correlation between all service srv provided by the system and the services required by the user, we first use a large vector model, such as openAI's text-embedding-ada-002, to convert the system services and KeyPoints obtained in step S21 into vectors, and use cosine similarity. The higher the cosine value of the vector, the higher the similarity. The specific cosine value, i.e. the similarity, is calculated as:
[0066]
[0067] Among them, sim i Indicates srv i That is, the similarity between the i-th service and the user's target service.
[0068] Through similarity calculation, K candidate services that are most similar to the application scenarios of the target expected service are automatically obtained to form a candidate service pool srvPool. The subsequent service solution space is the candidate service pool srvPool.
[0069] S3. Generate a set of indicators for each candidate service.
[0070] S31. Input the KeyPoints of the service description required by the user into the text model, and let the text model generate the description LLM_Obj of the indicators it considers important.
[0071] S32, the indicator description LLM_Obj generated by the text large model, the user-defined indicator description User_Obj and one of the srvPools i Describe the input to the code model, and generate stvPool from the code model i The corresponding test code is then run to obtain the test result LLM_Obj_Rst of the indicator description LLM_Obj generated by the large model and the test result User_Obj_Rst of the user-defined indicator description User_Obj.
[0072] S33, the combined large model LLM_Obj_Rst, the user's test result User_Obj_Rst and the system-defined indicator Sys_Obj test result Sys_Obj_Rst constitute the indicator result set Obj for each service in the final srvPool.
[0073] The system-defined indicators Sys_Obj are mainly external factors that can be obtained without running any code, including: price, service rating, number of users, geographical coverage, etc.
[0074] In this embodiment, the text model uses glm4 or GPT-4, and the code model uses ERNIE-Code. In actual application, other models can also be used.
[0075] S4. Use the TOPSIS method to find the optimal solution under multiple indicators, thereby completing the virtual mapping of the service.
[0076] S41, submit multiple indicator descriptions of user User_Obj, large model LLM_Obj and system Sys_Obj to the user, and the user determines the weight W of each indicator j
[0077] S42, first each srvPool i The corresponding multi-index result solution Obj is composed of users, large models and systems i Construct a decision matrix, and then use the TOPSIS method to find the optimal solution under multiple indicators and find the service that best suits the user.
[0078] When using the TOPSIS method, the decision matrix needs to be standardized, where the standardization process is different for positive indicators and negative indicators.
[0079] For positive indicators (bigger is better):
[0080]
[0081] For negative indicators (the smaller the better), you can convert them to positive indicators (the larger the better):
[0082]
[0083] The transformed values are then normalized:
[0084]
[0085] Then construct a weighted standardized decision matrix, which is: The next step is to determine the ideal solution and anti-ideal solution. * ) and the anti-ideal solution (A - ) are the maximum and minimum values of each criterion respectively;
[0086] The next step is to calculate the distance of each solution from the ideal and anti-ideal solutions using Euclidean distance.
[0087] Distance from the ideal solution:
[0088]
[0089] Distance to the anti-ideal solution:
[0090]
[0091] Next is to calculate the relative proximity, relative proximity Indicates how close service i is to the ideal solution:
[0092]
[0093] Finally, sort by relative proximity. All candidate services are ranked, and the larger the value, the better the service and the closer it is to the user's needs, thus achieving virtual mapping of services.
[0094] Based on the same inventive principle, the embodiment of the present invention also provides a virtual mapping system based on a large model, such as Figure 2 As shown, it includes information extraction module, service matching module, indicator generation and testing module, and solution module.
[0095] In the information extraction module, the dialogue model is used to communicate with the user, and the key information points required to complete the virtual mapping are extracted through continuous dialogue as the service description required by the user;
[0096] In the service matching module, the relevance between all services provided by the system and the service descriptions required by the user is calculated through the vector big model, so that the most relevant K services are selected from all services as candidate services and put into the candidate service pool srvPool;
[0097] In the indicator generation and testing module, the text big model and the code big model are used to generate the indicator set for each candidate service;
[0098] In the solution module, the TOPSIS method is used to solve the optimal solution under multiple indicators, thereby completing the virtual mapping of the service.
[0099] Based on the same inventive principle, an embodiment of the present invention also provides a large model-based virtual mapping system, including a memory and one or more processors, wherein the memory stores executable code, and when one or more processors execute the executable code, it is used to implement the virtual mapping method of the above embodiment.
[0100] The embodiments described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.< / end> < / end> < / end> < / end>
Claims
1. A virtual mapping method based on a large model, characterized in that: The following steps are involved: (1) Use the big dialogue model to communicate with the user and extract the key information points required to complete the virtual mapping through continuous dialogue as the service description required by the user; (2) The correlation between all services provided by the system and the service descriptions required by the user is calculated through the vector big model, so as to select the most relevant K services from all services as candidate services and put them into the candidate service pool srvPool; (3) Input the service description required by the user into the text model to generate the indicator description LLM_Obj; input the indicator description LLM_Obj generated by the text model, the indicator description User_Obj customized by the user, and the description of a candidate service in the candidate service pool srvPool into the code model to obtain the test code; Traverse each candidate service in the candidate service pool srvPool and obtain the test code corresponding to each candidate service; run each test code and obtain the test result LLM_Obj_Rst corresponding to LLM_Obj and the test result User_Obj_Rs corresponding to User_Obj; Combine LLM_Obj_Rst, User_Obj_Rst and the test result Sys_Obj_Rst of the system-defined indicator Sys_Obj to obtain the indicator result set Obj of each candidate service in the candidate service pool srvPool; (4) In the indicator result set Obj, the TOPSIS method is used to solve the optimal solution under multiple indicators, thereby completing the virtual mapping of the service.
2. The large model-based virtual mapping method according to claim 1, characterized in that: In step (1), the key information points required to complete the virtual mapping include: the type of service, the functional requirements of the service, the budget range, the service reliability requirements, the service performance requirements, and the service security requirements. The functional requirements of the service include: the specific functions and goals that the user hopes to achieve through the service, the input of the service, and the output of the service.
3. The virtual mapping method based on a large model according to claim 1, characterized in that: In step (1), the prompt words input to the dialogue model include both instructions and examples; The instructions are written in a role-playing manner, requiring the dialogue model to continuously extract set key information points during the dialogue with the user. When a key information point is not obtained, it is necessary to obtain it from the user by asking questions. After all key information points are obtained, the dialogue can be ended. The examples utilize the contextual reasoning ability of the dialogue model. Through examples, the dialogue model is guided to learn how to extract key point information, and to learn which information in the user's answers should be judged as key information points, and then extract and summarize them.
4. The large model-based virtual mapping method according to claim 1, characterized in that: In step (2), before calculating the correlation, the descriptions of all services provided by the system need to be converted into the same format as the service descriptions required by the user.
5. The virtual mapping method based on a large model according to claim 1, characterized in that: The specific process of step (2) is as follows: First, all services provided by the system and the service descriptions required by the user are converted into vectors by using a large vector model. Then, cosine similarity is used to automatically obtain the K candidate services that are most similar to the service descriptions required by the user to form a candidate service pool srvPool.
6. The large model-based virtual mapping method according to claim 1, characterized in that: In step (3), the system-defined indicator Sys_Obj is an external factor that can be obtained without running any code, including: price, service rating, number of users, and geographic coverage.
7. The large model-based virtual mapping method according to claim 1, characterized in that: The specific process of step (4) is as follows: Submit the indicator description LLM_Obj generated by the text model, the user-defined indicator description User_Obj, and the system-defined indicator description Sys_Obj to the user, and the user determines the weight W of each indicator. j ; Each Obj in the indicator result set Obj i They all correspond to the multi-objective solution composed of large models, users and systems. i Construct a decision matrix, and then use the TOPSIS method to find the optimal solution under multiple indicators and find the service that best suits the user.
8. The large model-based virtual mapping method according to claim 7, characterized in that: When using the TOPSIS method, the decision matrix needs to be standardized, where for positive indicators: For a negative indicator, convert it to a positive indicator: The transformed values are then normalized: Then construct a weighted standardized decision matrix, which is: The next step is to determine the ideal solution and anti-ideal solution. * and anti-ideal solution A - are the maximum and minimum values of each criterion, respectively; The next step is to calculate the distance of each solution from the ideal solution and the anti-ideal solution using Euclidean distance; where the distance from the ideal solution is: The distance to the anti-ideal solution is: Next is to calculate the relative proximity, relative proximity Indicates how close service i is to the ideal solution: Finally, according to the relative proximity All candidate services are ranked. The larger the value, the better the service and the closer it is to the user's needs, thereby realizing virtual mapping of services. Here, i refers to the i-th service, j refers to the j-th indicator, n refers to the total number of services, and k refers to the k-th service.
9. A virtual mapping system based on a large model, characterized in that: It includes information extraction module, service matching module, indicator generation and testing module, and solution module; In the information extraction module, the dialogue model is used to conduct dialogue with the user, and the key information points required to complete the virtual mapping are extracted through continuous dialogue as the service description required by the user; In the service matching module, the correlation between all services provided by the system and the service description required by the user is calculated through the vector big model, so as to select the most relevant K services from all services as candidate services and put them into the candidate service pool srvPool; In the indicator generation and testing module, a set of indicators for each candidate service is generated using a text large model and a code large model; In the solution module, the TOPSIS method is used to solve the optimal solution under multiple indicators, thereby completing the virtual mapping of the service.
10. A virtual mapping system based on a large model, characterized in that: The invention comprises a memory and one or more processors, wherein the memory stores executable codes, and when the one or more processors execute the executable codes, the virtual mapping method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
High-efficiency service decision-making method for uncertain big QoS data drive
CN105450723A
Web service selection method and device based on dynamic QoS (Quality of Service) and subjective and objective weights
CN106961356A
Web service selection method and system based on user preferences
CN109784722A
Dynamic QoS selection method and system for user demands
CN111683141A
Information recommendation method and apparatus, and storage medium and electronic device
WO2024099457A1
