Data display method and device based on large language model, medium and equipment

By generating interface layout information using large language models and prompt words, the problem of matching structured text display with application scenarios is solved, improving user experience and interface generation efficiency, and lowering the technical threshold.

CN120688455BActive Publication Date: 2026-03-31BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-21
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In existing technologies, the data display methods of structured text are difficult to match with actual application scenarios, resulting in a poor user reading experience. Furthermore, the technical threshold is high, making it difficult for non-front-end personnel to quickly build and publish data display interfaces.

Method used

By combining a large language model with prompt words, the interface layout information is determined and executable code is generated. The interface layout is represented using JavaScript extended syntax JSX code, and then displayed using React rendering technology, which lowers the technical threshold and improves the matching degree between the interface and data and the visualization effect.

Benefits of technology

It improves the visualization of data display, highlights key information, enhances user understanding and interactive experience, and reduces the technical difficulty from content generation to interface publishing, enabling non-front-end personnel to quickly build and publish data display interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120688455B_ABST
    Figure CN120688455B_ABST
Patent Text Reader

Abstract

A data display method, apparatus, medium, and device based on a large language model are disclosed, relating to the fields of large language models and computer technology. The method includes: receiving target data, which is used to determine the content to be displayed in a display interface; determining interface layout information corresponding to the target data based on the target data, the large language model, and prompt words corresponding to the large language model, wherein the interface layout information is represented by JavaScript Extended Syntax (JSX) code; compiling the interface layout information to obtain executable code corresponding to the interface layout information; and rendering the executable code and the target data to generate and display the display interface. This allows the large language model to determine the interface layout information based on the input target data, guided by prompt words, improving the matching degree between the interface layout information and the target data, thereby enhancing the visualization of the target data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the technical fields of computer technology and large language models, specifically to a data display method, apparatus, medium, and device based on a large language model. Background Technology

[0002] Structured text (such as JSON) can effectively carry rich semantic information and is a widely used form of expression in current data analysis, content generation, and document writing. Related technologies allow structured text to be written into specific templates to display the data content within that structured text to users. While the data content displayed in this way is complete, the user experience of reading and understanding key information is poor. Summary of the Invention

[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] Firstly, this disclosure provides a data visualization method based on a large language model, the method comprising:

[0005] Receive target data, wherein the target data is used to determine the display content in the display interface;

[0006] Based on the target data, the large language model, and the prompt words corresponding to the large language model, the interface layout information corresponding to the target data is determined, wherein the interface layout information is represented by JavaScript extended syntax JSX code;

[0007] The interface layout information is compiled to obtain the executable code corresponding to the interface layout information;

[0008] The executable code and the target data are used for rendering to generate and display the interface.

[0009] Secondly, this disclosure provides a data display device based on a large language model, the device comprising:

[0010] A receiving module is used to receive target data, wherein the target data is used to determine the display content in the display interface;

[0011] The determination module is used to determine the interface layout information corresponding to the target data based on the target data, the large language model, and the prompt words corresponding to the large language model, wherein the interface layout information is represented by JavaScript extended syntax JSX code;

[0012] A compilation module is used to compile the interface layout information to obtain executable code corresponding to the interface layout information;

[0013] The rendering module is used to render based on the executable code and the target data, generate the display interface, and display it.

[0014] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.

[0015] Fourthly, this disclosure provides an electronic device, comprising:

[0016] A storage device on which computer programs are stored;

[0017] A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect.

[0018] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.

[0019] The above technical solution allows for the determination of interface layout information based on the input target data and guided by prompts through a large language model. This improves the matching degree between the interface layout and the target data, and enables the rational arrangement of content within the display interface. This enhances the visualization of the target data, highlights key information, and improves the user's overall comprehension and interactive experience. Furthermore, it lowers the technical barrier from content generation to interface publishing, allowing non-front-end developers to quickly build and publish interfaces for data display. Moreover, displaying the target data through the interface enhances the visual hierarchy of the content, thereby improving user reading efficiency and visual appeal.

[0020] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0021] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:

[0022] Figure 1 This is a flowchart of a data display method based on a large language model provided according to one embodiment of the present disclosure;

[0023] Figure 2 This is a schematic diagram of a display interface provided according to one embodiment of the present disclosure;

