Plug-in embedding method, device and system, computer equipment and storage medium

By obtaining website attribute information to generate token data, the plug-in style is automatically adjusted to be consistent with the website style, solving the problem of interface fragmentation between SDK plug-ins on different websites and improving user experience and adaptability.

CN120687069APending Publication Date: 2025-09-23BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510773570.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In the existing technology, when the AI ​​assistant SDK plug-in is embedded in websites of different styles, it is easy to produce a sense of interface fragmentation, affecting the user experience. In addition, the custom style adaptation operation is cumbersome and difficult to cover personalized needs.

Method used

By obtaining the website's web page attribute information, identifying interface parameters, and generating token data to automatically adjust the plug-in style to make it consistent with the website style, the training model and database are used to quickly match the interface parameters, and dynamic adjustments are made based on user feedback.

Benefits of technology

It achieves seamless style integration between the plug-in and the website, improves user experience, reduces manual adaptation workload, and enhances the adaptability and interactive effects of the plug-in.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687069A_ABST
    Figure CN120687069A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a plug-in embedding method, device and system, computer equipment and a storage medium, and the method comprises the steps: obtaining webpage attribute information of a front end when an embedding request of a target plug-in is received; determining interface parameter information of the front end according to the webpage attribute information; generating token data corresponding to the target plug-in according to the interface parameter information; and sending the token data to the front end to enable the front end to embed the target plug-in into a website according to the token data. Therefore, the corresponding token data can be generated after the website interface parameters are identified through the webpage attribute information, and the target plug-in is embedded into the website according to the token data, so that the style fusion degree and adaptation degree of the plug-in and the website are improved, and the user experience is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of website technology, and in particular to a plug-in embedding method, device, system, computer equipment and storage medium. Background Art

[0002] With the development of artificial intelligence technology, more and more companies are integrating AI assistant software development kit (SDK) plug-ins into their websites to provide users with intelligent question-and-answer, automatic services and other capabilities. However, in existing technologies, such SDKs usually have fixed UI styles or pre-made themes. When embedded in websites with different styles, they can easily create a sense of interface fragmentation, affecting the user experience. For example, customer service SDKs and browser plug-in tools often do not adapt to styles and clearly have third-party service characteristics; some customized solutions require developers to manually configure styles, which is cumbersome and requires high design capabilities; even if preset themes are provided, it is difficult to cover the personalized needs of different websites.

[0003] Therefore, existing technologies cannot automatically adapt the SDK style to match the overall design style of the embedded website while ensuring a good user experience, resulting in a poor user experience. How to improve the adaptability of plug-ins to websites when embedded has become an urgent problem to be solved. Summary of the Invention

[0004] In view of this, in order to solve the above technical problems or part of the technical problems, embodiments of the present invention provide a plug-in embedding method, apparatus, system, computer equipment and storage medium.

[0005] In a first aspect, an embodiment of the present invention provides a plug-in embedding method, comprising:

[0006] When receiving the embed request of the target plug-in, obtain the front-end web page attribute information;

[0007] Determining interface parameter information of the front end according to the webpage attribute information;

[0008] Generate token data corresponding to the target plug-in according to the interface parameter information;

[0009] The token data is sent to the front end, so that the front end embeds the target plug-in into the website according to the token data.

[0010] In a possible implementation, determining the front-end interface parameter information according to the webpage attribute information includes:

[0011] Determining whether a database corresponding to the website contains interface parameter information corresponding to the webpage attribute information;

[0012] If the judgment result is no, the web page attribute information is input into the trained target model to generate interface parameter information corresponding to the web page attribute information through the target model. The web page attribute information includes at least one of the following: web page structure information, web page style information, page image information and web page logo. The interface parameter information includes at least one of the following: interface color parameters, interface font parameters, interface size parameters and interface style parameters.

[0013] In a possible implementation, generating token data corresponding to the target plug-in according to the interface parameter information includes:

[0014] Structuring the interface parameter information through the target model to generate style configuration parameters for the target plug-in;

[0015] The style configuration parameters are used as the token data.

[0016] In one possible implementation, the method further includes:

[0017] If the database corresponding to the website contains the interface parameter information corresponding to the webpage attribute information, determining the interface parameter information from the database according to the webpage identifier in the webpage attribute information;

[0018] Determine token data corresponding to the interface parameter information from a database.

[0019] In one possible implementation, the front end embeds the target plug-in into the website according to the token data, including:

[0020] The software development kit corresponding to the target plug-in is loaded through the front end, so that after the software development kit embeds the target plug-in into the website, the interface parameters of the target plug-in in the web page are adjusted according to the token data.

