Webpage processing method and device, equipment, storage medium and program product
By calculating the similarity of web page description information and automatically modifying web pages, it solves the problem of low efficiency of manual web production, realizes automatic web page modification, improves work efficiency and reduces the cost of learning programming skills.
Patent Information
- Application Number
- CN202411087069.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-15
AI Technical Summary
The efficiency of manual production of web pages in the existing technology is low, resulting in high requirements for staff programming skills and low work efficiency.
By receiving the web page generation instructions input by the user, the web page description information of the existing web page is obtained, the similarity between the target web page description information and the web page description information is calculated, the existing web page whose similarity is greater than the preset threshold is determined as the target web page, and a screenshot of the web page is output. And based on the screenshots of the target webpage selected by the user and the webpage modification information, the webpage is automatically modified to reduce manual editing time.
It realizes automatic web page modification, reduces the time cost of manual editing, improves the efficiency of web page production, and reduces the cost of learning programming skills.
Smart Images

Figure CN118779557A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a web page processing method, device, equipment, storage medium and program product. Background Art
[0002] With the continuous deepening of informatization, a large amount of information is disseminated through web pages. Different web page interfaces are required to display different information.
[0003] At present, the web page production process in the prior art usually requires manual generation and editing of the page.
[0004] However, the inventors have discovered that the prior art has at least the following technical problems: the efficiency of currently manually creating web pages is low. Summary of the invention
[0005] The embodiments of the present application provide a web page processing method, apparatus, device, storage medium and program product to solve the problem of low efficiency in current manual web page creation.
[0006] In a first aspect, an embodiment of the present application provides a web page processing method, including: in response to receiving a web page generation instruction input by a user, obtaining web page description information of an existing web page, wherein the web page generation instruction includes target web page description information and web page modification information; calculating the similarity between the target web page description information and the web page description information; determining an existing web page whose corresponding similarity is greater than a preset similarity threshold as a target web page; determining a web page screenshot corresponding to the target web page; outputting the web page screenshot; in response to receiving a selection instruction input by the user based on the web page screenshot, determining the target web page corresponding to the selection instruction as a web page to be modified; and modifying the web page to be modified according to the web page modification information to obtain a modified web page.
[0007] In one possible implementation, the web page to be modified is modified according to the web page modification information to obtain the modified web page, including: inputting the web page modification information into an instruction to generate a large language model, and obtaining a domain-specific language output by the instruction-generated large language model; using the domain-specific language and the web page to be modified to execute a web page modification program, and obtaining a modified web page output by the web page modification program.
[0008] In one possible implementation, a web page to be modified is modified according to web page modification information to obtain a modified web page, including: inputting the web page modification information into an instruction rewriting large language model to obtain at least one modification parameter among web page structure modification parameters, web page layout modification parameters and web page element modification parameters output by the instruction rewriting large language model; using the modification parameters to generate a web page modification instruction; using the web page modification instruction to modify the web page to be modified to obtain a modified web page.
[0009] In a possible implementation, the modification parameters are used to generate the webpage modification instruction, including: writing the modification parameters into an instruction template according to the type of the modification parameters to obtain the webpage modification instruction.
[0010] In one possible implementation, the similarity between the target web page description information and the web page description information is calculated, including: determining the target component type and the target component name in the target web page description information; determining the existing component type and the existing component name in the web page description information; calculating a first similarity between the target component type and the existing component type; calculating a second similarity between the target component name and the existing component name; and weightedly summing the first similarity and the second similarity to obtain the similarity between the target web page description information and the web page description information.
[0011] In a possible implementation, before obtaining web page description information of an existing web page in response to receiving a web page generation instruction input by a user, it also includes: obtaining a web page screenshot; identifying text in the web page screenshot to obtain a text recognition result; and inputting the text recognition result into a semantic analysis model to obtain web page description information.
[0012] In a second aspect, an embodiment of the present application provides a web page processing device, including: an information acquisition module, used to obtain web page description information of an existing web page in response to receiving a web page generation instruction input by a user, wherein the web page generation instruction includes target web page description information and web page modification information; a similarity calculation module, used to calculate the similarity between the target web page description information and the web page description information; a web page determination module, used to determine an existing web page whose corresponding similarity is greater than a preset similarity threshold as a target web page; a screenshot determination module, used to determine a web page screenshot corresponding to the target web page; a screenshot output module, used to output the web page screenshot; a modified web page determination module, used to determine the target web page corresponding to the selection instruction as a web page to be modified in response to receiving a selection instruction input by the user based on the web page screenshot; a web page modification module, used to modify the web page to be modified according to the web page modification information to obtain a modified web page.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor executes the first aspect above and / or various possible implementations of the first aspect.
[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.
[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.
[0016] The web page processing method, apparatus, device, storage medium and program product provided in the embodiments of the present application obtain a target web page with a high degree of similarity by comparing the web page description information of an existing web page with the target web page description information in a received web page generation instruction, output a screenshot of the target web page, receive a selection instruction input by a user according to the web page screenshot, determine the target web page corresponding to the selection instruction as the web page to be modified, modify the web page to be modified according to the web page modification information, and obtain the modified web page, thereby achieving the effect of modifying the existing web page to obtain a new web page and reducing the time cost of manually editing web pages. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] Figure 1 A schematic diagram of a scenario of the web page processing method provided in this application;
[0019] Figure 2 A schematic diagram of a flow chart of a web page processing method provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of the structure of a web page processing device provided in an embodiment of the present application;
[0021] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0022] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0023] 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, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0024] With the deepening of information technology, massive amounts of information are widely circulated through web pages. In order to effectively convey various types of information, it is necessary to design and apply web page interfaces of different styles to meet their respective display needs.
[0025] In the current technical environment, the creation and customization of web pages generally rely on manual operations, including page construction, content editing, etc. This process often requires human intervention to complete. However, manual page construction and content editing are inefficient and require high programming skills from staff.
[0026] In response to the above technical problems, the inventors proposed the following technical concept: receiving a web page generation instruction input by a user, obtaining web page description information of an existing web page, calculating the similarity between the target web page description information and the web page description information in the web page generation instruction, determining the existing web page whose similarity is greater than a preset threshold as the target web page, outputting a web page screenshot of the target web page, receiving a selection instruction for any web page screenshot, determining the target web page corresponding to the selection instruction as the web page to be modified, using the web page modification information in the web page generation instruction to modify the web page to be modified, and completing the modification or generation of the web page.
[0027] Figure 1 A schematic diagram of a scenario of the web page processing method provided in this application. Figure 1 , this scenario includes: terminal device 101.
[0028] In a specific implementation process, the terminal device 101 may include a computer, a server, a tablet, a mobile phone, a PDA (Personal Digital Assistant), a notebook, etc., which can input data.
[0029] Terminal device 101 is used to receive a web page generation instruction input by a user, obtain web page description information of an existing web page, use the target web page description information in the web page description information to determine a target web page that may serve as a basis for generating a new web page, output a screenshot of the target web page, and after receiving a selection instruction, use the web page modification information in the web page description information to modify the target web page corresponding to the selection instruction to obtain a modified web page.
[0030] It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the webpage processing method. In other feasible implementations of the present application, the above architecture may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown may be implemented by hardware, software, or a combination of software and hardware.
[0031] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0032] Figure 2 A schematic diagram of a web page processing method provided in an embodiment of the present application. The execution subject of the embodiment of the present application may be Figure 1 The terminal device 101 in the embodiment may also be a computer and / or a mobile phone, etc., which is not particularly limited in this embodiment. Figure 2 As shown, the method includes:
[0033] S201: In response to receiving a web page generation instruction input by a user, obtaining web page description information of an existing web page, wherein the web page generation instruction includes target web page description information and web page modification information.
[0034] In this step, the webpage generation instruction may be received by receiving voice or text information. Acquiring webpage description information of an existing webpage may include reading webpage description information corresponding to the existing webpage from a preset location, or may include reading information from the existing webpage as the webpage description information.
[0035] S202: Calculate the similarity between the target web page description information and the web page description information.
[0036] In this step, the target webpage description information may be converted into a target vector, the webpage description information may be converted into a reference vector, and the cosine similarity between the target vector and the reference vector may be calculated to obtain the similarity.
[0037] The target webpage description information is converted into a target vector, including converting the target webpage description information into a one-hot vector, converting the target webpage description information into a vector using the word2vec method, and converting the target webpage description information into a vector using the TF-IDF (termfrequency–inverse document frequency) method. The webpage description information is converted into a reference vector in the same way.
[0038] S203: Determine the existing web pages whose corresponding similarity is greater than a preset similarity threshold as target web pages.
[0039] In this step, the preset similarity threshold may be preset by the staff according to experimental data or experience parameters.
[0040] For example, there are currently existing web pages A, B, C, D, and E, and the corresponding similarities are 0.3, 0.6, 0.8, 0.9, and 0.4, respectively, and the preset similarity threshold is 0.7, then the existing web page C and the existing web page D are determined as target web pages. For another example, there are currently existing web pages P, Q, R, S, and T, and the corresponding similarities are 0.4, 0.9, 0.92, 0.88, and 0.3, respectively, and the preset similarity threshold is 0.8, then the existing web page Q, the existing web page R, and the existing web page S are determined as target web pages.
[0041] S204: Determine the webpage screenshot corresponding to the target webpage.
[0042] In this step, it may include searching for the correspondence between a preset address and a screenshot according to the address of the target web page to obtain a corresponding web page screenshot, or it may include entering the address of the target web page in a browser, allowing the browser to parse the address, establish a connection, send a request, receive a response, and render, and taking a screenshot of the rendered page to obtain a web page screenshot.
[0043] S205: Outputting a screenshot of the web page.
[0044] This step may include displaying the webpage screenshot, sending the webpage screenshot to a display device, etc.
[0045] S206: In response to receiving a selection instruction input by the user according to the webpage screenshot, determining a target webpage corresponding to the selection instruction as the webpage to be modified.
[0046] In this step, the selection instruction may include clicking, long pressing, etc. on the webpage screenshot.
[0047] For example, if there are currently 3 target web pages and a click signal for the second target web page is received, the second target web page is determined as the web page to be modified. For another example, if there are currently 4 target web pages and a click signal for the first target web page is received, the first target web page is determined as the web page to be modified.
[0048] S207: Modify the web page to be modified according to the web page modification information to obtain a modified web page.
[0049] In this step, the instructions in the webpage modification information may be used to modify the webpage to be modified to obtain a modified webpage. The contents after the preset field in the webpage modification information may also be written into the instruction template to obtain a modification instruction, and the modification instruction may be used to modify the webpage to be modified to obtain a modified webpage.
[0050] From the description of the above embodiments, it can be seen that the embodiments of the present application obtain a target web page with a higher similarity by comparing the web page description information of an existing web page with the target web page description information in the received web page generation instruction, output a screenshot of the target web page, receive a selection instruction input by the user according to the web page screenshot, determine the target web page corresponding to the selection instruction as the web page to be modified, modify the web page to be modified according to the web page modification information, and obtain the modified web page, thereby achieving the effect of modifying the existing web page to obtain a new web page and reducing the time cost of manual editing of web pages.
[0051] In a possible implementation, in the above step S207, modifying the web page to be modified according to the web page modification information to obtain the modified web page includes:
[0052] S207A1: Input the webpage modification information into the instruction generation large language model to obtain the domain-specific language output by the instruction generation large language model.
[0053] In this step, the instruction generation language model can be pre-trained by the staff. The domain-specific language can include at least one of component location, deleting component type, deleting component name, adding component type, adding component name, etc.
[0054] S207A2: Execute a webpage modification program using the domain-specific language and the webpage to be modified, and obtain a modified webpage output by the webpage modification program.
[0055] In this step, the domain-specific language and the web page to be modified can be input into a web page modification program. The web page modification program uses information such as component location, deleted component type, deleted component name, added component type, added component name, etc. in the domain-specific language to modify the input web page to be modified and obtain a modified web page.
[0056] The webpage modification program may be software or scripts pre-written by staff based on experimental data or experience.
[0057] From the description of the above embodiments, it can be seen that the embodiments of the present application generate a large language model by inputting instructions for web page modification information, thereby converting non-standardized input into a standardized domain-specific language, thereby using the domain-specific language to run the web page modification program, modify the web page to be modified, and obtain the modified web page, thereby reducing the time for manual modification of web pages and the time for learning programming skills required for manual modification of web pages.
[0058] In a possible implementation, in the above step S207, the web page to be modified is modified according to the web page modification information to obtain the modified web page, including: steps S207B1 to S207B3.
[0059] S207B1: Inputting webpage modification information into the instruction rewriting large language model to obtain at least one modification parameter of the webpage structure modification parameter, the webpage layout modification parameter and the webpage element modification parameter output by the instruction rewriting large language model.
[0060] In this step, the instruction rewriting language model can also be pre-trained by the staff. The webpage structure modification parameters can include the webpage structure to be modified and the modified webpage structure; the webpage layout modification parameters can include the webpage layout to be modified and the modified webpage layout; the webpage element modification parameters can include the webpage elements to be modified and the modified webpage elements.
[0061] S207B2: Generate a webpage modification instruction using the modification parameters.
[0062] In this step, the webpage structure modification parameters, webpage layout modification parameters and webpage element modification parameters in the modification parameters are written into the modification instruction template to obtain the webpage modification instruction. The modification parameters can also be combined with the preset fields to obtain the webpage modification instruction.
[0063] Among them, the modification instruction template and the preset fields can be pre-configured by the staff.
[0064] In a possible implementation, in this step, modifying parameters is used to generate a webpage modification instruction, including: step S207B21.
[0065] S207B21: According to the type of the modified parameter, write the modified parameter into the instruction template to obtain the webpage modification instruction.
[0066] In this step, the modification parameter may be written into a position corresponding to the parameter type in the instruction template to obtain a webpage modification instruction.
[0067] For example, if the type of modification parameter 1 is A, then the modification parameter 1 is written into the write position corresponding to type A in the instruction template; for another example, if the type of modification parameter 2 is B, then the modification parameter 2 is written into the write position corresponding to type B in the instruction template. After all modification parameters are written into the instruction template, a webpage modification instruction is obtained.
[0068] S207B3: Use the webpage modification instruction to modify the webpage to be modified to obtain a modified webpage.
[0069] This step may include executing a webpage modification instruction to modify the webpage to be modified to obtain a modified webpage; or may include inputting the address of the webpage to be modified and the webpage modification instruction into a preset webpage modification program to obtain a modified webpage output by the webpage modification program.
[0070] From the description of the above embodiments, it can be seen that the embodiments of the present application obtain modification parameters output by the large language model through the instruction rewriting of the web page modification information input into the instruction rewriting large language model, and use the modification parameters to generate web page modification instructions, and use the web page modification instructions to modify the web page to be modified to obtain the modified web page, thereby realizing the automatic optimization of the input web page modification information using the large language model, reducing the learning cost of personnel and increasing the efficiency of web page modification.
[0071] In a possible implementation, in the above step S202, calculating the similarity between the target web page description information and the web page description information includes: steps S2021 to S2025.
[0072] S2021: Determine the target component type and target component name in the target web page description information.
[0073] In this step, the target webpage description information may contain multiple components (such as buttons, text boxes, images, etc.), and the task of this sentence is to find a specific component from these description information and clarify its type (such as button, text box, etc.) and name (such as submit button, user name input box, etc.). The target component type included can be obtained by searching the first preset field in the target webpage description information, and the target component name included can be obtained by searching the second preset field in the target webpage description information; it can also include reading the adjacent field after the component type field in the target webpage description information to obtain the target component type, and the adjacent field after the component name field in the target webpage description information to obtain the target component name.
[0074] S2022: Determine the existing component type and the existing component name in the webpage description information.
[0075] This step is similar to the above step S2021 and will not be repeated here.
[0076] S2023: Calculate the first similarity between the target component type and the existing component type.
[0077] In this step, it can include determining the number of repeated component types in the target component type and the existing component types, dividing the number of repeated component types by the number of target component types to obtain a first similarity, or dividing the number of repeated component types by the number of component types to obtain a first similarity.
[0078] S2024: Calculate the second similarity between the target component name and the existing component name.
[0079] In this step, it can include calculating the cosine similarity between any target component name and each existing component name, determining the maximum cosine similarity as the component similarity corresponding to this target component name, if the component similarity exceeds a preset value, then this target component is determined as a similar component, and the number of similar components is divided by the number of target component names to obtain a second similarity.
[0080] S2025: Perform weighted summation of the first similarity and the second similarity to obtain the similarity between the target web page description information and the web page description information.
[0081] In this step, the weight value used in the weighted summation may be preset by the staff.
[0082] From the description of the above embodiments, it can be seen that the embodiments of the present application respectively calculate the similarity of component types and component names in the target web page information and the web page information of each existing web page, and comprehensively calculate the similarity between the target web page description information and the web page description information of each web page, so as to facilitate the subsequent determination of the target web page among multiple existing web pages.
[0083] In a possible implementation, before the step S206 of acquiring the webpage description information of the existing webpage in response to receiving the webpage generation instruction input by the user, the method further includes:
[0084] S220: Obtain a screenshot of the web page.
[0085] In this step, the webpage screenshot of an existing webpage may be read, or a similar solution as in the above step S204 may be used to obtain the webpage screenshot.
[0086] S221: Recognize text in the webpage screenshot to obtain a text recognition result.
[0087] In this step, an OCR (Optical Character Recognition) method may be used to recognize text in the webpage screenshot to obtain a text recognition result.
[0088] S222: Input the text recognition result into the semantic analysis model to obtain web page description information.
[0089] In this step, the semantic analysis model may be a large language model. In this step, the text recognition result may be directly input into the semantic analysis model, or the text recognition result may be spliced with a preset instruction field and the webpage description information may be input.
[0090] From the description of the above embodiments, it can be seen that the embodiments of the present application obtain web page screenshots, perform text recognition, input the text recognition results into a semantic analysis model, obtain web page description information, and automatically generate web page screenshots and web page description information corresponding to existing web pages, thereby saving time for manual summarization of web page description information.
[0091] In a possible implementation, after modifying the web page to be modified according to the web page modification information to obtain the modified web page, the method further includes: receiving a re-modification instruction input by a user; and modifying the modified web page according to the re-modification instruction to obtain a new modified web page.
[0092] Figure 3 This is a schematic diagram of the structure of the web page processing device provided in the embodiment of the present application. Figure 3 As shown, the web page processing device 300 includes: an information acquisition module 301, a similarity calculation module 302, a web page determination module 303, a screenshot determination module 304, a screenshot output module 305, a web page modification determination module 306 and a web page modification module 307.
[0093] The information acquisition module 301 is used to acquire web page description information of an existing web page in response to receiving a web page generation instruction input by a user, wherein the web page generation instruction includes target web page description information and web page modification information;
[0094] A similarity calculation module 302 is used to calculate the similarity between the target webpage description information and the webpage description information;
[0095] A webpage determination module 303 is used to determine an existing webpage whose corresponding similarity is greater than a preset similarity threshold as a target webpage;
[0096] A screenshot determination module 304 is used to determine a webpage screenshot corresponding to a target webpage;
[0097] Screenshot output module 305, used to output webpage screenshots;
[0098] A modified webpage determination module 306 is configured to determine a target webpage corresponding to the selection instruction as a webpage to be modified in response to receiving a selection instruction input by a user according to a webpage screenshot;
[0099] The webpage modification module 307 is used to modify the webpage to be modified according to the webpage modification information to obtain a modified webpage.
[0100] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0101] In one possible implementation, the web page modification module 307 is specifically used to input web page modification information into instructions to generate a large language model, obtain the domain-specific language output by the instructions to generate the large language model; use the domain-specific language and the web page to be modified to execute the web page modification program, and obtain the modified web page output by the web page modification program.
[0102] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0103] In one possible implementation, the web page modification module 307 is specifically used to input web page modification information into the instruction rewriting large language model to obtain at least one modification parameter among the web page structure modification parameters, web page layout modification parameters and web page element modification parameters output by the instruction rewriting large language model; use the modification parameters to generate a web page modification instruction; use the web page modification instruction to modify the web page to be modified to obtain a modified web page.
[0104] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0105] In a possible implementation, the webpage modification module 307 is specifically configured to write the modification parameters into the instruction template according to the type of the modification parameters to obtain the webpage modification instruction.
[0106] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0107] In one possible implementation, the similarity calculation module 302 is specifically used to determine the target component type and target component name in the target web page description information; determine the existing component type and existing component name in the web page description information; calculate the first similarity between the target component type and the existing component type; calculate the second similarity between the target component name and the existing component name; and weightedly sum the first similarity and the second similarity to obtain the similarity between the target web page description information and the web page description information.
[0108] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0109] In a possible implementation, the web page processing device 300 further includes: an information determination module 308.
[0110] The information determination module 308 is used to obtain a screenshot of a web page; recognize the text in the screenshot of the web page to obtain a text recognition result; and input the text recognition result into a semantic analysis model to obtain web page description information.
[0111] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0112] In order to implement the above embodiment, the embodiment of the present application also provides an electronic device.
[0113] refer to Figure 4 , which shows a schematic diagram of the structure of an electronic device 400 suitable for implementing the embodiment of the present application, and the electronic device 400 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (Portable Media Players, PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0114] like Figure 4 As shown, the electronic device 400 may include a processor (such as a central processing unit, a graphics processing unit, etc.) 401, and a memory 402 that is communicatively connected to the processor, which can perform various appropriate actions and processes according to the program stored in the memory 402, the computer execution instruction, or the program loaded from the storage device 408 to the random access memory (Random Access Memory, referred to as RAM) 403, to implement the web page processing method in any of the above embodiments, wherein the memory may be a read-only memory (Read Only Memory, referred to as ROM). In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the memory 402, and the RAM 403 are connected to each other via a bus 404. The input / output (I / O) interface 405 is also connected to the bus 404.
[0115] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0116] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the memory 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present application are executed.
[0117] It should be noted that the computer-readable storage medium mentioned above in the present application may be a computer-readable signal medium or a computer storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable storage medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0118] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0119] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0120] The computer program code for performing the operation of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0121] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0122] The modules involved in the embodiments described in this application can be implemented by software or hardware. The name of the unit does not limit the module itself in some cases. For example, the webpage determination module can also be described as a "target webpage determination module".
[0123] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0124] The present application also provides a computer-readable storage medium, which stores computer executable instructions. When a processor executes the computer executable instructions, the technical solution of the web page processing method in any of the above embodiments is implemented. Its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the web page processing method. Please refer to the implementation principle and beneficial effects of the web page processing method, and no further details will be given here.
[0125] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0126] The present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the technical solution of the web page processing method in any of the above-mentioned embodiments. Its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the web page processing method. Please refer to the implementation principle and beneficial effects of the web page processing method, and no further details will be given here.
[0127] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
[0128] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0129] It should be understood that the present application 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 application is limited only by the appended claims.
Claims
1. A web page processing method, characterized in that: include: In response to receiving a webpage generation instruction input by a user, obtaining webpage description information of an existing webpage, wherein the webpage generation instruction includes target webpage description information and webpage modification information; Calculating the similarity between the target web page description information and the web page description information; Determine the existing web pages whose corresponding similarity is greater than a preset similarity threshold as target web pages; Determine a webpage screenshot corresponding to the target webpage; Outputting the webpage screenshot; In response to receiving a selection instruction input by the user according to the webpage screenshot, determining a target webpage corresponding to the selection instruction as the webpage to be modified; The web page to be modified is modified according to the web page modification information to obtain a modified web page.
2. The method according to claim 1, characterized in that The step of modifying the web page to be modified according to the web page modification information to obtain a modified web page includes: Inputting the webpage modification information into an instruction to generate a large language model, and obtaining a domain-specific language output by the instruction to generate the large language model; The domain-specific language and the web page to be modified are used to execute a web page modification program to obtain a modified web page output by the web page modification program.
3. The method according to claim 1, characterized in that The step of modifying the web page to be modified according to the web page modification information to obtain a modified web page includes: Inputting the webpage modification information into the instruction rewriting large language model to obtain at least one modification parameter of the webpage structure modification parameter, the webpage layout modification parameter and the webpage element modification parameter output by the instruction rewriting large language model; Using the modification parameters, generating a webpage modification instruction; The webpage to be modified is modified using a webpage modification instruction to obtain a modified webpage.
4. The method according to claim 3, characterized in that Using the modification parameters to generate a webpage modification instruction includes: According to the type of the modification parameter, the modification parameter is written into the instruction template to obtain the webpage modification instruction.
5. The method according to claim 1, characterized in that The calculating the similarity between the target webpage description information and the webpage description information includes: Determine the target component type and target component name in the target webpage description information; Determine the existing component type and the existing component name in the webpage description information; Calculating a first similarity between the target component type and the existing component type; Calculating a second similarity between the target component name and the existing component name; The first similarity and the second similarity are weightedly summed to obtain the similarity between the target webpage description information and the webpage description information.
6. The method according to any one of claims 1 to 5, characterized in that Before acquiring web page description information of an existing web page in response to receiving a web page generation instruction input by a user, the method further includes: Get a screenshot of a web page; Recognize the text in the webpage screenshot to obtain a text recognition result; The text recognition result is input into the semantic analysis model to obtain the web page description information.
7. A web page processing device, characterized in that: include: An information acquisition module, configured to acquire web page description information of an existing web page in response to receiving a web page generation instruction input by a user, wherein the web page generation instruction includes target web page description information and web page modification information; A similarity calculation module, used to calculate the similarity between the target web page description information and the web page description information; A webpage determination module, used to determine an existing webpage whose corresponding similarity is greater than a preset similarity threshold as a target webpage; A screenshot determination module, used to determine the webpage screenshot corresponding to the target webpage; A screenshot output module, used to output the webpage screenshot; A modified webpage determination module, configured to, in response to receiving a selection instruction input by a user according to the webpage screenshot, determine a target webpage corresponding to the selection instruction as a webpage to be modified; The webpage modification module is used to modify the webpage to be modified according to the webpage modification information to obtain a modified webpage.
8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the web page processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the webpage processing method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the web page processing method according to any one of claims 1 to 6.