[0024] Figure 3 This is a flowchart of a data display method based on a large language model provided according to another embodiment of this disclosure;

[0025] Figure 4 This is a block diagram of a data display device based on a large language model provided according to one embodiment of the present disclosure;

[0026] Figure 5 A schematic diagram of the structure of an electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation

[0027] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0028] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0029] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0030] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0031] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0032] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0033] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0034] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0035] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0036] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0037] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0038] As described in the background section, structured text can be written into a specific template for display. This process allows users to see data content, but the display method and style are usually fixed and difficult to match with actual application scenarios. Therefore, this disclosure provides the following embodiments to improve the high-quality display of data.

[0039] Figure 1 The diagram shown is a flowchart of a data display method based on a large language model according to one embodiment of this disclosure. Figure 1 As shown, the method may include:

[0040] In step 11, target data is received, wherein the target data is used to determine the display content in the display interface.

[0041] As an example, the target data can be structured data that the user needs to analyze and display, such as data of the Markdown or JSON type. For example, the target data can be data from an analysis report. When browsing the target data based on the method disclosed herein, it can be displayed through a display interface. This display interface can include web page resources, such as web page features including titles, charts, highlighting, and section layout. The displayed content is determined by analyzing the target data.

[0042] In step 12, based on the target data, the large language model, and the prompt words corresponding to the large language model, the interface layout information corresponding to the target data is determined, wherein the interface layout information is represented by JavaScript extended syntax JSX code.

[0043] As an example, prompt words corresponding to the Large Language Model (LLM) can be pre-built. To improve the Large Language Model's semantic understanding of the target data and obtain a grammatically correct and structurally sound display interface, prompt words can be pre-configured to guide the Large Language Model in generating JSX code that conforms to the front-end framework, thereby achieving automatic generation of interface layout information.

[0044] In some possible embodiments, the prompt words corresponding to the large language model include at least one of the following types:

[0045] Layout guidance sub-tips are used by the large language model to determine the layout structure corresponding to the display interface. For example, layout guidance sub-tips can indicate the basic layout structure of a webpage, such as columns, information blocks, card layouts, etc., to guide the LLM to select appropriate visual hierarchy and layout structure based on the content of the target data.

[0046] Style guidance sub-prompts are used by the large language model to determine the style corresponding to the displayed content in the display interface. For example, in order to enhance the LLM's perception of language semantics, the style guidance sub-prompts can guide the LLM to automatically select the corresponding style based on the meaning of the fields in the target data, such as "conclusion", "indicator", "anomaly". The style can include font, color, emphasis, etc., to improve the matching degree between the display style of the displayed content and the semantics of the displayed content.

[0047] The layout object sub-tips are used by the large language model to determine the icon library and / or chart type library to which the layout object in the display interface belongs. For example, to avoid the LLM using non-existent layout objects, the allowed icon library and / or chart type library can be explicitly provided in the layout object sub-tips. This allows the LLM to determine the icons for the layout from the available icon library and the chart types for the layout from the available chart type library when generating the layout, thus determining the availability of the generated interface layout information.

[0048] Content generation specification sub-tips are used to indicate the constraint rules for content generation in the large language model. For example, to ensure the usability of interface layout information, constraint rules can be suggested in the content generation specification sub-tips. For example, for charts, chart construction rules can be set (such as the horizontal axis being a category field and the vertical axis being a numerical field), which can guide the LLM to automatically extract and transform visualization data from the target data to construct a standardized chart code snippet.

[0049] Component sub-prompts are used to indicate the usable page display components corresponding to the large language model and the scene information corresponding to the page display components. For example, the component sub-prompts can explicitly indicate the page display components that are allowed to be used, and the scene information can explain the applicable scenarios for each page display component, so as to guide the LLM to use only controlled components when generating interface layout information and avoid illegal component calls.

[0050] Specifically, the types of sub-hint words included in the prompt words of the large language model can be configured based on actual application scenarios. This allows for the analysis of target data using these prompt words to obtain semantically consistent and structurally clear interface layout information, improving the automation level of interface generation and the quality of the generated display interface. By setting these prompt words, multiple restrictions can be imposed on icons, components, chart types, and specifications, mitigating the risk of invalid or illegal code output by the LLM from the perspective of prompt words, and ensuring the executability of the interface layout information output by the large language model.