[0021] In one possible implementation, after the front end embeds the target plug-in into the website according to the token data, the method further includes:

[0022] Obtaining user feedback data for the target plug-in within a preset time period;

[0023] The target plug-in is adjusted according to the user feedback data.

[0024] In a second aspect, an embodiment of the present invention provides a plug-in embedding device, comprising:

[0025] The acquisition module is used to obtain the front-end web page attribute information when receiving the embed request of the target plug-in;

[0026] A determination module, configured to determine interface parameter information of the front end according to the webpage attribute information;

[0027] A generating module, configured to generate token data corresponding to the target plug-in according to the interface parameter information;

[0028] The sending module is used to send the token data to the front end, so that the front end embeds the target plug-in into the website according to the token data.

[0029] In a third aspect, an embodiment of the present invention provides a plug-in embedding system for implementing the plug-in embedding method in the first aspect, the system comprising: a front-end, a back-end service, a target model, and a database;

[0030] The front end is used to obtain the webpage attribute information of the front end through the software development kit when receiving the embedding request of the target plug-in;

[0031] The backend service is used to query the database for the interface parameter information corresponding to the webpage attribute information and the token data corresponding to the interface parameter information, or to receive the token data returned by the target model after sending the webpage attribute information to the target model;

[0032] The front end is further configured to receive token data sent by the back end service, so as to embed the target plug-in into the website according to the token data.

[0033] In a fourth aspect, an embodiment of the present invention provides a computer device, comprising: a processor and a memory, wherein the processor is configured to execute a plug-in embedding program stored in the memory to implement the plug-in embedding method described in any one of the first aspects above.

[0034] In a fifth aspect, an embodiment of the present invention provides a storage medium storing one or more programs, which can be executed by one or more processors to implement the plug-in embedding method described in any one of the first aspects above.

[0035] The plug-in embedding solution provided by an embodiment of the present invention obtains webpage attribute information from a front-end upon receiving an embed request for a target plug-in; determines interface parameter information of the front-end based on the webpage attribute information; generates token data corresponding to the target plug-in based on the interface parameter information; and sends the token data to the front-end, so that the front-end embeds the target plug-in into the website based on the token data. Thus, the target plug-in can be embedded into the website according to the token data after identifying the website interface parameters based on the webpage attribute information. This improves the integration and compatibility of the plug-in with the website style and enhances the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A flowchart of a plug-in embedding method provided by an embodiment of the present invention;

[0037] Figure 2 A flowchart of another plug-in embedding method provided by an embodiment of the present invention;

[0038] Figure 3 A flowchart of another plug-in embedding method provided by an embodiment of the present invention;

[0039] Figure 4 A flowchart of another plug-in embedding method provided by an embodiment of the present invention;

[0040] Figure 5 A schematic structural diagram of a plug-in embedding device provided by an embodiment of the present invention;

[0041] Figure 6 A schematic structural diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0043] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below with reference to the accompanying drawings. The embodiments do not limit the embodiments of the present invention.

[0044] Figure 1 A flow chart of a plug-in embedding method provided by an embodiment of the present invention is as follows: Figure 1 As shown, the method specifically includes:

[0045] S11. When receiving an embedding request of a target plug-in, obtaining the front-end web page attribute information.

[0046] The plug-in embedding method provided in an embodiment of the present invention is applied to computer devices, which may include but are not limited to: servers, desktop computers, etc. The execution entity is the back-end service of the computer device. It is suitable for scenarios where the AI ​​assistant SDK is embedded in various websites. It can automatically generate matching plug-in style configurations according to the interface styles of different websites, thereby achieving seamless integration of interface styles. It is widely used in intelligent service scenarios such as enterprise customer service, intelligent question and answer, and marketing recommendations.

[0047] In this embodiment, when the target plug-in SDK is loaded, it listens to or intercepts the DOMContentLoaded (document content loading completed) or load (complete loading completed) event of the target web page to ensure that the page content has completed preliminary rendering, so as to facilitate the accurate collection of web page attribute information. During the initialization phase, the plug-in injects a style collection script into the page through JavaScript. The script is executed in a non-invasive manner and does not affect the original page function. The script traverses the main nodes of the page through the DOM API (such as document.querySelectorAll), collects web page structure information (for example, DOM nodes, layout methods, hierarchical structure), web page style information (for example, CSS (Cascading Style Sheets) attribute values, web page background style, font style, etc.), page image information (for example, page screenshots, image color analysis), web page identification (for example, domain name, title, meta tags, favicon, etc.), and uses the collected information as the front-end web page attribute information.

