Front-end performance optimization method and device and computer equipment
By acquiring front-end page performance parameters and utilizing a large language model for automated optimization, the problem of inefficient front-end performance optimization in existing technologies has been solved, achieving a more efficient optimization process.
Patent Information
- Application Number
- CN202411049267.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-29
AI Technical Summary
Existing front-end performance optimization solutions rely on developer experience, are inefficient, require a lot of manpower in complex scenarios, and are difficult to optimize.
By acquiring the performance parameters of the front-end page, using a large language model to retrieve knowledge base and identify performance issues and optimization solutions, the front-end page can be automatically optimized.
It improves the efficiency of front-end page performance optimization and reduces the need for developers to make manual adjustments.
Smart Images

Figure CN119047576A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular to front-end performance optimization methods, devices and computer equipment. Background Art
[0002] Front-end performance optimization is crucial to online business systems. It directly affects user experience, website conversion rate, and the stability of the overall business system operation. Front-end performance optimization involves many aspects such as page loading speed, interactive response time, and resource optimization. The current front-end performance optimization solution relies on the experience of front-end developers and is manually adjusted and optimized by developers. This optimization solution is not efficient and requires a lot of manpower when facing complex optimization scenario requirements, making optimization difficult. Summary of the invention
[0003] To overcome the problems existing in the related art, this specification provides a front-end performance optimization method, apparatus and computer equipment.
[0004] According to the first aspect of the embodiments of this specification, a front-end performance optimization method is provided, the method comprising: obtaining performance parameters of a front-end page; retrieving target knowledge matching the performance parameters in a knowledge base; using a large language model to determine performance issues and optimization solutions corresponding to the target knowledge; and optimizing the front-end page according to the performance issues and the optimization solutions.
[0005] According to the second aspect of the embodiments of this specification, a front-end performance optimization device is provided, including: an acquisition module for acquiring performance parameters of a front-end page; a retrieval module for retrieving target knowledge matching the performance parameters in a knowledge base; a determination module for determining performance problems and optimization solutions corresponding to the target knowledge using a large language model; and an optimization module for optimizing the front-end page based on the performance problems and the optimization solutions.
[0006] According to a third aspect of the embodiments of this specification, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the front-end performance optimization method described in any embodiment of this specification is implemented.
[0007] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:
[0008] In the embodiments of this specification, the performance problems are analyzed and optimization solutions are inferred through the reasoning and analysis capabilities of the large language model, thereby avoiding the process of manual adjustment and optimization by the developer and improving the optimization efficiency of the front-end page performance.
[0009] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.
[0011] Figure 1 It is a flowchart of a front-end performance optimization method shown in this specification according to an exemplary embodiment.
[0012] Figure 2 is a schematic diagram of a front-end performance optimization method according to another exemplary embodiment.
[0013] Figure 3 It is a hardware structure diagram of the computer device where the front-end performance optimization device of the embodiment of this specification is located.
[0014] Figure 4 It is a block diagram of a front-end performance optimization device shown in this specification according to an exemplary embodiment. DETAILED DESCRIPTION
[0015] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.
[0016] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0017] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0018] Next, the embodiments of this specification are described in detail.
[0019] The front-end performance optimization method provided by the embodiments of this specification is described in detail below. Figure 1 As shown, Figure 1 This is a flowchart of a front-end performance optimization method shown in this specification according to an exemplary embodiment. The front-end performance optimization method provided in the embodiment of this specification may include the following steps.
[0020] In step 110, the performance parameters of the front-end page are obtained.
[0021] According to an embodiment of the present specification, the performance parameters may include at least one of the following: network parameters, behavior parameters and device parameters. Among them, the network parameters may include parameters such as the total number of requests, static resource loading time, transmission data size, TCP connection time, etc. The behavior parameters may include parameters such as page dwell time, click rate, scrolling behavior, exit rate, etc. The device parameters may include parameters such as device operating system, browser version, screen resolution, network type, etc. It is understood that in addition to the above parameters, the performance parameters may also include other parameters.
[0022] In step 120, target knowledge matching the performance parameters is retrieved from the knowledge base.
[0023] Optionally, the knowledge base may include one or more pieces of knowledge. The knowledge may include at least one of the following: performance parameters, performance issues, questions related to front-end optimization and answers to the questions, optimization solution code blocks, and device configuration parameters. Exemplarily, performance parameters may include network parameters, behavior parameters, and device parameters, etc. Performance issues may include, for example, high latency, low resolution, etc. Questions related to front-end optimization may include, for example, "What should I do if the front-end page resolution is low?" The corresponding answers may include, for example, "The problem of low front-end page resolution can be solved by optimizing fonts and pictures." For example, questions related to front-end optimization and corresponding answers can be collected from the conversation records of a large language model. The optimization solution code block may include the code required to implement the performance optimization solution. Device configuration parameters may include, for example, multi-terminal device resource loading methods, resolution parameters, etc.
[0024] In step 130, the large language model is used to determine performance issues and optimization solutions corresponding to the target knowledge.
[0025] According to the embodiments of this specification, for example, the intention prompt words can be determined according to the target knowledge, and then the target knowledge and the intention prompt words are input into the large language model, and the large language model generates corresponding answer data according to the target knowledge and the intention prompt words. The answer data includes performance problems and optimization solutions corresponding to the target knowledge.
[0026] According to the embodiments of this specification, the intent prompt word can be used to instruct the large language model to give an optimization solution for the front-end page based on the target knowledge. For example, the intent prompt word can be, for example, "The current mobile device resource loading time is too long. Please summarize and optimize based on the knowledge base search results and write a detailed solution. Specific modification code can be given."
[0027] According to the embodiments of this specification, performance issues can be used to describe performance issues existing in the front end, such as long loading time, low resolution, etc. Optimization solutions can be used to describe optimization methods that can be used to solve performance issues, such as CDN addresses for loading resources on mobile devices, image resolution, optimized code snippets, etc.
[0028] In step 140, the front-end page is optimized according to the performance problem and the optimization plan.
[0029] According to the embodiments of this specification, the performance problems are analyzed and optimization solutions are inferred through the reasoning and analysis capabilities of the large language model, thereby avoiding the process of manual adjustment and optimization by the developer and improving the optimization efficiency of the front-end page performance.
[0030] Optionally, for example, a front-end monitoring spider control may be deployed in advance in the terminal device, and the monitoring spider control may be used to capture the performance parameters of the front-end page. Based on this, the performance parameters may be obtained through the front-end monitoring spider control. The front-end monitoring spider control may include, for example, PerformanceObserver (performance monitor) or Performance API (performance application program interface) of other browsers.
[0031] Optionally, the knowledge in the knowledge base may be vectorized in advance to obtain knowledge vectors corresponding to each piece of knowledge, and then these knowledge vectors may be stored in a vector database, wherein the vector database may include, for example, a Milvus vector database.
[0032] Based on this, when it is necessary to retrieve target knowledge matching the performance parameters in the knowledge base, the performance parameters can be vectorized to obtain a performance vector. Then, a target knowledge vector whose similarity with the performance vector in the vector database is greater than a vector similarity threshold can be determined. Then, the knowledge corresponding to the target knowledge vector can be determined as the target knowledge. Among them, the vector similarity threshold can be set according to actual needs.
[0033] Optionally, when using a large language model to determine performance issues and optimization solutions corresponding to target knowledge, a regression algorithm can be used to obtain more accurate reasoning results, that is, continuously optimizing and adjusting the prompt words and / or parameters of the large language model until the answer data of the large language model meets the regression threshold.
[0034] For example, based on the target knowledge and the intention prompt words, multiple rounds of dialogue can be conducted with the large language model, and in each round of dialogue in the multiple rounds of dialogue, the intention prompt words and / or the parameters of the large language model can be adjusted to obtain multiple answer data corresponding to the multiple rounds of dialogue. Among them, adjusting the intention prompt words can, for example, include modifying the intention prompt words by word shifting, replacing, adding, etc. Adjusting the parameters of the large language model can, for example, include modifying the temperature (Temperature), Top-k and other parameters of the large language model.
[0035] If the similarity between multiple answer data is greater than the answer similarity threshold, the performance problem and optimization solution can be obtained from any answer data.
[0036] If the similarity between multiple answer data is less than or equal to the answer similarity threshold, multiple rounds of dialogue can be conducted again. Similarly, in each round of dialogue in the multiple rounds of dialogue, the parameters of the intent prompt words and / or the large language model are adjusted until the similarity between the multiple answer data obtained is greater than the answer similarity threshold.
[0037] The answer similarity threshold can be set according to actual needs. For example, if a similarity of 1 indicates that the answers are completely identical, the answer similarity threshold can be set to a value close to 1, such as 0.9.
[0038] According to an embodiment of the present specification, optimizing the front-end page according to performance issues and optimization solutions may, for example, include modifying the front-end page according to performance issues and optimization solutions; and / or adjusting the loading strategy of the front-end page according to performance issues and optimization solutions.
[0039] Optionally, for example, the performance problem and optimization solution can be input into an artificial intelligence code generation tool to obtain optimized code. Artificial intelligence code generation tools may include, for example, CodeGPT, Copilot, Sourcery, Snipper, etc. Then, the code of the front-end page can be modified according to the optimized code. Next, the modified code can be compiled to obtain a new front-end page. By intelligently identifying and refactoring code through artificial intelligence code generation tools, code execution efficiency can be improved and resource consumption can be reduced.
[0040] In addition, terminal devices can be of different types, such as mobile terminals and PC (Personal Computer) terminals. When generating optimized codes, the artificial intelligence code generation tool can generate optimized codes suitable for each type for different types. Subsequently, the optimization scheme suitable for the type can be automatically loaded according to different types of terminal devices.
[0041] Figure 2is a schematic diagram of a front-end performance optimization method according to another exemplary embodiment.
[0042] like Figure 2 As shown, the system architecture may include the following components:
[0043] 1. Front-end monitoring spider control. The front-end monitoring spider control can be used to collect performance parameters of the front-end page, such as network parameters (such as: total number of requests, static resource loading time, transmission data size, TCP connection time, etc.), behavior parameters (such as: page dwell time, click rate, user scrolling behavior, exit rate, etc.), device parameters (such as: device operating system, browser version, screen resolution, network type, etc.), etc. The collected data is desensitized and encrypted and then sent to the data decryption and cleaning platform.
[0044] 2. Data decryption and cleaning platform. The data decryption and cleaning platform can be used to decrypt and clean the data collected by the front-end monitoring spider control, that is, to decrypt the data to obtain the original performance parameters, and clean the abnormal data and invalid data, and then vectorize the cleaned data and store it in the vector database so that the knowledge base can accurately retrieve the data.
[0045] 3. Vector database. The vector database can be used to store vectorized performance parameters (such as network parameters, user behavior parameters, device parameters, etc.), performance issues (such as high latency, low resolution, etc.), front-end performance optimization solution questions and answers, optimization solution code blocks, device configuration parameters (such as multi-terminal device resource loading methods and resolution parameters, etc.), etc., so that the knowledge base can accurately retrieve. The vector database can be, for example, the Milvus vector database.
[0046] 4. Knowledge base. The knowledge base can be used to perform vectorized retrieval based on the vector database for the performance parameters collected by the front-end monitoring spider control or the natural language manually processed in the process of front-end performance optimization, and send the retrieval results (that is, the target knowledge) and intent prompt words to the LLM. The retrieval results may include, for example, retrieval data such as high resource loading time and corresponding processing solutions or device types. Intent prompt words may include, for example, "Currently, the resource loading time of mobile devices is too long. Please summarize and optimize based on the knowledge base retrieval results and write a detailed solution. Specific modification code can be provided."
[0047] 5. LLM (Large Language Model). LLM can be used to identify front-end performance issues and infer optimization solutions based on knowledge base search results and intent prompts through its reasoning and analysis capabilities, and send them to the strategic planning center platform. The optimization solution may include, for example, the CDN address of the resource loaded by the mobile device, the image resolution, and the optimized code snippet.
[0048] 6. Strategy Planning Center Platform. The Strategy Planning Center Platform can be used to receive performance issues analyzed by LLM and optimization solutions inferred. Then, based on the performance issues and optimization solutions, the front-end page can be optimized by automatic hosting or manual processing. The automatic hosting method refers to using the LLM code plug-in to automatically optimize the code and adjust the loading strategy. The manual processing method refers to the developer manually optimizing the code and adjusting the loading strategy.
[0049] 7. LLM code plug-in. The LLM code plug-in can be used to automatically optimize the code of the front-end page and adjust the loading strategy based on the performance issues and optimization solutions pushed by LLM through artificial intelligence code generation tools (such as CodeGPT, Copilot, Sourcery, Snipper) and automated script commands.
[0050] 8. The automated build and deployment platform can be used to synchronize the code snippets or loading strategies optimized by the LLM code plug-in to the front-end monitoring spider control, infer the client user's intention in real time, preload resources based on the inference results, or load the terminal loading strategy adapted to the terminal device. It can also be used to automatically compile and build the cloud service system, republish the cloud service system, and optimize real-time front-end performance issues.
[0051] 9. Cloud service. Cloud service can be used to provide corresponding front-end pages according to user requests. Cloud service can be provided by the server deployed by the system.
[0052] Exemplarily, in this embodiment, the front-end performance optimization method may include the following steps:
[0053] When a user accesses the front-end page, the front-end performance monitoring spider control starts working. The front-end monitoring spider control collects performance parameters such as network parameters, device platform data, resource loading time, and user interaction response, and desensitizes and encrypts the collected performance parameters and sends them to the data decryption and cleaning platform for data decryption and cleaning. The data decryption and cleaning platform decrypts, pre-processes, discards invalid data, aggregates and simplifies the encrypted performance parameters, so that the collected performance data can be vectorized and stored in the vector database.
[0054] The knowledge base retrieves the problem knowledge that matches the data parameters through vectorization, and sends the search results with intent prompt words to LLM. Based on the search results and intent prompt words, LLM analyzes and locates performance problems through problem classification and parameter extraction functions, and gives targeted optimization strategies, which are sent to the strategy planning center platform.
[0055] After obtaining the answer data of LLM, the strategic planning center platform can set the answer similarity threshold, and then combine the intent prompt words based on the retrieval and intent prompt words, and continue to have multiple rounds of dialogue with the large language model. In each dialogue, the intent prompt words are modified by word shift, replacement, addition, etc., and the temperature (Temperature), Top-k and other parameters of LLM are modified. If the similarity between the answer data obtained through multiple rounds of dialogue is higher than the answer similarity threshold, the answer data is determined to be the relatively optimal answer data.
[0056] The strategy planning center platform can send the relatively optimal answer data to the LLM code plug-in management center, which can perform multi-terminal adaptation in real time according to the optimization strategy in the answer data and the parameters of the terminal device. The adaptation process can include code rewriting and loading strategy adjustment, or predict the user's next click behavior based on a large amount of user click data, and output pre-load resource strategies. Then send the adjusted code snippet or loading strategy to the automated construction platform.
[0057] Developers can also view performance issues and LLM optimization solutions from the Strategy Planning Management Center, and perform manual code rewriting and loading strategy adjustments. The code rewriting process can automatically generate code snippets through natural language interaction with LLM, and use code snippets for optimization. After the optimization is completed, it can be directly synchronized to the automated code construction system.
[0058] The automated system building platform can monitor code and configuration changes through HOOKS. The optimized code snippets or optimization strategies of the LLM code plug-in can be synchronized to the front-end monitoring spider control. It can also infer the user intention of the terminal device based on the behavioral parameters of the terminal device in real time, preload resources based on the intention inference results, and load the appropriate loading strategy based on the type of terminal device. In addition, it can also automatically compile and build the cloud service system, republish the cloud service system, and optimize the real-time front-end performance issues.
[0059] When the obtained performance parameters of the front-end page include behavior parameters, the front-end performance optimization method of the embodiment of this specification can predict the pages and page elements that the user is about to visit based on the behavior parameters through time series and machine learning technology analysis, adjust the resource loading order in real time, reduce user waiting time and improve user experience.
[0060] In the case where the obtained performance parameters of the front-end page include device parameters, the front-end performance optimization method of the embodiment of the present specification can automatically load an optimization solution adapted to different types of terminal devices according to the different types of terminal devices.
[0061] Corresponding to the embodiments of the aforementioned methods, this specification also provides embodiments of a front-end performance optimization device and a terminal to which it is applied.
[0062] The embodiments of the front-end performance optimization device of this specification can be applied to computer devices, such as servers or terminal devices. The device embodiments can be implemented by software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 3 As shown in the figure, it is a hardware structure diagram of the computer device where the front-end performance optimization device of the embodiment of this specification is located. Figure 3 In addition to the processor 310, memory 330, network interface 320, and non-volatile memory 340 shown, the server or electronic device where the device 331 is located in the embodiment may also include other hardware according to the actual function of the computer device, which will not be described in detail.
[0063] like Figure 4 As shown, Figure 4 This is a block diagram of a front-end performance optimization device according to an exemplary embodiment of the present specification, the device comprising:
[0064] The acquisition module 410 is used to acquire the performance parameters of the front-end page;
[0065] Retrieval module 420, used to retrieve target knowledge matching the performance parameter in the knowledge base;
[0066] A determination module 430, for determining performance issues and optimization solutions corresponding to target knowledge using a large language model;
[0067] The optimization module 440 is used to optimize the front-end page according to the performance problem and the optimization solution.
[0068] Optionally, the retrieval module may include:
[0069] A vectorization submodule is used to vectorize the performance parameters to obtain a performance vector;
[0070] A vector determination submodule, used to determine a target knowledge vector in a vector database whose similarity with the performance vector is greater than a vector similarity threshold, wherein the vector database includes at least one knowledge vector, and the knowledge vector is obtained by vectorizing the knowledge in the knowledge base;
[0071] The knowledge determination submodule is used to determine the knowledge corresponding to the target knowledge vector as the target knowledge.
[0072] Optionally, the knowledge in the knowledge base includes at least one of the following: performance parameters, performance issues, questions related to front-end optimization and answers to the questions, optimization solution code blocks, and device configuration parameters.
[0073] Optionally, the determination module may include:
[0074] The prompt word determination submodule is used to determine the intention prompt word according to the target knowledge;
[0075] A dialogue submodule is used to conduct multiple rounds of dialogue with the large language model based on target knowledge and intent prompt words, and adjust the parameters of the intent prompt words and / or the large language model in each round of dialogue in the multiple rounds of dialogue to obtain multiple answer data;
[0076] The acquisition submodule is used to obtain performance issues and optimization solutions from the answer data if the similarity between multiple answer data is greater than the answer similarity threshold.
[0077] Optionally, the optimization module may include:
[0078] A modification submodule is used to modify the front-end page according to performance issues and optimization solutions; and / or an adjustment submodule is used to adjust the loading strategy of the front-end page according to performance issues and optimization solutions.
[0079] Optionally, modifying a submodule may include:
[0080] An input unit, used to input performance issues and optimization solutions into the artificial intelligence code generation tool to obtain optimized code;
[0081] The code modification unit is used to modify the code of the front-end page according to the optimized code;
[0082] The compilation unit is used to compile the modified code to obtain a new front-end page.
[0083] According to the embodiments of this specification, the performance problems are analyzed and optimization solutions are inferred through the reasoning and analysis capabilities of the large language model, thereby avoiding the process of manual adjustment and optimization by the developer and improving the optimization efficiency of the front-end page performance.
[0084] Accordingly, the present specification also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the front-end performance optimization method shown in any embodiment of the present specification is implemented.
[0085] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0086] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0087] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0088] Those skilled in the art will readily appreciate other embodiments of the specification after considering the specification and practicing the invention claimed herein. The specification is intended to cover any variations, uses or adaptations of the specification that follow the general principles of the specification and include common knowledge or customary techniques in the art that are not claimed in the specification. The specification and examples are to be considered exemplary only, and the true scope and spirit of the specification are indicated by the following claims.
[0089] It should be understood that the present description is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
[0090] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
Claims
1. A front-end performance optimization method, characterized in that: The method comprises: Get the performance parameters of the front-end page; Retrieving target knowledge matching the performance parameter in a knowledge base; Determine performance issues and optimization solutions corresponding to the target knowledge using a large language model; The front-end page is optimized according to the performance problem and the optimization solution.
2. The method according to claim 1, characterized in that The target knowledge in the retrieval knowledge base that matches the performance parameter includes: Vectorizing the performance parameters to obtain a performance vector; Determine a target knowledge vector in a vector database whose similarity to the performance vector is greater than a vector similarity threshold, wherein the vector database includes at least one knowledge vector obtained by vectorizing the knowledge in the knowledge base; The knowledge corresponding to the target knowledge vector is determined as the target knowledge.
3. The method according to claim 1 or 2, characterized in that: The knowledge in the knowledge base includes at least one of the following: performance parameters, performance issues, questions related to front-end optimization and answers to the questions, optimization solution code blocks, and device configuration parameters.
4. The method according to claim 1, characterized in that: The use of a large language model to determine the performance issues and optimization solutions corresponding to the target knowledge includes: Determine the intention prompt word according to the target knowledge; Based on the target knowledge and the intention prompt word, multiple rounds of dialogue are conducted with the large language model, and in each round of dialogue in the multiple rounds of dialogue, parameters of the intention prompt word and / or the large language model are adjusted to obtain multiple answer data; If the similarity between the multiple answer data is greater than the answer similarity threshold, the performance problem and the optimization solution are obtained from the answer data.
5. The method according to claim 1, characterized in that Optimizing the front-end page according to the performance problem and the optimization solution includes: Modify the front-end page according to the performance problem and optimization solution; and / or According to the performance problem and optimization solution, the loading strategy of the front-end page is adjusted.
6. The method according to claim 5, characterized in that The modifying the front-end page according to the performance problem and the optimization solution includes: Inputting the performance problem and the optimization solution into an artificial intelligence code generation tool to obtain an optimized code; Modify the code of the front-end page according to the optimized code; Compile the modified code to get a new front-end page.
7. A front-end performance optimization device, characterized in that: The device comprises: Acquisition module, used to obtain the performance parameters of the front-end page; A retrieval module, used to retrieve target knowledge matching the performance parameter in a knowledge base; A determination module, used to determine performance issues and optimization solutions corresponding to the target knowledge using a large language model; An optimization module is used to optimize the front-end page according to the performance problem and the optimization solution.
8. The device according to claim 7, characterized in that The retrieval module comprises: A vectorization submodule, used for vectorizing the performance parameters to obtain a performance vector; A vector determination submodule, used to determine a target knowledge vector in a vector database whose similarity with the performance vector is greater than a vector similarity threshold, wherein the vector database includes at least one knowledge vector obtained by vectorizing the knowledge in the knowledge base; The knowledge determination submodule is used to determine the knowledge corresponding to the target knowledge vector as the target knowledge.
9. The device according to claim 7 or 8, characterized in that The knowledge in the knowledge base includes at least one of the following: performance parameters, performance issues, questions related to front-end optimization and answers to the questions, optimization solution code blocks, and device configuration parameters.
10. The device according to claim 7, characterized in that The determination module comprises: A prompt word determination submodule, used to determine the intention prompt word according to the target knowledge; a dialogue submodule, configured to conduct multiple rounds of dialogue with a large language model based on the target knowledge and the intention prompt word, and adjust the parameters of the intention prompt word and / or the large language model in each round of the multiple rounds of dialogue to obtain multiple answer data; The acquisition submodule is used to acquire the performance problem and the optimization solution from the answer data if the similarity between the multiple answer data is greater than the answer similarity threshold.
11. The device according to claim 7, characterized in that The optimization module includes: A modification submodule, used to modify the front-end page according to the performance problem and optimization solution; and / or The adjustment submodule is used to adjust the loading strategy of the front-end page according to the performance problem and the optimization solution.
12. The device according to claim 11, characterized in that The modification submodule includes: An input unit, used to input the performance problem and the optimization solution into an artificial intelligence code generation tool to obtain an optimized code; A code modification unit, used to modify the code of the front-end page according to the optimized code; The compilation unit is used to compile the modified code to obtain a new front-end page.
13. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Robot dialogue method and device fusing knowledge base and large model, computer equipment and storage medium
CN117668189A
Multi-round dialogue method and device, equipment and storage medium
CN117669597A
Web front-end performance optimization method and system based on meta-learning
CN117762421A
Knowledge retrieval enhancement-based large language model question and answer method and device
CN118113836A
Method and device for analyzing application performance, computer equipment and storage medium
CN118227434A
Cited By
Method and device for unifying computing power resource vector distance of intelligent computing center
CN120429297A
Parameter recommendation method and device
CN120469727A
Self-adaptive software stack optimization method and system based on GPU (Graphics Processing Unit) server configuration
CN120803541A