[0051] In step 13, the interface layout information is compiled to obtain the executable code corresponding to the interface layout information.

[0052] The obtained interface layout information is JSX code, which cannot be directly executed in a browser. In this embodiment, to preview the interface, the layout information can be compiled to obtain executable code. For example, the JSX code can be compiled using a standard JavaScript compiler to obtain JavaScript code that can be loaded by the webpage.

[0053] In step 14, the executable code and target data are rendered to generate and display the interface.

[0054] As an example, the interface can be rendered using rendering technologies in this field, such as React rendering technology, to obtain and display the interface. If the target data is data from an analysis report, the determined interface layout information can include titles for multiple tabs, descriptions of anomalies, line charts for metric A and metric B (e.g., ...). Figure 2 As shown in A4, and interactive buttons for switching data units in the chart, the generated display interface is as follows: Figure 2 As shown.

[0055] Therefore, the above technical solution allows for the determination of interface layout information based on the input target data and guided by prompts using a large language model. This improves the matching degree between the interface layout information and the target data, and enables the rational arrangement of content within the display interface. This enhances the visualization of the target data, highlights key information, and improves the user's overall comprehension efficiency and interactive experience. Furthermore, it lowers the technical barrier from content generation to interface publishing, allowing non-front-end developers to quickly build and publish interfaces for data display. Moreover, displaying the target data through the interface enhances the visual hierarchy of the content, thereby improving user reading efficiency and visual appeal to a certain extent.

[0056] In some possible embodiments, the large language model corresponds to multiple candidate prompt words. As an example, multiple available prompt words can be set for the large language model based on the actual application scenario to improve the matching degree between the prompt words and the target data, thereby improving the accuracy of the obtained interface layout information.

[0057] Accordingly, determining the interface layout information for displaying the target data based on the target data, the large language model, and the prompt words corresponding to the large language model may include:

[0058] The target prompt word that matches the target data is determined by matching the target data with the candidate prompt words.

[0059] As an example, text similarity matching can be performed based on the data content in the target data and candidate prompt words, and the candidate prompt word with the highest similarity can be used as the target prompt word.

[0060] As another example, target data and multiple candidate prompts can be input into a large language model, which can then analyze the data to determine which prompt is the best match for the target data. The prompt selected by the large language model can then be used as the target prompt.

[0061] Then, the target data and the target prompt words are input into the large language model to obtain the interface layout information.

[0062] For example, target data and target prompts can be combined and input into the large language model, which will then analyze the target prompts and target data to determine the interface layout information such as components, charts, and icons used to display the target data based on the content and constraints in the target prompts.

[0063] Therefore, by using the above technical solution, target prompt words that are more closely matched to the target data can be identified, providing accurate prompt words for the analysis of large language models. This can improve the usability and accuracy of the output interface layout information and provide effective data support for the subsequent generation of high-quality display interfaces.

[0064] In some possible embodiments, determining the interface layout information corresponding to the target data based on the target data, the large language model, and the prompt words corresponding to the large language model may include:

[0065] Based on the target data and the type of the sub-prompt words corresponding to the large language model, determine the sub-prompt words under the specified type.

[0066] As an example, the target data and the type of sub-hint words can be input into a large language model for analysis to determine the sub-hint words under that type. For example, the types of sub-hint words corresponding to the large language model include layout guidance sub-hint words, style guidance sub-hint words, layout object sub-hint words, content generation specification sub-hint words, and component sub-hint words. In this embodiment, the target data and the type of sub-hint words (such as layout guidance sub-hint words) can be input into the large language model, and the large language model will analyze the target data to determine which basic typographic structures can be included to display the target data, thereby obtaining the layout guidance sub-hint words. As another example, the target data and style guidance sub-hint words can be input into the large language model, and the large language model will analyze the target data to determine the semantic fields that can be displayed in a style and their corresponding display styles, thereby obtaining the style guidance sub-hint words. Other methods for determining sub-hint words are not elaborated here.

[0067] The sub-prompt words corresponding to the large language model are merged to obtain the target prompt word of the large language model.