[0048] S12. Determine the front-end interface parameter information according to the webpage attribute information.

[0049] In this embodiment, the interface parameter information includes: interface color parameters (primary color, background color, secondary color, etc.), interface font parameters (font family, font size, line spacing, etc.), interface size parameters (button height, input box width, etc.), and interface style parameters (degree of rounded corners, shadow level, visual density, etc.). Specific interface parameters can be identified from the webpage attribute information.

[0050] Specifically, when identifying interface color parameters, the color, background-color, border-color and other CSS styles of page elements are read through the web page style information; after obtaining the page screenshot from the page image information, color clustering (such as K-means) is used to extract the main color tone; based on the web page structure information, the color styles of buttons, titles and other components that appear frequently on the page are analyzed to determine the main color; the main color of the brand is often determined based on the main color of web page logos such as favicon icons and website logo images.

[0051] When identifying interface font parameters, CSS properties used to define text styles are extracted from the body or common components based on the webpage style information. These include: font-family (font family), which represents the font name used for the text; font-size (font size), which represents the size of the text; and line-height (line spacing), which represents the vertical distance between lines, i.e., the height of the text line. The main content area or title area is determined based on the webpage structure information, with sampling prioritized from these areas. The domain name of the webpage of that type, as found in the webpage identifier, is used to determine whether it is a common brand style (e.g., the font of Company A).

[0052] When identifying interface size parameters, common components on the page (such as .btn, input, and .card) are identified based on the webpage structure information. Based on the webpage style information, important CSS attributes used to control the layout and size of webpage elements are extracted. These attributes may include: padding (internal margins), which controls the distance between the element's content and its border; margin (outer margins), which controls the spacing between the element and other external elements; height (height), which sets the height of the element's content area; and width (width), which sets the width of the element's content area. Visual density and layout proportions are also confirmed based on page image information.

