Data display method and device, storage medium and terminal
By using a pre-defined markup language and script statements from the target template engine to process structured data, the problem of users having difficulty understanding data is solved, achieving efficient and aesthetically pleasing data display.
Patent Information
- Application Number
- CN202411112117.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-26
AI Technical Summary
Users find it difficult to read and understand directly sent professional data, and existing technologies have failed to effectively solve the problem of complex logical processing in data display.
Data display templates are written using a pre-defined markup language, nested with script statements from the target template engine, and combined with structured data for translation and logical processing to generate response message source files, which are then rendered and displayed through a chat client.
It enables fast, simple logical processing and aesthetically pleasing display of structured data, improving user understanding and interactive experience.
Smart Images

Figure CN119025650A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and in particular, to a data display method, device, storage medium, and terminal. Background Art
[0002] With the rapid development of deep learning algorithms in the field of artificial intelligence, many platforms have gradually begun to use conversational robots when interacting with users. They respond and answer users after understanding their needs. Using conversational robots to complete conversations can provide users with accurate and efficient services while saving a lot of labor costs. When some data needs to be fed back to users, if all the data is sent directly to users, it may make it difficult for users to understand the professional terms and the meaning of the data. Therefore, a data display method is needed to display the data in a dialog box according to a certain format template to facilitate users' reading and understanding. Summary of the invention
[0003] The embodiments of this specification provide a data display method, device, storage medium and terminal, which can solve the technical problem in related technologies that it is difficult for users to read and understand data.
[0004] In a first aspect, an embodiment of the present specification provides a data display method, the method comprising:
[0005] Receive question keywords of the target question sent by the conversation client, and determine structured data corresponding to the question keywords;
[0006] The parsing engine of the target template engine is called to translate the preconfigured data display template and the structured data to obtain a reply message source file, wherein the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement is used to specify a logical processing method of the data;
[0007] The reply message source file is returned to the dialogue client, so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file.
[0008] In a possible implementation, the parsing engine of the target template engine is called to translate the preconfigured data display template and the structured data to obtain a reply message source file, including: calling the parsing engine of the target template engine to parse the logical processing operations implemented by the script statements of the target template engine in the preconfigured data display template; performing the above-mentioned logical processing operations on the structured data, and determining the reply message source file corresponding to the processed structured data based on the markup language statements in the preconfigured data display template.
[0009] In a possible implementation, the method further includes: modifying the source code of the original template engine to obtain a target template engine, wherein the target template engine supports the writing specification of the preset type of markup language.
[0010] In a possible implementation, the method further includes: pre-configuring at least one data display template corresponding to a question, the data display template being used to standardize the display effect of data and content in the reply message of the question; the parsing engine calling the target template engine combines the pre-configured data display template and the structured data for translation to obtain a reply message source file, including: determining a target data display template corresponding to the target question, and calling the parsing engine calling the target template engine combines the target data display template and the structured data for translation to obtain a reply message source file.
[0011] In a possible implementation, the determining of the structured data corresponding to the question keywords includes: searching a source database for original data related to the question keywords, and analyzing and processing the original data to obtain the structured data corresponding to the question keywords.
[0012] In a possible implementation, the above-mentioned reply message source file is returned to the above-mentioned dialogue client so that the above-mentioned dialogue client answers the above-mentioned target question according to the target reply message corresponding to the above-mentioned reply message source file, including: returning the above-mentioned reply message source file to the above-mentioned dialogue client so that the above-mentioned dialogue client renders the above-mentioned reply message source file based on a rendering engine to obtain the target reply message, receiving the above-mentioned target reply message, and answering the above-mentioned target question according to the above-mentioned target reply message.
[0013] In a second aspect, an embodiment of the present specification provides a data display device, the device comprising:
[0014] A data acquisition module, used to receive question keywords of a target question sent by a dialogue client, and determine structured data corresponding to the question keywords;
[0015] A template translation module, used to call the parsing engine of the target template engine to translate the preconfigured data display template and the structured data to obtain a reply message source file, wherein the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement is used to specify the logical processing method of the data;
[0016] The message rendering module is used to return the above-mentioned reply message source file to the above-mentioned dialogue client, so that the above-mentioned dialogue client answers the above-mentioned target reply message according to the target reply message corresponding to the above-mentioned reply message source file.
[0017] In a possible implementation, the template translation module is also used to call the parsing engine of the target template engine to parse the logical processing operations implemented by the script statements of the target template engine in the preconfigured data display template; perform the logical processing operations on the structured data, and determine the reply message source file corresponding to the processed structured data based on the markup language statements in the preconfigured data display template.
[0018] In a possible implementation, the apparatus further includes: an engine adaptability adjustment module, which is used to transform the source code of the original template engine to obtain a target template engine, wherein the target template engine supports the writing specification of the preset type of markup language.
[0019] In a possible implementation, the device further includes: a template configuration module, used to preconfigure a data display template corresponding to at least one question, wherein the data display template is used to standardize the display effect of data and content in the reply message of the question; the template translation module, further used to determine the target data display template corresponding to the target question, and call the parsing engine of the target template engine to translate the target data display template and the structured data to obtain a reply message source file.
[0020] In a possible implementation, the data acquisition module is further used to query the source database for original data related to the question keywords, and analyze and process the original data to obtain structured data corresponding to the question keywords.
[0021] In a possible implementation, the message rendering module is also used to return the reply message source file to the conversation client, so that the conversation client renders the reply message source file based on the rendering engine to obtain the target reply message, sends the target reply message, and answers the target question according to the target reply message.
[0022] In a third aspect, an embodiment of the present specification provides a computer program product comprising instructions, which, when executed on a computer or a processor, enables the computer or the processor to execute the steps of the above method.
[0023] In a fourth aspect, an embodiment of the present specification provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the above method.
[0024] In a fifth aspect, an embodiment of the present specification provides a terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is suitable for being loaded by the processor and executing the steps of the above method.
[0025] The beneficial effects brought by the technical solutions provided by some embodiments of this specification include at least:
[0026] The embodiment of the present specification provides a data display method, receiving the question keywords of the target question sent by the dialogue client, determining the structured data corresponding to the question keywords; calling the parsing engine of the target template engine to translate the preconfigured data display template and structured data to obtain a reply message source file, the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement is used to specify the logical processing method of the data; returning the reply message source file to the dialogue client, so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file. Since the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement of the target template engine specifies the logical processing method of the data; then when the target template engine is used to process the data display template and the structured data, the structured data can be logically processed according to the script statement in the data display template, and the corresponding target reply message can be rendered and displayed according to the display effect specified in the data display template. In this way, the data display template of a simple markup language is combined with the structured data corresponding to the keyword of the question, and the logical processing and display of the structured data are completed quickly and simply, which solves the problem of complex logical processing of structured data during display, and obtains a better data display effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0028] Figure 1 An exemplary system architecture diagram of a data display method provided in an embodiment of this specification;
[0029] Figure 2 A flowchart of a data display method provided in an embodiment of this specification;
[0030] Figure 3 An example diagram of a page layout of a reply message provided in an embodiment of this specification;
[0031] Figure 4 A flowchart of a data display method provided in an embodiment of this specification;
[0032] Figure 5A logic flow chart of a data display method provided in an embodiment of this specification;
[0033] Figure 6 A structural block diagram of a data display device provided in an embodiment of this specification;
[0034] Figure 7 A schematic diagram of the structure of a terminal provided in an embodiment of this specification. DETAILED DESCRIPTION
[0035] In order to make the features and advantages of the embodiments of this specification more obvious and easy to understand, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the embodiments of this specification.
[0036] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of this specification. Instead, they are only examples of devices and methods consistent with some aspects of the embodiments of this specification as detailed in the attached claims.
[0037] With the rapid development of deep learning algorithms in the field of artificial intelligence, many platforms have gradually begun to use conversational robots when interacting with users, responding and answering users after understanding their needs. Conversational robots can simulate human conversations and interact with humans. In the process of generating conversations, they can understand users' questions and give accurate answers based on natural language processing technology and machine learning algorithms. In further applications, they can also provide personalized services based on users' preferences and needs to improve user satisfaction. In terms of efficiency, conversational robots can be online 24 / 7, not restricted by time and place, and provide users with instant services; and they can handle multiple users' problems at the same time, thereby improving service efficiency. Therefore, using conversational robots to complete conversations can provide users with accurate and efficient services while saving a lot of labor costs. These advantages also make them widely used in interactive service scenarios.
[0038] When users interact with a conversational robot, they usually ask questions to the conversational robot so that the conversational robot can give corresponding answers. When answering users' questions, the conversational robot often needs to feed back some data to the user. If all the data is sent directly to the user, it may make it difficult for the user to understand the professional terms and the meaning of the data. In addition, after the conversational robot determines the raw data from the database, it often needs to perform some logical processing to process the data into the form and results required by the user.
[0039] Therefore, the embodiments of this specification provide a data display method to solve the above-mentioned technical problem that it is difficult for users to read and understand data.
[0040] See also Figure 1 , Figure 1 An exemplary system architecture diagram of a data display method provided in an embodiment of this specification.
[0041] like Figure 1 As shown, the system architecture may include a first terminal 101, a network 102, a server 103, and a second terminal 104. The network 102 is used to provide a medium for a communication link between the first terminal 101 and the server 103, between the first terminal 101 and the second terminal 104, and between the second terminal 104 and the server 103. The network 102 may include various types of wired communication links or wireless communication links, for example: the wired communication link includes an optical fiber, a twisted pair, or a coaxial cable, and the wireless communication link includes a Bluetooth communication link, a Wireless-Fidelity (Wi-Fi) communication link, or a microwave communication link.
[0042] The first terminal 101 and the second terminal 104 can interact with the server 103 through the network 102 to receive messages from the server 103 or send messages to the server 103, or the first terminal 101 and the second terminal 104 can interact with the server 103 through the network 102, and then receive messages or data sent by other users to the server 103. The first terminal 101 and the second terminal 104 can be hardware or software. When the first terminal 101 or the second terminal 104 is hardware, it can be various electronic devices, including but not limited to smart watches, smart phones, tablet computers, laptop portable computers and desktop computers. When the first terminal 101 or the second terminal 104 is software, it can be installed in the electronic devices listed above, which can be implemented as multiple software or software modules (for example: used to provide distributed services), or it can be implemented as a single software or software module, which is not specifically limited here.
[0043] In the embodiment of this specification, the first terminal 101 is taken as a terminal for implementing the data display method, and the second terminal 104 is taken as a dialogue client that directly interacts with the user. The first terminal 101 will first receive the question keywords of the target question sent by the dialogue client, and determine the structured data corresponding to the question keywords; further, the first terminal 101 calls the parsing engine of the target template engine to translate the preconfigured data display template and structured data to obtain a reply message source file, the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement is used to specify the logical processing method of the data; finally, the first terminal 101 returns the reply message source file to the dialogue client, so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file.
[0044] The server 103 may be a business server that provides various services. It should be noted that the server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster consisting of multiple servers, or it may be implemented as a single server. When the server 103 is software, it may be implemented as multiple software or software modules (for example, for providing distributed services), or it may be implemented as a single software or software module, which is not specifically limited here.
[0045] Alternatively, the system architecture may not include the server 103. In other words, the server 103 may be an optional device in the embodiments of this specification. That is, the method provided in the embodiments of this specification may be applied to a system structure that only includes the first terminal 101, and the embodiments of this specification do not limit this.
[0046] It should be understood that Figure 1 The number of first terminals, networks, servers, and second terminals in the figure is only illustrative, and any number of first terminals, networks, servers, and second terminals may be used according to implementation requirements.
[0047] See also Figure 2 , Figure 2 A flowchart of a data display method provided in an embodiment of this specification. The execution subject of the embodiment of this specification can be a terminal that executes data display, or a processor in the terminal that executes the data display method, or a data display service in the terminal that executes the data display method. For the convenience of description, the specific execution process of the data display method is introduced below by taking the execution subject as the processor in the terminal as an example.
[0048] like Figure 2 As shown, the data display method may at least include:
[0049] S202: Receive question keywords of the target question sent by the dialogue client, and determine structured data corresponding to the question keywords.
[0050] Optionally, users usually ask the conversation robot some questions that they are concerned about, and the description of the question contains keywords related to the question and the answer. These keywords often represent the core of the question and the user's true intention. The important elements of the answer that the user needs can be clarified from the question keywords. Therefore, when answering user questions, the conversation client can extract the question keywords from the target question raised by the user, and send the question keywords to the terminal that executes the data display method. After the terminal receives the question keywords of the target question sent by the conversation client, it can clarify the user's intention and needs, and determine the structured data used to answer the user's question based on the question keywords.
[0051] Optionally, in the embodiments of this specification, structured data refers to various data collected in advance and saved in the database after being processed according to certain rules. These data indicate the original data collected by the system in various scenarios. Therefore, the structured data corresponding to the question keywords also indicate the original data related to the keywords. Then, the target questions raised by the user can be answered by adaptively processing these data, so that the user can understand the various situations he wants to know.
[0052] Optionally, the conversation client can extract the keywords of the question, or the user can mark the keywords of the question himself. If the user marks the keywords of the question himself, he directly and clearly indicates the data he needs and the key elements of the answer he needs in the question, such as "Data type: payment data" and "Date: March 2024". If the user directly asks the question in natural language, the conversation client can use natural language processing technology to extract the keywords of the target question and perform natural language understanding on each message sent by the user. The rules and algorithms used in natural language processing technology have been pre-trained and optimized to accurately identify key information points in the question.
[0053] S204, calling the parsing engine of the target template engine to translate the preconfigured data display template and structured data to obtain a reply message source file, wherein the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement is used to specify the logical processing method of the data.
[0054] Optionally, when answering a user's question, you may need to display multiple data and information to the user. In order to make the answer content more beautiful on the page and easier for the user to view and understand, the answer content needs to be formatted in a standardized manner. For example, see Figure 3 , Figure 3This is an example of a page layout of a reply message provided in an embodiment of this specification. Figure 3 As shown, in the dialogue interaction interface, when user A asks "What is the specific transaction information of transaction number: 123456?", the title of the reply message output to him is "Basic transaction information" and the specific content is "Transaction number: 123456; Transaction status: XXXX; Transaction amount: 12 yuan; Merchant name: B". When this information is displayed on the page, it needs to be reasonably laid out. For example, the font size and font color of the title and other content can be different, and the data type needs to be marked with "[ ]". These layouts make the message content more beautiful and easier for users to understand the data.
[0055] Optionally, in order to quickly and easily generate a formatted reply message, the formatting format of the data in the message text can be pre-specified, that is, a pre-configured data display template. The data display template includes the font of the data name, the data font, text color, number color, link color, use of brackets, use of dividing lines, etc. The data display template can be used to arrange and display structured data according to the pre-configured data formatting method.
[0056] Optionally, a data display template may be written using a preset type of markup language. In a feasible implementation of the present specification, the preset type of markup language may be the Markdown language. Markdown is a lightweight markup language that uses an easy-to-read and easy-to-write plain text format to write documents, which are then converted into valid XHTML (or HTML) documents. Due to the lightweight, easy-to-read and easy-to-write characteristics of Markdown, and its support for pictures, charts, and mathematical formulas, the Markdown language is very suitable for writing data display templates in the embodiments of the present specification.
[0057] Furthermore, markup languages are different from programming languages. Markup languages use a series of agreed-upon tags to mark electronic documents in order to define the semantics, structure, and format of electronic documents. Markup languages do not implement logical relationships, and it is impossible to define data calculation methods based on markup languages. Programming languages are mainly used to write computer programs, which contain a series of instructions and rules that allow programmers to create algorithms, control the behavior of computers, and implement various tasks and functions, such as data processing, logical control, arithmetic operations, etc. The goal is to implement algorithms and solve problems. In other words, the core content of programming languages is logical relationships. Therefore, when using a preset type of markup language to write a data display template, the data display template can only adjust the display method of the data display, but cannot implement the calculation of the data.
[0058] Optionally, when using a data display template to display structured data, the parsing engine in the template engine is usually used to combine the data display template and the structured data for translation, thereby outputting the parsing engine used in the template engine to combine the data display template and the structured data. Structured data is raw data related to the keywords of the question, so when generating a reply message based on it, it may be necessary to perform a series of logical processing on the structured data to obtain the final data used to answer the user's question. When generating a reply message based on it, it is also necessary to perform a series of logical processing on the structured data to obtain the final data used to answer the user's question. Therefore, in order to solve the problem of logical calculation of data, a code script that can implement complex data logic processing can be nested in the data display template.
[0059] In a preferred embodiment, the target template engine can use an engine with logic code compilation capability, so the script statement of the target template engine for specifying the logic processing method of the data can be nested in the data display template, so that the data display template can have the logic processing capability for the data based on the script statement of the target template engine. After the script statement of the target template engine is nested in the data display template, the specific implementation process of the data logic calculation performance is that the parsing engine of the target template engine can determine the data processing method through the script statement of the target template engine in the data display template, and perform corresponding processing on the data, and then display the data calculation results according to the data display method specified by the markup language in the data display template. In this way, after the data display template is configured, it can not only specify the data display specifications through the markup language, but also realize the logical processing of the data through the nested script statement of the target template engine.
[0060] In the embodiments of this specification, the target template engine can be implemented using the Thymeleaf engine tool. Thymeleaf is an XML / XHTML / HTML5 template engine for application development. Under the Thymeleaf tool, the data display template can be written using the Markdown markup language and the template file contains script statements in the Thymeleaf syntax. The script statements in the Thymeleaf syntax are used to implement data processing such as quantitative variable output, conditional judgment, and traversal of collections. For designers, during the configuration process of the data display template, the data display can be previewed in the browser, thereby achieving a what-you-see-is-what-you-get design effect.
[0061] Furthermore, when generating a reply message for a target question based on a data display template, the parsing engine of the Thymeleaf template engine reads the file of the data display template, and parses and renders the template according to the dynamic data corresponding to the target question provided by the database, and obtains the reply message source file after processing and translating the data.
[0062] Specifically, the parsing engine will identify the script statements of Thymeleaf syntax in the data display template, and execute the corresponding operations of the statements according to these syntaxes, such as replacing variables, executing conditional judgments, traversing collections, etc. Finally, the parsing engine will generate a complete rendering result, which is the reply message source file corresponding to the target question. After the data display template has the ability to process data dynamically and logically, each time after determining the structured data, the parsing engine of the target template engine can perform real-time dynamic rendering based on the template. Then the data display template can be installed in the client without a fixed version, but can be dynamically configured and adjusted based on the target template engine, which means that the data display template can be dynamically modified and no longer needs to be adjusted through the client version update, which improves the maintainability of the data display template. In addition, the separation of markup language and scripting language in the data display template allows the data display method and data processing logic to be maintained and adjusted separately, which makes the template more readable.
[0063] S206: Return the reply message source file to the dialogue client, so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file.
[0064] Optionally, after generating the reply message source file corresponding to the target question, the reply message source file is returned to the conversation client. When the conversation client receives the reply message source file, it will perform corresponding processing according to the content of the file. This includes parsing the text information, data information, etc. in the file, and rendering the target reply message for display in the interactive interface according to the file. Through these operations, the conversation client can use the target reply message corresponding to the reply message source file to accurately answer the target question in the interactive interface with the user, providing the user with a smooth and convenient conversation experience.
[0065] In an embodiment of the present specification, a data display method is provided, which receives the question keywords of the target question sent by the dialogue client, determines the structured data corresponding to the question keywords; calls the parsing engine of the target template engine to translate the preconfigured data display template and structured data to obtain a reply message source file, the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement is used to specify the logical processing method of the data; returns the reply message source file to the dialogue client, so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file. Since the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement of the target template engine specifies the logical processing method of the data; then when the target template engine is used to process the data display template and structured data, the structured data can be logically processed according to the script statement in the data display template, and the corresponding target reply message can be rendered and displayed according to the display effect specified in the data display template. In this way, it is possible to combine the data display template of a simple markup language with the structured data corresponding to the keywords of the question, quickly and easily complete the logical processing and display of the structured data, solve the problem of complex logical processing of structured data when displaying, and obtain better data display effects.
[0066] See also Figure 4 , Figure 4 A flowchart of a data display method provided in an embodiment of this specification.
[0067] like Figure 4 As shown, the data display method may at least include:
[0068] S402: receiving the question keywords of the target question sent by the dialogue client, searching the source database for original data related to the question keywords, and analyzing and processing the original data to obtain structured data corresponding to the question keywords.
[0069] Optionally, during the operation of the system, the system continuously collects raw data from various scenarios, such as transaction data, user data, etc. These raw data are stored in the source database for easy access and processing by other services. Figure 5 , Figure 5 A logical flow chart of a data display method provided in an embodiment of this specification, such as Figure 5 As shown, from the introduction of the above embodiments, it can be known that when the question keywords of the target question sent by the dialogue client are received, the original data related to the question keywords can be queried in the source database, and the original data can be analyzed and processed to obtain structured data corresponding to the question keywords.
[0070] S404: Transform the source code of the original template engine to obtain a target template engine, where the target template engine supports writing specifications of a preset type of markup language.
[0071] Optionally, in order to process data display templates written in a preset type of markup language, the target template engine needs to support the writing specifications of the preset type of markup language. Based on this, it is necessary to first modify the source code of the original template engine to obtain the target template engine. When the target template engine is the Thymeleaf template engine and the preset type of markup language is the Markdown language, it is necessary to modify the source code of the Thymeleaf engine to make it suitable for generating Markdown-standard templates, so that the Markdown template can be edited in the Thymeleaf engine. The script statements of the Thymeleaf engine are nested in the Markdown template, which also enables the Markdown template to not only standardize the data display format, but also write logical effects such as judgment and looping. Based on this, the Markdown template can be used in dialogue scenarios to define the display effect of structured data and realize the separation of display templates and data.
[0072] S406. Preconfigure at least one data display template corresponding to a question, where the data display template is used to standardize the display effect of data and content in a reply message to the question.
[0073] Alternatively, if Figure 5 As shown, considering that different types of questions will require different display effects to display reply messages, data display templates corresponding to different types of questions can be configured for different types of questions. These data display templates are used to standardize the display effects of data and content when generating answers.
[0074] S408: Determine a target data display template corresponding to the target question, call a parsing engine of a target template engine to translate the target data display template and structured data to obtain a reply message source file.
[0075] Optionally, after configuring different data display templates for different types of questions, for a target question sent by a user in an actual scenario, a target data display template corresponding to the target question can be determined, and a reply message source file can be generated using the target data display template and structured data corresponding to the target question.
[0076] Furthermore, since the target data display template specifies the specific display method of the message content based on the markup statements therein, and implements the logical processing of the data based on the script statements therein, when the parsing engine of the target template engine is called to translate the target data display template and the structured data to obtain the reply message source file, Figure 5As shown, specifically, the parsing engine of the target template engine can be called first to parse the logical processing operations implemented by the script statements of the target template engine in the preconfigured data display template, thereby clarifying which calculations need to be performed based on the structured data, and performing corresponding logical processing operations on the structured data according to the statements in the template, such as loops, judgments, etc., and then determining the reply message source file corresponding to the processed structured data based on the markup language statements in the preconfigured data display template.
[0077] S410. Return the reply message source file to the dialogue client, so that the dialogue client renders the reply message source file based on the rendering engine to obtain a target reply message, sends the target reply message, and answers the target question according to the target reply message.
[0078] Alternatively, if Figure 5 As shown, after generating the reply message source file corresponding to the target question, the reply message source file is returned to the conversation client. When the conversation client receives the reply message source file, it parses the text information, data information, etc. in the file, and renders the target reply message for display in the interactive interface according to the file. Through these operations, the conversation client can use the target reply message corresponding to the reply message source file to accurately answer the target question in the interactive interface with the user, providing the user with a smooth and convenient conversation experience.
[0079] In an embodiment of the present specification, a data display method is provided, which queries the original data related to the question keywords in the source database, and analyzes and processes the original data to obtain structured data corresponding to the question keywords; the source code of the original template engine is modified to obtain a target template engine, so that the target template engine supports the writing specifications of a preset type of markup language; for different types of questions, data display templates corresponding to each type of question are configured, and these data display templates are used to standardize the display effects of data and content when generating answers; the parsing engine of the target template engine is called to parse the logical processing operations implemented by the script statements of the target template engine in the pre-configured data display template, and the structured data is subjected to corresponding logical processing operations according to the statements in the template, such as loops, judgments, etc., and then the reply message source file corresponding to the processed structured data is determined based on the markup language statements in the pre-configured data display template, thereby solving the complex logical processing problem of structured data during display and obtaining a better data display effect.
[0080] See also Figure 6 , Figure 6 This is a structural block diagram of a data display device provided in an embodiment of this specification. Figure 6 As shown, the data display device 600 includes:
[0081] The data acquisition module 610 is used to receive the question keywords of the target question sent by the dialogue client and determine the structured data corresponding to the question keywords;
[0082] The template translation module 620 is used to call the parsing engine of the target template engine to translate the preconfigured data display template and structured data to obtain a reply message source file, wherein the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement is used to specify the logical processing method of the data;
[0083] The message rendering module 630 is used to return the reply message source file to the dialogue client, so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file.
[0084] Optionally, the template translation module 620 is also used to call the parsing engine of the target template engine to parse the logical processing operations implemented by the script statements of the target template engine in the preconfigured data display template; perform logical processing operations on the structured data, and determine the reply message source file corresponding to the processed structured data based on the markup language statements in the preconfigured data display template.
[0085] Optionally, the data display device 600 further includes: an engine adaptability adjustment module, which is used to transform the source code of the original template engine to obtain a target template engine, and the target template engine supports the writing specification of a preset type of markup language.
[0086] Optionally, the data display device 600 also includes: a template configuration module, used to pre-configure at least one data display template corresponding to a question, the data display template is used to standardize the display effect of data and content in the reply message of the question; a template translation module 620, which is also used to determine the target data display template corresponding to the target question, and call the parsing engine of the target template engine to translate the target data display template and structured data to obtain the reply message source file.
[0087] Optionally, the data acquisition module 610 is further used to query the source database for original data related to the question keywords, and analyze and process the original data to obtain structured data corresponding to the question keywords.
[0088] Optionally, the message rendering module 630 is also used to return the reply message source file to the dialogue client, so that the dialogue client renders the reply message source file based on the rendering engine to obtain a target reply message, sends the target reply message, and answers the target question according to the target reply message.
[0089] In an embodiment of the present specification, a data display device is provided, wherein a data acquisition module is used to receive question keywords of a target question sent by a conversation client, and determine the structured data corresponding to the question keywords; a template translation module is used to call the parsing engine of the target template engine to translate the preconfigured data display template and structured data to obtain a reply message source file, wherein the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein; a message rendering module is used to return the reply message source file to the conversation client, so that the conversation client answers the target question according to the target reply message corresponding to the reply message source file. Since the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement of the target template engine specifies the logical processing method of the data; then when the target template engine is used to process the data display template and structured data, the structured data can be logically processed according to the script statement in the data display template, and the corresponding target reply message can be rendered and displayed according to the display effect specified in the data display template. In this way, it is possible to combine the data display template of a simple markup language with the structured data corresponding to the keywords of the question, quickly and easily complete the logical processing and display of the structured data, solve the problem of complex logical processing of structured data when displaying, and obtain better data display effects.
[0090] The embodiments of this specification provide a computer program product including instructions. When the computer program product is executed on a computer or a processor, the computer or the processor executes the steps of any one of the methods in the above embodiments.
[0091] The embodiments of this specification also provide a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded by a processor and executing the steps of any method in the above embodiments.
[0092] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of a terminal provided in an embodiment of this specification. Figure 7 As shown, the terminal 700 may include: at least one terminal processor 701 , at least one network interface 704 , a user interface 703 , a memory 705 , and at least one communication bus 702 .
[0093] The communication bus 702 is used to realize the connection and communication between these components.
[0094] The user interface 703 may include a display screen (Display) and a camera (Camera), and the optional user interface 703 may also include a standard wired interface and a wireless interface.
[0095] The network interface 704 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0096] Among them, the terminal processor 701 may include one or more processing cores. The terminal processor 701 uses various interfaces and lines to connect various parts in the entire terminal 700, and executes various functions and processes data of the terminal 700 by running or executing instructions, programs, code sets or instruction sets stored in the memory 705, and calling data stored in the memory 705. Optionally, the terminal processor 701 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The terminal processor 701 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the terminal processor 701, and it can be implemented separately through a chip.
[0097] Among them, the memory 705 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory, ROM). Optionally, the memory 705 includes a non-transitory computer-readable storage medium. The memory 705 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 705 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 705 may also be optionally at least one storage device located away from the aforementioned terminal processor 701. As Figure 7 As shown, the memory 705 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a data display program.
[0098] exist Figure 7 In the terminal 700 shown, the user interface 703 is mainly used to provide an input interface for the user and obtain the data input by the user; and the terminal processor 701 can be used to call the data display program stored in the memory 705 and specifically perform the following operations:
[0099] Receive the question keywords of the target question sent by the conversation client, and determine the structured data corresponding to the question keywords;
[0100] The parsing engine of the target template engine is called to translate the pre-configured data display template and structured data to obtain a reply message source file, wherein the data display template is written in a preset type of markup language and a script statement of the target template engine is embedded therein, and the script statement is used to specify a logical processing method of the data;
[0101] The reply message source file is returned to the dialogue client, so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file.
[0102] In some embodiments, when the terminal processor 701 executes the call to the parsing engine of the target template engine to translate the preconfigured data display template and structured data to obtain a reply message source file, it specifically performs the following steps: calling the parsing engine of the target template engine to parse the logical processing operations implemented by the script statements of the target template engine in the preconfigured data display template; performing logical processing operations on the structured data, and determining the reply message source file corresponding to the processed structured data based on the markup language statements in the preconfigured data display template.
[0103] In some embodiments, the terminal processor 701 further specifically performs the following steps: transforming the source code of the original template engine to obtain a target template engine, where the target template engine supports the writing specification of a preset type of markup language.
[0104] In some embodiments, the terminal processor 701 also specifically performs the following steps: pre-configure at least one data display template corresponding to a question, the data display template is used to standardize the display effect of data and content in the reply message of the question; when the terminal processor 701 executes the call to the parsing engine of the target template engine to combine the pre-configured data display template and structured data for translation to obtain the reply message source file, it specifically performs the following steps: determine the target data display template corresponding to the target question, call the parsing engine of the target template engine to combine the target data display template and structured data for translation to obtain the reply message source file.
[0105] In some embodiments, when determining the structured data corresponding to the question keywords, the terminal processor 701 specifically performs the following steps: querying the original data related to the question keywords in the source database, and analyzing and processing the original data to obtain the structured data corresponding to the question keywords.
[0106] In some embodiments, when the terminal processor 701 returns the reply message source file to the dialogue client so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file, it specifically performs the following steps: returns the reply message source file to the dialogue client so that the dialogue client renders the reply message source file based on the rendering engine to obtain the target reply message, sends the target reply message, and answers the target question according to the target reply message.
[0107] In the several embodiments provided in this specification, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0108] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0109] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, the above process or function according to the embodiment of this specification is generated in whole or in part. The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above computer instructions can be stored in a computer-readable storage medium or transmitted by the above computer-readable storage medium. The above computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The above computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVD)), or semiconductor media (for example, solid state disks (SSD)), etc.
[0110] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0111] In addition, it should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this specification are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0112] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0113] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0114] The above is a description of a data display method, device, storage medium and terminal provided in the embodiments of this specification. For technicians in this field, according to the ideas of the embodiments of this specification, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the embodiments of this specification.
Claims
1. A data display method, the method comprising: Receiving question keywords of a target question sent by a dialogue client, and determining structured data corresponding to the question keywords; The parsing engine of the target template engine is called to translate the preconfigured data display template and the structured data to obtain a reply message source file, wherein the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement is used to specify a logical processing method of the data; The reply message source file is returned to the dialogue client, so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file.
2. According to the method of claim 1, the calling of the parsing engine of the target template engine combines the preconfigured data presentation template and the structured data to translate to obtain the reply message source file, comprising: Calling a parsing engine of a target template engine to parse the logic processing operations implemented by the script statements of the target template engine in the preconfigured data presentation template; The logical processing operation is performed on the structured data, and a reply message source file corresponding to the processed structured data is determined based on the markup language statement in the preconfigured data presentation template.
3. The method according to claim 1, further comprising: The source code of the original template engine is modified to obtain a target template engine, wherein the target template engine supports the writing specification of the preset type of markup language.
4. The method according to claim 1, further comprising: Preconfigure at least one data display template corresponding to a question, wherein the data display template is used to standardize the display effect of data and content in a reply message to the question; The parsing engine of the calling target template engine combines the preconfigured data presentation template and the structured data for translation to obtain a reply message source file, including: A target data display template corresponding to the target question is determined, and a parsing engine of a target template engine is called to translate the target data display template and the structured data to obtain a reply message source file.
5. The method according to claim 1, wherein determining the structured data corresponding to the question keyword comprises: The original data related to the question keywords are searched in the source database, and the original data are analyzed and processed to obtain structured data corresponding to the question keywords.
6. The method according to claim 1, wherein returning the reply message source file to the dialogue client so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file comprises: The reply message source file is returned to the dialogue client, so that the dialogue client renders the reply message source file based on a rendering engine to obtain a target reply message, sends the target reply message, and answers the target question according to the target reply message.
7. A data display device, comprising: A data acquisition module, configured to receive question keywords of a target question sent by a dialog client, and determine structured data corresponding to the question keywords; A template translation module, used for calling a parsing engine of a target template engine to translate a preconfigured data display template and the structured data to obtain a reply message source file, wherein the data display template is written in a preset type of markup language and has a script statement of the target template engine embedded therein, and the script statement is used to specify a logical processing method of data; A message rendering module is used to return the reply message source file to the dialogue client, so that the dialogue client answers the target question according to the target reply message corresponding to the reply message source file.
8. A computer program product comprising instructions, which, when executed on a computer or a processor, causes the computer or the processor to execute the steps of the method according to any one of claims 1 to 6.
9. A computer storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the method according to any one of claims 1 to 6.
10. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program.