[0068] By following the steps described above, the sub-prompt words under each type of sub-prompt word can be determined. In this embodiment, the determined sub-prompt words can be merged to obtain the target prompt word, thereby guiding the analysis process of the large language model based on sub-prompt words under multiple dimensions.

[0069] Then, the target data and the target prompt words are input into the large language model to obtain the interface layout information.

[0070] For example, target data and target prompts can be combined and input into the large language model, which will then analyze the target prompts and target data to determine the interface layout information such as components, charts, and icons used to display the target data based on the content and constraints in the target prompts.

[0071] Therefore, the above technical solutions can improve the diversity of sub-prompt words under various types, improve the matching degree between sub-prompt words and target data, further improve the accuracy of target prompt words, provide accurate prompt words for the analysis of large language models, improve the usability and accuracy of the output interface layout information, and provide effective data support for the subsequent generation of high-quality display interfaces.

[0072] In some possible embodiments, compiling the interface layout information to obtain the executable code corresponding to the interface layout information may include:

[0073] Based on the interface layout information, a compilation service call request is constructed and sent to the compilation service, wherein the compilation service is a pre-encapsulated Hypertext Transfer Protocol (HTTP) service.

[0074] In this embodiment, a compilation service can be pre-built, which can be deployed as a general-purpose service on any backend platform. For example, this compilation service can be built using the esbuild compiler. The built compilation service can be encapsulated as an HTTP (Hypertext Transfer Protocol) service, such as by encapsulating it to build a Node.js service. This compilation service is an online service and provides a standard HTTP interface, allowing compilation to be performed by submitting UI layout information via a POST request.

[0075] Then, the executable code returned by the compilation service is received. This executable code can be JavaScript code that can be executed by a browser.

[0076] In this embodiment, an HTTP service can be invoked through a compilation service call request, and the executable code compiled by the compilation service can be received. The compilation of interface layout information is realized through an online compilation service, which facilitates platform integration and asynchronous processing and improves the compilation efficiency of interface layout information.

[0077] In some possible embodiments, the compilation service responds to a compilation service call request via a separate thread.

[0078] As an example, to avoid potential single-threaded blocking during the compilation process, the Node.js worker_threads module can be used for concurrent processing in the compilation service. The Node.js worker_threads module allows JavaScript code to run in an independent thread separate from the main thread, enabling each compilation service call request to run in an independent thread. This improves the stability and scalability of the compilation service, prevents single points of failure from slowing down the overall service, and enhances compilation efficiency.

[0079] In some possible embodiments, the executable code is JavaScript code; correspondingly, the rendering based on the executable code and the target data to generate and display the display interface may include:

[0080] Create the interface code corresponding to the display interface, and the interface code contains inline frame components.

[0081] The display interface can be an interface within a generation platform used to generate the display interface, serving as the main interface for data display. This interface code can contain inline frame components to embed the generated interface for displaying the target data into this main interface, achieving isolation between the generated display content and the interface within the generation platform.

[0082] As an example, an inline frame component can be an iframe component, in which HTML code can be written into the iframe's document using document.write to form an independently running rendering environment.

[0083] The JS code is injected into the inline frame component via a link.

[0084] As an example, the compiled JS code can be passed as a link as a parameter to an inline frame component. The inline frame component will then inject the link as... <script src=""…”">,从而在内联框架组件中动态加载生成的界面逻辑和DOM(Document Object Model,文档对象模型)结构。

[0085] 基于更新后的界面代码进行渲染,获得所述展示界面,其中,所述展示界面中所述内联框架组件对应的区域展示基于所述目标数据确定的展示内容。

[0086] 作为示例,可以通过React渲染技术对界面代码进行渲染,从而在展示界面中展示目标数据对应的展示内容。例如React的ref是用于访问在函数组件或类组件中渲染的DOM界面或React元素的方式,基于ref可以直接操作DOM节点,或者在渲染的组件实例上调用方法,如基于React的ref控制,外部可控制内联框架组件的加载状态、高度调整、刷新等行为,并且可以支持设置回调函数监听内联框架组件的加载完成、页面内事件等,便于业务系统进行集成。

