A question and answer type causal evaluation data query method and system
The question-and-answer causal evaluation data query system, based on a browser-web server architecture, solves the problems of complexity and professional knowledge threshold in causal inference data query, and achieves a low-cost, efficient causal evaluation and query experience.
Patent Information
- Application Number
- CN202311669306.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-07
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-12-07
AI Technical Summary
Existing graph databases and causal reasoning tools are complex and require a high level of expertise in causal reasoning data queries, making it difficult to meet the convenient query needs of non-professional users.
Design a question-and-answer causal assessment data query method and system. Through a browser-web server architecture, it provides causal problem modeling, data storage and graphical interface, hides technical details and supports users to perform causal assessment and query through simple operations.
It lowers the technical threshold for causal reasoning, improves user experience, increases query efficiency, reduces frequent front-end and back-end interactions, and has low development and maintenance costs.
Smart Images

Figure CN117708196B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of human-computer interaction technology, and more specifically, to a question-and-answer causal evaluation data query method and system. Background Technology
[0002] Exploring the objective connections between things and clarifying causes and consequences has been a human endeavor for thousands of years, and it also helps humanity to understand things more comprehensively and essentially. Causal reasoning is a mathematical system that describes causality and is a powerful tool for exploring causal relationships between things. In recent years, with the mutual promotion of machine learning and causal reasoning, causal reasoning has gradually become one of the hot topics in industrial applications and academic research.
[0003] Causal DAGs are an important representation of causal models, characterized by their clarity and ease of understanding, providing definite answers to problems in various scenarios. While various graph databases and causal inference tools exist, current graph databases often focus on general graph data storage and retrieval, lacking interfaces for causal inference-related data queries. Directly using them for causal inference queries requires a clear understanding of the graph's structural principles to associate the queried data with specific nodes and edges, resulting in verbose and cumbersome query languages with poor readability. Mainstream causal inference tools typically offer two usage methods: calling library functions during programming and using a graphical interface. However, both require users with causal inference expertise. For advanced users seeking quick cause-and-effect tracing without concern for technical details in specific causal evaluation applications, the learning curve is steep, making these methods less user-friendly and intuitive.
[0004] Therefore, how to design a question-and-answer causal evaluation data query method and system that has both causal reasoning and data storage functions, can shield upper-level users from the complex technical details of causal reasoning, and expose a question-and-answer human-computer interaction interface to support users to quickly and conveniently evaluate and query the data they care about has become an urgent problem to be solved in this field. Summary of the Invention
[0005] The purpose of this invention is to provide a question-and-answer causal assessment data query method and system to overcome the deficiencies of the existing technology.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0007] A question-and-answer causal assessment data query method includes the following steps:
[0008] S1. Model causal relationships for causal evaluation problems in application scenarios, obtain causal graphs and basic causal inference data, and store the data;
[0009] S2. Build a data query system for causal reasoning based on a browser-web server. The data query system includes a web server and a browser. The web server is used to respond to causal data query requests from the front end based on Servlet, integrate the causal reasoning engine, and store and manage the causal graph and basic causal reasoning data in step S1. The browser is used to provide common causal question syntax for users to click and select, display the causal graph and numerical results returned by the current query, and extract key parameters after parsing the causal reasoning question selected by the user. Through a pre-established causal question-URL address mapping table, the browser sends the corresponding HTTP request to the backend when executing the query, and updates the control data in the answer area when receiving the response data from the backend.
[0010] S3. Based on the browser side of the data query system, during the system login initialization phase, a cause-effect graph query request is sent, and after receiving the response, the queried cause-effect graph is stored in the cache.
[0011] S4. On the browser side, the causal problem to be queried is identified and parameters are extracted. If the causal problem only involves causal pointing problems such as seeking causes or query results, the query results are obtained by searching for the nodes and edges corresponding to the events in the causal graph cached in the initialization phase, and the data is updated to the front-end graphical control to display the query results. If the causal problem involves the reconstruction of the causal graph or the detailed calculation of causal effect values, the URL is obtained by querying the pre-established causal problem-URL mapping table, and a query request is sent to the web server through the URL.
[0012] After receiving a query request, the S5 web server extracts and encapsulates the parameters, then calls the corresponding interface of the causal reasoning engine to perform causal discovery and causal reasoning calculations. The calculation results are then updated and saved to the database while responding to the front-end request.
[0013] Furthermore, step S1 specifically includes the following steps:
[0014] S11. Based on expert experience, select factors relevant to this causal assessment problem;
[0015] S12. Collect historical data on causal assessment issues and related factors, and after data preprocessing, import them into the causal reasoning engine. The causal graph and basic causal reasoning data are obtained by calculating through the causal discovery algorithm.
[0016] S13. Store the historical data and basic causal reasoning data in the database.
[0017] The present invention also provides a system for querying data based on the above-described question-and-answer causal assessment method, comprising:
[0018] The causal relationship modeling module is used to model causal relationships for causal evaluation problems in application scenarios, obtain causal graphs and basic causal inference data, and store the data.
[0019] A data query system is used to build a causal inference data query system based on a browser-web server. The data query system includes a web server and a browser. The web server is used to respond to causal data query requests from the front end based on Servlet, integrate the causal inference engine, and store and manage the causal graph and basic causal inference data in step S1. The browser is used to provide common causal question syntax for users to click and select, display the causal graph and numerical results returned by the current query, and extract key parameters after parsing the causal inference question selected by the user. Through a pre-established causal question-URL address mapping table, the browser sends the corresponding HTTP request to the backend when executing the query, and updates the control data in the answer area when receiving the backend response data.
[0020] The query request module is used to send a cause-effect graph query request to the browser of the data query system during the system login initialization phase, and store the obtained cause-effect graph in the cache after receiving the response.
[0021] The query response module is used by the browser to identify the causal issues to be queried and extract parameters. If the causal issue only involves causal pointing questions such as seeking causes or query results, the query results are obtained by searching for the nodes and edges corresponding to the events in the causal graph cached during the initialization phase, and the data is updated to the front-end graphical control to display the query results. If the causal issue involves the reconstruction of the causal graph or the detailed calculation of causal effect values, the URL is obtained by querying the pre-established causal issue-URL mapping table, and a query request is sent to the web server through the URL.
[0022] The data update module is used to extract and encapsulate parameters after the web server receives a query request, and then call the corresponding interface of the causal reasoning engine to perform causal discovery and causal reasoning calculations. The calculation results are updated and saved to the database at the same time as responding to the front-end request.
[0023] Furthermore, the web server includes:
[0024] The response module is based on Servlet responses to causal data query requests from the front end;
[0025] The business logic module includes a causal reasoning engine, which integrates causal reasoning-related algorithms and their calling interfaces;
[0026] The data access module is used to store and manage the causal graphs and basic causal inference data obtained by the causal relationship modeling module.
[0027] Furthermore, the browser end includes:
[0028] The graphical interface includes a question area and an answer area, which are used for human-computer interaction causal reasoning queries and query result display, respectively. The question area is a cascading selector, providing common causal question syntax for users to click and select; the answer area is a relationship diagram and text, displaying the causal diagram and numerical results returned by the current query.
[0029] The business processing module is used to parse the causal reasoning question selected by the user and extract key parameters. If the causal question only involves causal pointing questions such as seeking causes or querying results, it searches for the nodes and edges corresponding to the events in the causal graph cached during the initialization phase to obtain the query results and updates the data to the front-end graphical control to display the query results. If the causal question involves the reconstruction of the causal graph or the detailed calculation of causal effect values, it sends the corresponding HTTP request to the backend when executing the query through a pre-established causal question-URL address mapping table. When the backend response data is received, the control data in the answer area is updated.
[0030] Compared with the prior art, the advantages of the present invention are as follows:
[0031] 1. This invention addresses specific causal problems in the field of causal assessment, providing a complete process for causal modeling, data storage, and data querying based on a browser-web server. It boasts low development and maintenance costs and offers users a question-and-answer interactive query interface that shields technical details, lowering the technical barrier for users. Users do not need to install causal reasoning tools on their browser or possess professional causal reasoning knowledge; they can easily select and query commonly used causal reasoning data through simple mouse clicks in the browser, enhancing the user experience.
[0032] 2. During the system login initialization phase, the front end will automatically send a global cause-effect graph query request and store the query results returned by the back end in the cache. For subsequent queries that only contain cause-effect relationship types, the front end's business processing module will directly retrieve the results from the cache, reducing frequent interactions between the front end and the back end and improving query efficiency.
[0033] 3. The common cause-and-effect question syntax provided in the cascading selector of the browser-side graphical interface of this invention is easy for developers to extend. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a schematic diagram of the structure of the question-and-answer causal assessment data query system of the present invention.
[0036] Figure 2 This refers to the layout of the front-end graphical interface in this invention. Detailed Implementation
[0037] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby providing a clearer and more explicit definition of the scope of protection of the present invention.
[0038] See Figure 1 and Figure 2 As shown, this embodiment discloses a question-and-answer causal assessment data query method, including the following steps:
[0039] Step S1: Model causal relationships for the causal evaluation problem in the application scenario, obtain a causal graph and basic causal inference data, and store the data. This specifically includes the following steps:
[0040] Step S11: Based on expert experience, select factors that may be relevant to the causal assessment problem.
[0041] Step S12: Collect historical data on causal assessment issues and related factors. After data preprocessing, import the data into the causal reasoning engine and calculate the causal graph and basic causal reasoning data through the causal discovery algorithm.
[0042] Step S13: Store the historical data and basic causal reasoning data into the database.
[0043] Step S2: Build a causal inference data query system based on a browser-web server. This data query system includes a web server and a browser. The web server is used to respond to causal data query requests from the front end based on Servlet, integrate the causal inference engine, and store and manage the causal graph and basic causal inference data from step S1. The browser is used to provide common causal question syntax for users to click and select, display the causal graph and numerical results returned by the current query, and extract key parameters after parsing the causal inference question selected by the user. Through a pre-established causal question-URL address mapping table, the browser sends the corresponding HTTP request to the backend when executing the query, and updates the control data in the answer area when receiving the response data from the backend.
[0044] Step S3: Log in to the front-end operation interface of the causal reasoning data query system. During the login initialization phase, send a causal graph query request based on the browser of the data query system. After receiving the response, store the causal graph obtained by the query in the cache.
[0045] Step S4: Users can select causal questions to ask in the question area of the graphical interface by clicking with the mouse. The business processing module on the browser side identifies and extracts parameters of the causal questions to be queried. If the causal question only involves causal pointing questions such as seeking causes or querying results, the query results are obtained by searching for the nodes and edges corresponding to the events in the previously cached causal graph and updating the data to the front-end graphical control to display the query results. If the causal question involves the reconstruction of the causal graph or the detailed calculation of causal effect values, the URL is obtained by querying the pre-established causal question-URL mapping table and a query request is sent to the web server through the URL.
[0046] Step S5: After receiving the query request, the web server extracts and encapsulates the parameters, then calls the corresponding interface of the causal reasoning engine to perform causal discovery and causal reasoning calculations. The calculation results are then updated and saved to the database while responding to the front-end request.
[0047] Combination Figure 1 As shown, the present invention also provides a system for querying data based on the above-described question-and-answer causal assessment method, comprising:
[0048] The causal relationship modeling module is used to model causal relationships for causal evaluation problems in application scenarios, obtain causal graphs and basic causal inference data, and store the data.
[0049] A data query system is used to build a causal inference data query system based on a browser-web server. The data query system includes a web server and a browser. The web server is used to respond to causal data query requests from the front end based on Servlet, integrate the causal inference engine, and store and manage the causal graph and basic causal inference data in step S1. The browser is used to provide common causal question syntax for users to click and select, display the causal graph and numerical results returned by the current query, and extract key parameters after parsing the causal inference question selected by the user. Through a pre-established causal question-URL address mapping table, the browser sends the corresponding HTTP request to the backend when executing the query, and updates the control data in the answer area when it receives the response data from the backend.
[0050] In this embodiment, the Web server includes: a response module, which responds to causal data query requests from the front end based on a Servlet; a business logic module, which includes a causal inference engine and integrates causal inference-related algorithms and their calling interfaces; and a data access module, which stores and manages the causal graph and basic causal inference data obtained by the causal relationship modeling module.
[0051] In this embodiment, the browser includes: a graphical interface comprising a question area and an answer area, used for causal reasoning queries and query result display respectively; the question area is a cascading selector, providing common causal question syntax for users to click and select; the answer area is a relationship graph and text, displaying the causal graph and numerical results returned by the current query; and a business processing module, used to parse the causal reasoning question selected by the user and extract key parameters. If the causal question only involves causal pointing questions such as seeking causes or query results, the module searches for the nodes and edges corresponding to the events in the causal graph cached during the initialization phase to obtain query results and updates the data to the front-end graphical control to display the query results. If the causal question involves the reconstruction of the causal graph or the detailed calculation of causal effect values, the module sends the corresponding HTTP request to the backend when executing the query through a pre-established causal question-URL address mapping table; and updates the control data in the answer area when receiving the backend response data.
[0052] In this embodiment, the common causal question syntax provided in the cascading selector mainly uses common causal interrogative sentences with simple and easy-to-understand syntax, but can also be customized according to user needs. For example: "What events participate in causal reasoning in this system?", "What is the causal relationship diagram generated by this system?", "What is the causal relationship between event A and event B?", "What are the possible causes of event B?", "What results might event A lead to?".
[0053] The event list provided in the cascading selector must include the causal problem and factor list selected in step S1. Taking the causal relationship problem of the yield of a certain piece of farmland as an example, if step S1 selects the factors related to the yield of farmland as: soil fertility, texture, drainage, microorganisms, and fertilizer; combined with Figure 2 As shown, in the list of events A, events A1 can be set as soil fertility, events A2 as texture, events A3 as drainage, events A4 as microorganisms, and events A5 as fertilizer; while in the list of events B, event B1 is yield.
[0054] The query request module is used to send a causal graph query request to the browser based on the data query system during the system login initialization phase. After receiving the response, the obtained causal graph is stored in the cache. The query response module is used by the browser to identify the causal problem to be queried and extract parameters. If the causal problem only involves causal pointing problems such as seeking causes or query results, the query results are obtained by searching for the nodes and edges corresponding to the events in the causal graph cached during the initialization phase, and the data is updated to the front-end graphical control to display the query results. If the causal problem involves the reconstruction of the causal graph or the detailed calculation of causal effect values, the URL is obtained by querying the pre-established causal problem-URL mapping table (as shown in Table 1), and a query request is sent to the web server through the URL.
[0055] Table 1
[0056]
[0057] The data update module is used to extract and encapsulate parameters after the web server receives a query request, and then call the corresponding interface of the causal reasoning engine to perform causal discovery and causal reasoning calculations. The calculation results are updated and saved to the database at the same time as responding to the front-end request.
[0058] This invention addresses specific causal problems in the field of causal assessment, providing a complete process for causal modeling, data storage, and data querying based on a browser-web server. It boasts low development and maintenance costs and offers users a question-and-answer interactive query interface that shields technical details, lowering the technical barrier for users. Users do not need to install causal reasoning tools on their browser host or possess professional causal reasoning knowledge; they can easily select and query commonly used causal reasoning data through simple mouse clicks in the browser, enhancing the user experience.
[0059] During the system login initialization phase, the front end of this invention will automatically send a global cause-effect graph query request and store the query results returned by the back end in the cache. For subsequent queries that only contain cause-effect pointing relationships, the front end's business processing module will directly retrieve the results from the cache, reducing frequent interactions between the front end and the back end and improving query efficiency.
[0060] The common cause-and-effect question syntax provided in the browser-side graphical interface cascading selector of this invention is easy for developers to extend.
[0061] Although embodiments of the present invention have been described in conjunction with the accompanying drawings, the patent owner may make various modifications or alterations within the scope of the appended claims, as long as they do not exceed the protection scope described in the claims of the present invention, they shall be within the protection scope of the present invention.
Claims
1. A question-and-answer causal assessment data query method, characterized in that, Includes the following steps: S1. Model causal relationships for causal evaluation problems in application scenarios, obtain causal graphs and basic causal inference data, and store the data; S2. Build a causal reasoning data query system based on a browser-web server. The data query system includes a web server and a browser. The web server is used to respond to causal data query requests from the front end based on Servlet, integrate the causal reasoning engine, and store and manage the causal graph and basic causal reasoning data in step S1. The browser is used to provide common causal question syntax for users to click and select, display the causal graph and numerical results returned by the current query, and extract key parameters after parsing the causal reasoning question selected by the user. Through a pre-established causal question-URL address mapping table, the browser sends the corresponding HTTP request to the backend when executing the query, and updates the control data in the answer area when receiving the backend response data. S3. Based on the browser side of the data query system, during the system login initialization phase, a cause-effect graph query request is sent, and after receiving the response, the queried cause-effect graph is stored in the cache. S4. The browser identifies and extracts parameters for the causal problem to be queried. If the causal problem only involves causal pointing problems such as seeking causes or query results, the browser searches for the nodes and edges corresponding to the events in the causal graph cached during the initialization phase to obtain the query results and updates the data to the front-end graphical control to display the query results. If the causal problem involves the reconstruction of the causal graph or the detailed calculation of the causal effect value, then the URL is obtained by querying the pre-established causal problem-URL mapping table, and a query request is sent to the web server through the URL. After receiving a query request, the S5 web server extracts and encapsulates the parameters, then calls the corresponding interface of the causal reasoning engine to perform causal discovery and causal reasoning calculations. The calculation results are then updated and saved to the database while responding to the front-end request.
2. The question-and-answer causal assessment data query method according to claim 1, characterized in that, Step S1 specifically includes the following steps: S11. Based on expert experience, select factors relevant to this causal assessment problem; S12. Collect historical data on causal assessment issues and related factors, and after data preprocessing, import them into the causal reasoning engine. The causal graph and basic causal reasoning data are obtained by calculating through the causal discovery algorithm. S13. Store the historical data and basic causal reasoning data in the database.
3. A system for querying data for question-and-answer causal assessment according to claim 1 or 2, characterized in that, include: The causal relationship modeling module is used to model causal relationships for causal evaluation problems in application scenarios, obtain causal graphs and basic causal inference data, and store the data. A data query system is used to build a causal inference data query system based on a browser-web server. The data query system includes a web server and a browser. The web server is used to respond to causal data query requests from the front end based on Servlet, integrate the causal inference engine, and store and manage the causal graph and basic causal inference data in step S1. The browser is used to provide common causal question syntax for users to click and select, display the causal graph and numerical results returned by the current query, and extract key parameters after parsing the causal inference question selected by the user. Through a pre-established causal question-URL address mapping table, the browser sends the corresponding HTTP request to the backend when executing the query, and updates the control data in the answer area when receiving the backend response data. The query request module is used to send a cause-effect graph query request to the browser of the data query system during the system login initialization phase, and store the obtained cause-effect graph in the cache after receiving the response. The query response module is used by the browser to identify the causal problem to be queried and extract parameters. If the causal problem only involves causal pointing problems such as seeking causes or query results, the query results are obtained by searching the nodes and edges corresponding to the events in the causal graph cached in the initialization phase, and the data is updated to the front-end graphical control to display the query results. If the causal problem involves the reconstruction of the causal graph or the detailed calculation of the causal effect value, then the URL is obtained by querying the pre-established causal problem-URL mapping table, and a query request is sent to the web server through the URL. The data update module is used to extract and encapsulate parameters after the web server receives a query request, and then call the corresponding interface of the causal reasoning engine to perform causal discovery and causal reasoning calculations. The calculation results are updated and saved to the database at the same time as responding to the front-end request.
4. The system according to claim 3, characterized in that, The web server includes: The response module is based on Servlet to respond to causal data query requests from the front end; The business logic module includes a causal reasoning engine, which integrates causal reasoning-related algorithms and their calling interfaces; The data access module is used to store and manage the causal graphs and basic causal inference data obtained by the causal relationship modeling module.
5. The system according to claim 3, characterized in that, The browser includes: The graphical interface includes a question area and an answer area, which are used for human-computer interaction causal reasoning queries and query result display, respectively. The question area is a cascading selector, providing common causal question syntax for users to click and select; the answer area is a relationship diagram and text, displaying the causal diagram and numerical results returned by the current query. The business processing module is used to parse the causal reasoning question selected by the user and extract key parameters. If the causal question only involves causal pointing questions such as seeking causes or querying results, it searches for the nodes and edges corresponding to the events in the causal graph cached during the initialization phase to obtain the query results and updates the data to the front-end graphical control to display the query results. If the causal question involves the reconstruction of the causal graph or the detailed calculation of causal effect values, it sends the corresponding HTTP request to the backend when executing the query through a pre-established causal question-URL address mapping table. When the backend response data is received, the control data in the answer area is updated.