[0053] When identifying interface style parameters, CSS properties used to control the visual style of elements are extracted based on web page style information. These properties may include: border-radius (which sets the radius of the rounded corners of an element for a softer appearance); box-shadow (which adds shadows to elements for a more three-dimensional and layered effect); and border-style (which sets the line style of the element's borders). The web page structure determines whether the layout is card-based or modular. The page image information is used to visually analyze whether the colors are high-contrast and the layout is dense. The domain name used in the web page logo identifies the style of some brand websites.

[0054] S13. Generate token data corresponding to the target plug-in according to the interface parameter information.

[0055] In this embodiment, the design token refers to a set of structured, reusable, and computable style parameters that describe the style of the plug-in. This data is used by the plug-in during rendering to ensure that the visual style is consistent with the current web page.

[0056] Specifically, unified structured processing can be performed based on interface parameter information to construct token data in a standard format. This means formatting a data set into a predefined structure as token data. This structure must be adapted to the front-end plugin's style rendering framework. Depending on the plugin's actual component design system, the extracted parameters may be mapped, cropped, and merged. For example, multiple fonts may be unified into a font-family-base, and default values ​​may be filled in. If certain styles on the webpage are undefined, alternative values ​​in the default token template may be used, and the data may be converted to JSON or other structured formats. The generated design token data can also be saved to a cache or local storage for subsequent rendering.

[0057] S14. Send the token data to the front end so that the front end embeds the target plug-in into the website according to the token data.

[0058] In this embodiment, token data is sent to the front end through an interface. The general methods include: using HTTP API response return (such as: GET / sdk / token-config), JSON injection during SDK initialization, and WebSocket real-time push if dynamic updates are required. When the front end loads the plug-in initialization script, it receives the above token data and stores it in the configuration object inside the plug-in. The front-end plug-in constructs CSS variables or style attributes based on the token data, or dynamically creates styles through JavaScript. After the style rendering is completed, the front end will fully embed the plug-in component into the target website according to the style and function configuration to ensure that the style is consistent with the overall website and avoid a sense of disconnection.

[0059] The plug-in embedding method provided by an embodiment of the present invention obtains webpage attribute information from a front-end upon receiving an embedding request for a target plug-in; determines interface parameter information of the front-end based on the webpage attribute information; generates token data corresponding to the target plug-in based on the interface parameter information; and sends the token data to the front-end, so that the front-end embeds the target plug-in into the website based on the token data. Thus, the target plug-in can be embedded into the website based on the token data after identifying the website interface parameters based on the webpage attribute information. This improves the integration and compatibility of the plug-in with the website's style and enhances the user experience.

[0060] Figure 2 A flow chart of another plug-in embedding method provided by an embodiment of the present invention is shown as follows: Figure 2 As shown, the method specifically includes:

[0061] S21. When receiving an embedding request of a target plug-in, obtain the front-end web page attribute information.

[0062] In this embodiment, similar to step S11, please refer to Figure 1 For the sake of brevity, the relevant content will not be elaborated here.

[0063] S22. Determine whether the database corresponding to the website contains interface parameter information corresponding to the web page attribute information; if the determination result is no, input the web page attribute information into the trained target model to generate interface parameter information corresponding to the web page attribute information through the target model.

[0064] In this embodiment, the web page attribute information includes at least one of the following: web page structure information, web page style information, page image information and web page logo; the interface parameter information includes at least one of the following: interface color parameters, interface font parameters, interface size parameters and interface style parameters.

[0065] Specifically, the system uses the webpage ID as the primary key to query the backend database to see if the interface parameter information corresponding to the website already exists. If the judgment result is no, the webpage attribute information is input into the trained target model. If there is no ready-made configuration in the database, the system automatically calls the trained multimodal large model (interface style generation model). This model is based on deep learning and multimodal analysis technology. After inputting the webpage attribute information, it outputs the corresponding interface parameter information. The output interface parameter information can be stored in the database and bound to the current website ID for quick matching and call next time, without the need for repeated analysis.

[0066] In one possible implementation, if the database corresponding to the website contains interface parameter information corresponding to the webpage attribute information, the interface parameter information is determined from the database according to the webpage identifier in the webpage attribute information; and token data corresponding to the interface parameter information is determined from the database.

[0067] In this embodiment, the web page identifier is used as an index to access the back-end database to find out whether there is interface parameter information corresponding to the website; if the search is successful, the interface parameter information bound to the website is obtained, and based on the interface parameter information in the above query results, the corresponding token data (such as design style configuration items) is queried. The database has a one-to-one correspondence between the interface parameter information and the token data. Thus, the token data is obtained. By quickly matching and retrieving the existing data, the system can efficiently complete the adaptation rendering of the target plug-in, improve the response speed, avoid repeated calculations, and save resources.

[0068] S23. Structural processing is performed on the interface parameter information through the target model to generate style configuration parameters for the target plug-in; and the style configuration parameters are used as token data.

[0069] In this embodiment, the target model receives the interface parameter information generated in the previous stage as input data, classifies and maps the input parameters through rule matching or a trained multimodal model, and generates structured style data for configuring the target plug-in interface. For example, "primary color" is mapped to "primaryColor", "font type" is mapped to "fontFamily", "rounded corners" is mapped to "borderRadius", etc. A set of data structures (i.e., style configuration parameters) that conform to the plug-in style system is output. The above-mentioned structured style configuration parameters are encapsulated as token data in the design token format. The token data can be directly read by the front-end plug-in and applied to interface rendering.

[0070] S24. Send the token data to the front end so that the front end loads the software development kit corresponding to the target plug-in, so that after the software development kit embeds the target plug-in into the website, the interface parameters of the target plug-in in the web page are adjusted according to the token data.

[0071] In this embodiment, the software development kit (SDK) corresponding to the target plug-in is loaded, and the embedding method is to embed the target plug-in on the front page of the website through <script>标签或模块化引入方式(如import)加载提供的目标插件SDK脚本资源。前端页面在DOMContentLoaded或load事件触发时,执行SDK的初始化方法,发送嵌入请求。SDK在接收到初始化指令后,会在指定的容器节点中渲染插件相关的HTML结构。插件包含的交互组件(如对话框、按钮、输入框)在渲染后会绑定所需事件监听器与数据通信接口。插件在初始化过程中,通过网络请求或全局注入变量接收服务端返回的令牌数据。将令牌数据中的样式配置参数(如主色、字体、边距、圆角、阴影等)动态转换为内联CSS或通过样式变量注入CSS变量中。若插件使用了样式构建系统,则解析令牌数据生成对应的样式类或动态样式表。插件在渲染时读取上述样式数据,并将其应用到对应组件的样式属性上,实现界面颜色、字体、尺寸、风格等参数的自动匹配。

[0072] S25、获取预设时间段内针对目标插件的用户反馈数据;根据用户反馈数据对目标插件进行调整。

[0073] 在本实施例中,系统可设定一个固定的时间窗口(如24小时、7天),在该时间段内收集用户使用数据和反馈信息。采集用户反馈数据的方式包括:行为数据采集:采集用户点击、输入、停留时间、滚动行为、插件使用频率等;利用埋点技术实现自动上报。显式反馈采集:插件中提供评价入口(如"喜欢 / 不喜欢”按钮、星级打分、问题反馈表单等),由用户主动提交。错误和异常信息收集:捕获插件运行过程中产生的异常或卡顿(如JS报错、渲染失败)并上报服务端。将收集的反馈数据通过API上传至后端;后端存入数据库(如MySQL或MongoDB),并按插件ID、用户ID、时间戳等字段归类索引。

[0074] 对行为数据进行聚合分析(如点击热区统计、页面停留时间、页面退出率);对显式反馈数据进行情感分类、关键词提取;根据异常信息生成错误日志或性能指标报告。生成调整建议:若用户普遍反馈"按钮太小”、"颜色太暗”等问题,系统自动生成样式调整建议;若某些功能使用率极低,可建议简化界面或隐藏功能;若存在稳定性问题,优先触发插件修复流程。调整插件:系统自动更新目标插件的令牌数据(样式配置、行为配置等);可通过热更新方式推送新的令牌数据至前端,无需用户手动刷新;插件下一次加载时将自动适配更新后的界面或逻辑。

[0075] 在一个可能的实施方式中,引入情感计算技术,通过摄像头、麦克风或其他传感器实时采集用户的情绪状态信息(如面部表情、语音语调、打字节奏等),并将这些情绪数据输入情感识别模型进行分析。根据识别结果,将识别出的情绪状态映射到预定义的令牌参数集合(如色彩方案、动画参数),系统动态调整目标插件的界面设计风格,包括界面颜色、字体样式、动画效果和交互元素等。例如,当检测到用户处于焦虑或压力状态时,系统自动切换为冷色调、简洁设计风格以缓解用户情绪;当用户处于愉悦状态时,则采用明快鲜艳的配色和丰富交互增强体验。通过情感驱动的界面自适应,提升用户与插件交互的情感共鸣和使用满意度。

[0076] 在一个可能的实施方式中,针对电商网站的特殊应用场景,结合用户购买行为数据(浏览历史、购物车商品、成交记录等)和推荐系统输出的个性化商品信息,动态调整目标插件的布局和样式,以提升用户购买转化率。具体包括:根据用户偏好调整插件中推荐商品模块的位置和展示样式;根据促销活动自动改变按钮颜色和文案样式以增强吸引力;根据用户访问时段调整动画节奏和交互反馈;通过大数据分析实时优化界面布局,使插件能够灵活融入不同商品页和活动页,提升视觉和功能的一致性,增强用户购物体验。

[0077] 本发明实施例提供的插件嵌入方法,通过动态分析网站的结构、样式和图像等多维度属性,实现插件界面与网站设计风格的高度契合,显著减少人工适配工作量,降低企业开发者的接入门槛。生成的设计令牌使插件界面参数如颜色、字体、尺寸等与目标网站无缝融合,消除传统第三方插件带来的割裂感,提升用户的沉浸感和满意度。利用多模态大模型技术综合处理网站信息,结合用户反馈和行为数据,实现插件设计的持续优化和个性化调整,增强插件的适应能力和交互效果。设计令牌作为统一的样式配置标准,方便后续版本迭代和多场景快速应用,同时支持情感计算、用户行为驱动等创新功能,为智能交互提供丰富扩展空间。通过本地数据处理和合理的权限控制机制,确保用户隐私得到有效保护,满足合规要求的同时,保障系统运行的安全可靠。

[0078] 本发明实施例还提供一种插件嵌入系统,包括:前端、后端服务、目标模型和数据库;

[0079] 前端,用于当接收到目标插件的嵌入请求时,通过软件开发工具包获取前端的网页属性信息;

[0080] 后端服务,用于从数据库查询网页属性信息对应的界面参数信息,以及界面参数信息对应的令牌数据,或,用于向目标模型发送网页属性信息后,接收目标模型返回的令牌数据;

[0081] 前端,还用于接收后端服务发送的令牌数据,以根据令牌数据将目标插件嵌入网站。

[0082] 在本实施例中,可实现如图3所示的方法,图3为本发明实施例提供的再一种插件嵌入方法的流程示意图,前端在接收到目标插件的嵌入请求后,初始化SDK,基于SDK收集网站信息:网页结构信息、网页样式信息、页面图像信息和网页标识,作为网页属性信息。将网页属性信息发送至后端服务,后端服务从数据库中查询是否有当前网页属性信息对应的界面参数信息及令牌数据,若是,则直接从数据库中获取网页属性信息对应的界面参数信息和令牌数据,若否,则向目标模型(多模态大模型)发送分析任务和网页属性信息,以使目标模型基于网页属性信息分析网站设计风格,并提取界面参数信息,基于界面参数信息生成设计Token(令牌数据),并返回后端服务,同时发送至数据库进行存储,后端服务基于令牌数据应用设计配置并渲染适配后的AI助理界面,使其按照令牌数据嵌入网站。

[0083] 图4为本发明实施例提供的又一种插件嵌入方法的流程示意图,在客户端网站中执行:嵌入的目标插件为AI助理SDK插件(基于Next.js+TypeScript+TailwindCSS);SDK中内置一个"页面数据采集器”模块,具体包括:页面截图模块(提取图像),DOM结构分析模块(提取结构),CSS样式提取模块(提取配色等),将通过不同模块获取的信息作为网页属性信息。设计原子Token配置项模块(样式变量如字体、颜色、圆角等),SDK数据处理模块:负责将采集的网页属性信息结构化处理成风格识别所需的输入格式;然后传输给后端服务。后端服务(Python+FastAPI)接收前端数据后,通过API网关和风格分析处理器将数据发送给大模型服务;如果数据库已有样式缓存,则直接返回缓存;否则发起新分析请求,调用大模型识别风格。多模态大模型服务接收分析任务,识别网站的设计风格(配色、字体、UI元素圆角等)作为界面参数信息,并基于界面参数信息生成Token,并返回结构化的"主题Token配置”。并使用MySQL数据库存储每个获取的网页属性信息、界面参数信息及对应的Token,便于下次命中缓存快速响应。

[0084] 图5为本发明实施例提供的一种插件嵌入装置的结构示意图,如图5所示,该装置具体包括:

[0085] 获取模块51,用于当接收到目标插件的嵌入请求时,获取前端的网页属性信息;

[0086] 确定模块52,用于根据所述网页属性信息确定所述前端的界面参数信息;

[0087] 生成模块53,用于根据所述界面参数信息生成所述目标插件对应的令牌数据;

[0088] 发送模块54,用于将所述令牌数据发送至所述前端,以使所述前端根据所述令牌数据将所述目标插件嵌入网站。

[0089] 在一个可能的实施方式中,判断模块55,用于判断所述网站对应的数据库中是否包含所述网页属性信息对应的界面参数信息;

[0090] 若判断结果为否,则将所述网页属性信息输入训练好的目标模型,以通过所述目标模型生成所述网页属性信息对应的界面参数信息,所述网页属性信息,包括以下至少一个:网页结构信息、网页样式信息、页面图像信息和网页标识,所述界面参数信息,包括以下至少一个:界面颜色参数、界面字体参数、界面尺寸参数、界面风格参数。

[0091] 在一个可能的实施方式中,所述生成模块,具体用于通过所述目标模型对所述界面参数信息进行结构化处理,生成针对所述目标插件的样式配置参数;

[0092] 将所述样式配置参数作为所述令牌数据。

[0093] 在一个可能的实施方式中,所述确定模块,还用于若所述网站对应的数据库中包含所述网页属性信息对应的界面参数信息时,根据所述网页属性信息中的网页标识从所述数据库中确定所述界面参数信息;

[0094] 从数据库中确定所述界面参数信息对应的令牌数据。

[0095] 在一个可能的实施方式中,处理模块56,用于通过所述前端加载所述目标插件对应的软件开发工具包,以使所述软件开发工具包将所述目标插件嵌入所述网站后,根据所述令牌数据对所述目标插件在所述网页中的界面参数进行调整。

[0096] 在一个可能的实施方式中,调整模块57,用于获取预设时间段内针对所述目标插件的用户反馈数据;

[0097] 根据所述用户反馈数据对所述目标插件进行调整。

[0098] 本实施例提供的插件嵌入装置可以是如图5中所示的装置,可执行如图1-2中插件嵌入方法的所有步骤,进而实现图1-2所示插件嵌入方法的技术效果,具体请参照图1-2相关描述,为简洁描述,在此不作赘述。

[0099] 图6为本发明实施例提供的一种计算机设备的结构示意图,图6所示的计算机设备600包括:至少一个处理器601、存储器602、至少一个网络接口604和其他用户接口603。计算机设备600中的各个组件通过总线系统605耦合在一起。可理解,总线系统605用于实现这些组件之间的连接通信。总线系统605除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图6中将各种总线都标为总线系统605。

[0100] 其中,用户接口603可以包括显示器、键盘或者点击设备(例如,鼠标,轨迹球(trackball)、触感板或者触摸屏等。

[0101] 可以理解,本发明实施例中的存储器602可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data RateSDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(DirectRambus RAM,DRRAM)。本文描述的存储器602旨在包括但不限于这些和任意其它适合类型的存储器。

[0102] 在一些实施方式中,存储器602存储了如下的元素,可执行单元或者数据结构,或者他们的子集,或者他们的扩展集:操作系统6021和应用程序6022。

[0103] 其中,操作系统6021,包含各种系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务。应用程序6022,包含各种应用程序,例如媒体播放器(Media Player)、浏览器(Browser)等,用于实现各种应用业务。实现本发明实施例方法的程序可以包含在应用程序6022中。

[0104] 在本发明实施例中,通过调用存储器602存储的程序或指令,具体的,可以是应用程序6022中存储的程序或指令,处理器601用于执行各方法实施例所提供的方法步骤,例如包括:

[0105] 当接收到目标插件的嵌入请求时,获取前端的网页属性信息;

[0106] 根据所述网页属性信息确定所述前端的界面参数信息;

[0107] 根据所述界面参数信息生成所述目标插件对应的令牌数据;

[0108] 将所述令牌数据发送至所述前端,以使所述前端根据所述令牌数据将所述目标插件嵌入网站。

[0109] 在一个可能的实施方式中,判断所述网站对应的数据库中是否包含所述网页属性信息对应的界面参数信息;

[0110] 若判断结果为否,则将所述网页属性信息输入训练好的目标模型,以通过所述目标模型生成所述网页属性信息对应的界面参数信息,所述网页属性信息,包括以下至少一个:网页结构信息、网页样式信息、页面图像信息和网页标识,所述界面参数信息,包括以下至少一个:界面颜色参数、界面字体参数、界面尺寸参数、界面风格参数。

[0111] 在一个可能的实施方式中,通过所述目标模型对所述界面参数信息进行结构化处理,生成针对所述目标插件的样式配置参数;

[0112] 将所述样式配置参数作为所述令牌数据。

[0113] 在一个可能的实施方式中,若所述网站对应的数据库中包含所述网页属性信息对应的界面参数信息时,根据所述网页属性信息中的网页标识从所述数据库中确定所述界面参数信息;

[0114] 从数据库中确定所述界面参数信息对应的令牌数据。

[0115] 在一个可能的实施方式中,通过所述前端加载所述目标插件对应的软件开发工具包,以使所述软件开发工具包将所述目标插件嵌入所述网站后,根据所述令牌数据对所述目标插件在所述网页中的界面参数进行调整。

[0116] 在一个可能的实施方式中,获取预设时间段内针对所述目标插件的用户反馈数据;

[0117] 根据所述用户反馈数据对所述目标插件进行调整。

[0118] 上述本发明实施例揭示的方法可以应用于处理器601中,或者由处理器601实现。处理器601可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器601中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器601可以是通用处理器、数字信号处理器(Digital SignalProcessor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(FieldProgrammable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。软件单元可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器602,处理器601读取存储器602中的信息,结合其硬件完成上述方法的步骤。

[0119] 可以理解的是,本文描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(ApplicationSpecific Integrated Circuits,ASIC)、数字信号处理器(DigitalSignalProcessing,DSP)、数字信号处理设备(DSPDevice,DSPD)、可编程逻辑设备(Programmable LogicDevice,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。

[0120] 对于软件实现,可通过执行本文所述功能的单元来实现本文所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。

[0121] 本实施例提供的计算机设备可以是如图6中所示的设备,可执行如图1-2中插件嵌入方法的所有步骤,进而实现图1-2所示插件嵌入方法的技术效果,具体请参照图1-2相关描述,为简洁描述,在此不作赘述。

[0122] 本发明实施例还提供了一种存储介质(计算机可读存储介质)。这里的存储介质存储有一个或者多个程序。其中,存储介质可以包括易失性存储器,例如随机存取存储器;存储器也可以包括非易失性存储器,例如只读存储器、快闪存储器、硬盘或固态硬盘;存储器还可以包括上述种类的存储器的组合。

[0123] 当存储介质中一个或者多个程序可被一个或者多个处理器执行,以实现上述在设备侧执行的插件嵌入方法。

[0124] 所述处理器用于执行存储器中存储的插件嵌入程序,以实现以下在设备侧执行的插件嵌入方法的步骤:

[0125] 当接收到目标插件的嵌入请求时,获取前端的网页属性信息;

[0126] 根据所述网页属性信息确定所述前端的界面参数信息;

[0127] 根据所述界面参数信息生成所述目标插件对应的令牌数据;

[0128] 将所述令牌数据发送至所述前端,以使所述前端根据所述令牌数据将所述目标插件嵌入网站。

[0129] 在一个可能的实施方式中,判断所述网站对应的数据库中是否包含所述网页属性信息对应的界面参数信息;

[0130] 若判断结果为否,则将所述网页属性信息输入训练好的目标模型,以通过所述目标模型生成所述网页属性信息对应的界面参数信息,所述网页属性信息,包括以下至少一个:网页结构信息、网页样式信息、页面图像信息和网页标识,所述界面参数信息,包括以下至少一个:界面颜色参数、界面字体参数、界面尺寸参数、界面风格参数。

[0131] 在一个可能的实施方式中,通过所述目标模型对所述界面参数信息进行结构化处理,生成针对所述目标插件的样式配置参数;

[0132] 将所述样式配置参数作为所述令牌数据。

[0133] 在一个可能的实施方式中,若所述网站对应的数据库中包含所述网页属性信息对应的界面参数信息时,根据所述网页属性信息中的网页标识从所述数据库中确定所述界面参数信息;

[0134] 从数据库中确定所述界面参数信息对应的令牌数据。

[0135] 在一个可能的实施方式中,通过所述前端加载所述目标插件对应的软件开发工具包,以使所述软件开发工具包将所述目标插件嵌入所述网站后,根据所述令牌数据对所述目标插件在所述网页中的界面参数进行调整。

[0136] 在一个可能的实施方式中,获取预设时间段内针对所述目标插件的用户反馈数据;

[0137] 根据所述用户反馈数据对所述目标插件进行调整。

[0138] 专业人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。

[0139] 结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。

[0140] 以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。< / script>

Claims

1. A plug-in embedding method, characterized in that: include: When receiving the embed request of the target plug-in, obtain the front-end web page attribute information; Determining interface parameter information of the front end according to the webpage attribute information; Generate token data corresponding to the target plug-in according to the interface parameter information; The token data is sent to the front end, so that the front end embeds the target plug-in into the website according to the token data.

2. The method according to claim 1, characterized in that The determining of the front-end interface parameter information according to the webpage attribute information includes: Determining whether a database corresponding to the website contains interface parameter information corresponding to the webpage attribute information; If the judgment result is no, the web page attribute information is input into the trained target model to generate interface parameter information corresponding to the web page attribute information through the target model. The web page attribute information includes at least one of the following: web page structure information, web page style information, page image information and web page logo. The interface parameter information includes at least one of the following: interface color parameters, interface font parameters, interface size parameters and interface style parameters.

3. The method according to claim 2, characterized in that Generating token data corresponding to the target plug-in according to the interface parameter information includes: Structuring the interface parameter information through the target model to generate style configuration parameters for the target plug-in; The style configuration parameters are used as the token data.

4. The method according to claim 3, characterized in that The method further comprises: If the database corresponding to the website contains the interface parameter information corresponding to the webpage attribute information, determining the interface parameter information from the database according to the webpage identifier in the webpage attribute information; Determine token data corresponding to the interface parameter information from a database.

5. The method according to claim 1, wherein The front end embeds the target plug-in into the website according to the token data, including: The software development kit corresponding to the target plug-in is loaded through the front end, so that after the software development kit embeds the target plug-in into the website, the interface parameters of the target plug-in in the web page are adjusted according to the token data.

6. The method according to claim 1, characterized in that After the front end embeds the target plug-in into the website according to the token data, the method further includes: Obtaining user feedback data for the target plug-in within a preset time period; The target plug-in is adjusted according to the user feedback data.

7. A plug-in embedding device, characterized in that: include: The acquisition module is used to obtain the front-end web page attribute information when receiving the embed request of the target plug-in; A determination module, configured to determine interface parameter information of the front end according to the webpage attribute information; A generating module, configured to generate token data corresponding to the target plug-in according to the interface parameter information; The sending module is used to send the token data to the front end, so that the front end embeds the target plug-in into the website according to the token data.

8. A plug-in embedding system, characterized in that: For implementing the plug-in embedding method according to claim 1, the system comprises: a front-end, a back-end service, a target model and a database; The front end is used to obtain the webpage attribute information of the front end through the software development kit when receiving the embedding request of the target plug-in; The backend service is used to query the database for the interface parameter information corresponding to the webpage attribute information and the token data corresponding to the interface parameter information, or to receive the token data returned by the target model after sending the webpage attribute information to the target model; The front end is further configured to receive token data sent by the back end service, so as to embed the target plug-in into the website according to the token data.

9. A computer device, characterized in that: include: A processor and a memory, wherein the processor is configured to execute a plug-in embedding program stored in the memory to implement the plug-in embedding method according to any one of claims 1 to 6.

10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the plug-in embedding method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Permission management method and device based on Next.js, equipment and medium

    CN121530646A