[0087] 由此,通过上述技术方案,可以在展示界面中通过注入JS代码的方式,在展示界面中的通过内联框架组件实现对目标数据对应的展示内容的展示,使得生成的展示内容和展示界面进行解耦合,提升组件复用性和隔离性,增加界面渲染的灵活性和兼容性,使得本公开所公开的方法可以嵌入已有的业务系统或平台,拓宽本公开提供的方法的使用范围。

[0088] 在一些可能的实施例中,所述JS代码中包含多个子组件的JS代码。如图2所示,其中组件A1、A2、A3和A4分别对应一子组件,JS代码中可以包含上述子组件的JS代码。

[0089] 所述界面代码中包含多个所述内联框架组件,每一所述子组件的JS代码对应一所述内联框架组件。

[0090] 相应地,所述在所述内联框架组件中以链接的方式注入所述JS代码,可以包括:

[0091] 针对每一所述内联框架组件,在所述内联框架组件中以链接的方式注入一所述子组件的JS代码。

[0092] 该实施例中,展示界面的界面代码中可以包含内联框架组件F1、F2、F3、F4,其中,在F1中注入A1的JS代码,在F2中注入A2的JS代码,在F3中注入A3的JS代码,在F4中注入A4的JS代码。则在进行界面渲染后,可以在展示界面中实现多个渲染内容的并列展示,并且不同的子组件在不同的内联框架组件中,可以支持子组件的按需加载和卸载,进一步提升展示界面的可编辑性,为用户提供更加贴合其使用需求的展示方式,提升数据展示的性能。

[0093] 如图3所示,为基于本公开的一种实施方式提供的基于大语言模型的数据展示方法的流程图,用户基于前端输入目标数据,之后目将标数据发送至后端进行处理。在后端处理过程中,根据目标数据和提示词确定用于输入大语言模型的目标提示词,并通过大语言模型对目标提示词和目标数据进行分析获得界面布局信息。之后,通过编译服务如Node.js对界面布局信息进行编译,获得可执行代码如JS代码。进一步地,基于该JS代码生成链接,并返回至前端,以在前端中将该JS代码的链接注入展示界面中的内联框架组件中,并通过对内联框架组件进行渲染而在展示界面中展示目标数据对应的展示内容。其中,上述步骤的具体实现方式已在上文进行详述,在此不作赘述。

[0094] 基于同样的发明构思,本公开还提供一种基于大语言模型的数据展示装置,如图4所示,所述装置10包括:

[0095] 接收模块100,用于接收目标数据,其中,所述目标数据用于确定展示界面中的展示内容;

[0096] 确定模块200,用于基于所述目标数据、大语言模型以及所述大语言模型对应的提示词,确定展示所述目标数据对应的界面布局信息,其中,所述界面布局信息通过JavaScript扩展语法JSX代码表示;

[0097] 编译模块300,用于对所述界面布局信息进行编译,获得所述界面布局信息对应的可执行代码;

[0098] 渲染模块400,用于基于所述可执行代码和所述目标数据进行渲染,生成所述展示界面并展示。

[0099] 可选地,所述大语言模型对应有多个候选提示词;

[0100] 所述确定模块200包括:

[0101] 匹配子模块,用于根据所述目标数据和所述候选提示词进行匹配,确定与所述目标数据匹配的目标提示词;

[0102] 处理子模块,用于将所述目标数据和所述目标提示词输入所述大语言模型,获得所述界面布局信息。

[0103] 可选地,所述大语言模型对应的提示词中包含以下类型中的至少一者:

[0104] 布局引导子提示词,用于所述大语言模型确定所述展示界面对应的排版结构;

[0105] 样式引导子提示词,用于所述大语言模型确定展示界面中的展示内容对应的样式;

[0106] 布局对象子提示词,用于所述大语言模型确定所述展示界面中的布局对象所属的图标库和 / 或图表类型库;

[0107] 内容生成规范子提示词,用于表示所述大语言模型的内容生成的约束规则;

[0108] 组件子提示词,用于表示所述大语言模型对应的可使用的页面展示组件以及所述页面展示组件对应的场景信息。

[0109] 可选地,所述确定模块200包括:

[0110] 确定子模块,用于根据所述目标数据和所述大语言模型对应的子提示词的类型,确定所述类型下的子提示词;

[0111] 合并子模块,用于将所述大语言模型对应的子提示词进行合并,获得所述大语言模型的目标提示词;

[0112] 处理子模块,用于将所述目标数据和所述目标提示词输入所述大语言模型,获得所述界面布局信息。

[0113] 可选地,所述编译模块300包括:

[0114] 发送子模块,用于基于所述界面布局信息构建编译服务调用请求,并将所述编译服务调用请求发送至编译服务,其中,所述编译服务为预先封装的超文本传输协议HTTP服务;

[0115] 接收子模块,用于接收所述编译服务返回的可执行代码。

[0116] 可选地,所述编译服务中通过一独立线程响应一所述编译服务调用请求。

[0117] 可选地,所述可执行代码为JS代码;

[0118] 所述渲染模块400包括:

[0119] 创建子模块,用于创建所述展示界面对应的界面代码,所述界面代码中包含内联框架组件;

[0120] 注入子模块,用于在所述内联框架组件中以链接的方式注入所述JS代码;

[0121] 渲染子模块,用于基于更新后的界面代码进行渲染,获得所述展示界面,其中,所述展示界面中所述内联框架组件对应的区域展示基于所述目标数据确定的展示内容。

[0122] 可选地,所述JS代码中包含多个子组件的JS代码,所述界面代码中包含多个所述内联框架组件,每一所述子组件的JS代码对应一所述内联框架组件;

[0123] 所述注入子模块用于:

[0124] 针对每一所述内联框架组件,在所述内联框架组件中以链接的方式注入一所述子组件的JS代码。

[0125] 下面参考图5,其示出了适于用来实现本公开实施例的电子设备(例如终端设备或服务器)600的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。

[0126] 如图5所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM 603通过总线604彼此相连。输入 / 输出(I / O)接口605也连接至总线604。

[0127] 通常,以下装置可以连接至I / O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。

[0128] 特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开实施例的方法中限定的上述功能。

[0129] 需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。

[0130] 在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText TransferProtocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网("LAN”),广域网("WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。

[0131] 上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。

[0132] 上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:接收目标数据,其中,所述目标数据用于确定展示界面中的展示内容;基于所述目标数据、大语言模型以及所述大语言模型对应的提示词,确定展示所述目标数据对应的界面布局信息,其中,所述界面布局信息通过JavaScript扩展语法JSX代码表示;对所述界面布局信息进行编译,获得所述界面布局信息对应的可执行代码;基于所述可执行代码和所述目标数据进行渲染,生成所述展示界面并展示。

[0133] 可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如"C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。

[0134] 附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和 / 或流程图中的每个方框、以及框图和 / 或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。

[0135] 描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,接收模块还可以被描述为"接收目标数据的模块”。

[0136] 本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。

[0137] 在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。

[0138] 根据本公开的一个或多个实施例,示例1提供了一种基于大语言模型的数据展示方法,所述方法包括:

[0139] 接收目标数据,其中,所述目标数据用于确定展示界面中的展示内容;

[0140] 基于所述目标数据、大语言模型以及所述大语言模型对应的提示词,确定展示所述目标数据对应的界面布局信息,其中,所述界面布局信息通过JavaScript扩展语法JSX代码表示;

[0141] 对所述界面布局信息进行编译,获得所述界面布局信息对应的可执行代码;

[0142] 基于所述可执行代码和所述目标数据进行渲染,生成所述展示界面并展示。

[0143] 根据本公开的一个或多个实施例,示例2提供了示例1的方法,所述大语言模型对应有多个候选提示词;

[0144] 所述基于所述目标数据、大语言模型以及所述大语言模型对应的提示词,确定展示所述目标数据对应的界面布局信息,包括:

[0145] 根据所述目标数据和所述候选提示词进行匹配,确定与所述目标数据匹配的目标提示词;

[0146] 将所述目标数据和所述目标提示词输入所述大语言模型,获得所述界面布局信息。

[0147] 根据本公开的一个或多个实施例,示例3提供了示例1的方法,所述大语言模型对应的提示词 中包含以下类型中的至少一者:

[0148] 布局引导子提示词,用于所述大语言模型确定所述展示界面对应的排版结构;

[0149] 样式引导子提示词,用于所述大语言模型确定展示界面中的展示内容对应的样式;

[0150] 布局对象子提示词,用于所述大语言模型确定所述展示界面中的布局对象所属的图标库和 / 或图表类型库;

[0151] 内容生成规范子提示词,用于表示所述大语言模型的内容生成的约束规则;

[0152] 组件子提示词,用于表示所述大语言模型对应的可使用的页面展示组件以及所述页面展示组件对应的场景信息。

[0153] 根据本公开的一个或多个实施例,示例4提供了示例3的方法,所述基于所述目标数据、大语言模型以及所述大语言模型对应的提示词,确定展示所述目标数据对应的界面布局信息,包括 :

[0154] 根据所述目标数据和所述大语言模型对应的子提示词的类型,确定所述类型下的子提示词;

[0155] 将所述大语言模型对应的子提示词进行合并,获得所述大语言模型的目标提示词;

[0156] 将所述目标数据和所述目标提示词输入所述大语言模型,获得所述界面布局信息。

[0157] 根据本公开的一个或多个实施例,示例5提供了示例1的方法,所述对所述界面布局信息进行编译,获得所述界面布局信息对应的可执行代码,包括:

[0158] 基于所述界面布局信息构建编译服务调用请求,并将所述编译服务调用请求发送至编译服务,其中,所述编译服务为预先封装的超文本传输协议HTTP服务;

[0159] 接收所述编译服务返回的可执行代码。

[0160] 根据本公开的一个或多个实施例,示例6提供了示例5的方法,所述编译服务中通过一独立线程响应一所述编译服务调用请求。

[0161] 根据本公开的一个或多个实施例,示例7提供了示例1的方法,所述可执行代码为JS代码;

[0162] 所述基于所述可执行代码和所述目标数据进行渲染,生成所述展示界面并展示,包括:

[0163] 创建所述展示界面对应的界面代码,所述界面代码中包含内联框架组件;

[0164] 在所述内联框架组件中以链接的方式注入所述JS代码;

[0165] 基于更新后的界面代码进行渲染,获得所述展示界面,其中,所述展示界面中所述内联框架组件对应的区域展示基于所述目标数据确定的展示内容。

[0166] 根据本公开的一个或多个实施例,示例8提供了示例7的方法,所述JS代码中包含多个子组件的JS代码,所述界面代码中包含多个所述内联框架组件,每一所述子组件的JS代码对应一所述内联框架组件;

[0167] 所述在所述内联框架组件中以链接的方式注入所述JS代码,包括:

[0168] 针对每一所述内联框架组件,在所述内联框架组件中以链接的方式注入一所述子组件的JS代码。

[0169] 根据本公开的一个或多个实施例,示例9提供了一种基于大语言模型的数据展示装置,所述装置包括:

[0170] 接收模块,用于接收目标数据,其中,所述目标数据用于确定展示界面中的展示内容;

[0171] 确定模块,用于基于所述目标数据、大语言模型以及所述大语言模型对应的提示词,确定展示所述目标数据对应的界面布局信息,其中,所述界面布局信息通过JavaScript扩展语法JSX代码表示;

[0172] 编译模块,用于对所述界面布局信息进行编译,获得所述界面布局信息对应的可执行代码;

[0173] 渲染模块,用于基于所述可执行代码和所述目标数据进行渲染,生成所述展示界面并展示。

[0174] 根据本公开的一个或多个实施例,示例10提供了一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理装置执行时实现示例1-8中任一项所述方法的步骤。

[0175] 根据本公开的一个或多个实施例,示例11提供了一种电子设备,包括:

[0176] 存储装置,其上存储有计算机程序;

[0177] 处理装置,用于执行所述存储装置中的所述计算机程序,以实现示例1-8中任一项所述方法的步骤。

[0178] 根据本公开的一个或多个实施例,示例12提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现示例1-8中任一项所述的方法的步骤。

[0179] 以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

[0180] 此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。

[0181] 尽管已经采用特定于结构特征和 / 或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。< / script>

Claims

1. A data presentation method based on a large language model, characterized in that, The method comprises: receiving target data, wherein the target data is used to determine display content in a display interface; determining interface layout information corresponding to the display of the target data based on the target data, a large language model, and prompt words corresponding to the large language model, wherein the interface layout information is represented by JavaScript extension syntax (JSX) code, and the large language model corresponds to a plurality of candidate prompt words; compiling the interface layout information to obtain executable code corresponding to the interface layout information; performing rendering based on the executable code and the target data to generate and display the display interface; determining the interface layout information corresponding to the display of the target data based on the target data, the large language model, and the prompt words corresponding to the large language model, comprises: matching the target data and the candidate prompt words to determine a target prompt word matched with the target data; inputting the target data and the target prompt word into the large language model to obtain the interface layout information; or determining the interface layout information corresponding to the display of the target data based on the target data, the large language model, and the prompt words corresponding to the large language model, comprises: determining a sub-prompt word under a type according to the target data and the type of the sub-prompt word corresponding to the large language model; merging the sub-prompt words corresponding to the large language model to obtain a target prompt word of the large language model; inputting the target data and the target prompt word into the large language model to obtain the interface layout information.

2. The data presentation method of claim 1, wherein, The prompt words corresponding to the large language model comprise at least one of the following types: a layout guide sub-prompt word used by the large language model to determine a layout structure corresponding to the display interface; a style guide sub-prompt word used by the large language model to determine a style corresponding to display content in the display interface; a layout object sub-prompt word used by the large language model to determine an icon library and / or a chart type library to which a layout object in the display interface belongs; a content generation specification sub-prompt word used to represent a constraint rule for content generation of the large language model; a component sub-prompt word used to represent a page display component that can be used by the large language model and scene information corresponding to the page display component.

3. The data presentation method of claim 1, wherein, The compiling of the interface layout information to obtain the executable code corresponding to the interface layout information comprises: constructing a compilation service calling request based on the interface layout information, and sending the compilation service calling request to a compilation service, wherein the compilation service is a pre-encapsulated hypertext transfer protocol (HTTP) service; receiving executable code returned by the compilation service.

4. The data presentation method of claim 3, wherein, In the compilation service, an independent thread responds to a compilation service calling request.

5. The data presentation method of claim 1, wherein, The executable code is JS code. The rendering based on the executable code and the target data to generate and display the display interface comprises: creating interface code corresponding to the display interface, wherein the interface code comprises an inline frame component; injecting the JS code into the inline frame component in a linked manner. The updated interface code is rendered to obtain the display interface, wherein the area corresponding to the inline frame component in the display interface displays content determined based on the target data.

6. The data presentation method of claim 5, wherein, The JS code contains JS code for multiple sub-components, and the interface code contains multiple inline frame components. The JS code for each sub-component corresponds to one inline frame component. The injection of the JS code into the inline frame component via a link includes: For each of the inline frame components, the JS code of one of the child components is injected into the inline frame component via a link. 7.A data display device based on a large language model, characterized in that, The device includes: A receiving module is used to receive target data, wherein the target data is used to determine the display content in the display interface; The determination module is used to determine the interface layout information corresponding to the target data based on the target data, the large language model and the prompt words corresponding to the large language model. The interface layout information is represented by JavaScript extended syntax JSX code, and the large language model has multiple candidate prompt words. A compilation module is used to compile the interface layout information to obtain executable code corresponding to the interface layout information; The rendering module is used to render based on the executable code and the target data, generate the display interface, and display it. The determining module includes: The matching submodule is used to match the target data and the candidate prompt words to determine the target prompt words that match the target data; The processing submodule is used to input the target data and the target prompt words into the large language model to obtain the interface layout information; Alternatively, the determining module may include: The determination submodule is used to determine the sub-prompt words under the specified type based on the target data and the type of sub-prompt words corresponding to the large language model; The merging submodule is used to merge the sub-prompt words corresponding to the large language model to obtain the target prompt word of the large language model; The processing submodule is used to input the target data and the target prompt words into the large language model to obtain the interface layout information.

8. A computer readable medium having stored thereon a computer program, characterized in that, When the computer program is executed by the processing device, it implements the steps of the data display method according to any one of claims 1-6.

9. An electronic device, comprising: include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the data display method according to any one of claims 1-6.

10. A computer program product comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the data display method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Method for generating page, storage medium and electronic device

    US20250061266A1

  • Task generation method and system based on large language model, and device and storage medium

    WO2024244271A1